@axlsdk/studio 0.15.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,313 @@
1
+ var Xy=Object.defineProperty;var yx=l=>{throw TypeError(l)};var Vy=(l,r,i)=>r in l?Xy(l,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[r]=i;var oi=(l,r,i)=>Vy(l,typeof r!="symbol"?r+"":r,i),jd=(l,r,i)=>r.has(l)||yx("Cannot "+i);var _=(l,r,i)=>(jd(l,r,"read from private field"),i?i.call(l):r.get(l)),be=(l,r,i)=>r.has(l)?yx("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(l):r.set(l,i),me=(l,r,i,u)=>(jd(l,r,"write to private field"),u?u.call(l,i):r.set(l,i),i),Re=(l,r,i)=>(jd(l,r,"access private method"),i);var Ko=(l,r,i,u)=>({set _(d){me(l,r,d,i)},get _(){return _(l,r,u)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const x of f.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&u(x)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var Nd={exports:{}},ui={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bx;function Zy(){if(bx)return ui;bx=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(u,d,f){var x=null;if(f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),"key"in d){f={};for(var m in d)m!=="key"&&(f[m]=d[m])}else f=d;return d=f.ref,{$$typeof:l,type:u,key:x,ref:d!==void 0?d:null,props:f}}return ui.Fragment=r,ui.jsx=i,ui.jsxs=i,ui}var jx;function Fy(){return jx||(jx=1,Nd.exports=Zy()),Nd.exports}var a=Fy(),Sd={exports:{}},Ce={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Nx;function Jy(){if(Nx)return Ce;Nx=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),x=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),w=Symbol.iterator;function k(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,A={};function z(C,q,W){this.props=C,this.context=q,this.refs=A,this.updater=W||E}z.prototype.isReactComponent={},z.prototype.setState=function(C,q){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,q,"setState")},z.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function V(){}V.prototype=z.prototype;function N(C,q,W){this.props=C,this.context=q,this.refs=A,this.updater=W||E}var S=N.prototype=new V;S.constructor=N,O(S,z.prototype),S.isPureReactComponent=!0;var M=Array.isArray;function U(){}var D={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function se(C,q,W){var ie=W.ref;return{$$typeof:l,type:C,key:q,ref:ie!==void 0?ie:null,props:W}}function I(C,q){return se(C.type,q,C.props)}function oe(C){return typeof C=="object"&&C!==null&&C.$$typeof===l}function Y(C){var q={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(W){return q[W]})}var ne=/\/+/g;function Q(C,q){return typeof C=="object"&&C!==null&&C.key!=null?Y(""+C.key):q.toString(36)}function G(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(U,U):(C.status="pending",C.then(function(q){C.status==="pending"&&(C.status="fulfilled",C.value=q)},function(q){C.status==="pending"&&(C.status="rejected",C.reason=q)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function T(C,q,W,ie,fe){var ye=typeof C;(ye==="undefined"||ye==="boolean")&&(C=null);var ce=!1;if(C===null)ce=!0;else switch(ye){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(C.$$typeof){case l:case r:ce=!0;break;case y:return ce=C._init,T(ce(C._payload),q,W,ie,fe)}}if(ce)return fe=fe(C),ce=ie===""?"."+Q(C,0):ie,M(fe)?(W="",ce!=null&&(W=ce.replace(ne,"$&/")+"/"),T(fe,q,W,"",function(ft){return ft})):fe!=null&&(oe(fe)&&(fe=I(fe,W+(fe.key==null||C&&C.key===fe.key?"":(""+fe.key).replace(ne,"$&/")+"/")+ce)),q.push(fe)),1;ce=0;var we=ie===""?".":ie+":";if(M(C))for(var Me=0;Me<C.length;Me++)ie=C[Me],ye=we+Q(ie,Me),ce+=T(ie,q,W,ye,fe);else if(Me=k(C),typeof Me=="function")for(C=Me.call(C),Me=0;!(ie=C.next()).done;)ie=ie.value,ye=we+Q(ie,Me++),ce+=T(ie,q,W,ye,fe);else if(ye==="object"){if(typeof C.then=="function")return T(G(C),q,W,ie,fe);throw q=String(C),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ce}function H(C,q,W){if(C==null)return C;var ie=[],fe=0;return T(C,ie,"","",function(ye){return q.call(W,ye,fe++)}),ie}function J(C){if(C._status===-1){var q=C._result;q=q(),q.then(function(W){(C._status===0||C._status===-1)&&(C._status=1,C._result=W)},function(W){(C._status===0||C._status===-1)&&(C._status=2,C._result=W)}),C._status===-1&&(C._status=0,C._result=q)}if(C._status===1)return C._result.default;throw C._result}var he=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},de={map:H,forEach:function(C,q,W){H(C,function(){q.apply(this,arguments)},W)},count:function(C){var q=0;return H(C,function(){q++}),q},toArray:function(C){return H(C,function(q){return q})||[]},only:function(C){if(!oe(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ce.Activity=v,Ce.Children=de,Ce.Component=z,Ce.Fragment=i,Ce.Profiler=d,Ce.PureComponent=N,Ce.StrictMode=u,Ce.Suspense=h,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(C){return D.H.useMemoCache(C)}},Ce.cache=function(C){return function(){return C.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(C,q,W){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ie=O({},C.props),fe=C.key;if(q!=null)for(ye in q.key!==void 0&&(fe=""+q.key),q)!le.call(q,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&q.ref===void 0||(ie[ye]=q[ye]);var ye=arguments.length-2;if(ye===1)ie.children=W;else if(1<ye){for(var ce=Array(ye),we=0;we<ye;we++)ce[we]=arguments[we+2];ie.children=ce}return se(C.type,fe,ie)},Ce.createContext=function(C){return C={$$typeof:x,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:f,_context:C},C},Ce.createElement=function(C,q,W){var ie,fe={},ye=null;if(q!=null)for(ie in q.key!==void 0&&(ye=""+q.key),q)le.call(q,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(fe[ie]=q[ie]);var ce=arguments.length-2;if(ce===1)fe.children=W;else if(1<ce){for(var we=Array(ce),Me=0;Me<ce;Me++)we[Me]=arguments[Me+2];fe.children=we}if(C&&C.defaultProps)for(ie in ce=C.defaultProps,ce)fe[ie]===void 0&&(fe[ie]=ce[ie]);return se(C,ye,fe)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(C){return{$$typeof:m,render:C}},Ce.isValidElement=oe,Ce.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:J}},Ce.memo=function(C,q){return{$$typeof:g,type:C,compare:q===void 0?null:q}},Ce.startTransition=function(C){var q=D.T,W={};D.T=W;try{var ie=C(),fe=D.S;fe!==null&&fe(W,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(U,he)}catch(ye){he(ye)}finally{q!==null&&W.types!==null&&(q.types=W.types),D.T=q}},Ce.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ce.use=function(C){return D.H.use(C)},Ce.useActionState=function(C,q,W){return D.H.useActionState(C,q,W)},Ce.useCallback=function(C,q){return D.H.useCallback(C,q)},Ce.useContext=function(C){return D.H.useContext(C)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(C,q){return D.H.useDeferredValue(C,q)},Ce.useEffect=function(C,q){return D.H.useEffect(C,q)},Ce.useEffectEvent=function(C){return D.H.useEffectEvent(C)},Ce.useId=function(){return D.H.useId()},Ce.useImperativeHandle=function(C,q,W){return D.H.useImperativeHandle(C,q,W)},Ce.useInsertionEffect=function(C,q){return D.H.useInsertionEffect(C,q)},Ce.useLayoutEffect=function(C,q){return D.H.useLayoutEffect(C,q)},Ce.useMemo=function(C,q){return D.H.useMemo(C,q)},Ce.useOptimistic=function(C,q){return D.H.useOptimistic(C,q)},Ce.useReducer=function(C,q,W){return D.H.useReducer(C,q,W)},Ce.useRef=function(C){return D.H.useRef(C)},Ce.useState=function(C){return D.H.useState(C)},Ce.useSyncExternalStore=function(C,q,W){return D.H.useSyncExternalStore(C,q,W)},Ce.useTransition=function(){return D.H.useTransition()},Ce.version="19.2.4",Ce}var Sx;function uf(){return Sx||(Sx=1,Sd.exports=Jy()),Sd.exports}var b=uf(),wd={exports:{}},ci={},Ed={exports:{}},Cd={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var wx;function Iy(){return wx||(wx=1,(function(l){function r(T,H){var J=T.length;T.push(H);e:for(;0<J;){var he=J-1>>>1,de=T[he];if(0<d(de,H))T[he]=H,T[J]=de,J=he;else break e}}function i(T){return T.length===0?null:T[0]}function u(T){if(T.length===0)return null;var H=T[0],J=T.pop();if(J!==H){T[0]=J;e:for(var he=0,de=T.length,C=de>>>1;he<C;){var q=2*(he+1)-1,W=T[q],ie=q+1,fe=T[ie];if(0>d(W,J))ie<de&&0>d(fe,W)?(T[he]=fe,T[ie]=J,he=ie):(T[he]=W,T[q]=J,he=q);else if(ie<de&&0>d(fe,J))T[he]=fe,T[ie]=J,he=ie;else break e}}return H}function d(T,H){var J=T.sortIndex-H.sortIndex;return J!==0?J:T.id-H.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var x=Date,m=x.now();l.unstable_now=function(){return x.now()-m}}var h=[],g=[],y=1,v=null,w=3,k=!1,E=!1,O=!1,A=!1,z=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var H=i(g);H!==null;){if(H.callback===null)u(g);else if(H.startTime<=T)u(g),H.sortIndex=H.expirationTime,r(h,H);else break;H=i(g)}}function M(T){if(O=!1,S(T),!E)if(i(h)!==null)E=!0,U||(U=!0,Y());else{var H=i(g);H!==null&&G(M,H.startTime-T)}}var U=!1,D=-1,le=5,se=-1;function I(){return A?!0:!(l.unstable_now()-se<le)}function oe(){if(A=!1,U){var T=l.unstable_now();se=T;var H=!0;try{e:{E=!1,O&&(O=!1,V(D),D=-1),k=!0;var J=w;try{t:{for(S(T),v=i(h);v!==null&&!(v.expirationTime>T&&I());){var he=v.callback;if(typeof he=="function"){v.callback=null,w=v.priorityLevel;var de=he(v.expirationTime<=T);if(T=l.unstable_now(),typeof de=="function"){v.callback=de,S(T),H=!0;break t}v===i(h)&&u(h),S(T)}else u(h);v=i(h)}if(v!==null)H=!0;else{var C=i(g);C!==null&&G(M,C.startTime-T),H=!1}}break e}finally{v=null,w=J,k=!1}H=void 0}}finally{H?Y():U=!1}}}var Y;if(typeof N=="function")Y=function(){N(oe)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,Q=ne.port2;ne.port1.onmessage=oe,Y=function(){Q.postMessage(null)}}else Y=function(){z(oe,0)};function G(T,H){D=z(function(){T(l.unstable_now())},H)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(T){T.callback=null},l.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<T?Math.floor(1e3/T):5},l.unstable_getCurrentPriorityLevel=function(){return w},l.unstable_next=function(T){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var J=w;w=H;try{return T()}finally{w=J}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(T,H){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var J=w;w=T;try{return H()}finally{w=J}},l.unstable_scheduleCallback=function(T,H,J){var he=l.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?he+J:he):J=he,T){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=J+de,T={id:y++,callback:H,priorityLevel:T,startTime:J,expirationTime:de,sortIndex:-1},J>he?(T.sortIndex=J,r(g,T),i(h)===null&&T===i(g)&&(O?(V(D),D=-1):O=!0,G(M,J-he))):(T.sortIndex=de,r(h,T),E||k||(E=!0,U||(U=!0,Y()))),T},l.unstable_shouldYield=I,l.unstable_wrapCallback=function(T){var H=w;return function(){var J=w;w=H;try{return T.apply(this,arguments)}finally{w=J}}}})(Cd)),Cd}var Ex;function Wy(){return Ex||(Ex=1,Ed.exports=Iy()),Ed.exports}var kd={exports:{}},Qt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Cx;function Py(){if(Cx)return Qt;Cx=1;var l=uf();function r(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(h,g,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:v==null?null:""+v,children:h,containerInfo:g,implementation:y}}var x=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Qt.createPortal=function(h,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return f(h,g,null,y)},Qt.flushSync=function(h){var g=x.T,y=u.p;try{if(x.T=null,u.p=2,h)return h()}finally{x.T=g,u.p=y,u.d.f()}},Qt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(h,g))},Qt.prefetchDNS=function(h){typeof h=="string"&&u.d.D(h)},Qt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var y=g.as,v=m(y,g.crossOrigin),w=typeof g.integrity=="string"?g.integrity:void 0,k=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?u.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:k}):y==="script"&&u.d.X(h,{crossOrigin:v,integrity:w,fetchPriority:k,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Qt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=m(g.as,g.crossOrigin);u.d.M(h,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(h)},Qt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,v=m(y,g.crossOrigin);u.d.L(h,y,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Qt.preloadModule=function(h,g){if(typeof h=="string")if(g){var y=m(g.as,g.crossOrigin);u.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(h)},Qt.requestFormReset=function(h){u.d.r(h)},Qt.unstable_batchedUpdates=function(h,g){return h(g)},Qt.useFormState=function(h,g,y){return x.H.useFormState(h,g,y)},Qt.useFormStatus=function(){return x.H.useHostTransitionStatus()},Qt.version="19.2.4",Qt}var kx;function eb(){if(kx)return kd.exports;kx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),kd.exports=Py(),kd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Tx;function tb(){if(Tx)return ci;Tx=1;var l=Wy(),r=uf(),i=eb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function x(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){n=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return h(o),e;if(c===s)return h(o),t;c=c.sibling}throw Error(u(188))}if(n.return!==s.return)n=o,s=c;else{for(var p=!1,j=o.child;j;){if(j===n){p=!0,n=o,s=c;break}if(j===s){p=!0,s=o,n=c;break}j=j.sibling}if(!p){for(j=c.child;j;){if(j===n){p=!0,n=c,s=o;break}if(j===s){p=!0,s=c,n=o;break}j=j.sibling}if(!p)throw Error(u(189))}}if(n.alternate!==s)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),N=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case z:return"Profiler";case A:return"StrictMode";case M:return"Suspense";case U:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case N:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var G=Array.isArray,T=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},he=[],de=-1;function C(e){return{current:e}}function q(e){0>de||(e.current=he[de],he[de]=null,de--)}function W(e,t){de++,he[de]=e.current,e.current=t}var ie=C(null),fe=C(null),ye=C(null),ce=C(null);function we(e,t){switch(W(ye,t),W(fe,e),W(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gp(t),e=Yp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ie),W(ie,e)}function Me(){q(ie),q(fe),q(ye)}function ft(e){e.memoizedState!==null&&W(ce,e);var t=ie.current,n=Yp(t,e.type);t!==n&&(W(fe,e),W(ie,n))}function Yt(e){fe.current===e&&(q(ie),q(fe)),ce.current===e&&(q(ce),li._currentValue=J)}var rn,on;function At(e){if(rn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);rn=t&&t[1]||"",on=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+rn+e+on}var at=!1;function Rt(e,t){if(!e||at)return"";at=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(F){var X=F}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(F){X=F}e.call(ae.prototype)}}else{try{throw Error()}catch(F){X=F}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(F){if(F&&X&&typeof F.stack=="string")return[F.stack,X.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),p=c[0],j=c[1];if(p&&j){var R=p.split(`
44
+ `),K=j.split(`
45
+ `);for(o=s=0;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;for(;o<K.length&&!K[o].includes("DetermineComponentFrameRoot");)o++;if(s===R.length||o===K.length)for(s=R.length-1,o=K.length-1;1<=s&&0<=o&&R[s]!==K[o];)o--;for(;1<=s&&0<=o;s--,o--)if(R[s]!==K[o]){if(s!==1||o!==1)do if(s--,o--,0>o||R[s]!==K[o]){var P=`
46
+ `+R[s].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=s&&0<=o);break}}}finally{at=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?At(n):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return At(e.type);case 16:return At("Lazy");case 13:return e.child!==t&&t!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return Rt(e.type,!1);case 11:return Rt(e.type.render,!1);case 1:return Rt(e.type,!0);case 31:return At("Activity");default:return""}}function Ot(e){try{var t="",n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var ea=Object.prototype.hasOwnProperty,_n=l.unstable_scheduleCallback,Gn=l.unstable_cancelCallback,jl=l.unstable_shouldYield,$t=l.unstable_requestPaint,Xe=l.unstable_now,xr=l.unstable_getCurrentPriorityLevel,ki=l.unstable_ImmediatePriority,Ti=l.unstable_UserBlockingPriority,Nl=l.unstable_NormalPriority,Df=l.unstable_LowPriority,gr=l.unstable_IdlePriority,Mi=l.log,Ai=l.unstable_setDisableYieldValue,Ra=null,Et=null;function Kt(e){if(typeof Mi=="function"&&Ai(e),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Ra,e)}catch{}}var Xt=Math.clz32?Math.clz32:lt,Sl=Math.log,fu=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(Sl(e)/fu|0)|0}var Oa=256,_e=262144,_a=4194304;function ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rs(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var j=s&134217727;return j!==0?(s=j&~c,s!==0?o=ta(s):(p&=j,p!==0?o=ta(p):n||(n=j&~e,n!==0&&(o=ta(n))))):(j=s&~c,j!==0?o=ta(j):p!==0?o=ta(p):n||(n=s&~e,n!==0&&(o=ta(n)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:o}function wl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hu(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ri(){var e=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),e}function za(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Da(e,t,n,s,o,c){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,R=e.expirationTimes,K=e.hiddenUpdates;for(n=p&~n;0<n;){var P=31-Xt(n),ae=1<<P;j[P]=0,R[P]=-1;var X=K[P];if(X!==null)for(K[P]=null,P=0;P<X.length;P++){var F=X[P];F!==null&&(F.lane&=-536870913)}n&=~ae}s!==0&&is(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(p&~t))}function is(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Xt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function $n(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Xt(n),o=1<<s;o&t|e[s]&t&&(e[s]|=t),n&=~o}}function os(e,t){var n=t&-t;return n=(n&42)!==0?1:vr(n),(n&(e.suspendedLanes|t))!==0?0:n}function vr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function us(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function yr(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:fx(e.type))}function Oi(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var It=Math.random().toString(36).slice(2),dt="__reactFiber$"+It,Bt="__reactProps$"+It,Ua="__reactContainer$"+It,cs="__reactEvents$"+It,mu="__reactListeners$"+It,_i="__reactHandles$"+It,br="__reactResources$"+It,La="__reactMarker$"+It;function ds(e){delete e[dt],delete e[Bt],delete e[cs],delete e[mu],delete e[_i]}function na(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ua]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jp(e);e!==null;){if(n=e[dt])return n;e=Jp(e)}return t}e=n,n=e.parentNode}return null}function ee(e){if(e=e[dt]||e[Ua]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function re(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ue(e){var t=e[br];return t||(t=e[br]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function pe(e){e[La]=!0}var xe=new Set,Ue={};function Ee(e,t){Oe(e,t),Oe(e+"Capture",t)}function Oe(e,t){for(Ue[e]=t,e=0;e<t.length;e++)xe.add(t[e])}var Ve=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),et={},st={};function fs(e){return ea.call(st,e)?!0:ea.call(et,e)?!1:Ve.test(e)?st[e]=!0:(et[e]=!0,!1)}function aa(e,t,n){if(fs(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function El(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ct(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zi(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(p){n=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kl(e){if(!e._valueTracker){var t=Cl(e)?"checked":"value";e._valueTracker=zi(e,t,""+e[t])}}function hs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Cl(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Tl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ml=/[\n"\\]/g;function _t(e){return e.replace(Ml,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function pu(e,t,n,s,o,c,p,j){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kt(t)):e.value!==""+kt(t)&&(e.value=""+kt(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?xu(e,p,kt(t)):n!=null?xu(e,p,kt(n)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+kt(j):e.removeAttribute("name")}function Uf(e,t,n,s,o,c,p,j){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){kl(e);return}n=n!=null?""+kt(n):"",t=t!=null?""+kt(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=j?e.checked:!!s,e.defaultChecked=!!s,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),kl(e)}function xu(e,t,n){t==="number"&&Tl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ms(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&s&&(e[n].defaultSelected=!0)}else{for(n=""+kt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Lf(e,t,n){if(t!=null&&(t=""+kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+kt(n):""}function Hf(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(u(92));if(G(s)){if(1<s.length)throw Error(u(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=kt(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),kl(e)}function ps(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Q0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function qf(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||Q0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Bf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&n[o]!==s&&qf(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&qf(e,c,t[c])}function gu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Y0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Di(e){return Y0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function la(){}var vu=null;function yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xs=null,gs=null;function Qf(e){var t=ee(e);if(t&&(e=t.stateNode)){var n=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(pu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_t(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var o=s[Bt]||null;if(!o)throw Error(u(90));pu(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&hs(s)}break e;case"textarea":Lf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ms(e,!!n.multiple,t,!1)}}}var bu=!1;function Gf(e,t,n){if(bu)return e(t,n);bu=!0;try{var s=e(t);return s}finally{if(bu=!1,(xs!==null||gs!==null)&&(So(),xs&&(t=xs,e=gs,gs=xs=null,Qf(t),e)))for(t=0;t<e.length;t++)Qf(e[t])}}function jr(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Bt]||null;if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ju=!1;if(sa)try{var Nr={};Object.defineProperty(Nr,"passive",{get:function(){ju=!0}}),window.addEventListener("test",Nr,Nr),window.removeEventListener("test",Nr,Nr)}catch{ju=!1}var Ha=null,Nu=null,Ui=null;function Yf(){if(Ui)return Ui;var e,t=Nu,n=t.length,s,o="value"in Ha?Ha.value:Ha.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var p=n-e;for(s=1;s<=p&&t[n-s]===o[c-s];s++);return Ui=o.slice(e,1<s?1-s:void 0)}function Li(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Hi(){return!0}function $f(){return!1}function Wt(e){function t(n,s,o,c,p){this._reactName=n,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(c):c[j]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Hi:$f,this.isPropagationStopped=$f,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hi)},persist:function(){},isPersistent:Hi}),t}var Al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qi=Wt(Al),Sr=v({},Al,{view:0,detail:0}),$0=Wt(Sr),Su,wu,wr,Bi=v({},Sr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wr&&(wr&&e.type==="mousemove"?(Su=e.screenX-wr.screenX,wu=e.screenY-wr.screenY):wu=Su=0,wr=e),Su)},movementY:function(e){return"movementY"in e?e.movementY:wu}}),Kf=Wt(Bi),K0=v({},Bi,{dataTransfer:0}),X0=Wt(K0),V0=v({},Sr,{relatedTarget:0}),Eu=Wt(V0),Z0=v({},Al,{animationName:0,elapsedTime:0,pseudoElement:0}),F0=Wt(Z0),J0=v({},Al,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),I0=Wt(J0),W0=v({},Al,{data:0}),Xf=Wt(W0),P0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ev={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"},tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tv[e])?!!t[e]:!1}function Cu(){return nv}var av=v({},Sr,{key:function(e){if(e.key){var t=P0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ev[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cu,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lv=Wt(av),sv=v({},Bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vf=Wt(sv),rv=v({},Sr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cu}),iv=Wt(rv),ov=v({},Al,{propertyName:0,elapsedTime:0,pseudoElement:0}),uv=Wt(ov),cv=v({},Bi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),dv=Wt(cv),fv=v({},Al,{newState:0,oldState:0}),hv=Wt(fv),mv=[9,13,27,32],ku=sa&&"CompositionEvent"in window,Er=null;sa&&"documentMode"in document&&(Er=document.documentMode);var pv=sa&&"TextEvent"in window&&!Er,Zf=sa&&(!ku||Er&&8<Er&&11>=Er),Ff=" ",Jf=!1;function If(e,t){switch(e){case"keyup":return mv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vs=!1;function xv(e,t){switch(e){case"compositionend":return Wf(t);case"keypress":return t.which!==32?null:(Jf=!0,Ff);case"textInput":return e=t.data,e===Ff&&Jf?null:e;default:return null}}function gv(e,t){if(vs)return e==="compositionend"||!ku&&If(e,t)?(e=Yf(),Ui=Nu=Ha=null,vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zf&&t.locale!=="ko"?null:t.data;default:return null}}var vv={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 Pf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vv[e.type]:t==="textarea"}function eh(e,t,n,s){xs?gs?gs.push(s):gs=[s]:xs=s,t=Ao(t,"onChange"),0<t.length&&(n=new qi("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Cr=null,kr=null;function yv(e){Up(e,0)}function Qi(e){var t=re(e);if(hs(t))return e}function th(e,t){if(e==="change")return t}var nh=!1;if(sa){var Tu;if(sa){var Mu="oninput"in document;if(!Mu){var ah=document.createElement("div");ah.setAttribute("oninput","return;"),Mu=typeof ah.oninput=="function"}Tu=Mu}else Tu=!1;nh=Tu&&(!document.documentMode||9<document.documentMode)}function lh(){Cr&&(Cr.detachEvent("onpropertychange",sh),kr=Cr=null)}function sh(e){if(e.propertyName==="value"&&Qi(kr)){var t=[];eh(t,kr,e,yu(e)),Gf(yv,t)}}function bv(e,t,n){e==="focusin"?(lh(),Cr=t,kr=n,Cr.attachEvent("onpropertychange",sh)):e==="focusout"&&lh()}function jv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qi(kr)}function Nv(e,t){if(e==="click")return Qi(t)}function Sv(e,t){if(e==="input"||e==="change")return Qi(t)}function wv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:wv;function Tr(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var o=n[s];if(!ea.call(t,o)||!un(e[o],t[o]))return!1}return!0}function rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ih(e,t){var n=rh(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rh(n)}}function oh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?oh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tl(e.document)}return t}function Au(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ev=sa&&"documentMode"in document&&11>=document.documentMode,ys=null,Ru=null,Mr=null,Ou=!1;function ch(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ou||ys==null||ys!==Tl(s)||(s=ys,"selectionStart"in s&&Au(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Mr&&Tr(Mr,s)||(Mr=s,s=Ao(Ru,"onSelect"),0<s.length&&(t=new qi("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ys)))}function Rl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var bs={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionrun:Rl("Transition","TransitionRun"),transitionstart:Rl("Transition","TransitionStart"),transitioncancel:Rl("Transition","TransitionCancel"),transitionend:Rl("Transition","TransitionEnd")},_u={},dh={};sa&&(dh=document.createElement("div").style,"AnimationEvent"in window||(delete bs.animationend.animation,delete bs.animationiteration.animation,delete bs.animationstart.animation),"TransitionEvent"in window||delete bs.transitionend.transition);function Ol(e){if(_u[e])return _u[e];if(!bs[e])return e;var t=bs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dh)return _u[e]=t[n];return e}var fh=Ol("animationend"),hh=Ol("animationiteration"),mh=Ol("animationstart"),Cv=Ol("transitionrun"),kv=Ol("transitionstart"),Tv=Ol("transitioncancel"),ph=Ol("transitionend"),xh=new Map,zu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zu.push("scrollEnd");function zn(e,t){xh.set(e,t),Ee(t,[e])}var Gi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bn=[],js=0,Du=0;function Yi(){for(var e=js,t=Du=js=0;t<e;){var n=bn[t];bn[t++]=null;var s=bn[t];bn[t++]=null;var o=bn[t];bn[t++]=null;var c=bn[t];if(bn[t++]=null,s!==null&&o!==null){var p=s.pending;p===null?o.next=o:(o.next=p.next,p.next=o),s.pending=o}c!==0&&gh(n,o,c)}}function $i(e,t,n,s){bn[js++]=e,bn[js++]=t,bn[js++]=n,bn[js++]=s,Du|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Uu(e,t,n,s){return $i(e,t,n,s),Ki(e)}function _l(e,t){return $i(e,null,null,t),Ki(e)}function gh(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,s=c.alternate,s!==null&&(s.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-Xt(n),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=n|536870912),c):null}function Ki(e){if(50<Ir)throw Ir=0,Kc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ns={};function Mv(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(e,t,n,s){return new Mv(e,t,n,s)}function Lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ra(e,t){var n=e.alternate;return n===null?(n=cn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vh(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Xi(e,t,n,s,o,c){var p=0;if(s=e,typeof e=="function")Lu(e)&&(p=1);else if(typeof e=="string")p=zy(e,n,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=cn(31,n,t,o),e.elementType=se,e.lanes=c,e;case O:return zl(n.children,o,c,t);case A:p=8,o|=24;break;case z:return e=cn(12,n,t,o|2),e.elementType=z,e.lanes=c,e;case M:return e=cn(13,n,t,o),e.elementType=M,e.lanes=c,e;case U:return e=cn(19,n,t,o),e.elementType=U,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:p=10;break e;case V:p=9;break e;case S:p=11;break e;case D:p=14;break e;case le:p=16,s=null;break e}p=29,n=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=cn(p,n,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function zl(e,t,n,s){return e=cn(7,e,s,t),e.lanes=n,e}function Hu(e,t,n){return e=cn(6,e,null,t),e.lanes=n,e}function yh(e){var t=cn(18,null,null,0);return t.stateNode=e,t}function qu(e,t,n){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bh=new WeakMap;function jn(e,t){if(typeof e=="object"&&e!==null){var n=bh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ot(t)},bh.set(e,t),t)}return{value:e,source:t,stack:Ot(t)}}var Ss=[],ws=0,Vi=null,Ar=0,Nn=[],Sn=0,qa=null,Kn=1,Xn="";function ia(e,t){Ss[ws++]=Ar,Ss[ws++]=Vi,Vi=e,Ar=t}function jh(e,t,n){Nn[Sn++]=Kn,Nn[Sn++]=Xn,Nn[Sn++]=qa,qa=e;var s=Kn;e=Xn;var o=32-Xt(s)-1;s&=~(1<<o),n+=1;var c=32-Xt(t)+o;if(30<c){var p=o-o%5;c=(s&(1<<p)-1).toString(32),s>>=p,o-=p,Kn=1<<32-Xt(t)+o|n<<o|s,Xn=c+e}else Kn=1<<c|n<<o|s,Xn=e}function Bu(e){e.return!==null&&(ia(e,1),jh(e,1,0))}function Qu(e){for(;e===Vi;)Vi=Ss[--ws],Ss[ws]=null,Ar=Ss[--ws],Ss[ws]=null;for(;e===qa;)qa=Nn[--Sn],Nn[Sn]=null,Xn=Nn[--Sn],Nn[Sn]=null,Kn=Nn[--Sn],Nn[Sn]=null}function Nh(e,t){Nn[Sn++]=Kn,Nn[Sn++]=Xn,Nn[Sn++]=qa,Kn=t.id,Xn=t.overflow,qa=e}var zt=null,rt=null,qe=!1,Ba=null,wn=!1,Gu=Error(u(519));function Qa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rr(jn(t,e)),Gu}function Sh(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[dt]=e,t[Bt]=s,n){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(n=0;n<Pr.length;n++)De(Pr[n],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Uf(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Hf(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||Bp(t.textContent,n)?(s.popover!=null&&(De("beforetoggle",t),De("toggle",t)),s.onScroll!=null&&De("scroll",t),s.onScrollEnd!=null&&De("scrollend",t),s.onClick!=null&&(t.onclick=la),t=!0):t=!1,t||Qa(e,!0)}function wh(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:zt=zt.return}}function Es(e){if(e!==zt)return!1;if(!qe)return wh(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||rd(e.type,e.memoizedProps)),n=!n),n&&rt&&Qa(e),wh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));rt=Fp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));rt=Fp(e)}else t===27?(t=rt,tl(e.type)?(e=dd,dd=null,rt=e):rt=t):rt=zt?Cn(e.stateNode.nextSibling):null;return!0}function Dl(){rt=zt=null,qe=!1}function Yu(){var e=Ba;return e!==null&&(nn===null?nn=e:nn.push.apply(nn,e),Ba=null),e}function Rr(e){Ba===null?Ba=[e]:Ba.push(e)}var $u=C(null),Ul=null,oa=null;function Ga(e,t,n){W($u,t._currentValue),t._currentValue=n}function ua(e){e._currentValue=$u.current,q($u)}function Ku(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Xu(e,t,n,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var p=o.child;c=c.firstContext;e:for(;c!==null;){var j=c;c=o;for(var R=0;R<t.length;R++)if(j.context===t[R]){c.lanes|=n,j=c.alternate,j!==null&&(j.lanes|=n),Ku(c.return,n,e),s||(p=null);break e}c=j.next}}else if(o.tag===18){if(p=o.return,p===null)throw Error(u(341));p.lanes|=n,c=p.alternate,c!==null&&(c.lanes|=n),Ku(p,n,e),p=null}else p=o.child;if(p!==null)p.return=o;else for(p=o;p!==null;){if(p===e){p=null;break}if(o=p.sibling,o!==null){o.return=p.return,p=o;break}p=p.return}o=p}}function Cs(e,t,n,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var p=o.alternate;if(p===null)throw Error(u(387));if(p=p.memoizedProps,p!==null){var j=o.type;un(o.pendingProps.value,p.value)||(e!==null?e.push(j):e=[j])}}else if(o===ce.current){if(p=o.alternate,p===null)throw Error(u(387));p.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(li):e=[li])}o=o.return}e!==null&&Xu(t,e,n,s),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ll(e){Ul=e,oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Eh(Ul,e)}function Fi(e,t){return Ul===null&&Ll(e),Eh(e,t)}function Eh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},oa===null){if(e===null)throw Error(u(308));oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oa=oa.next=t;return n}var Av=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Rv=l.unstable_scheduleCallback,Ov=l.unstable_NormalPriority,vt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vu(){return{controller:new Av,data:new Map,refCount:0}}function Or(e){e.refCount--,e.refCount===0&&Rv(Ov,function(){e.controller.abort()})}var _r=null,Zu=0,ks=0,Ts=null;function _v(e,t){if(_r===null){var n=_r=[];Zu=0,ks=Ic(),Ts={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Zu++,t.then(Ch,Ch),t}function Ch(){if(--Zu===0&&_r!==null){Ts!==null&&(Ts.status="fulfilled");var e=_r;_r=null,ks=0,Ts=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zv(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),s}var kh=T.S;T.S=function(e,t){cp=Xe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_v(e,t),kh!==null&&kh(e,t)};var Hl=C(null);function Fu(){var e=Hl.current;return e!==null?e:tt.pooledCache}function Ji(e,t){t===null?W(Hl,Hl.current):W(Hl,t.pool)}function Th(){var e=Fu();return e===null?null:{parent:vt._currentValue,pool:e}}var Ms=Error(u(460)),Ju=Error(u(474)),Ii=Error(u(542)),Wi={then:function(){}};function Mh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ah(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(la,la),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oh(e),e;default:if(typeof t.status=="string")t.then(la,la);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Oh(e),e}throw Bl=t,Ms}}function ql(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Bl=n,Ms):n}}var Bl=null;function Rh(){if(Bl===null)throw Error(u(459));var e=Bl;return Bl=null,e}function Oh(e){if(e===Ms||e===Ii)throw Error(u(483))}var As=null,zr=0;function Pi(e){var t=zr;return zr+=1,As===null&&(As=[]),Ah(As,e,t)}function Dr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function eo(e,t){throw t.$$typeof===w?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _h(e){function t(B,L){if(e){var $=B.deletions;$===null?(B.deletions=[L],B.flags|=16):$.push(L)}}function n(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function s(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function o(B,L){return B=ra(B,L),B.index=0,B.sibling=null,B}function c(B,L,$){return B.index=$,e?($=B.alternate,$!==null?($=$.index,$<L?(B.flags|=67108866,L):$):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function p(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function j(B,L,$,te){return L===null||L.tag!==6?(L=Hu($,B.mode,te),L.return=B,L):(L=o(L,$),L.return=B,L)}function R(B,L,$,te){var je=$.type;return je===O?P(B,L,$.props.children,te,$.key):L!==null&&(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===le&&ql(je)===L.type)?(L=o(L,$.props),Dr(L,$),L.return=B,L):(L=Xi($.type,$.key,$.props,null,B.mode,te),Dr(L,$),L.return=B,L)}function K(B,L,$,te){return L===null||L.tag!==4||L.stateNode.containerInfo!==$.containerInfo||L.stateNode.implementation!==$.implementation?(L=qu($,B.mode,te),L.return=B,L):(L=o(L,$.children||[]),L.return=B,L)}function P(B,L,$,te,je){return L===null||L.tag!==7?(L=zl($,B.mode,te,je),L.return=B,L):(L=o(L,$),L.return=B,L)}function ae(B,L,$){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Hu(""+L,B.mode,$),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case k:return $=Xi(L.type,L.key,L.props,null,B.mode,$),Dr($,L),$.return=B,$;case E:return L=qu(L,B.mode,$),L.return=B,L;case le:return L=ql(L),ae(B,L,$)}if(G(L)||Y(L))return L=zl(L,B.mode,$,null),L.return=B,L;if(typeof L.then=="function")return ae(B,Pi(L),$);if(L.$$typeof===N)return ae(B,Fi(B,L),$);eo(B,L)}return null}function X(B,L,$,te){var je=L!==null?L.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return je!==null?null:j(B,L,""+$,te);if(typeof $=="object"&&$!==null){switch($.$$typeof){case k:return $.key===je?R(B,L,$,te):null;case E:return $.key===je?K(B,L,$,te):null;case le:return $=ql($),X(B,L,$,te)}if(G($)||Y($))return je!==null?null:P(B,L,$,te,null);if(typeof $.then=="function")return X(B,L,Pi($),te);if($.$$typeof===N)return X(B,L,Fi(B,$),te);eo(B,$)}return null}function F(B,L,$,te,je){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return B=B.get($)||null,j(L,B,""+te,je);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case k:return B=B.get(te.key===null?$:te.key)||null,R(L,B,te,je);case E:return B=B.get(te.key===null?$:te.key)||null,K(L,B,te,je);case le:return te=ql(te),F(B,L,$,te,je)}if(G(te)||Y(te))return B=B.get($)||null,P(L,B,te,je,null);if(typeof te.then=="function")return F(B,L,$,Pi(te),je);if(te.$$typeof===N)return F(B,L,$,Fi(L,te),je);eo(L,te)}return null}function ge(B,L,$,te){for(var je=null,Qe=null,ve=L,Ae=L=0,He=null;ve!==null&&Ae<$.length;Ae++){ve.index>Ae?(He=ve,ve=null):He=ve.sibling;var Ge=X(B,ve,$[Ae],te);if(Ge===null){ve===null&&(ve=He);break}e&&ve&&Ge.alternate===null&&t(B,ve),L=c(Ge,L,Ae),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge,ve=He}if(Ae===$.length)return n(B,ve),qe&&ia(B,Ae),je;if(ve===null){for(;Ae<$.length;Ae++)ve=ae(B,$[Ae],te),ve!==null&&(L=c(ve,L,Ae),Qe===null?je=ve:Qe.sibling=ve,Qe=ve);return qe&&ia(B,Ae),je}for(ve=s(ve);Ae<$.length;Ae++)He=F(ve,B,Ae,$[Ae],te),He!==null&&(e&&He.alternate!==null&&ve.delete(He.key===null?Ae:He.key),L=c(He,L,Ae),Qe===null?je=He:Qe.sibling=He,Qe=He);return e&&ve.forEach(function(rl){return t(B,rl)}),qe&&ia(B,Ae),je}function Ne(B,L,$,te){if($==null)throw Error(u(151));for(var je=null,Qe=null,ve=L,Ae=L=0,He=null,Ge=$.next();ve!==null&&!Ge.done;Ae++,Ge=$.next()){ve.index>Ae?(He=ve,ve=null):He=ve.sibling;var rl=X(B,ve,Ge.value,te);if(rl===null){ve===null&&(ve=He);break}e&&ve&&rl.alternate===null&&t(B,ve),L=c(rl,L,Ae),Qe===null?je=rl:Qe.sibling=rl,Qe=rl,ve=He}if(Ge.done)return n(B,ve),qe&&ia(B,Ae),je;if(ve===null){for(;!Ge.done;Ae++,Ge=$.next())Ge=ae(B,Ge.value,te),Ge!==null&&(L=c(Ge,L,Ae),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge);return qe&&ia(B,Ae),je}for(ve=s(ve);!Ge.done;Ae++,Ge=$.next())Ge=F(ve,B,Ae,Ge.value,te),Ge!==null&&(e&&Ge.alternate!==null&&ve.delete(Ge.key===null?Ae:Ge.key),L=c(Ge,L,Ae),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge);return e&&ve.forEach(function(Ky){return t(B,Ky)}),qe&&ia(B,Ae),je}function Pe(B,L,$,te){if(typeof $=="object"&&$!==null&&$.type===O&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case k:e:{for(var je=$.key;L!==null;){if(L.key===je){if(je=$.type,je===O){if(L.tag===7){n(B,L.sibling),te=o(L,$.props.children),te.return=B,B=te;break e}}else if(L.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===le&&ql(je)===L.type){n(B,L.sibling),te=o(L,$.props),Dr(te,$),te.return=B,B=te;break e}n(B,L);break}else t(B,L);L=L.sibling}$.type===O?(te=zl($.props.children,B.mode,te,$.key),te.return=B,B=te):(te=Xi($.type,$.key,$.props,null,B.mode,te),Dr(te,$),te.return=B,B=te)}return p(B);case E:e:{for(je=$.key;L!==null;){if(L.key===je)if(L.tag===4&&L.stateNode.containerInfo===$.containerInfo&&L.stateNode.implementation===$.implementation){n(B,L.sibling),te=o(L,$.children||[]),te.return=B,B=te;break e}else{n(B,L);break}else t(B,L);L=L.sibling}te=qu($,B.mode,te),te.return=B,B=te}return p(B);case le:return $=ql($),Pe(B,L,$,te)}if(G($))return ge(B,L,$,te);if(Y($)){if(je=Y($),typeof je!="function")throw Error(u(150));return $=je.call($),Ne(B,L,$,te)}if(typeof $.then=="function")return Pe(B,L,Pi($),te);if($.$$typeof===N)return Pe(B,L,Fi(B,$),te);eo(B,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,L!==null&&L.tag===6?(n(B,L.sibling),te=o(L,$),te.return=B,B=te):(n(B,L),te=Hu($,B.mode,te),te.return=B,B=te),p(B)):n(B,L)}return function(B,L,$,te){try{zr=0;var je=Pe(B,L,$,te);return As=null,je}catch(ve){if(ve===Ms||ve===Ii)throw ve;var Qe=cn(29,ve,null,B.mode);return Qe.lanes=te,Qe.return=B,Qe}finally{}}}var Ql=_h(!0),zh=_h(!1),Ya=!1;function Iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function $a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ye&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Ki(e),gh(e,null,n),t}return $i(e,s,t,n),Ki(e)}function Ur(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$n(e,n)}}function Pu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=p:c=c.next=p,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ec=!1;function Lr(){if(ec){var e=Ts;if(e!==null)throw e}}function Hr(e,t,n,s){ec=!1;var o=e.updateQueue;Ya=!1;var c=o.firstBaseUpdate,p=o.lastBaseUpdate,j=o.shared.pending;if(j!==null){o.shared.pending=null;var R=j,K=R.next;R.next=null,p===null?c=K:p.next=K,p=R;var P=e.alternate;P!==null&&(P=P.updateQueue,j=P.lastBaseUpdate,j!==p&&(j===null?P.firstBaseUpdate=K:j.next=K,P.lastBaseUpdate=R))}if(c!==null){var ae=o.baseState;p=0,P=K=R=null,j=c;do{var X=j.lane&-536870913,F=X!==j.lane;if(F?(Le&X)===X:(s&X)===X){X!==0&&X===ks&&(ec=!0),P!==null&&(P=P.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ge=e,Ne=j;X=t;var Pe=n;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){ae=ge.call(Pe,ae,X);break e}ae=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,X=typeof ge=="function"?ge.call(Pe,ae,X):ge,X==null)break e;ae=v({},ae,X);break e;case 2:Ya=!0}}X=j.callback,X!==null&&(e.flags|=64,F&&(e.flags|=8192),F=o.callbacks,F===null?o.callbacks=[X]:F.push(X))}else F={lane:X,tag:j.tag,payload:j.payload,callback:j.callback,next:null},P===null?(K=P=F,R=ae):P=P.next=F,p|=X;if(j=j.next,j===null){if(j=o.shared.pending,j===null)break;F=j,j=F.next,F.next=null,o.lastBaseUpdate=F,o.shared.pending=null}}while(!0);P===null&&(R=ae),o.baseState=R,o.firstBaseUpdate=K,o.lastBaseUpdate=P,c===null&&(o.shared.lanes=0),Ja|=p,e.lanes=p,e.memoizedState=ae}}function Dh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Uh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Dh(n[e],t)}var Rs=C(null),to=C(0);function Lh(e,t){e=va,W(to,e),W(Rs,t),va=e|t.baseLanes}function tc(){W(to,va),W(Rs,Rs.current)}function nc(){va=to.current,q(Rs),q(to)}var dn=C(null),En=null;function Xa(e){var t=e.alternate;W(xt,xt.current&1),W(dn,e),En===null&&(t===null||Rs.current!==null||t.memoizedState!==null)&&(En=e)}function ac(e){W(xt,xt.current),W(dn,e),En===null&&(En=e)}function Hh(e){e.tag===22?(W(xt,xt.current),W(dn,e),En===null&&(En=e)):Va()}function Va(){W(xt,xt.current),W(dn,dn.current)}function fn(e){q(dn),En===e&&(En=null),q(xt)}var xt=C(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ud(n)||cd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ca=0,Te=null,Ie=null,yt=null,ao=!1,Os=!1,Gl=!1,lo=0,qr=0,_s=null,Dv=0;function ht(){throw Error(u(321))}function lc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!un(e[n],t[n]))return!1;return!0}function sc(e,t,n,s,o,c){return ca=c,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?jm:bc,Gl=!1,c=n(s,o),Gl=!1,Os&&(c=Bh(t,n,s,o)),qh(e),c}function qh(e){T.H=Gr;var t=Ie!==null&&Ie.next!==null;if(ca=0,yt=Ie=Te=null,ao=!1,qr=0,_s=null,t)throw Error(u(300));e===null||bt||(e=e.dependencies,e!==null&&Zi(e)&&(bt=!0))}function Bh(e,t,n,s){Te=e;var o=0;do{if(Os&&(_s=null),qr=0,Os=!1,25<=o)throw Error(u(301));if(o+=1,yt=Ie=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}T.H=Nm,c=t(n,s)}while(Os);return c}function Uv(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?Br(t):t,e=e.useState()[0],(Ie!==null?Ie.memoizedState:null)!==e&&(Te.flags|=1024),t}function rc(){var e=lo!==0;return lo=0,e}function ic(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function oc(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}ca=0,yt=Ie=Te=null,Os=!1,qr=lo=0,_s=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Te.memoizedState=yt=e:yt=yt.next=e,yt}function gt(){if(Ie===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=yt===null?Te.memoizedState:yt.next;if(t!==null)yt=t,Ie=e;else{if(e===null)throw Te.alternate===null?Error(u(467)):Error(u(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},yt===null?Te.memoizedState=yt=e:yt=yt.next=e}return yt}function so(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Br(e){var t=qr;return qr+=1,_s===null&&(_s=[]),e=Ah(_s,e,t),t=Te,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?jm:bc),e}function ro(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Br(e);if(e.$$typeof===N)return Dt(e)}throw Error(u(438,String(e)))}function uc(e){var t=null,n=Te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=so(),Te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=I;return t.index++,n}function da(e,t){return typeof t=="function"?t(e):t}function io(e){var t=gt();return cc(t,Ie,e)}function cc(e,t,n){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=n;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var p=o.next;o.next=c.next,c.next=p}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var j=p=null,R=null,K=t,P=!1;do{var ae=K.lane&-536870913;if(ae!==K.lane?(Le&ae)===ae:(ca&ae)===ae){var X=K.revertLane;if(X===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ae===ks&&(P=!0);else if((ca&X)===X){K=K.next,X===ks&&(P=!0);continue}else ae={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(j=R=ae,p=c):R=R.next=ae,Te.lanes|=X,Ja|=X;ae=K.action,Gl&&n(c,ae),c=K.hasEagerState?K.eagerState:n(c,ae)}else X={lane:ae,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},R===null?(j=R=X,p=c):R=R.next=X,Te.lanes|=ae,Ja|=ae;K=K.next}while(K!==null&&K!==t);if(R===null?p=c:R.next=j,!un(c,e.memoizedState)&&(bt=!0,P&&(n=Ts,n!==null)))throw n;e.memoizedState=c,e.baseState=p,e.baseQueue=R,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function dc(e){var t=gt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var s=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var p=o=o.next;do c=e(c,p.action),p=p.next;while(p!==o);un(c,t.memoizedState)||(bt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,s]}function Qh(e,t,n){var s=Te,o=gt(),c=qe;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var p=!un((Ie||o).memoizedState,n);if(p&&(o.memoizedState=n,bt=!0),o=o.queue,mc($h.bind(null,s,o,e),[e]),o.getSnapshot!==t||p||yt!==null&&yt.memoizedState.tag&1){if(s.flags|=2048,zs(9,{destroy:void 0},Yh.bind(null,s,o,n,t),null),tt===null)throw Error(u(349));c||(ca&127)!==0||Gh(s,t,n)}return n}function Gh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t=so(),Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yh(e,t,n,s){t.value=n,t.getSnapshot=s,Kh(t)&&Xh(e)}function $h(e,t,n){return n(function(){Kh(t)&&Xh(e)})}function Kh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!un(e,n)}catch{return!0}}function Xh(e){var t=_l(e,2);t!==null&&an(t,e,2)}function fc(e){var t=Vt();if(typeof e=="function"){var n=e;if(e=n(),Gl){Kt(!0);try{n()}finally{Kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:e},t}function Vh(e,t,n,s){return e.baseState=n,cc(e,Ie,typeof s=="function"?s:da)}function Lv(e,t,n,s,o){if(co(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};T.T!==null?n(!0):c.isTransition=!1,s(c),n=t.pending,n===null?(c.next=t.pending=c,Zh(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Zh(e,t){var n=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=T.T,p={};T.T=p;try{var j=n(o,s),R=T.S;R!==null&&R(p,j),Fh(e,t,j)}catch(K){hc(e,t,K)}finally{c!==null&&p.types!==null&&(c.types=p.types),T.T=c}}else try{c=n(o,s),Fh(e,t,c)}catch(K){hc(e,t,K)}}function Fh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){Jh(e,t,s)},function(s){return hc(e,t,s)}):Jh(e,t,n)}function Jh(e,t,n){t.status="fulfilled",t.value=n,Ih(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zh(e,n)))}function hc(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Ih(t),t=t.next;while(t!==s)}e.action=null}function Ih(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Wh(e,t){return t}function Ph(e,t){if(qe){var n=tt.formState;if(n!==null){e:{var s=Te;if(qe){if(rt){t:{for(var o=rt,c=wn;o.nodeType!==8;){if(!c){o=null;break t}if(o=Cn(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){rt=Cn(o.nextSibling),s=o.data==="F!";break e}}Qa(s)}s=!1}s&&(t=n[0])}}return n=Vt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wh,lastRenderedState:t},n.queue=s,n=vm.bind(null,Te,s),s.dispatch=n,s=fc(!1),c=yc.bind(null,Te,!1,s.queue),s=Vt(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,n=Lv.bind(null,Te,o,c,n),o.dispatch=n,s.memoizedState=e,[t,n,!1]}function em(e){var t=gt();return tm(t,Ie,e)}function tm(e,t,n){if(t=cc(e,t,Wh)[0],e=io(da)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Br(t)}catch(p){throw p===Ms?Ii:p}else s=t;t=gt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(Te.flags|=2048,zs(9,{destroy:void 0},Hv.bind(null,o,n),null)),[s,c,e]}function Hv(e,t){e.action=t}function nm(e){var t=gt(),n=Ie;if(n!==null)return tm(t,n,e);gt(),t=t.memoizedState,n=gt();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function zs(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=so(),Te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function am(){return gt().memoizedState}function oo(e,t,n,s){var o=Vt();Te.flags|=e,o.memoizedState=zs(1|t,{destroy:void 0},n,s===void 0?null:s)}function uo(e,t,n,s){var o=gt();s=s===void 0?null:s;var c=o.memoizedState.inst;Ie!==null&&s!==null&&lc(s,Ie.memoizedState.deps)?o.memoizedState=zs(t,c,n,s):(Te.flags|=e,o.memoizedState=zs(1|t,c,n,s))}function lm(e,t){oo(8390656,8,e,t)}function mc(e,t){uo(2048,8,e,t)}function qv(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=so(),Te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function sm(e){var t=gt().memoizedState;return qv({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function rm(e,t){return uo(4,2,e,t)}function im(e,t){return uo(4,4,e,t)}function om(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function um(e,t,n){n=n!=null?n.concat([e]):null,uo(4,4,om.bind(null,t,e),n)}function pc(){}function cm(e,t){var n=gt();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&lc(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function dm(e,t){var n=gt();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&lc(t,s[1]))return s[0];if(s=e(),Gl){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[s,t],s}function xc(e,t,n){return n===void 0||(ca&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=fp(),Te.lanes|=e,Ja|=e,n)}function fm(e,t,n,s){return un(n,t)?n:Rs.current!==null?(e=xc(e,n,s),un(e,t)||(bt=!0),e):(ca&42)===0||(ca&1073741824)!==0&&(Le&261930)===0?(bt=!0,e.memoizedState=n):(e=fp(),Te.lanes|=e,Ja|=e,t)}function hm(e,t,n,s,o){var c=H.p;H.p=c!==0&&8>c?c:8;var p=T.T,j={};T.T=j,yc(e,!1,t,n);try{var R=o(),K=T.S;if(K!==null&&K(j,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var P=zv(R,s);Qr(e,t,P,pn(e))}else Qr(e,t,s,pn(e))}catch(ae){Qr(e,t,{then:function(){},status:"rejected",reason:ae},pn())}finally{H.p=c,p!==null&&j.types!==null&&(p.types=j.types),T.T=p}}function Bv(){}function gc(e,t,n,s){if(e.tag!==5)throw Error(u(476));var o=mm(e).queue;hm(e,o,t,J,n===null?Bv:function(){return pm(e),n(s)})}function mm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:J},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pm(e){var t=mm(e);t.next===null&&(t=e.alternate.memoizedState),Qr(e,t.next.queue,{},pn())}function vc(){return Dt(li)}function xm(){return gt().memoizedState}function gm(){return gt().memoizedState}function Qv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pn();e=$a(n);var s=Ka(t,e,n);s!==null&&(an(s,t,n),Ur(s,t,n)),t={cache:Vu()},e.payload=t;return}t=t.return}}function Gv(e,t,n){var s=pn();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},co(e)?ym(t,n):(n=Uu(e,t,n,s),n!==null&&(an(n,e,s),bm(n,t,s)))}function vm(e,t,n){var s=pn();Qr(e,t,n,s)}function Qr(e,t,n,s){var o={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(co(e))ym(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,j=c(p,n);if(o.hasEagerState=!0,o.eagerState=j,un(j,p))return $i(e,t,o,0),tt===null&&Yi(),!1}catch{}finally{}if(n=Uu(e,t,o,s),n!==null)return an(n,e,s),bm(n,t,s),!0}return!1}function yc(e,t,n,s){if(s={lane:2,revertLane:Ic(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},co(e)){if(t)throw Error(u(479))}else t=Uu(e,n,s,2),t!==null&&an(t,e,2)}function co(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function ym(e,t){Os=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bm(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,$n(e,n)}}var Gr={readContext:Dt,use:ro,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Gr.useEffectEvent=ht;var jm={readContext:Dt,use:ro,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:lm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,oo(4194308,4,om.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oo(4194308,4,e,t)},useInsertionEffect:function(e,t){oo(4,2,e,t)},useMemo:function(e,t){var n=Vt();t=t===void 0?null:t;var s=e();if(Gl){Kt(!0);try{e()}finally{Kt(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Vt();if(n!==void 0){var o=n(t);if(Gl){Kt(!0);try{n(t)}finally{Kt(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Gv.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=fc(e);var t=e.queue,n=vm.bind(null,Te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:pc,useDeferredValue:function(e,t){var n=Vt();return xc(n,e,t)},useTransition:function(){var e=fc(!1);return e=hm.bind(null,Te,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Te,o=Vt();if(qe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),tt===null)throw Error(u(349));(Le&127)!==0||Gh(s,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,lm($h.bind(null,s,c,e),[e]),s.flags|=2048,zs(9,{destroy:void 0},Yh.bind(null,s,c,n,t),null),n},useId:function(){var e=Vt(),t=tt.identifierPrefix;if(qe){var n=Xn,s=Kn;n=(s&~(1<<32-Xt(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=lo++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Dv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:vc,useFormState:Ph,useActionState:Ph,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,Te,!0,n),n.dispatch=t,[e,t]},useMemoCache:uc,useCacheRefresh:function(){return Vt().memoizedState=Qv.bind(null,Te)},useEffectEvent:function(e){var t=Vt(),n={impl:e};return t.memoizedState=n,function(){if((Ye&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},bc={readContext:Dt,use:ro,useCallback:cm,useContext:Dt,useEffect:mc,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:im,useMemo:dm,useReducer:io,useRef:am,useState:function(){return io(da)},useDebugValue:pc,useDeferredValue:function(e,t){var n=gt();return fm(n,Ie.memoizedState,e,t)},useTransition:function(){var e=io(da)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Br(e),t]},useSyncExternalStore:Qh,useId:xm,useHostTransitionStatus:vc,useFormState:em,useActionState:em,useOptimistic:function(e,t){var n=gt();return Vh(n,Ie,e,t)},useMemoCache:uc,useCacheRefresh:gm};bc.useEffectEvent=sm;var Nm={readContext:Dt,use:ro,useCallback:cm,useContext:Dt,useEffect:mc,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:im,useMemo:dm,useReducer:dc,useRef:am,useState:function(){return dc(da)},useDebugValue:pc,useDeferredValue:function(e,t){var n=gt();return Ie===null?xc(n,e,t):fm(n,Ie.memoizedState,e,t)},useTransition:function(){var e=dc(da)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Br(e),t]},useSyncExternalStore:Qh,useId:xm,useHostTransitionStatus:vc,useFormState:nm,useActionState:nm,useOptimistic:function(e,t){var n=gt();return Ie!==null?Vh(n,Ie,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:uc,useCacheRefresh:gm};Nm.useEffectEvent=sm;function jc(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Nc={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=pn(),o=$a(s);o.payload=t,n!=null&&(o.callback=n),t=Ka(e,o,s),t!==null&&(an(t,e,s),Ur(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=pn(),o=$a(s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Ka(e,o,s),t!==null&&(an(t,e,s),Ur(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pn(),s=$a(n);s.tag=2,t!=null&&(s.callback=t),t=Ka(e,s,n),t!==null&&(an(t,e,n),Ur(t,e,n))}};function Sm(e,t,n,s,o,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,p):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,s)||!Tr(o,c):!0}function wm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Nc.enqueueReplaceState(t,t.state,null)}function Yl(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function Em(e){Gi(e)}function Cm(e){console.error(e)}function km(e){Gi(e)}function fo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Tm(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Sc(e,t,n){return n=$a(n),n.tag=3,n.payload={element:null},n.callback=function(){fo(e,t)},n}function Mm(e){return e=$a(e),e.tag=3,e}function Am(e,t,n,s){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){Tm(t,n,s)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Tm(t,n,s),typeof o!="function"&&(Ia===null?Ia=new Set([this]):Ia.add(this));var j=s.stack;this.componentDidCatch(s.value,{componentStack:j!==null?j:""})})}function Yv(e,t,n,s,o){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Cs(t,n,o,!0),n=dn.current,n!==null){switch(n.tag){case 31:case 13:return En===null?wo():n.alternate===null&&mt===0&&(mt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,s===Wi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Zc(e,s,o)),!1;case 22:return n.flags|=65536,s===Wi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),Zc(e,s,o)),!1}throw Error(u(435,n.tag))}return Zc(e,s,o),wo(),!1}if(qe)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==Gu&&(e=Error(u(422),{cause:s}),Rr(jn(e,n)))):(s!==Gu&&(t=Error(u(423),{cause:s}),Rr(jn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=jn(s,n),o=Sc(e.stateNode,s,o),Pu(e,o),mt!==4&&(mt=2)),!1;var c=Error(u(520),{cause:s});if(c=jn(c,n),Jr===null?Jr=[c]:Jr.push(c),mt!==4&&(mt=2),t===null)return!0;s=jn(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=Sc(n.stateNode,s,e),Pu(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ia===null||!Ia.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Mm(o),Am(o,e,n,s),Pu(n,o),!1}n=n.return}while(n!==null);return!1}var wc=Error(u(461)),bt=!1;function Ut(e,t,n,s){t.child=e===null?zh(t,null,n,s):Ql(t,e.child,n,s)}function Rm(e,t,n,s,o){n=n.render;var c=t.ref;if("ref"in s){var p={};for(var j in s)j!=="ref"&&(p[j]=s[j])}else p=s;return Ll(t),s=sc(e,t,n,p,c,o),j=rc(),e!==null&&!bt?(ic(e,t,o),fa(e,t,o)):(qe&&j&&Bu(t),t.flags|=1,Ut(e,t,s,o),t.child)}function Om(e,t,n,s,o){if(e===null){var c=n.type;return typeof c=="function"&&!Lu(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,_m(e,t,c,s,o)):(e=Xi(n.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Oc(e,o)){var p=c.memoizedProps;if(n=n.compare,n=n!==null?n:Tr,n(p,s)&&e.ref===t.ref)return fa(e,t,o)}return t.flags|=1,e=ra(c,s),e.ref=t.ref,e.return=t,t.child=e}function _m(e,t,n,s,o){if(e!==null){var c=e.memoizedProps;if(Tr(c,s)&&e.ref===t.ref)if(bt=!1,t.pendingProps=s=c,Oc(e,o))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,fa(e,t,o)}return Ec(e,t,n,s,o)}function zm(e,t,n,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return Dm(e,t,c,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ji(t,c!==null?c.cachePool:null),c!==null?Lh(t,c):tc(),Hh(t);else return s=t.lanes=536870912,Dm(e,t,c!==null?c.baseLanes|n:n,n,s)}else c!==null?(Ji(t,c.cachePool),Lh(t,c),Va(),t.memoizedState=null):(e!==null&&Ji(t,null),tc(),Va());return Ut(e,t,o,n),t.child}function Yr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Dm(e,t,n,s,o){var c=Fu();return c=c===null?null:{parent:vt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Ji(t,null),tc(),Hh(t),e!==null&&Cs(e,t,s,!0),t.childLanes=o,null}function ho(e,t){return t=po({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Um(e,t,n){return Ql(t,e.child,null,n),e=ho(t,t.pendingProps),e.flags|=2,fn(t),t.memoizedState=null,e}function $v(e,t,n){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(s.mode==="hidden")return e=ho(t,s),t.lanes=536870912,Yr(null,e);if(ac(t),(e=rt)?(e=Zp(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qa!==null?{id:Kn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,zt=t,rt=null)):e=null,e===null)throw Qa(t);return t.lanes=536870912,null}return ho(t,s)}var c=e.memoizedState;if(c!==null){var p=c.dehydrated;if(ac(t),o)if(t.flags&256)t.flags&=-257,t=Um(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(bt||Cs(e,t,n,!1),o=(n&e.childLanes)!==0,bt||o){if(s=tt,s!==null&&(p=os(s,n),p!==0&&p!==c.retryLane))throw c.retryLane=p,_l(e,p),an(s,e,p),wc;wo(),t=Um(e,t,n)}else e=c.treeContext,rt=Cn(p.nextSibling),zt=t,qe=!0,Ba=null,wn=!1,e!==null&&Nh(t,e),t=ho(t,s),t.flags|=4096;return t}return e=ra(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mo(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Ec(e,t,n,s,o){return Ll(t),n=sc(e,t,n,s,void 0,o),s=rc(),e!==null&&!bt?(ic(e,t,o),fa(e,t,o)):(qe&&s&&Bu(t),t.flags|=1,Ut(e,t,n,o),t.child)}function Lm(e,t,n,s,o,c){return Ll(t),t.updateQueue=null,n=Bh(t,s,n,o),qh(e),s=rc(),e!==null&&!bt?(ic(e,t,c),fa(e,t,c)):(qe&&s&&Bu(t),t.flags|=1,Ut(e,t,n,c),t.child)}function Hm(e,t,n,s,o){if(Ll(t),t.stateNode===null){var c=Ns,p=n.contextType;typeof p=="object"&&p!==null&&(c=Dt(p)),c=new n(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Nc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Iu(t),p=n.contextType,c.context=typeof p=="object"&&p!==null?Dt(p):Ns,c.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(jc(t,n,p,s),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&Nc.enqueueReplaceState(c,c.state,null),Hr(t,s,c,o),Lr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var j=t.memoizedProps,R=Yl(n,j);c.props=R;var K=c.context,P=n.contextType;p=Ns,typeof P=="object"&&P!==null&&(p=Dt(P));var ae=n.getDerivedStateFromProps;P=typeof ae=="function"||typeof c.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,P||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(j||K!==p)&&wm(t,c,s,p),Ya=!1;var X=t.memoizedState;c.state=X,Hr(t,s,c,o),Lr(),K=t.memoizedState,j||X!==K||Ya?(typeof ae=="function"&&(jc(t,n,ae,s),K=t.memoizedState),(R=Ya||Sm(t,n,R,s,X,K,p))?(P||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=K),c.props=s,c.state=K,c.context=p,s=R):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,Wu(e,t),p=t.memoizedProps,P=Yl(n,p),c.props=P,ae=t.pendingProps,X=c.context,K=n.contextType,R=Ns,typeof K=="object"&&K!==null&&(R=Dt(K)),j=n.getDerivedStateFromProps,(K=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==ae||X!==R)&&wm(t,c,s,R),Ya=!1,X=t.memoizedState,c.state=X,Hr(t,s,c,o),Lr();var F=t.memoizedState;p!==ae||X!==F||Ya||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof j=="function"&&(jc(t,n,j,s),F=t.memoizedState),(P=Ya||Sm(t,n,P,s,X,F,R)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(K||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,F,R),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,F,R)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=F),c.props=s,c.state=F,c.context=R,s=P):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,mo(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=Ql(t,e.child,null,o),t.child=Ql(t,null,n,o)):Ut(e,t,n,o),t.memoizedState=c.state,e=t.child):e=fa(e,t,o),e}function qm(e,t,n,s){return Dl(),t.flags|=256,Ut(e,t,n,s),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kc(e){return{baseLanes:e,cachePool:Th()}}function Tc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=mn),e}function Bm(e,t,n){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,p;if((p=c)||(p=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),p&&(o=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(o?Xa(t):Va(),(e=rt)?(e=Zp(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qa!==null?{id:Kn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},n=yh(e),n.return=t,t.child=n,zt=t,rt=null)):e=null,e===null)throw Qa(t);return cd(e)?t.lanes=32:t.lanes=536870912,null}var j=s.children;return s=s.fallback,o?(Va(),o=t.mode,j=po({mode:"hidden",children:j},o),s=zl(s,o,n,null),j.return=t,s.return=t,j.sibling=s,t.child=j,s=t.child,s.memoizedState=kc(n),s.childLanes=Tc(e,p,n),t.memoizedState=Cc,Yr(null,s)):(Xa(t),Mc(t,j))}var R=e.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(c)t.flags&256?(Xa(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState!==null?(Va(),t.child=e.child,t.flags|=128,t=null):(Va(),j=s.fallback,o=t.mode,s=po({mode:"visible",children:s.children},o),j=zl(j,o,n,null),j.flags|=2,s.return=t,j.return=t,s.sibling=j,t.child=s,Ql(t,e.child,null,n),s=t.child,s.memoizedState=kc(n),s.childLanes=Tc(e,p,n),t.memoizedState=Cc,t=Yr(null,s));else if(Xa(t),cd(j)){if(p=j.nextSibling&&j.nextSibling.dataset,p)var K=p.dgst;p=K,s=Error(u(419)),s.stack="",s.digest=p,Rr({value:s,source:null,stack:null}),t=Ac(e,t,n)}else if(bt||Cs(e,t,n,!1),p=(n&e.childLanes)!==0,bt||p){if(p=tt,p!==null&&(s=os(p,n),s!==0&&s!==R.retryLane))throw R.retryLane=s,_l(e,s),an(p,e,s),wc;ud(j)||wo(),t=Ac(e,t,n)}else ud(j)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,rt=Cn(j.nextSibling),zt=t,qe=!0,Ba=null,wn=!1,e!==null&&Nh(t,e),t=Mc(t,s.children),t.flags|=4096);return t}return o?(Va(),j=s.fallback,o=t.mode,R=e.child,K=R.sibling,s=ra(R,{mode:"hidden",children:s.children}),s.subtreeFlags=R.subtreeFlags&65011712,K!==null?j=ra(K,j):(j=zl(j,o,n,null),j.flags|=2),j.return=t,s.return=t,s.sibling=j,t.child=s,Yr(null,s),s=t.child,j=e.child.memoizedState,j===null?j=kc(n):(o=j.cachePool,o!==null?(R=vt._currentValue,o=o.parent!==R?{parent:R,pool:R}:o):o=Th(),j={baseLanes:j.baseLanes|n,cachePool:o}),s.memoizedState=j,s.childLanes=Tc(e,p,n),t.memoizedState=Cc,Yr(e.child,s)):(Xa(t),n=e.child,e=n.sibling,n=ra(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function Mc(e,t){return t=po({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function po(e,t){return e=cn(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return Ql(t,e.child,null,n),e=Mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ku(e.return,t,n)}function Rc(e,t,n,s,o,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:o,treeForkCount:c}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=s,p.tail=n,p.tailMode=o,p.treeForkCount=c)}function Gm(e,t,n){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var p=xt.current,j=(p&2)!==0;if(j?(p=p&1|2,t.flags|=128):p&=1,W(xt,p),Ut(e,t,s,n),s=qe?Ar:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qm(e,n,t);else if(e.tag===19)Qm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&no(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Rc(t,!1,o,n,c,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&no(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Rc(t,!0,n,null,c,s);break;case"together":Rc(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function fa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ja|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Cs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Zi(e)))}function Kv(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),Ga(t,vt,e.memoizedState.cache),Dl();break;case 27:case 5:ft(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:Ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ac(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Xa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Bm(e,t,n):(Xa(t),e=fa(e,t,n),e!==null?e.sibling:null);Xa(t);break;case 19:var o=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Cs(e,t,n,!1),s=(n&t.childLanes)!==0),o){if(s)return Gm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),W(xt,xt.current),s)break;return null;case 22:return t.lanes=0,zm(e,t,n,t.pendingProps);case 24:Ga(t,vt,e.memoizedState.cache)}return fa(e,t,n)}function Ym(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Oc(e,n)&&(t.flags&128)===0)return bt=!1,Kv(e,t,n);bt=(e.flags&131072)!==0}else bt=!1,qe&&(t.flags&1048576)!==0&&jh(t,Ar,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ql(t.elementType),t.type=e,typeof e=="function")Lu(e)?(s=Yl(e,s),t.tag=1,t=Hm(null,t,e,s,n)):(t.tag=0,t=Ec(null,t,e,s,n));else{if(e!=null){var o=e.$$typeof;if(o===S){t.tag=11,t=Rm(null,t,e,s,n);break e}else if(o===D){t.tag=14,t=Om(null,t,e,s,n);break e}}throw t=Q(e)||e,Error(u(306,t,""))}}return t;case 0:return Ec(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,o=Yl(s,t.pendingProps),Hm(e,t,s,o,n);case 3:e:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,Wu(e,t),Hr(t,s,null,n);var p=t.memoizedState;if(s=p.cache,Ga(t,vt,s),s!==c.cache&&Xu(t,[vt],n,!0),Lr(),s=p.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=qm(e,t,s,n);break e}else if(s!==o){o=jn(Error(u(424)),t),Rr(o),t=qm(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(rt=Cn(e.firstChild),zt=t,qe=!0,Ba=null,wn=!0,n=zh(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Dl(),s===o){t=fa(e,t,n);break e}Ut(e,t,s,n)}t=t.child}return t;case 26:return mo(e,t),e===null?(n=ex(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,s=Ro(ye.current).createElement(n),s[dt]=t,s[Bt]=e,Lt(s,n,e),pe(s),t.stateNode=s):t.memoizedState=ex(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ft(t),e===null&&qe&&(s=t.stateNode=Ip(t.type,t.pendingProps,ye.current),zt=t,wn=!0,o=rt,tl(t.type)?(dd=o,rt=Cn(s.firstChild)):rt=o),Ut(e,t,t.pendingProps.children,n),mo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((o=s=rt)&&(s=jy(s,t.type,t.pendingProps,wn),s!==null?(t.stateNode=s,zt=t,rt=Cn(s.firstChild),wn=!1,o=!0):o=!1),o||Qa(t)),ft(t),o=t.type,c=t.pendingProps,p=e!==null?e.memoizedProps:null,s=c.children,rd(o,c)?s=null:p!==null&&rd(o,p)&&(t.flags|=32),t.memoizedState!==null&&(o=sc(e,t,Uv,null,null,n),li._currentValue=o),mo(e,t),Ut(e,t,s,n),t.child;case 6:return e===null&&qe&&((e=n=rt)&&(n=Ny(n,t.pendingProps,wn),n!==null?(t.stateNode=n,zt=t,rt=null,e=!0):e=!1),e||Qa(t)),null;case 13:return Bm(e,t,n);case 4:return we(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Ql(t,null,s,n):Ut(e,t,s,n),t.child;case 11:return Rm(e,t,t.type,t.pendingProps,n);case 7:return Ut(e,t,t.pendingProps,n),t.child;case 8:return Ut(e,t,t.pendingProps.children,n),t.child;case 12:return Ut(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,Ga(t,t.type,s.value),Ut(e,t,s.children,n),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,Ll(t),o=Dt(o),s=s(o),t.flags|=1,Ut(e,t,s,n),t.child;case 14:return Om(e,t,t.type,t.pendingProps,n);case 15:return _m(e,t,t.type,t.pendingProps,n);case 19:return Gm(e,t,n);case 31:return $v(e,t,n);case 22:return zm(e,t,n,t.pendingProps);case 24:return Ll(t),s=Dt(vt),e===null?(o=Fu(),o===null&&(o=tt,c=Vu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:s,cache:o},Iu(t),Ga(t,vt,o)):((e.lanes&n)!==0&&(Wu(e,t),Hr(t,null,null,n),Lr()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ga(t,vt,s)):(s=c.cache,Ga(t,vt,s),s!==o.cache&&Xu(t,[vt],n,!0))),Ut(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ha(e){e.flags|=4}function _c(e,t,n,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(xp())e.flags|=8192;else throw Bl=Wi,Ju}else e.flags&=-16777217}function $m(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!sx(t))if(xp())e.flags|=8192;else throw Bl=Wi,Ju}function xo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ri():536870912,e.lanes|=t,Hs|=t)}function $r(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Xv(e,t,n){var s=t.pendingProps;switch(Qu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ua(vt),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Es(t)?ha(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yu())),it(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(ha(t),c!==null?(it(t),$m(t,c)):(it(t),_c(t,o,null,s,n))):c?c!==e.memoizedState?(ha(t),it(t),$m(t,c)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ha(t),it(t),_c(t,o,e,s,n)),null;case 27:if(Yt(t),n=ye.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ha(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return it(t),null}e=ie.current,Es(t)?Sh(t):(e=Ip(o,s,n),t.stateNode=e,ha(t))}return it(t),null;case 5:if(Yt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ha(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return it(t),null}if(c=ie.current,Es(t))Sh(t);else{var p=Ro(ye.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=p.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?p.createElement("select",{is:s.is}):p.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?p.createElement(o,{is:s.is}):p.createElement(o)}}c[dt]=t,c[Bt]=s;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=c;e:switch(Lt(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ha(t)}}return it(t),_c(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ha(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=ye.current,Es(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,o=zt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||Bp(e.nodeValue,n)),e||Qa(t,!0)}else e=Ro(e).createTextNode(s),e[dt]=t,t.stateNode=e}return it(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Es(t),n!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[dt]=t}else Dl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else n=Yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fn(t),t):(fn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return it(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Es(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[dt]=t}else Dl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),o=!1}else o=Yu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(fn(t),t):(fn(t),null)}return fn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xo(t,t.updateQueue),it(t),null);case 4:return Me(),e===null&&td(t.stateNode.containerInfo),it(t),null;case 10:return ua(t.type),it(t),null;case 19:if(q(xt),s=t.memoizedState,s===null)return it(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)$r(s,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=no(e),c!==null){for(t.flags|=128,$r(s,!1),e=c.updateQueue,t.updateQueue=e,xo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vh(n,e),n=n.sibling;return W(xt,xt.current&1|2),qe&&ia(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Xe()>jo&&(t.flags|=128,o=!0,$r(s,!1),t.lanes=4194304)}else{if(!o)if(e=no(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,xo(t,e),$r(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!qe)return it(t),null}else 2*Xe()-s.renderingStartTime>jo&&n!==536870912&&(t.flags|=128,o=!0,$r(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Xe(),e.sibling=null,n=xt.current,W(xt,o?n&1|2:n&1),qe&&ia(t,s.treeForkCount),e):(it(t),null);case 22:case 23:return fn(t),nc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&xo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&q(Hl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ua(vt),it(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Vv(e,t){switch(Qu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(vt),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Yt(t),null;case 31:if(t.memoizedState!==null){if(fn(t),t.alternate===null)throw Error(u(340));Dl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Dl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(xt),null;case 4:return Me(),null;case 10:return ua(t.type),null;case 22:case 23:return fn(t),nc(),e!==null&&q(Hl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(vt),null;case 25:return null;default:return null}}function Km(e,t){switch(Qu(t),t.tag){case 3:ua(vt),Me();break;case 26:case 27:case 5:Yt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&fn(t);break;case 13:fn(t);break;case 19:q(xt);break;case 10:ua(t.type);break;case 22:case 23:fn(t),nc(),e!==null&&q(Hl);break;case 24:ua(vt)}}function Kr(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var o=s.next;n=o;do{if((n.tag&e)===e){s=void 0;var c=n.create,p=n.inst;s=c(),p.destroy=s}n=n.next}while(n!==o)}}catch(j){Fe(t,t.return,j)}}function Za(e,t,n){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var p=s.inst,j=p.destroy;if(j!==void 0){p.destroy=void 0,o=t;var R=n,K=j;try{K()}catch(P){Fe(o,R,P)}}}s=s.next}while(s!==c)}}catch(P){Fe(t,t.return,P)}}function Xm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Uh(t,n)}catch(s){Fe(e,e.return,s)}}}function Vm(e,t,n){n.props=Yl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Fe(e,t,s)}}function Xr(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(o){Fe(e,t,o)}}function Vn(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(o){Fe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){Fe(e,t,o)}else n.current=null}function Zm(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(o){Fe(e,e.return,o)}}function zc(e,t,n){try{var s=e.stateNode;py(s,e.type,n,t),s[Bt]=t}catch(o){Fe(e,e.return,o)}}function Fm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tl(e.type)||e.tag===4}function Dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&tl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Uc(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=la));else if(s!==4&&(s===27&&tl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Uc(e,t,n),e=e.sibling;e!==null;)Uc(e,t,n),e=e.sibling}function go(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(go(e,t,n),e=e.sibling;e!==null;)go(e,t,n),e=e.sibling}function Jm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Lt(t,s,n),t[dt]=e,t[Bt]=n}catch(c){Fe(e,e.return,c)}}var ma=!1,jt=!1,Lc=!1,Im=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Zv(e,t){if(e=e.containerInfo,ld=Ho,e=uh(e),Au(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var p=0,j=-1,R=-1,K=0,P=0,ae=e,X=null;t:for(;;){for(var F;ae!==n||o!==0&&ae.nodeType!==3||(j=p+o),ae!==c||s!==0&&ae.nodeType!==3||(R=p+s),ae.nodeType===3&&(p+=ae.nodeValue.length),(F=ae.firstChild)!==null;)X=ae,ae=F;for(;;){if(ae===e)break t;if(X===n&&++K===o&&(j=p),X===c&&++P===s&&(R=p),(F=ae.nextSibling)!==null)break;ae=X,X=ae.parentNode}ae=F}n=j===-1||R===-1?null:{start:j,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(sd={focusedElem:e,selectionRange:n},Ho=!1,Tt=t;Tt!==null;)if(t=Tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Tt=e;else for(;Tt!==null;){switch(t=Tt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,o=c.memoizedProps,c=c.memoizedState,s=n.stateNode;try{var ge=Yl(n.type,o);e=s.getSnapshotBeforeUpdate(ge,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Fe(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)od(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":od(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Tt=e;break}Tt=t.return}}function Wm(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:xa(e,n),s&4&&Kr(5,n);break;case 1:if(xa(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){Fe(n,n.return,p)}else{var o=Yl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Fe(n,n.return,p)}}s&64&&Xm(n),s&512&&Xr(n,n.return);break;case 3:if(xa(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Uh(e,t)}catch(p){Fe(n,n.return,p)}}break;case 27:t===null&&s&4&&Jm(n);case 26:case 5:xa(e,n),t===null&&s&4&&Zm(n),s&512&&Xr(n,n.return);break;case 12:xa(e,n);break;case 31:xa(e,n),s&4&&tp(e,n);break;case 13:xa(e,n),s&4&&np(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ay.bind(null,n),Sy(e,n))));break;case 22:if(s=n.memoizedState!==null||ma,!s){t=t!==null&&t.memoizedState!==null||jt,o=ma;var c=jt;ma=s,(jt=t)&&!c?ga(e,n,(n.subtreeFlags&8772)!==0):xa(e,n),ma=o,jt=c}break;case 30:break;default:xa(e,n)}}function Pm(e){var t=e.alternate;t!==null&&(e.alternate=null,Pm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ds(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ut=null,Pt=!1;function pa(e,t,n){for(n=n.child;n!==null;)ep(e,t,n),n=n.sibling}function ep(e,t,n){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ra,n)}catch{}switch(n.tag){case 26:jt||Vn(n,t),pa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:jt||Vn(n,t);var s=ut,o=Pt;tl(n.type)&&(ut=n.stateNode,Pt=!1),pa(e,t,n),ti(n.stateNode),ut=s,Pt=o;break;case 5:jt||Vn(n,t);case 6:if(s=ut,o=Pt,ut=null,pa(e,t,n),ut=s,Pt=o,ut!==null)if(Pt)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(n.stateNode)}catch(c){Fe(n,t,c)}else try{ut.removeChild(n.stateNode)}catch(c){Fe(n,t,c)}break;case 18:ut!==null&&(Pt?(e=ut,Xp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Xs(e)):Xp(ut,n.stateNode));break;case 4:s=ut,o=Pt,ut=n.stateNode.containerInfo,Pt=!0,pa(e,t,n),ut=s,Pt=o;break;case 0:case 11:case 14:case 15:Za(2,n,t),jt||Za(4,n,t),pa(e,t,n);break;case 1:jt||(Vn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&Vm(n,t,s)),pa(e,t,n);break;case 21:pa(e,t,n);break;case 22:jt=(s=jt)||n.memoizedState!==null,pa(e,t,n),jt=s;break;default:pa(e,t,n)}}function tp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xs(e)}catch(n){Fe(t,t.return,n)}}}function np(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xs(e)}catch(n){Fe(t,t.return,n)}}function Fv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Im),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Im),t;default:throw Error(u(435,e.tag))}}function vo(e,t){var n=Fv(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var o=ly.bind(null,e,s);s.then(o,o)}})}function en(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s],c=e,p=t,j=p;e:for(;j!==null;){switch(j.tag){case 27:if(tl(j.type)){ut=j.stateNode,Pt=!1;break e}break;case 5:ut=j.stateNode,Pt=!1;break e;case 3:case 4:ut=j.stateNode.containerInfo,Pt=!0;break e}j=j.return}if(ut===null)throw Error(u(160));ep(c,p,o),ut=null,Pt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ap(t,e),t=t.sibling}var Dn=null;function ap(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:en(t,e),tn(e),s&4&&(Za(3,e,e.return),Kr(3,e),Za(5,e,e.return));break;case 1:en(t,e),tn(e),s&512&&(jt||n===null||Vn(n,n.return)),s&64&&ma&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var o=Dn;if(en(t,e),tn(e),s&512&&(jt||n===null||Vn(n,n.return)),s&4){var c=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[La]||c[dt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),Lt(c,s,n),c[dt]=e,pe(c),s=c;break e;case"link":var p=ax("link","href",o).get(s+(n.href||""));if(p){for(var j=0;j<p.length;j++)if(c=p[j],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(j,1);break t}}c=o.createElement(s),Lt(c,s,n),o.head.appendChild(c);break;case"meta":if(p=ax("meta","content",o).get(s+(n.content||""))){for(j=0;j<p.length;j++)if(c=p[j],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(j,1);break t}}c=o.createElement(s),Lt(c,s,n),o.head.appendChild(c);break;default:throw Error(u(468,s))}c[dt]=e,pe(c),s=c}e.stateNode=s}else lx(o,e.type,e.stateNode);else e.stateNode=nx(o,s,e.memoizedProps);else c!==s?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,s===null?lx(o,e.type,e.stateNode):nx(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&zc(e,e.memoizedProps,n.memoizedProps)}break;case 27:en(t,e),tn(e),s&512&&(jt||n===null||Vn(n,n.return)),n!==null&&s&4&&zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(en(t,e),tn(e),s&512&&(jt||n===null||Vn(n,n.return)),e.flags&32){o=e.stateNode;try{ps(o,"")}catch(ge){Fe(e,e.return,ge)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,zc(e,o,n!==null?n.memoizedProps:o)),s&1024&&(Lc=!0);break;case 6:if(en(t,e),tn(e),s&4){if(e.stateNode===null)throw Error(u(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ge){Fe(e,e.return,ge)}}break;case 3:if(zo=null,o=Dn,Dn=Oo(t.containerInfo),en(t,e),Dn=o,tn(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Xs(t.containerInfo)}catch(ge){Fe(e,e.return,ge)}Lc&&(Lc=!1,lp(e));break;case 4:s=Dn,Dn=Oo(e.stateNode.containerInfo),en(t,e),tn(e),Dn=s;break;case 12:en(t,e),tn(e);break;case 31:en(t,e),tn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vo(e,s)));break;case 13:en(t,e),tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(bo=Xe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vo(e,s)));break;case 22:o=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,K=ma,P=jt;if(ma=K||o,jt=P||R,en(t,e),jt=P,ma=K,tn(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||R||ma||jt||$l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(c=R.stateNode,o)p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{j=R.stateNode;var ae=R.memoizedProps.style,X=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;j.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(ge){Fe(R,R.return,ge)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=o?"":R.memoizedProps}catch(ge){Fe(R,R.return,ge)}}}else if(t.tag===18){if(n===null){R=t;try{var F=R.stateNode;o?Vp(F,!0):Vp(R.stateNode,!1)}catch(ge){Fe(R,R.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,vo(e,n))));break;case 19:en(t,e),tn(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,vo(e,s)));break;case 30:break;case 21:break;default:en(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Fm(s)){n=s;break}s=s.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var o=n.stateNode,c=Dc(e);go(e,c,o);break;case 5:var p=n.stateNode;n.flags&32&&(ps(p,""),n.flags&=-33);var j=Dc(e);go(e,j,p);break;case 3:case 4:var R=n.stateNode.containerInfo,K=Dc(e);Uc(e,K,R);break;default:throw Error(u(161))}}catch(P){Fe(e,e.return,P)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function lp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;lp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Wm(e,t.alternate,t),t=t.sibling}function $l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Za(4,t,t.return),$l(t);break;case 1:Vn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Vm(t,t.return,n),$l(t);break;case 27:ti(t.stateNode);case 26:case 5:Vn(t,t.return),$l(t);break;case 22:t.memoizedState===null&&$l(t);break;case 30:$l(t);break;default:$l(t)}e=e.sibling}}function ga(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,p=c.flags;switch(c.tag){case 0:case 11:case 15:ga(o,c,n),Kr(4,c);break;case 1:if(ga(o,c,n),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(K){Fe(s,s.return,K)}if(s=c,o=s.updateQueue,o!==null){var j=s.stateNode;try{var R=o.shared.hiddenCallbacks;if(R!==null)for(o.shared.hiddenCallbacks=null,o=0;o<R.length;o++)Dh(R[o],j)}catch(K){Fe(s,s.return,K)}}n&&p&64&&Xm(c),Xr(c,c.return);break;case 27:Jm(c);case 26:case 5:ga(o,c,n),n&&s===null&&p&4&&Zm(c),Xr(c,c.return);break;case 12:ga(o,c,n);break;case 31:ga(o,c,n),n&&p&4&&tp(o,c);break;case 13:ga(o,c,n),n&&p&4&&np(o,c);break;case 22:c.memoizedState===null&&ga(o,c,n),Xr(c,c.return);break;case 30:break;default:ga(o,c,n)}t=t.sibling}}function Hc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Or(n))}function qc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Or(e))}function Un(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sp(e,t,n,s),t=t.sibling}function sp(e,t,n,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Un(e,t,n,s),o&2048&&Kr(9,t);break;case 1:Un(e,t,n,s);break;case 3:Un(e,t,n,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Or(e)));break;case 12:if(o&2048){Un(e,t,n,s),e=t.stateNode;try{var c=t.memoizedProps,p=c.id,j=c.onPostCommit;typeof j=="function"&&j(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Fe(t,t.return,R)}}else Un(e,t,n,s);break;case 31:Un(e,t,n,s);break;case 13:Un(e,t,n,s);break;case 23:break;case 22:c=t.stateNode,p=t.alternate,t.memoizedState!==null?c._visibility&2?Un(e,t,n,s):Vr(e,t):c._visibility&2?Un(e,t,n,s):(c._visibility|=2,Ds(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Hc(p,t);break;case 24:Un(e,t,n,s),o&2048&&qc(t.alternate,t);break;default:Un(e,t,n,s)}}function Ds(e,t,n,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,p=t,j=n,R=s,K=p.flags;switch(p.tag){case 0:case 11:case 15:Ds(c,p,j,R,o),Kr(8,p);break;case 23:break;case 22:var P=p.stateNode;p.memoizedState!==null?P._visibility&2?Ds(c,p,j,R,o):Vr(c,p):(P._visibility|=2,Ds(c,p,j,R,o)),o&&K&2048&&Hc(p.alternate,p);break;case 24:Ds(c,p,j,R,o),o&&K&2048&&qc(p.alternate,p);break;default:Ds(c,p,j,R,o)}t=t.sibling}}function Vr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,o=s.flags;switch(s.tag){case 22:Vr(n,s),o&2048&&Hc(s.alternate,s);break;case 24:Vr(n,s),o&2048&&qc(s.alternate,s);break;default:Vr(n,s)}t=t.sibling}}var Zr=8192;function Us(e,t,n){if(e.subtreeFlags&Zr)for(e=e.child;e!==null;)rp(e,t,n),e=e.sibling}function rp(e,t,n){switch(e.tag){case 26:Us(e,t,n),e.flags&Zr&&e.memoizedState!==null&&Dy(n,Dn,e.memoizedState,e.memoizedProps);break;case 5:Us(e,t,n);break;case 3:case 4:var s=Dn;Dn=Oo(e.stateNode.containerInfo),Us(e,t,n),Dn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Zr,Zr=16777216,Us(e,t,n),Zr=s):Us(e,t,n));break;default:Us(e,t,n)}}function ip(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Tt=s,up(s,e)}ip(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)op(e),e=e.sibling}function op(e){switch(e.tag){case 0:case 11:case 15:Fr(e),e.flags&2048&&Za(9,e,e.return);break;case 3:Fr(e);break;case 12:Fr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,yo(e)):Fr(e);break;default:Fr(e)}}function yo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Tt=s,up(s,e)}ip(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Za(8,t,t.return),yo(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,yo(t));break;default:yo(t)}e=e.sibling}}function up(e,t){for(;Tt!==null;){var n=Tt;switch(n.tag){case 0:case 11:case 15:Za(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Or(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Tt=s;else e:for(n=e;Tt!==null;){s=Tt;var o=s.sibling,c=s.return;if(Pm(s),s===n){Tt=null;break e}if(o!==null){o.return=c,Tt=o;break e}Tt=c}}}var Jv={getCacheForType:function(e){var t=Dt(vt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Dt(vt).controller.signal}},Iv=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,ze=null,Le=0,Ze=0,hn=null,Fa=!1,Ls=!1,Bc=!1,va=0,mt=0,Ja=0,Kl=0,Qc=0,mn=0,Hs=0,Jr=null,nn=null,Gc=!1,bo=0,cp=0,jo=1/0,No=null,Ia=null,St=0,Wa=null,qs=null,ya=0,Yc=0,$c=null,dp=null,Ir=0,Kc=null;function pn(){return(Ye&2)!==0&&Le!==0?Le&-Le:T.T!==null?Ic():yr()}function fp(){if(mn===0)if((Le&536870912)===0||qe){var e=_e;_e<<=1,(_e&3932160)===0&&(_e=262144),mn=e}else mn=536870912;return e=dn.current,e!==null&&(e.flags|=32),mn}function an(e,t,n){(e===tt&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Bs(e,0),Pa(e,Le,mn,!1)),Yn(e,n),((Ye&2)===0||e!==tt)&&(e===tt&&((Ye&2)===0&&(Kl|=n),mt===4&&Pa(e,Le,mn,!1)),Zn(e))}function hp(e,t,n){if((Ye&6)!==0)throw Error(u(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||wl(e,t),o=s?ey(e,t):Vc(e,t,!0),c=s;do{if(o===0){Ls&&!s&&Pa(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!Wv(n)){o=Vc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var j=e;o=Jr;var R=j.current.memoizedState.isDehydrated;if(R&&(Bs(j,p).flags|=256),p=Vc(j,p,!1),p!==2){if(Bc&&!R){j.errorRecoveryDisabledLanes|=c,Kl|=c,o=4;break e}c=nn,nn=o,c!==null&&(nn===null?nn=c:nn.push.apply(nn,c))}o=p}if(c=!1,o!==2)continue}}if(o===1){Bs(e,0),Pa(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Pa(s,t,mn,!Fa);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=bo+300-Xe(),10<o)){if(Pa(s,t,mn,!Fa),rs(s,0,!0)!==0)break e;ya=t,s.timeoutHandle=$p(mp.bind(null,s,n,nn,No,Gc,t,mn,Kl,Hs,Fa,c,"Throttled",-0,0),o);break e}mp(s,n,nn,No,Gc,t,mn,Kl,Hs,Fa,c,null,-0,0)}}break}while(!0);Zn(e)}function mp(e,t,n,s,o,c,p,j,R,K,P,ae,X,F){if(e.timeoutHandle=-1,ae=t.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},rp(t,c,ae);var ge=(c&62914560)===c?bo-Xe():(c&4194048)===c?cp-Xe():0;if(ge=Uy(ae,ge),ge!==null){ya=c,e.cancelPendingCommit=ge(Np.bind(null,e,t,c,n,s,o,p,j,R,P,ae,null,X,F)),Pa(e,c,p,!K);return}}Np(e,t,c,n,s,o,p,j,R)}function Wv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var o=n[s],c=o.getSnapshot;o=o.value;try{if(!un(c(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pa(e,t,n,s){t&=~Qc,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-Xt(o),p=1<<c;s[c]=-1,o&=~p}n!==0&&is(e,n,t)}function So(){return(Ye&6)===0?(Wr(0),!1):!0}function Xc(){if(ze!==null){if(Ze===0)var e=ze.return;else e=ze,oa=Ul=null,oc(e),As=null,zr=0,e=ze;for(;e!==null;)Km(e.alternate,e),e=e.return;ze=null}}function Bs(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,vy(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ya=0,Xc(),tt=e,ze=n=ra(e.current,null),Le=t,Ze=0,hn=null,Fa=!1,Ls=wl(e,t),Bc=!1,Hs=mn=Qc=Kl=Ja=mt=0,nn=Jr=null,Gc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-Xt(s),c=1<<o;t|=e[o],s&=~c}return va=t,Yi(),n}function pp(e,t){Te=null,T.H=Gr,t===Ms||t===Ii?(t=Rh(),Ze=3):t===Ju?(t=Rh(),Ze=4):Ze=t===wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,ze===null&&(mt=1,fo(e,jn(t,e.current)))}function xp(){var e=dn.current;return e===null?!0:(Le&4194048)===Le?En===null:(Le&62914560)===Le||(Le&536870912)!==0?e===En:!1}function gp(){var e=T.H;return T.H=Gr,e===null?Gr:e}function vp(){var e=T.A;return T.A=Jv,e}function wo(){mt=4,Fa||(Le&4194048)!==Le&&dn.current!==null||(Ls=!0),(Ja&134217727)===0&&(Kl&134217727)===0||tt===null||Pa(tt,Le,mn,!1)}function Vc(e,t,n){var s=Ye;Ye|=2;var o=gp(),c=vp();(tt!==e||Le!==t)&&(No=null,Bs(e,t)),t=!1;var p=mt;e:do try{if(Ze!==0&&ze!==null){var j=ze,R=hn;switch(Ze){case 8:Xc(),p=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var K=Ze;if(Ze=0,hn=null,Qs(e,j,R,K),n&&Ls){p=0;break e}break;default:K=Ze,Ze=0,hn=null,Qs(e,j,R,K)}}Pv(),p=mt;break}catch(P){pp(e,P)}while(!0);return t&&e.shellSuspendCounter++,oa=Ul=null,Ye=s,T.H=o,T.A=c,ze===null&&(tt=null,Le=0,Yi()),p}function Pv(){for(;ze!==null;)yp(ze)}function ey(e,t){var n=Ye;Ye|=2;var s=gp(),o=vp();tt!==e||Le!==t?(No=null,jo=Xe()+500,Bs(e,t)):Ls=wl(e,t);e:do try{if(Ze!==0&&ze!==null){t=ze;var c=hn;t:switch(Ze){case 1:Ze=0,hn=null,Qs(e,t,c,1);break;case 2:case 9:if(Mh(c)){Ze=0,hn=null,bp(t);break}t=function(){Ze!==2&&Ze!==9||tt!==e||(Ze=7),Zn(e)},c.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Mh(c)?(Ze=0,hn=null,bp(t)):(Ze=0,hn=null,Qs(e,t,c,7));break;case 5:var p=null;switch(ze.tag){case 26:p=ze.memoizedState;case 5:case 27:var j=ze;if(p?sx(p):j.stateNode.complete){Ze=0,hn=null;var R=j.sibling;if(R!==null)ze=R;else{var K=j.return;K!==null?(ze=K,Eo(K)):ze=null}break t}}Ze=0,hn=null,Qs(e,t,c,5);break;case 6:Ze=0,hn=null,Qs(e,t,c,6);break;case 8:Xc(),mt=6;break e;default:throw Error(u(462))}}ty();break}catch(P){pp(e,P)}while(!0);return oa=Ul=null,T.H=s,T.A=o,Ye=n,ze!==null?0:(tt=null,Le=0,Yi(),mt)}function ty(){for(;ze!==null&&!jl();)yp(ze)}function yp(e){var t=Ym(e.alternate,e,va);e.memoizedProps=e.pendingProps,t===null?Eo(e):ze=t}function bp(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lm(n,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Lm(n,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:oc(t);default:Km(n,t),t=ze=vh(t,va),t=Ym(n,t,va)}e.memoizedProps=e.pendingProps,t===null?Eo(e):ze=t}function Qs(e,t,n,s){oa=Ul=null,oc(t),As=null,zr=0;var o=t.return;try{if(Yv(e,o,t,n,Le)){mt=1,fo(e,jn(n,e.current)),ze=null;return}}catch(c){if(o!==null)throw ze=o,c;mt=1,fo(e,jn(n,e.current)),ze=null;return}t.flags&32768?(qe||s===1?e=!0:Ls||(Le&536870912)!==0?e=!1:(Fa=e=!0,(s===2||s===9||s===3||s===6)&&(s=dn.current,s!==null&&s.tag===13&&(s.flags|=16384))),jp(t,e)):Eo(t)}function Eo(e){var t=e;do{if((t.flags&32768)!==0){jp(t,Fa);return}e=t.return;var n=Xv(t.alternate,t,va);if(n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);mt===0&&(mt=5)}function jp(e,t){do{var n=Vv(e.alternate,e);if(n!==null){n.flags&=32767,ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=n}while(e!==null);mt=6,ze=null}function Np(e,t,n,s,o,c,p,j,R){e.cancelPendingCommit=null;do Co();while(St!==0);if((Ye&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=Du,Da(e,n,c,p,j,R),e===tt&&(ze=tt=null,Le=0),qs=t,Wa=e,ya=n,Yc=c,$c=o,dp=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,sy(Nl,function(){return kp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=T.T,T.T=null,o=H.p,H.p=2,p=Ye,Ye|=4;try{Zv(e,t,n)}finally{Ye=p,H.p=o,T.T=s}}St=1,Sp(),wp(),Ep()}}function Sp(){if(St===1){St=0;var e=Wa,t=qs,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null;var s=H.p;H.p=2;var o=Ye;Ye|=4;try{ap(t,e);var c=sd,p=uh(e.containerInfo),j=c.focusedElem,R=c.selectionRange;if(p!==j&&j&&j.ownerDocument&&oh(j.ownerDocument.documentElement,j)){if(R!==null&&Au(j)){var K=R.start,P=R.end;if(P===void 0&&(P=K),"selectionStart"in j)j.selectionStart=K,j.selectionEnd=Math.min(P,j.value.length);else{var ae=j.ownerDocument||document,X=ae&&ae.defaultView||window;if(X.getSelection){var F=X.getSelection(),ge=j.textContent.length,Ne=Math.min(R.start,ge),Pe=R.end===void 0?Ne:Math.min(R.end,ge);!F.extend&&Ne>Pe&&(p=Pe,Pe=Ne,Ne=p);var B=ih(j,Ne),L=ih(j,Pe);if(B&&L&&(F.rangeCount!==1||F.anchorNode!==B.node||F.anchorOffset!==B.offset||F.focusNode!==L.node||F.focusOffset!==L.offset)){var $=ae.createRange();$.setStart(B.node,B.offset),F.removeAllRanges(),Ne>Pe?(F.addRange($),F.extend(L.node,L.offset)):($.setEnd(L.node,L.offset),F.addRange($))}}}}for(ae=[],F=j;F=F.parentNode;)F.nodeType===1&&ae.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ae.length;j++){var te=ae[j];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Ho=!!ld,sd=ld=null}finally{Ye=o,H.p=s,T.T=n}}e.current=t,St=2}}function wp(){if(St===2){St=0;var e=Wa,t=qs,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=T.T,T.T=null;var s=H.p;H.p=2;var o=Ye;Ye|=4;try{Wm(e,t.alternate,t)}finally{Ye=o,H.p=s,T.T=n}}St=3}}function Ep(){if(St===4||St===3){St=0,$t();var e=Wa,t=qs,n=ya,s=dp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,qs=Wa=null,Cp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Ia=null),us(n),t=t.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ra,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=T.T,o=H.p,H.p=2,T.T=null;try{for(var c=e.onRecoverableError,p=0;p<s.length;p++){var j=s[p];c(j.value,{componentStack:j.stack})}}finally{T.T=t,H.p=o}}(ya&3)!==0&&Co(),Zn(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Kc?Ir++:(Ir=0,Kc=e):Ir=0,Wr(0)}}function Cp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Or(t)))}function Co(){return Sp(),wp(),Ep(),kp()}function kp(){if(St!==5)return!1;var e=Wa,t=Yc;Yc=0;var n=us(ya),s=T.T,o=H.p;try{H.p=32>n?32:n,T.T=null,n=$c,$c=null;var c=Wa,p=ya;if(St=0,qs=Wa=null,ya=0,(Ye&6)!==0)throw Error(u(331));var j=Ye;if(Ye|=4,op(c.current),sp(c,c.current,p,n),Ye=j,Wr(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ra,c)}catch{}return!0}finally{H.p=o,T.T=s,Cp(e,t)}}function Tp(e,t,n){t=jn(n,t),t=Sc(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(Yn(e,2),Zn(e))}function Fe(e,t,n){if(e.tag===3)Tp(e,e,n);else for(;t!==null;){if(t.tag===3){Tp(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ia===null||!Ia.has(s))){e=jn(n,e),n=Mm(2),s=Ka(t,n,2),s!==null&&(Am(n,s,t,e),Yn(s,2),Zn(s));break}}t=t.return}}function Zc(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Iv;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(n)||(Bc=!0,o.add(n),e=ny.bind(null,e,t,n),t.then(e,e))}function ny(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,tt===e&&(Le&n)===n&&(mt===4||mt===3&&(Le&62914560)===Le&&300>Xe()-bo?(Ye&2)===0&&Bs(e,0):Qc|=n,Hs===Le&&(Hs=0)),Zn(e)}function Mp(e,t){t===0&&(t=Ri()),e=_l(e,t),e!==null&&(Yn(e,t),Zn(e))}function ay(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mp(e,n)}function ly(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),Mp(e,n)}function sy(e,t){return _n(e,t)}var ko=null,Gs=null,Fc=!1,To=!1,Jc=!1,el=0;function Zn(e){e!==Gs&&e.next===null&&(Gs===null?ko=Gs=e:Gs=Gs.next=e),To=!0,Fc||(Fc=!0,iy())}function Wr(e,t){if(!Jc&&To){Jc=!0;do for(var n=!1,s=ko;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var p=s.suspendedLanes,j=s.pingedLanes;c=(1<<31-Xt(42|e)+1)-1,c&=o&~(p&~j),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,_p(s,c))}else c=Le,c=rs(s,s===tt?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||wl(s,c)||(n=!0,_p(s,c));s=s.next}while(n);Jc=!1}}function ry(){Ap()}function Ap(){To=Fc=!1;var e=0;el!==0&&gy()&&(e=el);for(var t=Xe(),n=null,s=ko;s!==null;){var o=s.next,c=Rp(s,t);c===0?(s.next=null,n===null?ko=o:n.next=o,o===null&&(Gs=n)):(n=s,(e!==0||(c&3)!==0)&&(To=!0)),s=o}St!==0&&St!==5||Wr(e),el!==0&&(el=0)}function Rp(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var p=31-Xt(c),j=1<<p,R=o[p];R===-1?((j&n)===0||(j&s)!==0)&&(o[p]=hu(j,t)):R<=t&&(e.expiredLanes|=j),c&=~j}if(t=tt,n=Le,n=rs(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Gn(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||wl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Gn(s),us(n)){case 2:case 8:n=Ti;break;case 32:n=Nl;break;case 268435456:n=gr;break;default:n=Nl}return s=Op.bind(null,e),n=_n(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Gn(s),e.callbackPriority=2,e.callbackNode=null,2}function Op(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Co()&&e.callbackNode!==n)return null;var s=Le;return s=rs(e,e===tt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(hp(e,s,t),Rp(e,Xe()),e.callbackNode!=null&&e.callbackNode===n?Op.bind(null,e):null)}function _p(e,t){if(Co())return null;hp(e,t,!0)}function iy(){yy(function(){(Ye&6)!==0?_n(ki,ry):Ap()})}function Ic(){if(el===0){var e=ks;e===0&&(e=Oa,Oa<<=1,(Oa&261888)===0&&(Oa=256)),el=e}return el}function zp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Di(""+e)}function Dp(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function oy(e,t,n,s,o){if(t==="submit"&&n&&n.stateNode===o){var c=zp((o[Bt]||null).action),p=s.submitter;p&&(t=(t=p[Bt]||null)?zp(t.formAction):p.getAttribute("formAction"),t!==null&&(c=t,p=null));var j=new qi("action","action",null,s,o);e.push({event:j,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(el!==0){var R=p?Dp(o,p):new FormData(o);gc(n,{pending:!0,data:R,method:o.method,action:c},null,R)}}else typeof c=="function"&&(j.preventDefault(),R=p?Dp(o,p):new FormData(o),gc(n,{pending:!0,data:R,method:o.method,action:c},c,R))},currentTarget:o}]})}}for(var Wc=0;Wc<zu.length;Wc++){var Pc=zu[Wc],uy=Pc.toLowerCase(),cy=Pc[0].toUpperCase()+Pc.slice(1);zn(uy,"on"+cy)}zn(fh,"onAnimationEnd"),zn(hh,"onAnimationIteration"),zn(mh,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(Cv,"onTransitionRun"),zn(kv,"onTransitionStart"),zn(Tv,"onTransitionCancel"),zn(ph,"onTransitionEnd"),Oe("onMouseEnter",["mouseout","mouseover"]),Oe("onMouseLeave",["mouseout","mouseover"]),Oe("onPointerEnter",["pointerout","pointerover"]),Oe("onPointerLeave",["pointerout","pointerover"]),Ee("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ee("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ee("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ee("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ee("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ee("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pr));function Up(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var p=s.length-1;0<=p;p--){var j=s[p],R=j.instance,K=j.currentTarget;if(j=j.listener,R!==c&&o.isPropagationStopped())break e;c=j,o.currentTarget=K;try{c(o)}catch(P){Gi(P)}o.currentTarget=null,c=R}else for(p=0;p<s.length;p++){if(j=s[p],R=j.instance,K=j.currentTarget,j=j.listener,R!==c&&o.isPropagationStopped())break e;c=j,o.currentTarget=K;try{c(o)}catch(P){Gi(P)}o.currentTarget=null,c=R}}}}function De(e,t){var n=t[cs];n===void 0&&(n=t[cs]=new Set);var s=e+"__bubble";n.has(s)||(Lp(t,e,2,!1),n.add(s))}function ed(e,t,n){var s=0;t&&(s|=4),Lp(n,e,s,t)}var Mo="_reactListening"+Math.random().toString(36).slice(2);function td(e){if(!e[Mo]){e[Mo]=!0,xe.forEach(function(n){n!=="selectionchange"&&(dy.has(n)||ed(n,!1,e),ed(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mo]||(t[Mo]=!0,ed("selectionchange",!1,t))}}function Lp(e,t,n,s){switch(fx(t)){case 2:var o=qy;break;case 8:o=By;break;default:o=xd}n=o.bind(null,t,n,e),o=void 0,!ju||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function nd(e,t,n,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var p=s.tag;if(p===3||p===4){var j=s.stateNode.containerInfo;if(j===o)break;if(p===4)for(p=s.return;p!==null;){var R=p.tag;if((R===3||R===4)&&p.stateNode.containerInfo===o)return;p=p.return}for(;j!==null;){if(p=na(j),p===null)return;if(R=p.tag,R===5||R===6||R===26||R===27){s=c=p;continue e}j=j.parentNode}}s=s.return}Gf(function(){var K=c,P=yu(n),ae=[];e:{var X=xh.get(e);if(X!==void 0){var F=qi,ge=e;switch(e){case"keypress":if(Li(n)===0)break e;case"keydown":case"keyup":F=lv;break;case"focusin":ge="focus",F=Eu;break;case"focusout":ge="blur",F=Eu;break;case"beforeblur":case"afterblur":F=Eu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Kf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=X0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=iv;break;case fh:case hh:case mh:F=F0;break;case ph:F=uv;break;case"scroll":case"scrollend":F=$0;break;case"wheel":F=dv;break;case"copy":case"cut":case"paste":F=I0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=Vf;break;case"toggle":case"beforetoggle":F=hv}var Ne=(t&4)!==0,Pe=!Ne&&(e==="scroll"||e==="scrollend"),B=Ne?X!==null?X+"Capture":null:X;Ne=[];for(var L=K,$;L!==null;){var te=L;if($=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||$===null||B===null||(te=jr(L,B),te!=null&&Ne.push(ei(L,te,$))),Pe)break;L=L.return}0<Ne.length&&(X=new F(X,ge,null,n,P),ae.push({event:X,listeners:Ne}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",X&&n!==vu&&(ge=n.relatedTarget||n.fromElement)&&(na(ge)||ge[Ua]))break e;if((F||X)&&(X=P.window===P?P:(X=P.ownerDocument)?X.defaultView||X.parentWindow:window,F?(ge=n.relatedTarget||n.toElement,F=K,ge=ge?na(ge):null,ge!==null&&(Pe=f(ge),Ne=ge.tag,ge!==Pe||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(F=null,ge=K),F!==ge)){if(Ne=Kf,te="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Vf,te="onPointerLeave",B="onPointerEnter",L="pointer"),Pe=F==null?X:re(F),$=ge==null?X:re(ge),X=new Ne(te,L+"leave",F,n,P),X.target=Pe,X.relatedTarget=$,te=null,na(P)===K&&(Ne=new Ne(B,L+"enter",ge,n,P),Ne.target=$,Ne.relatedTarget=Pe,te=Ne),Pe=te,F&&ge)t:{for(Ne=fy,B=F,L=ge,$=0,te=B;te;te=Ne(te))$++;te=0;for(var je=L;je;je=Ne(je))te++;for(;0<$-te;)B=Ne(B),$--;for(;0<te-$;)L=Ne(L),te--;for(;$--;){if(B===L||L!==null&&B===L.alternate){Ne=B;break t}B=Ne(B),L=Ne(L)}Ne=null}else Ne=null;F!==null&&Hp(ae,X,F,Ne,!1),ge!==null&&Pe!==null&&Hp(ae,Pe,ge,Ne,!0)}}e:{if(X=K?re(K):window,F=X.nodeName&&X.nodeName.toLowerCase(),F==="select"||F==="input"&&X.type==="file")var Qe=th;else if(Pf(X))if(nh)Qe=Sv;else{Qe=jv;var ve=bv}else F=X.nodeName,!F||F.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?K&&gu(K.elementType)&&(Qe=th):Qe=Nv;if(Qe&&(Qe=Qe(e,K))){eh(ae,Qe,n,P);break e}ve&&ve(e,X,K),e==="focusout"&&K&&X.type==="number"&&K.memoizedProps.value!=null&&xu(X,"number",X.value)}switch(ve=K?re(K):window,e){case"focusin":(Pf(ve)||ve.contentEditable==="true")&&(ys=ve,Ru=K,Mr=null);break;case"focusout":Mr=Ru=ys=null;break;case"mousedown":Ou=!0;break;case"contextmenu":case"mouseup":case"dragend":Ou=!1,ch(ae,n,P);break;case"selectionchange":if(Ev)break;case"keydown":case"keyup":ch(ae,n,P)}var Ae;if(ku)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else vs?If(e,n)&&(He="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(He="onCompositionStart");He&&(Zf&&n.locale!=="ko"&&(vs||He!=="onCompositionStart"?He==="onCompositionEnd"&&vs&&(Ae=Yf()):(Ha=P,Nu="value"in Ha?Ha.value:Ha.textContent,vs=!0)),ve=Ao(K,He),0<ve.length&&(He=new Xf(He,e,null,n,P),ae.push({event:He,listeners:ve}),Ae?He.data=Ae:(Ae=Wf(n),Ae!==null&&(He.data=Ae)))),(Ae=pv?xv(e,n):gv(e,n))&&(He=Ao(K,"onBeforeInput"),0<He.length&&(ve=new Xf("onBeforeInput","beforeinput",null,n,P),ae.push({event:ve,listeners:He}),ve.data=Ae)),oy(ae,e,K,n,P)}Up(ae,t)})}function ei(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ao(e,t){for(var n=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=jr(e,n),o!=null&&s.unshift(ei(e,o,c)),o=jr(e,t),o!=null&&s.push(ei(e,o,c))),e.tag===3)return s;e=e.return}return[]}function fy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hp(e,t,n,s,o){for(var c=t._reactName,p=[];n!==null&&n!==s;){var j=n,R=j.alternate,K=j.stateNode;if(j=j.tag,R!==null&&R===s)break;j!==5&&j!==26&&j!==27||K===null||(R=K,o?(K=jr(n,c),K!=null&&p.unshift(ei(n,K,R))):o||(K=jr(n,c),K!=null&&p.push(ei(n,K,R)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var hy=/\r\n?/g,my=/\u0000|\uFFFD/g;function qp(e){return(typeof e=="string"?e:""+e).replace(hy,`
49
+ `).replace(my,"")}function Bp(e,t){return t=qp(t),qp(e)===t}function We(e,t,n,s,o,c){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ps(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ps(e,""+s);break;case"className":El(e,"class",s);break;case"tabIndex":El(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":El(e,n,s);break;case"style":Bf(e,s,c);break;case"data":if(t!=="object"){El(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Di(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&We(e,t,"name",o.name,o,null),We(e,t,"formEncType",o.formEncType,o,null),We(e,t,"formMethod",o.formMethod,o,null),We(e,t,"formTarget",o.formTarget,o,null)):(We(e,t,"encType",o.encType,o,null),We(e,t,"method",o.method,o,null),We(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Di(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=la);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Di(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":De("beforetoggle",e),De("toggle",e),aa(e,"popover",s);break;case"xlinkActuate":Ct(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ct(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ct(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ct(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ct(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ct(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ct(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":aa(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=G0.get(n)||n,aa(e,n,s))}}function ad(e,t,n,s,o,c){switch(n){case"style":Bf(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof s=="string"?ps(e,s):(typeof s=="number"||typeof s=="bigint")&&ps(e,""+s);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"onClick":s!=null&&(e.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ue.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),c=e[Bt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,o);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):aa(e,n,s)}}}function Lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var s=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var p=n[c];if(p!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:We(e,t,c,p,n,null)}}o&&We(e,t,"srcSet",n.srcSet,n,null),s&&We(e,t,"src",n.src,n,null);return;case"input":De("invalid",e);var j=c=p=o=null,R=null,K=null;for(s in n)if(n.hasOwnProperty(s)){var P=n[s];if(P!=null)switch(s){case"name":o=P;break;case"type":p=P;break;case"checked":R=P;break;case"defaultChecked":K=P;break;case"value":c=P;break;case"defaultValue":j=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(u(137,t));break;default:We(e,t,s,P,n,null)}}Uf(e,c,j,R,K,p,o,!1);return;case"select":De("invalid",e),s=p=c=null;for(o in n)if(n.hasOwnProperty(o)&&(j=n[o],j!=null))switch(o){case"value":c=j;break;case"defaultValue":p=j;break;case"multiple":s=j;default:We(e,t,o,j,n,null)}t=c,n=p,e.multiple=!!s,t!=null?ms(e,!!s,t,!1):n!=null&&ms(e,!!s,n,!0);return;case"textarea":De("invalid",e),c=o=s=null;for(p in n)if(n.hasOwnProperty(p)&&(j=n[p],j!=null))switch(p){case"value":s=j;break;case"defaultValue":o=j;break;case"children":c=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(u(91));break;default:We(e,t,p,j,n,null)}Hf(e,s,o,c);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(s=n[R],s!=null))switch(R){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:We(e,t,R,s,n,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(s=0;s<Pr.length;s++)De(Pr[s],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in n)if(n.hasOwnProperty(K)&&(s=n[K],s!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:We(e,t,K,s,n,null)}return;default:if(gu(t)){for(P in n)n.hasOwnProperty(P)&&(s=n[P],s!==void 0&&ad(e,t,P,s,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(s=n[j],s!=null&&We(e,t,j,s,n,null))}function py(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,p=null,j=null,R=null,K=null,P=null;for(F in n){var ae=n[F];if(n.hasOwnProperty(F)&&ae!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":R=ae;default:s.hasOwnProperty(F)||We(e,t,F,null,s,ae)}}for(var X in s){var F=s[X];if(ae=n[X],s.hasOwnProperty(X)&&(F!=null||ae!=null))switch(X){case"type":c=F;break;case"name":o=F;break;case"checked":K=F;break;case"defaultChecked":P=F;break;case"value":p=F;break;case"defaultValue":j=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(u(137,t));break;default:F!==ae&&We(e,t,X,F,s,ae)}}pu(e,p,j,R,K,P,c,o);return;case"select":F=p=j=X=null;for(c in n)if(R=n[c],n.hasOwnProperty(c)&&R!=null)switch(c){case"value":break;case"multiple":F=R;default:s.hasOwnProperty(c)||We(e,t,c,null,s,R)}for(o in s)if(c=s[o],R=n[o],s.hasOwnProperty(o)&&(c!=null||R!=null))switch(o){case"value":X=c;break;case"defaultValue":j=c;break;case"multiple":p=c;default:c!==R&&We(e,t,o,c,s,R)}t=j,n=p,s=F,X!=null?ms(e,!!n,X,!1):!!s!=!!n&&(t!=null?ms(e,!!n,t,!0):ms(e,!!n,n?[]:"",!1));return;case"textarea":F=X=null;for(j in n)if(o=n[j],n.hasOwnProperty(j)&&o!=null&&!s.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:We(e,t,j,null,s,o)}for(p in s)if(o=s[p],c=n[p],s.hasOwnProperty(p)&&(o!=null||c!=null))switch(p){case"value":X=o;break;case"defaultValue":F=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&We(e,t,p,o,s,c)}Lf(e,X,F);return;case"option":for(var ge in n)if(X=n[ge],n.hasOwnProperty(ge)&&X!=null&&!s.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:We(e,t,ge,null,s,X)}for(R in s)if(X=s[R],F=n[R],s.hasOwnProperty(R)&&X!==F&&(X!=null||F!=null))switch(R){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:We(e,t,R,X,s,F)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in n)X=n[Ne],n.hasOwnProperty(Ne)&&X!=null&&!s.hasOwnProperty(Ne)&&We(e,t,Ne,null,s,X);for(K in s)if(X=s[K],F=n[K],s.hasOwnProperty(K)&&X!==F&&(X!=null||F!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(u(137,t));break;default:We(e,t,K,X,s,F)}return;default:if(gu(t)){for(var Pe in n)X=n[Pe],n.hasOwnProperty(Pe)&&X!==void 0&&!s.hasOwnProperty(Pe)&&ad(e,t,Pe,void 0,s,X);for(P in s)X=s[P],F=n[P],!s.hasOwnProperty(P)||X===F||X===void 0&&F===void 0||ad(e,t,P,X,s,F);return}}for(var B in n)X=n[B],n.hasOwnProperty(B)&&X!=null&&!s.hasOwnProperty(B)&&We(e,t,B,null,s,X);for(ae in s)X=s[ae],F=n[ae],!s.hasOwnProperty(ae)||X===F||X==null&&F==null||We(e,t,ae,X,s,F)}function Qp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var o=n[s],c=o.transferSize,p=o.initiatorType,j=o.duration;if(c&&j&&Qp(p)){for(p=0,j=o.responseEnd,s+=1;s<n.length;s++){var R=n[s],K=R.startTime;if(K>j)break;var P=R.transferSize,ae=R.initiatorType;P&&Qp(ae)&&(R=R.responseEnd,p+=P*(R<j?1:(j-K)/(R-K)))}if(--s,t+=8*(c+p)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ld=null,sd=null;function Ro(e){return e.nodeType===9?e:e.ownerDocument}function Gp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Yp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function rd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var id=null;function gy(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var $p=typeof setTimeout=="function"?setTimeout:void 0,vy=typeof clearTimeout=="function"?clearTimeout:void 0,Kp=typeof Promise=="function"?Promise:void 0,yy=typeof queueMicrotask=="function"?queueMicrotask:typeof Kp<"u"?function(e){return Kp.resolve(null).then(e).catch(by)}:$p;function by(e){setTimeout(function(){throw e})}function tl(e){return e==="head"}function Xp(e,t){var n=t,s=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(o),Xs(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")ti(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ti(n);for(var c=n.firstChild;c;){var p=c.nextSibling,j=c.nodeName;c[La]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=p}}else n==="body"&&ti(e.ownerDocument.body);n=o}while(n);Xs(t)}function Vp(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function od(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":od(n),ds(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function jy(e,t,n,s){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[La])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function Ny(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cn(e.nextSibling),e===null))return null;return e}function Zp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cn(e.nextSibling),e===null))return null;return e}function ud(e){return e.data==="$?"||e.data==="$~"}function cd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Sy(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var dd=null;function Fp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Cn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Ip(e,t,n){switch(t=Ro(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function ti(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ds(e)}var kn=new Map,Wp=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ba=H.d;H.d={f:wy,r:Ey,D:Cy,C:ky,L:Ty,m:My,X:Ry,S:Ay,M:Oy};function wy(){var e=ba.f(),t=So();return e||t}function Ey(e){var t=ee(e);t!==null&&t.tag===5&&t.type==="form"?pm(t):ba.r(e)}var Ys=typeof document>"u"?null:document;function Pp(e,t,n){var s=Ys;if(s&&typeof t=="string"&&t){var o=_t(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Wp.has(o)||(Wp.add(o),e={rel:e,crossOrigin:n,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Lt(t,"link",e),pe(t),s.head.appendChild(t)))}}function Cy(e){ba.D(e),Pp("dns-prefetch",e,null)}function ky(e,t){ba.C(e,t),Pp("preconnect",e,t)}function Ty(e,t,n){ba.L(e,t,n);var s=Ys;if(s&&e&&t){var o='link[rel="preload"][as="'+_t(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+_t(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+_t(n.imageSizes)+'"]')):o+='[href="'+_t(e)+'"]';var c=o;switch(t){case"style":c=$s(e);break;case"script":c=Ks(e)}kn.has(c)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),kn.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(ni(c))||t==="script"&&s.querySelector(ai(c))||(t=s.createElement("link"),Lt(t,"link",e),pe(t),s.head.appendChild(t)))}}function My(e,t){ba.m(e,t);var n=Ys;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+_t(s)+'"][href="'+_t(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ks(e)}if(!kn.has(c)&&(e=v({rel:"modulepreload",href:e},t),kn.set(c,e),n.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ai(c)))return}s=n.createElement("link"),Lt(s,"link",e),pe(s),n.head.appendChild(s)}}}function Ay(e,t,n){ba.S(e,t,n);var s=Ys;if(s&&e){var o=ue(s).hoistableStyles,c=$s(e);t=t||"default";var p=o.get(c);if(!p){var j={loading:0,preload:null};if(p=s.querySelector(ni(c)))j.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=kn.get(c))&&fd(e,n);var R=p=s.createElement("link");pe(R),Lt(R,"link",e),R._p=new Promise(function(K,P){R.onload=K,R.onerror=P}),R.addEventListener("load",function(){j.loading|=1}),R.addEventListener("error",function(){j.loading|=2}),j.loading|=4,_o(p,t,s)}p={type:"stylesheet",instance:p,count:1,state:j},o.set(c,p)}}}function Ry(e,t){ba.X(e,t);var n=Ys;if(n&&e){var s=ue(n).hoistableScripts,o=Ks(e),c=s.get(o);c||(c=n.querySelector(ai(o)),c||(e=v({src:e,async:!0},t),(t=kn.get(o))&&hd(e,t),c=n.createElement("script"),pe(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Oy(e,t){ba.M(e,t);var n=Ys;if(n&&e){var s=ue(n).hoistableScripts,o=Ks(e),c=s.get(o);c||(c=n.querySelector(ai(o)),c||(e=v({src:e,async:!0,type:"module"},t),(t=kn.get(o))&&hd(e,t),c=n.createElement("script"),pe(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function ex(e,t,n,s){var o=(o=ye.current)?Oo(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$s(n.href),n=ue(o).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=$s(n.href);var c=ue(o).hoistableStyles,p=c.get(e);if(p||(o=o.ownerDocument||o,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,p),(c=o.querySelector(ni(e)))&&!c._p&&(p.instance=c,p.state.loading=5),kn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},kn.set(e,n),c||_y(o,e,n,p.state))),t&&s===null)throw Error(u(528,""));return p}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ks(n),n=ue(o).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function $s(e){return'href="'+_t(e)+'"'}function ni(e){return'link[rel="stylesheet"]['+e+"]"}function tx(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function _y(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Lt(t,"link",n),pe(t),e.head.appendChild(t))}function Ks(e){return'[src="'+_t(e)+'"]'}function ai(e){return"script[async]"+e}function nx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+_t(n.href)+'"]');if(s)return t.instance=s,pe(s),s;var o=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),pe(s),Lt(s,"style",o),_o(s,n.precedence,e),t.instance=s;case"stylesheet":o=$s(n.href);var c=e.querySelector(ni(o));if(c)return t.state.loading|=4,t.instance=c,pe(c),c;s=tx(n),(o=kn.get(o))&&fd(s,o),c=(e.ownerDocument||e).createElement("link"),pe(c);var p=c;return p._p=new Promise(function(j,R){p.onload=j,p.onerror=R}),Lt(c,"link",s),t.state.loading|=4,_o(c,n.precedence,e),t.instance=c;case"script":return c=Ks(n.src),(o=e.querySelector(ai(c)))?(t.instance=o,pe(o),o):(s=n,(o=kn.get(c))&&(s=v({},n),hd(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),pe(o),Lt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,_o(s,n.precedence,e));return t.instance}function _o(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,p=0;p<s.length;p++){var j=s[p];if(j.dataset.precedence===t)c=j;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var zo=null;function ax(e,t,n){if(zo===null){var s=new Map,o=zo=new Map;o.set(n,s)}else o=zo,s=o.get(n),s||(s=new Map,o.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[La]||c[dt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(t)||"";p=e+p;var j=s.get(p);j?j.push(c):s.set(p,[c])}}return s}function lx(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function zy(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function sx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dy(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=$s(s.href),c=t.querySelector(ni(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Do.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,pe(c);return}c=t.ownerDocument||t,s=tx(s),(o=kn.get(o))&&fd(s,o),c=c.createElement("link"),pe(c);var p=c;p._p=new Promise(function(j,R){p.onload=j,p.onerror=R}),Lt(c,"link",s),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Do.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var md=0;function Uy(e,t){return e.stylesheets&&e.count===0&&Lo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&Lo(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&md===0&&(md=62500*xy());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Lo(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>md?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Do(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Uo=null;function Lo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Uo=new Map,t.forEach(Ly,e),Uo=null,Do.call(e))}function Ly(e,t){if(!(t.state.loading&4)){var n=Uo.get(e);if(n)var s=n.get(null);else{n=new Map,Uo.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var p=o[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),s=p)}s&&n.set(null,s)}o=t.instance,p=o.getAttribute("data-precedence"),c=n.get(p)||s,c===s&&n.set(null,o),n.set(p,o),this.count++,s=Do.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var li={$$typeof:N,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Hy(e,t,n,s,o,c,p,j,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=za(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=za(0),this.hiddenUpdates=za(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function rx(e,t,n,s,o,c,p,j,R,K,P,ae){return e=new Hy(e,t,n,p,R,K,P,ae,j),t=1,c===!0&&(t|=24),c=cn(3,null,null,t),e.current=c,c.stateNode=e,t=Vu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:n,cache:t},Iu(c),e}function ix(e){return e?(e=Ns,e):Ns}function ox(e,t,n,s,o,c){o=ix(o),s.context===null?s.context=o:s.pendingContext=o,s=$a(t),s.payload={element:n},c=c===void 0?null:c,c!==null&&(s.callback=c),n=Ka(e,s,t),n!==null&&(an(n,e,t),Ur(n,e,t))}function ux(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pd(e,t){ux(e,t),(e=e.alternate)&&ux(e,t)}function cx(e){if(e.tag===13||e.tag===31){var t=_l(e,67108864);t!==null&&an(t,e,67108864),pd(e,67108864)}}function dx(e){if(e.tag===13||e.tag===31){var t=pn();t=vr(t);var n=_l(e,t);n!==null&&an(n,e,t),pd(e,t)}}var Ho=!0;function qy(e,t,n,s){var o=T.T;T.T=null;var c=H.p;try{H.p=2,xd(e,t,n,s)}finally{H.p=c,T.T=o}}function By(e,t,n,s){var o=T.T;T.T=null;var c=H.p;try{H.p=8,xd(e,t,n,s)}finally{H.p=c,T.T=o}}function xd(e,t,n,s){if(Ho){var o=gd(s);if(o===null)nd(e,t,s,qo,n),hx(e,s);else if(Gy(o,e,t,n,s))s.stopPropagation();else if(hx(e,s),t&4&&-1<Qy.indexOf(e)){for(;o!==null;){var c=ee(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=ta(c.pendingLanes);if(p!==0){var j=c;for(j.pendingLanes|=2,j.entangledLanes|=2;p;){var R=1<<31-Xt(p);j.entanglements[1]|=R,p&=~R}Zn(c),(Ye&6)===0&&(jo=Xe()+500,Wr(0))}}break;case 31:case 13:j=_l(c,2),j!==null&&an(j,c,2),So(),pd(c,2)}if(c=gd(s),c===null&&nd(e,t,s,qo,n),c===o)break;o=c}o!==null&&s.stopPropagation()}else nd(e,t,s,null,n)}}function gd(e){return e=yu(e),vd(e)}var qo=null;function vd(e){if(qo=null,e=na(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=x(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qo=e,null}function fx(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xr()){case ki:return 2;case Ti:return 8;case Nl:case Df:return 32;case gr:return 268435456;default:return 32}default:return 32}}var yd=!1,nl=null,al=null,ll=null,si=new Map,ri=new Map,sl=[],Qy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hx(e,t){switch(e){case"focusin":case"focusout":nl=null;break;case"dragenter":case"dragleave":al=null;break;case"mouseover":case"mouseout":ll=null;break;case"pointerover":case"pointerout":si.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ri.delete(t.pointerId)}}function ii(e,t,n,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=ee(t),t!==null&&cx(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Gy(e,t,n,s,o){switch(t){case"focusin":return nl=ii(nl,e,t,n,s,o),!0;case"dragenter":return al=ii(al,e,t,n,s,o),!0;case"mouseover":return ll=ii(ll,e,t,n,s,o),!0;case"pointerover":var c=o.pointerId;return si.set(c,ii(si.get(c)||null,e,t,n,s,o)),!0;case"gotpointercapture":return c=o.pointerId,ri.set(c,ii(ri.get(c)||null,e,t,n,s,o)),!0}return!1}function mx(e){var t=na(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=x(n),t!==null){e.blockedOn=t,Oi(e.priority,function(){dx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Oi(e.priority,function(){dx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gd(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);vu=s,n.target.dispatchEvent(s),vu=null}else return t=ee(n),t!==null&&cx(t),e.blockedOn=n,!1;t.shift()}return!0}function px(e,t,n){Bo(e)&&n.delete(t)}function Yy(){yd=!1,nl!==null&&Bo(nl)&&(nl=null),al!==null&&Bo(al)&&(al=null),ll!==null&&Bo(ll)&&(ll=null),si.forEach(px),ri.forEach(px)}function Qo(e,t){e.blockedOn===t&&(e.blockedOn=null,yd||(yd=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Yy)))}var Go=null;function xx(e){Go!==e&&(Go=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Go===e&&(Go=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(vd(s||n)===null)continue;break}var c=ee(n);c!==null&&(e.splice(t,3),t-=3,gc(c,{pending:!0,data:o,method:n.method,action:s},s,o))}}))}function Xs(e){function t(R){return Qo(R,e)}nl!==null&&Qo(nl,e),al!==null&&Qo(al,e),ll!==null&&Qo(ll,e),si.forEach(t),ri.forEach(t);for(var n=0;n<sl.length;n++){var s=sl[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<sl.length&&(n=sl[0],n.blockedOn===null);)mx(n),n.blockedOn===null&&sl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var o=n[s],c=n[s+1],p=o[Bt]||null;if(typeof c=="function")p||xx(n);else if(p){var j=null;if(c&&c.hasAttribute("formAction")){if(o=c,p=c[Bt]||null)j=p.formAction;else if(vd(o)!==null)continue}else j=p.action;typeof j=="function"?n[s+1]=j:(n.splice(s,3),s-=3),xx(n)}}}function gx(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return o=p})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function bd(e){this._internalRoot=e}Yo.prototype.render=bd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,s=pn();ox(n,s,e,t,null,null)},Yo.prototype.unmount=bd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ox(e.current,2,null,e,null,null),So(),t[Ua]=null}};function Yo(e){this._internalRoot=e}Yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=yr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sl.length&&t!==0&&t<sl[n].priority;n++);sl.splice(n,0,e),n===0&&mx(e)}};var vx=r.version;if(vx!=="19.2.4")throw Error(u(527,vx,"19.2.4"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var $y={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$o.isDisabled&&$o.supportsFiber)try{Ra=$o.inject($y),Et=$o}catch{}}return ci.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,s="",o=Em,c=Cm,p=km;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=rx(e,1,!1,null,null,n,s,null,o,c,p,gx),e[Ua]=t.current,td(e),new bd(t)},ci.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var s=!1,o="",c=Em,p=Cm,j=km,R=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(R=n.formState)),t=rx(e,1,!0,t,n??null,s,o,R,c,p,j,gx),t.context=ix(null),n=t.current,s=pn(),s=vr(s),o=$a(s),o.callback=null,Ka(n,o,s),n=s,t.current.lanes=n,Yn(t,n),Zn(t),e[Ua]=t.current,td(e),new Yo(t)},ci.version="19.2.4",ci}var Mx;function nb(){if(Mx)return wd.exports;Mx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),wd.exports=tb(),wd.exports}var ab=nb(),dr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(l){return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lb={setTimeout:(l,r)=>setTimeout(l,r),clearTimeout:l=>clearTimeout(l),setInterval:(l,r)=>setInterval(l,r),clearInterval:l=>clearInterval(l)},ol,of,xg,sb=(xg=class{constructor(){be(this,ol,lb);be(this,of,!1)}setTimeoutProvider(l){me(this,ol,l)}setTimeout(l,r){return _(this,ol).setTimeout(l,r)}clearTimeout(l){_(this,ol).clearTimeout(l)}setInterval(l,r){return _(this,ol).setInterval(l,r)}clearInterval(l){_(this,ol).clearInterval(l)}},ol=new WeakMap,of=new WeakMap,xg),Vl=new sb;function rb(l){setTimeout(l,0)}var as=typeof window>"u"||"Deno"in globalThis;function Ft(){}function ib(l,r){return typeof l=="function"?l(r):l}function Ud(l){return typeof l=="number"&&l>=0&&l!==1/0}function kg(l,r){return Math.max(l+(r||0)-Date.now(),0)}function gl(l,r){return typeof l=="function"?l(r):l}function Mn(l,r){return typeof l=="function"?l(r):l}function Ax(l,r){const{type:i="all",exact:u,fetchStatus:d,predicate:f,queryKey:x,stale:m}=l;if(x){if(u){if(r.queryHash!==cf(x,r.options))return!1}else if(!pi(r.queryKey,x))return!1}if(i!=="all"){const h=r.isActive();if(i==="active"&&!h||i==="inactive"&&h)return!1}return!(typeof m=="boolean"&&r.isStale()!==m||d&&d!==r.state.fetchStatus||f&&!f(r))}function Rx(l,r){const{exact:i,status:u,predicate:d,mutationKey:f}=l;if(f){if(!r.options.mutationKey)return!1;if(i){if(ls(r.options.mutationKey)!==ls(f))return!1}else if(!pi(r.options.mutationKey,f))return!1}return!(u&&r.state.status!==u||d&&!d(r))}function cf(l,r){return((r==null?void 0:r.queryKeyHashFn)||ls)(l)}function ls(l){return JSON.stringify(l,(r,i)=>Ld(i)?Object.keys(i).sort().reduce((u,d)=>(u[d]=i[d],u),{}):i)}function pi(l,r){return l===r?!0:typeof l!=typeof r?!1:l&&r&&typeof l=="object"&&typeof r=="object"?Object.keys(r).every(i=>pi(l[i],r[i])):!1}var ob=Object.prototype.hasOwnProperty;function Tg(l,r,i=0){if(l===r)return l;if(i>500)return r;const u=Ox(l)&&Ox(r);if(!u&&!(Ld(l)&&Ld(r)))return r;const f=(u?l:Object.keys(l)).length,x=u?r:Object.keys(r),m=x.length,h=u?new Array(m):{};let g=0;for(let y=0;y<m;y++){const v=u?y:x[y],w=l[v],k=r[v];if(w===k){h[v]=w,(u?y<f:ob.call(l,v))&&g++;continue}if(w===null||k===null||typeof w!="object"||typeof k!="object"){h[v]=k;continue}const E=Tg(w,k,i+1);h[v]=E,E===w&&g++}return f===m&&g===f?l:h}function tu(l,r){if(!r||Object.keys(l).length!==Object.keys(r).length)return!1;for(const i in l)if(l[i]!==r[i])return!1;return!0}function Ox(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function Ld(l){if(!_x(l))return!1;const r=l.constructor;if(r===void 0)return!0;const i=r.prototype;return!(!_x(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(l)!==Object.prototype)}function _x(l){return Object.prototype.toString.call(l)==="[object Object]"}function ub(l){return new Promise(r=>{Vl.setTimeout(r,l)})}function Hd(l,r,i){return typeof i.structuralSharing=="function"?i.structuralSharing(l,r):i.structuralSharing!==!1?Tg(l,r):r}function cb(l,r,i=0){const u=[...l,r];return i&&u.length>i?u.slice(1):u}function db(l,r,i=0){const u=[r,...l];return i&&u.length>i?u.slice(0,-1):u}var df=Symbol();function Mg(l,r){return!l.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!l.queryFn||l.queryFn===df?()=>Promise.reject(new Error(`Missing queryFn: '${l.queryHash}'`)):l.queryFn}function ff(l,r){return typeof l=="function"?l(...r):!!l}function fb(l,r,i){let u=!1,d;return Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(d??(d=r()),u||(u=!0,d.aborted?i():d.addEventListener("abort",i,{once:!0})),d)}),l}var Zl,ul,Js,gg,hb=(gg=class extends dr{constructor(){super();be(this,Zl);be(this,ul);be(this,Js);me(this,Js,r=>{if(!as&&window.addEventListener){const i=()=>r();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){_(this,ul)||this.setEventListener(_(this,Js))}onUnsubscribe(){var r;this.hasListeners()||((r=_(this,ul))==null||r.call(this),me(this,ul,void 0))}setEventListener(r){var i;me(this,Js,r),(i=_(this,ul))==null||i.call(this),me(this,ul,r(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(r){_(this,Zl)!==r&&(me(this,Zl,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(i=>{i(r)})}isFocused(){var r;return typeof _(this,Zl)=="boolean"?_(this,Zl):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},Zl=new WeakMap,ul=new WeakMap,Js=new WeakMap,gg),hf=new hb;function qd(){let l,r;const i=new Promise((d,f)=>{l=d,r=f});i.status="pending",i.catch(()=>{});function u(d){Object.assign(i,d),delete i.resolve,delete i.reject}return i.resolve=d=>{u({status:"fulfilled",value:d}),l(d)},i.reject=d=>{u({status:"rejected",reason:d}),r(d)},i}var mb=rb;function pb(){let l=[],r=0,i=m=>{m()},u=m=>{m()},d=mb;const f=m=>{r?l.push(m):d(()=>{i(m)})},x=()=>{const m=l;l=[],m.length&&d(()=>{u(()=>{m.forEach(h=>{i(h)})})})};return{batch:m=>{let h;r++;try{h=m()}finally{r--,r||x()}return h},batchCalls:m=>(...h)=>{f(()=>{m(...h)})},schedule:f,setNotifyFunction:m=>{i=m},setBatchNotifyFunction:m=>{u=m},setScheduler:m=>{d=m}}}var wt=pb(),Is,cl,Ws,vg,xb=(vg=class extends dr{constructor(){super();be(this,Is,!0);be(this,cl);be(this,Ws);me(this,Ws,r=>{if(!as&&window.addEventListener){const i=()=>r(!0),u=()=>r(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",u)}}})}onSubscribe(){_(this,cl)||this.setEventListener(_(this,Ws))}onUnsubscribe(){var r;this.hasListeners()||((r=_(this,cl))==null||r.call(this),me(this,cl,void 0))}setEventListener(r){var i;me(this,Ws,r),(i=_(this,cl))==null||i.call(this),me(this,cl,r(this.setOnline.bind(this)))}setOnline(r){_(this,Is)!==r&&(me(this,Is,r),this.listeners.forEach(u=>{u(r)}))}isOnline(){return _(this,Is)}},Is=new WeakMap,cl=new WeakMap,Ws=new WeakMap,vg),nu=new xb;function gb(l){return Math.min(1e3*2**l,3e4)}function Ag(l){return(l??"online")==="online"?nu.isOnline():!0}var Bd=class extends Error{constructor(l){super("CancelledError"),this.revert=l==null?void 0:l.revert,this.silent=l==null?void 0:l.silent}};function Rg(l){let r=!1,i=0,u;const d=qd(),f=()=>d.status!=="pending",x=O=>{var A;if(!f()){const z=new Bd(O);w(z),(A=l.onCancel)==null||A.call(l,z)}},m=()=>{r=!0},h=()=>{r=!1},g=()=>hf.isFocused()&&(l.networkMode==="always"||nu.isOnline())&&l.canRun(),y=()=>Ag(l.networkMode)&&l.canRun(),v=O=>{f()||(u==null||u(),d.resolve(O))},w=O=>{f()||(u==null||u(),d.reject(O))},k=()=>new Promise(O=>{var A;u=z=>{(f()||g())&&O(z)},(A=l.onPause)==null||A.call(l)}).then(()=>{var O;u=void 0,f()||(O=l.onContinue)==null||O.call(l)}),E=()=>{if(f())return;let O;const A=i===0?l.initialPromise:void 0;try{O=A??l.fn()}catch(z){O=Promise.reject(z)}Promise.resolve(O).then(v).catch(z=>{var U;if(f())return;const V=l.retry??(as?0:3),N=l.retryDelay??gb,S=typeof N=="function"?N(i,z):N,M=V===!0||typeof V=="number"&&i<V||typeof V=="function"&&V(i,z);if(r||!M){w(z);return}i++,(U=l.onFail)==null||U.call(l,i,z),ub(S).then(()=>g()?void 0:k()).then(()=>{r?w(z):E()})})};return{promise:d,status:()=>d.status,cancel:x,continue:()=>(u==null||u(),d),cancelRetry:m,continueRetry:h,canStart:y,start:()=>(y()?E():k().then(E),d)}}var Fl,yg,Og=(yg=class{constructor(){be(this,Fl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ud(this.gcTime)&&me(this,Fl,Vl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(l){this.gcTime=Math.max(this.gcTime||0,l??(as?1/0:300*1e3))}clearGcTimeout(){_(this,Fl)&&(Vl.clearTimeout(_(this,Fl)),me(this,Fl,void 0))}},Fl=new WeakMap,yg),Jl,Ps,Tn,Il,Mt,vi,Wl,Hn,ja,bg,vb=(bg=class extends Og{constructor(r){super();be(this,Hn);be(this,Jl);be(this,Ps);be(this,Tn);be(this,Il);be(this,Mt);be(this,vi);be(this,Wl);me(this,Wl,!1),me(this,vi,r.defaultOptions),this.setOptions(r.options),this.observers=[],me(this,Il,r.client),me(this,Tn,_(this,Il).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,me(this,Jl,Dx(this.options)),this.state=r.state??_(this,Jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=_(this,Mt))==null?void 0:r.promise}setOptions(r){if(this.options={..._(this,vi),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Dx(this.options);i.data!==void 0&&(this.setState(zx(i.data,i.dataUpdatedAt)),me(this,Jl,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Tn).remove(this)}setData(r,i){const u=Hd(this.state.data,r,this.options);return Re(this,Hn,ja).call(this,{data:u,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),u}setState(r,i){Re(this,Hn,ja).call(this,{type:"setState",state:r,setStateOptions:i})}cancel(r){var u,d;const i=(u=_(this,Mt))==null?void 0:u.promise;return(d=_(this,Mt))==null||d.cancel(r),i?i.then(Ft).catch(Ft):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Jl))}isActive(){return this.observers.some(r=>Mn(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===df||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>gl(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!kg(this.state.dataUpdatedAt,r)}onFocus(){var i;const r=this.observers.find(u=>u.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(i=_(this,Mt))==null||i.continue()}onOnline(){var i;const r=this.observers.find(u=>u.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(i=_(this,Mt))==null||i.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),_(this,Tn).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(i=>i!==r),this.observers.length||(_(this,Mt)&&(_(this,Wl)?_(this,Mt).cancel({revert:!0}):_(this,Mt).cancelRetry()),this.scheduleGc()),_(this,Tn).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,Hn,ja).call(this,{type:"invalidate"})}async fetch(r,i){var h,g,y,v,w,k,E,O,A,z,V,N;if(this.state.fetchStatus!=="idle"&&((h=_(this,Mt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(_(this,Mt))return _(this,Mt).continueRetry(),_(this,Mt).promise}if(r&&this.setOptions(r),!this.options.queryFn){const S=this.observers.find(M=>M.options.queryFn);S&&this.setOptions(S.options)}const u=new AbortController,d=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(me(this,Wl,!0),u.signal)})},f=()=>{const S=Mg(this.options,i),U=(()=>{const D={client:_(this,Il),queryKey:this.queryKey,meta:this.meta};return d(D),D})();return me(this,Wl,!1),this.options.persister?this.options.persister(S,U,this):S(U)},m=(()=>{const S={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:_(this,Il),state:this.state,fetchFn:f};return d(S),S})();(g=this.options.behavior)==null||g.onFetch(m,this),me(this,Ps,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=m.fetchOptions)==null?void 0:y.meta))&&Re(this,Hn,ja).call(this,{type:"fetch",meta:(v=m.fetchOptions)==null?void 0:v.meta}),me(this,Mt,Rg({initialPromise:i==null?void 0:i.initialPromise,fn:m.fetchFn,onCancel:S=>{S instanceof Bd&&S.revert&&this.setState({..._(this,Ps),fetchStatus:"idle"}),u.abort()},onFail:(S,M)=>{Re(this,Hn,ja).call(this,{type:"failed",failureCount:S,error:M})},onPause:()=>{Re(this,Hn,ja).call(this,{type:"pause"})},onContinue:()=>{Re(this,Hn,ja).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const S=await _(this,Mt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(k=(w=_(this,Tn).config).onSuccess)==null||k.call(w,S,this),(O=(E=_(this,Tn).config).onSettled)==null||O.call(E,S,this.state.error,this),S}catch(S){if(S instanceof Bd){if(S.silent)return _(this,Mt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Re(this,Hn,ja).call(this,{type:"error",error:S}),(z=(A=_(this,Tn).config).onError)==null||z.call(A,S,this),(N=(V=_(this,Tn).config).onSettled)==null||N.call(V,this.state.data,S,this),S}finally{this.scheduleGc()}}},Jl=new WeakMap,Ps=new WeakMap,Tn=new WeakMap,Il=new WeakMap,Mt=new WeakMap,vi=new WeakMap,Wl=new WeakMap,Hn=new WeakSet,ja=function(r){const i=u=>{switch(r.type){case"failed":return{...u,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,..._g(u.data,this.options),fetchMeta:r.meta??null};case"success":const d={...u,...zx(r.data,r.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return me(this,Ps,r.manual?d:void 0),d;case"error":const f=r.error;return{...u,error:f,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...r.state}}};this.state=i(this.state),wt.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),_(this,Tn).notify({query:this,type:"updated",action:r})})},bg);function _g(l,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ag(r.networkMode)?"fetching":"paused",...l===void 0&&{error:null,status:"pending"}}}function zx(l,r){return{data:l,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Dx(l){const r=typeof l.initialData=="function"?l.initialData():l.initialData,i=r!==void 0,u=i?typeof l.initialDataUpdatedAt=="function"?l.initialDataUpdatedAt():l.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:i?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var ln,Be,yi,Zt,Pl,er,Na,dl,bi,tr,nr,es,ts,fl,ar,Ke,mi,Qd,Gd,Yd,$d,Kd,Xd,Vd,zg,jg,yb=(jg=class extends dr{constructor(r,i){super();be(this,Ke);be(this,ln);be(this,Be);be(this,yi);be(this,Zt);be(this,Pl);be(this,er);be(this,Na);be(this,dl);be(this,bi);be(this,tr);be(this,nr);be(this,es);be(this,ts);be(this,fl);be(this,ar,new Set);this.options=i,me(this,ln,r),me(this,dl,null),me(this,Na,qd()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Be).addObserver(this),Ux(_(this,Be),this.options)?Re(this,Ke,mi).call(this):this.updateResult(),Re(this,Ke,$d).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zd(_(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zd(_(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,Ke,Kd).call(this),Re(this,Ke,Xd).call(this),_(this,Be).removeObserver(this)}setOptions(r){const i=this.options,u=_(this,Be);if(this.options=_(this,ln).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Mn(this.options.enabled,_(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,Ke,Vd).call(this),_(this,Be).setOptions(this.options),i._defaulted&&!tu(this.options,i)&&_(this,ln).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Be),observer:this});const d=this.hasListeners();d&&Lx(_(this,Be),u,this.options,i)&&Re(this,Ke,mi).call(this),this.updateResult(),d&&(_(this,Be)!==u||Mn(this.options.enabled,_(this,Be))!==Mn(i.enabled,_(this,Be))||gl(this.options.staleTime,_(this,Be))!==gl(i.staleTime,_(this,Be)))&&Re(this,Ke,Qd).call(this);const f=Re(this,Ke,Gd).call(this);d&&(_(this,Be)!==u||Mn(this.options.enabled,_(this,Be))!==Mn(i.enabled,_(this,Be))||f!==_(this,fl))&&Re(this,Ke,Yd).call(this,f)}getOptimisticResult(r){const i=_(this,ln).getQueryCache().build(_(this,ln),r),u=this.createResult(i,r);return jb(this,u)&&(me(this,Zt,u),me(this,er,this.options),me(this,Pl,_(this,Be).state)),u}getCurrentResult(){return _(this,Zt)}trackResult(r,i){return new Proxy(r,{get:(u,d)=>(this.trackProp(d),i==null||i(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,Na).status==="pending"&&_(this,Na).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(r){_(this,ar).add(r)}getCurrentQuery(){return _(this,Be)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const i=_(this,ln).defaultQueryOptions(r),u=_(this,ln).getQueryCache().build(_(this,ln),i);return u.fetch().then(()=>this.createResult(u,i))}fetch(r){return Re(this,Ke,mi).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Zt)))}createResult(r,i){var se;const u=_(this,Be),d=this.options,f=_(this,Zt),x=_(this,Pl),m=_(this,er),g=r!==u?r.state:_(this,yi),{state:y}=r;let v={...y},w=!1,k;if(i._optimisticResults){const I=this.hasListeners(),oe=!I&&Ux(r,i),Y=I&&Lx(r,u,i,d);(oe||Y)&&(v={...v,..._g(y.data,r.options)}),i._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:E,errorUpdatedAt:O,status:A}=v;k=v.data;let z=!1;if(i.placeholderData!==void 0&&k===void 0&&A==="pending"){let I;f!=null&&f.isPlaceholderData&&i.placeholderData===(m==null?void 0:m.placeholderData)?(I=f.data,z=!0):I=typeof i.placeholderData=="function"?i.placeholderData((se=_(this,nr))==null?void 0:se.state.data,_(this,nr)):i.placeholderData,I!==void 0&&(A="success",k=Hd(f==null?void 0:f.data,I,i),w=!0)}if(i.select&&k!==void 0&&!z)if(f&&k===(x==null?void 0:x.data)&&i.select===_(this,bi))k=_(this,tr);else try{me(this,bi,i.select),k=i.select(k),k=Hd(f==null?void 0:f.data,k,i),me(this,tr,k),me(this,dl,null)}catch(I){me(this,dl,I)}_(this,dl)&&(E=_(this,dl),k=_(this,tr),O=Date.now(),A="error");const V=v.fetchStatus==="fetching",N=A==="pending",S=A==="error",M=N&&V,U=k!==void 0,le={status:A,fetchStatus:v.fetchStatus,isPending:N,isSuccess:A==="success",isError:S,isInitialLoading:M,isLoading:M,data:k,dataUpdatedAt:v.dataUpdatedAt,error:E,errorUpdatedAt:O,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:V,isRefetching:V&&!N,isLoadingError:S&&!U,isPaused:v.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:S&&U,isStale:mf(r,i),refetch:this.refetch,promise:_(this,Na),isEnabled:Mn(i.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const I=le.data!==void 0,oe=le.status==="error"&&!I,Y=G=>{oe?G.reject(le.error):I&&G.resolve(le.data)},ne=()=>{const G=me(this,Na,le.promise=qd());Y(G)},Q=_(this,Na);switch(Q.status){case"pending":r.queryHash===u.queryHash&&Y(Q);break;case"fulfilled":(oe||le.data!==Q.value)&&ne();break;case"rejected":(!oe||le.error!==Q.reason)&&ne();break}}return le}updateResult(){const r=_(this,Zt),i=this.createResult(_(this,Be),this.options);if(me(this,Pl,_(this,Be).state),me(this,er,this.options),_(this,Pl).data!==void 0&&me(this,nr,_(this,Be)),tu(i,r))return;me(this,Zt,i);const u=()=>{if(!r)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!_(this,ar).size)return!0;const x=new Set(f??_(this,ar));return this.options.throwOnError&&x.add("error"),Object.keys(_(this,Zt)).some(m=>{const h=m;return _(this,Zt)[h]!==r[h]&&x.has(h)})};Re(this,Ke,zg).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,Ke,$d).call(this)}},ln=new WeakMap,Be=new WeakMap,yi=new WeakMap,Zt=new WeakMap,Pl=new WeakMap,er=new WeakMap,Na=new WeakMap,dl=new WeakMap,bi=new WeakMap,tr=new WeakMap,nr=new WeakMap,es=new WeakMap,ts=new WeakMap,fl=new WeakMap,ar=new WeakMap,Ke=new WeakSet,mi=function(r){Re(this,Ke,Vd).call(this);let i=_(this,Be).fetch(this.options,r);return r!=null&&r.throwOnError||(i=i.catch(Ft)),i},Qd=function(){Re(this,Ke,Kd).call(this);const r=gl(this.options.staleTime,_(this,Be));if(as||_(this,Zt).isStale||!Ud(r))return;const u=kg(_(this,Zt).dataUpdatedAt,r)+1;me(this,es,Vl.setTimeout(()=>{_(this,Zt).isStale||this.updateResult()},u))},Gd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Be)):this.options.refetchInterval)??!1},Yd=function(r){Re(this,Ke,Xd).call(this),me(this,fl,r),!(as||Mn(this.options.enabled,_(this,Be))===!1||!Ud(_(this,fl))||_(this,fl)===0)&&me(this,ts,Vl.setInterval(()=>{(this.options.refetchIntervalInBackground||hf.isFocused())&&Re(this,Ke,mi).call(this)},_(this,fl)))},$d=function(){Re(this,Ke,Qd).call(this),Re(this,Ke,Yd).call(this,Re(this,Ke,Gd).call(this))},Kd=function(){_(this,es)&&(Vl.clearTimeout(_(this,es)),me(this,es,void 0))},Xd=function(){_(this,ts)&&(Vl.clearInterval(_(this,ts)),me(this,ts,void 0))},Vd=function(){const r=_(this,ln).getQueryCache().build(_(this,ln),this.options);if(r===_(this,Be))return;const i=_(this,Be);me(this,Be,r),me(this,yi,r.state),this.hasListeners()&&(i==null||i.removeObserver(this),r.addObserver(this))},zg=function(r){wt.batch(()=>{r.listeners&&this.listeners.forEach(i=>{i(_(this,Zt))}),_(this,ln).getQueryCache().notify({query:_(this,Be),type:"observerResultsUpdated"})})},jg);function bb(l,r){return Mn(r.enabled,l)!==!1&&l.state.data===void 0&&!(l.state.status==="error"&&r.retryOnMount===!1)}function Ux(l,r){return bb(l,r)||l.state.data!==void 0&&Zd(l,r,r.refetchOnMount)}function Zd(l,r,i){if(Mn(r.enabled,l)!==!1&&gl(r.staleTime,l)!=="static"){const u=typeof i=="function"?i(l):i;return u==="always"||u!==!1&&mf(l,r)}return!1}function Lx(l,r,i,u){return(l!==r||Mn(u.enabled,l)===!1)&&(!i.suspense||l.state.status!=="error")&&mf(l,i)}function mf(l,r){return Mn(r.enabled,l)!==!1&&l.isStaleByTime(gl(r.staleTime,l))}function jb(l,r){return!tu(l.getCurrentResult(),r)}function Hx(l){return{onFetch:(r,i)=>{var y,v,w,k,E;const u=r.options,d=(w=(v=(y=r.fetchOptions)==null?void 0:y.meta)==null?void 0:v.fetchMore)==null?void 0:w.direction,f=((k=r.state.data)==null?void 0:k.pages)||[],x=((E=r.state.data)==null?void 0:E.pageParams)||[];let m={pages:[],pageParams:[]},h=0;const g=async()=>{let O=!1;const A=N=>{fb(N,()=>r.signal,()=>O=!0)},z=Mg(r.options,r.fetchOptions),V=async(N,S,M)=>{if(O)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const D=(()=>{const oe={client:r.client,queryKey:r.queryKey,pageParam:S,direction:M?"backward":"forward",meta:r.options.meta};return A(oe),oe})(),le=await z(D),{maxPages:se}=r.options,I=M?db:cb;return{pages:I(N.pages,le,se),pageParams:I(N.pageParams,S,se)}};if(d&&f.length){const N=d==="backward",S=N?Nb:qx,M={pages:f,pageParams:x},U=S(u,M);m=await V(M,U,N)}else{const N=l??f.length;do{const S=h===0?x[0]??u.initialPageParam:qx(u,m);if(h>0&&S==null)break;m=await V(m,S),h++}while(h<N)}return m};r.options.persister?r.fetchFn=()=>{var O,A;return(A=(O=r.options).persister)==null?void 0:A.call(O,g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},i)}:r.fetchFn=g}}}function qx(l,{pages:r,pageParams:i}){const u=r.length-1;return r.length>0?l.getNextPageParam(r[u],r,i[u],i):void 0}function Nb(l,{pages:r,pageParams:i}){var u;return r.length>0?(u=l.getPreviousPageParam)==null?void 0:u.call(l,r[0],r,i[0],i):void 0}var ji,Jn,Gt,ns,In,il,Ng,Sb=(Ng=class extends Og{constructor(r){super();be(this,In);be(this,ji);be(this,Jn);be(this,Gt);be(this,ns);me(this,ji,r.client),this.mutationId=r.mutationId,me(this,Gt,r.mutationCache),me(this,Jn,[]),this.state=r.state||Dg(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){_(this,Jn).includes(r)||(_(this,Jn).push(r),this.clearGcTimeout(),_(this,Gt).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){me(this,Jn,_(this,Jn).filter(i=>i!==r)),this.scheduleGc(),_(this,Gt).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){_(this,Jn).length||(this.state.status==="pending"?this.scheduleGc():_(this,Gt).remove(this))}continue(){var r;return((r=_(this,ns))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var x,m,h,g,y,v,w,k,E,O,A,z,V,N,S,M,U,D;const i=()=>{Re(this,In,il).call(this,{type:"continue"})},u={client:_(this,ji),meta:this.options.meta,mutationKey:this.options.mutationKey};me(this,ns,Rg({fn:()=>this.options.mutationFn?this.options.mutationFn(r,u):Promise.reject(new Error("No mutationFn found")),onFail:(le,se)=>{Re(this,In,il).call(this,{type:"failed",failureCount:le,error:se})},onPause:()=>{Re(this,In,il).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Gt).canRun(this)}));const d=this.state.status==="pending",f=!_(this,ns).canStart();try{if(d)i();else{Re(this,In,il).call(this,{type:"pending",variables:r,isPaused:f}),_(this,Gt).config.onMutate&&await _(this,Gt).config.onMutate(r,this,u);const se=await((m=(x=this.options).onMutate)==null?void 0:m.call(x,r,u));se!==this.state.context&&Re(this,In,il).call(this,{type:"pending",context:se,variables:r,isPaused:f})}const le=await _(this,ns).start();return await((g=(h=_(this,Gt).config).onSuccess)==null?void 0:g.call(h,le,r,this.state.context,this,u)),await((v=(y=this.options).onSuccess)==null?void 0:v.call(y,le,r,this.state.context,u)),await((k=(w=_(this,Gt).config).onSettled)==null?void 0:k.call(w,le,null,this.state.variables,this.state.context,this,u)),await((O=(E=this.options).onSettled)==null?void 0:O.call(E,le,null,r,this.state.context,u)),Re(this,In,il).call(this,{type:"success",data:le}),le}catch(le){try{await((z=(A=_(this,Gt).config).onError)==null?void 0:z.call(A,le,r,this.state.context,this,u))}catch(se){Promise.reject(se)}try{await((N=(V=this.options).onError)==null?void 0:N.call(V,le,r,this.state.context,u))}catch(se){Promise.reject(se)}try{await((M=(S=_(this,Gt).config).onSettled)==null?void 0:M.call(S,void 0,le,this.state.variables,this.state.context,this,u))}catch(se){Promise.reject(se)}try{await((D=(U=this.options).onSettled)==null?void 0:D.call(U,void 0,le,r,this.state.context,u))}catch(se){Promise.reject(se)}throw Re(this,In,il).call(this,{type:"error",error:le}),le}finally{_(this,Gt).runNext(this)}}},ji=new WeakMap,Jn=new WeakMap,Gt=new WeakMap,ns=new WeakMap,In=new WeakSet,il=function(r){const i=u=>{switch(r.type){case"failed":return{...u,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...u,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:r.error,failureCount:u.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=i(this.state),wt.batch(()=>{_(this,Jn).forEach(u=>{u.onMutationUpdate(r)}),_(this,Gt).notify({mutation:this,type:"updated",action:r})})},Ng);function Dg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sa,qn,Ni,Sg,wb=(Sg=class extends dr{constructor(r={}){super();be(this,Sa);be(this,qn);be(this,Ni);this.config=r,me(this,Sa,new Set),me(this,qn,new Map),me(this,Ni,0)}build(r,i,u){const d=new Sb({client:r,mutationCache:this,mutationId:++Ko(this,Ni)._,options:r.defaultMutationOptions(i),state:u});return this.add(d),d}add(r){_(this,Sa).add(r);const i=Xo(r);if(typeof i=="string"){const u=_(this,qn).get(i);u?u.push(r):_(this,qn).set(i,[r])}this.notify({type:"added",mutation:r})}remove(r){if(_(this,Sa).delete(r)){const i=Xo(r);if(typeof i=="string"){const u=_(this,qn).get(i);if(u)if(u.length>1){const d=u.indexOf(r);d!==-1&&u.splice(d,1)}else u[0]===r&&_(this,qn).delete(i)}}this.notify({type:"removed",mutation:r})}canRun(r){const i=Xo(r);if(typeof i=="string"){const u=_(this,qn).get(i),d=u==null?void 0:u.find(f=>f.state.status==="pending");return!d||d===r}else return!0}runNext(r){var u;const i=Xo(r);if(typeof i=="string"){const d=(u=_(this,qn).get(i))==null?void 0:u.find(f=>f!==r&&f.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{_(this,Sa).forEach(r=>{this.notify({type:"removed",mutation:r})}),_(this,Sa).clear(),_(this,qn).clear()})}getAll(){return Array.from(_(this,Sa))}find(r){const i={exact:!0,...r};return this.getAll().find(u=>Rx(i,u))}findAll(r={}){return this.getAll().filter(i=>Rx(r,i))}notify(r){wt.batch(()=>{this.listeners.forEach(i=>{i(r)})})}resumePausedMutations(){const r=this.getAll().filter(i=>i.state.isPaused);return wt.batch(()=>Promise.all(r.map(i=>i.continue().catch(Ft))))}},Sa=new WeakMap,qn=new WeakMap,Ni=new WeakMap,Sg);function Xo(l){var r;return(r=l.options.scope)==null?void 0:r.id}var wa,hl,sn,Ea,ka,Io,Fd,wg,Eb=(wg=class extends dr{constructor(i,u){super();be(this,ka);be(this,wa);be(this,hl);be(this,sn);be(this,Ea);me(this,wa,i),this.setOptions(u),this.bindMethods(),Re(this,ka,Io).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var d;const u=this.options;this.options=_(this,wa).defaultMutationOptions(i),tu(this.options,u)||_(this,wa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,sn),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&ls(u.mutationKey)!==ls(this.options.mutationKey)?this.reset():((d=_(this,sn))==null?void 0:d.state.status)==="pending"&&_(this,sn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=_(this,sn))==null||i.removeObserver(this)}onMutationUpdate(i){Re(this,ka,Io).call(this),Re(this,ka,Fd).call(this,i)}getCurrentResult(){return _(this,hl)}reset(){var i;(i=_(this,sn))==null||i.removeObserver(this),me(this,sn,void 0),Re(this,ka,Io).call(this),Re(this,ka,Fd).call(this)}mutate(i,u){var d;return me(this,Ea,u),(d=_(this,sn))==null||d.removeObserver(this),me(this,sn,_(this,wa).getMutationCache().build(_(this,wa),this.options)),_(this,sn).addObserver(this),_(this,sn).execute(i)}},wa=new WeakMap,hl=new WeakMap,sn=new WeakMap,Ea=new WeakMap,ka=new WeakSet,Io=function(){var u;const i=((u=_(this,sn))==null?void 0:u.state)??Dg();me(this,hl,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},Fd=function(i){wt.batch(()=>{var u,d,f,x,m,h,g,y;if(_(this,Ea)&&this.hasListeners()){const v=_(this,hl).variables,w=_(this,hl).context,k={client:_(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(d=(u=_(this,Ea)).onSuccess)==null||d.call(u,i.data,v,w,k)}catch(E){Promise.reject(E)}try{(x=(f=_(this,Ea)).onSettled)==null||x.call(f,i.data,null,v,w,k)}catch(E){Promise.reject(E)}}else if((i==null?void 0:i.type)==="error"){try{(h=(m=_(this,Ea)).onError)==null||h.call(m,i.error,v,w,k)}catch(E){Promise.reject(E)}try{(y=(g=_(this,Ea)).onSettled)==null||y.call(g,void 0,i.error,v,w,k)}catch(E){Promise.reject(E)}}}this.listeners.forEach(v=>{v(_(this,hl))})})},wg),Wn,Eg,Cb=(Eg=class extends dr{constructor(r={}){super();be(this,Wn);this.config=r,me(this,Wn,new Map)}build(r,i,u){const d=i.queryKey,f=i.queryHash??cf(d,i);let x=this.get(f);return x||(x=new vb({client:r,queryKey:d,queryHash:f,options:r.defaultQueryOptions(i),state:u,defaultOptions:r.getQueryDefaults(d)}),this.add(x)),x}add(r){_(this,Wn).has(r.queryHash)||(_(this,Wn).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const i=_(this,Wn).get(r.queryHash);i&&(r.destroy(),i===r&&_(this,Wn).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){wt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return _(this,Wn).get(r)}getAll(){return[..._(this,Wn).values()]}find(r){const i={exact:!0,...r};return this.getAll().find(u=>Ax(i,u))}findAll(r={}){const i=this.getAll();return Object.keys(r).length>0?i.filter(u=>Ax(r,u)):i}notify(r){wt.batch(()=>{this.listeners.forEach(i=>{i(r)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},Wn=new WeakMap,Eg),pt,ml,pl,lr,sr,xl,rr,ir,Cg,kb=(Cg=class{constructor(l={}){be(this,pt);be(this,ml);be(this,pl);be(this,lr);be(this,sr);be(this,xl);be(this,rr);be(this,ir);me(this,pt,l.queryCache||new Cb),me(this,ml,l.mutationCache||new wb),me(this,pl,l.defaultOptions||{}),me(this,lr,new Map),me(this,sr,new Map),me(this,xl,0)}mount(){Ko(this,xl)._++,_(this,xl)===1&&(me(this,rr,hf.subscribe(async l=>{l&&(await this.resumePausedMutations(),_(this,pt).onFocus())})),me(this,ir,nu.subscribe(async l=>{l&&(await this.resumePausedMutations(),_(this,pt).onOnline())})))}unmount(){var l,r;Ko(this,xl)._--,_(this,xl)===0&&((l=_(this,rr))==null||l.call(this),me(this,rr,void 0),(r=_(this,ir))==null||r.call(this),me(this,ir,void 0))}isFetching(l){return _(this,pt).findAll({...l,fetchStatus:"fetching"}).length}isMutating(l){return _(this,ml).findAll({...l,status:"pending"}).length}getQueryData(l){var i;const r=this.defaultQueryOptions({queryKey:l});return(i=_(this,pt).get(r.queryHash))==null?void 0:i.state.data}ensureQueryData(l){const r=this.defaultQueryOptions(l),i=_(this,pt).build(this,r),u=i.state.data;return u===void 0?this.fetchQuery(l):(l.revalidateIfStale&&i.isStaleByTime(gl(r.staleTime,i))&&this.prefetchQuery(r),Promise.resolve(u))}getQueriesData(l){return _(this,pt).findAll(l).map(({queryKey:r,state:i})=>{const u=i.data;return[r,u]})}setQueryData(l,r,i){const u=this.defaultQueryOptions({queryKey:l}),d=_(this,pt).get(u.queryHash),f=d==null?void 0:d.state.data,x=ib(r,f);if(x!==void 0)return _(this,pt).build(this,u).setData(x,{...i,manual:!0})}setQueriesData(l,r,i){return wt.batch(()=>_(this,pt).findAll(l).map(({queryKey:u})=>[u,this.setQueryData(u,r,i)]))}getQueryState(l){var i;const r=this.defaultQueryOptions({queryKey:l});return(i=_(this,pt).get(r.queryHash))==null?void 0:i.state}removeQueries(l){const r=_(this,pt);wt.batch(()=>{r.findAll(l).forEach(i=>{r.remove(i)})})}resetQueries(l,r){const i=_(this,pt);return wt.batch(()=>(i.findAll(l).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...l},r)))}cancelQueries(l,r={}){const i={revert:!0,...r},u=wt.batch(()=>_(this,pt).findAll(l).map(d=>d.cancel(i)));return Promise.all(u).then(Ft).catch(Ft)}invalidateQueries(l,r={}){return wt.batch(()=>(_(this,pt).findAll(l).forEach(i=>{i.invalidate()}),(l==null?void 0:l.refetchType)==="none"?Promise.resolve():this.refetchQueries({...l,type:(l==null?void 0:l.refetchType)??(l==null?void 0:l.type)??"active"},r)))}refetchQueries(l,r={}){const i={...r,cancelRefetch:r.cancelRefetch??!0},u=wt.batch(()=>_(this,pt).findAll(l).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,i);return i.throwOnError||(f=f.catch(Ft)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(u).then(Ft)}fetchQuery(l){const r=this.defaultQueryOptions(l);r.retry===void 0&&(r.retry=!1);const i=_(this,pt).build(this,r);return i.isStaleByTime(gl(r.staleTime,i))?i.fetch(r):Promise.resolve(i.state.data)}prefetchQuery(l){return this.fetchQuery(l).then(Ft).catch(Ft)}fetchInfiniteQuery(l){return l.behavior=Hx(l.pages),this.fetchQuery(l)}prefetchInfiniteQuery(l){return this.fetchInfiniteQuery(l).then(Ft).catch(Ft)}ensureInfiniteQueryData(l){return l.behavior=Hx(l.pages),this.ensureQueryData(l)}resumePausedMutations(){return nu.isOnline()?_(this,ml).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,pt)}getMutationCache(){return _(this,ml)}getDefaultOptions(){return _(this,pl)}setDefaultOptions(l){me(this,pl,l)}setQueryDefaults(l,r){_(this,lr).set(ls(l),{queryKey:l,defaultOptions:r})}getQueryDefaults(l){const r=[..._(this,lr).values()],i={};return r.forEach(u=>{pi(l,u.queryKey)&&Object.assign(i,u.defaultOptions)}),i}setMutationDefaults(l,r){_(this,sr).set(ls(l),{mutationKey:l,defaultOptions:r})}getMutationDefaults(l){const r=[..._(this,sr).values()],i={};return r.forEach(u=>{pi(l,u.mutationKey)&&Object.assign(i,u.defaultOptions)}),i}defaultQueryOptions(l){if(l._defaulted)return l;const r={..._(this,pl).queries,...this.getQueryDefaults(l.queryKey),...l,_defaulted:!0};return r.queryHash||(r.queryHash=cf(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===df&&(r.enabled=!1),r}defaultMutationOptions(l){return l!=null&&l._defaulted?l:{..._(this,pl).mutations,...(l==null?void 0:l.mutationKey)&&this.getMutationDefaults(l.mutationKey),...l,_defaulted:!0}}clear(){_(this,pt).clear(),_(this,ml).clear()}},pt=new WeakMap,ml=new WeakMap,pl=new WeakMap,lr=new WeakMap,sr=new WeakMap,xl=new WeakMap,rr=new WeakMap,ir=new WeakMap,Cg),Ug=b.createContext(void 0),Si=l=>{const r=b.useContext(Ug);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},Tb=({client:l,children:r})=>(b.useEffect(()=>(l.mount(),()=>{l.unmount()}),[l]),a.jsx(Ug.Provider,{value:l,children:r})),Lg=b.createContext(!1),Mb=()=>b.useContext(Lg);Lg.Provider;function Ab(){let l=!1;return{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l}}var Rb=b.createContext(Ab()),Ob=()=>b.useContext(Rb),_b=(l,r,i)=>{const u=i!=null&&i.state.error&&typeof l.throwOnError=="function"?ff(l.throwOnError,[i.state.error,i]):l.throwOnError;(l.suspense||l.experimental_prefetchInRender||u)&&(r.isReset()||(l.retryOnMount=!1))},zb=l=>{b.useEffect(()=>{l.clearReset()},[l])},Db=({result:l,errorResetBoundary:r,throwOnError:i,query:u,suspense:d})=>l.isError&&!r.isReset()&&!l.isFetching&&u&&(d&&l.data===void 0||ff(i,[l.error,u])),Ub=l=>{if(l.suspense){const i=d=>d==="static"?d:Math.max(d??1e3,1e3),u=l.staleTime;l.staleTime=typeof u=="function"?(...d)=>i(u(...d)):i(u),typeof l.gcTime=="number"&&(l.gcTime=Math.max(l.gcTime,1e3))}},Lb=(l,r)=>l.isLoading&&l.isFetching&&!r,Hb=(l,r)=>(l==null?void 0:l.suspense)&&r.isPending,Bx=(l,r,i)=>r.fetchOptimistic(l).catch(()=>{i.clearReset()});function qb(l,r,i){var w,k,E,O;const u=Mb(),d=Ob(),f=Si(),x=f.defaultQueryOptions(l);(k=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||k.call(w,x);const m=f.getQueryCache().get(x.queryHash);x._optimisticResults=u?"isRestoring":"optimistic",Ub(x),_b(x,d,m),zb(d);const h=!f.getQueryCache().get(x.queryHash),[g]=b.useState(()=>new r(f,x)),y=g.getOptimisticResult(x),v=!u&&l.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(A=>{const z=v?g.subscribe(wt.batchCalls(A)):Ft;return g.updateResult(),z},[g,v]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),b.useEffect(()=>{g.setOptions(x)},[x,g]),Hb(x,y))throw Bx(x,g,d);if(Db({result:y,errorResetBoundary:d,throwOnError:x.throwOnError,query:m,suspense:x.suspense}))throw y.error;if((O=(E=f.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||O.call(E,x,y),x.experimental_prefetchInRender&&!as&&Lb(y,u)){const A=h?Bx(x,g,d):m==null?void 0:m.promise;A==null||A.catch(Ft).finally(()=>{g.updateResult()})}return x.notifyOnChangeProps?y:g.trackResult(y)}function gn(l,r){return qb(l,yb)}function Jd(l,r){const i=Si(),[u]=b.useState(()=>new Eb(i,l));b.useEffect(()=>{u.setOptions(l)},[u,l]);const d=b.useSyncExternalStore(b.useCallback(x=>u.subscribe(wt.batchCalls(x)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),f=b.useCallback((x,m)=>{u.mutate(x,m).catch(Ft)},[u]);if(d.error&&ff(u.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}const Bb=new kb({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),pf="axl.studio.theme",Hg="(prefers-color-scheme: dark)",Qx="dark",Qb=["auto","light","dark"];function xf(){try{const l=localStorage.getItem(pf);if(l&&Qb.includes(l))return l}catch{}return"auto"}function Gb(l){try{localStorage.setItem(pf,l)}catch{}}function Yb(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia(Hg).matches?"dark":"light"}function gf(l){return l==="auto"?Yb():l}function vf(l){if(typeof document>"u")return;const r=document.documentElement;l==="dark"?r.classList.add(Qx):r.classList.remove(Qx)}function qg(l){if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(Hg),i=()=>{const d=xf();l(d,gf(d))},u=d=>{d.key!==null&&d.key!==pf||i()};return r.addEventListener("change",i),window.addEventListener("storage",u),()=>{r.removeEventListener("change",i),window.removeEventListener("storage",u)}}function $b(){return qg((l,r)=>{vf(r)})}function Kb(l){return l==="auto"?"light":l==="light"?"dark":"auto"}/**
50
+ * react-router v7.13.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Gx="popstate";function Xb(l={}){function r(u,d){let{pathname:f,search:x,hash:m}=u.location;return Id("",{pathname:f,search:x,hash:m},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function i(u,d){return typeof d=="string"?d:xi(d)}return Zb(r,i,null,l)}function ct(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function Qn(l,r){if(!l){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Vb(){return Math.random().toString(36).substring(2,10)}function Yx(l,r){return{usr:l.state,key:l.key,idx:r}}function Id(l,r,i=null,u){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof r=="string"?fr(r):r,state:i,key:r&&r.key||u||Vb()}}function xi({pathname:l="/",search:r="",hash:i=""}){return r&&r!=="?"&&(l+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(l+=i.charAt(0)==="#"?i:"#"+i),l}function fr(l){let r={};if(l){let i=l.indexOf("#");i>=0&&(r.hash=l.substring(i),l=l.substring(0,i));let u=l.indexOf("?");u>=0&&(r.search=l.substring(u),l=l.substring(0,u)),l&&(r.pathname=l)}return r}function Zb(l,r,i,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,x=d.history,m="POP",h=null,g=y();g==null&&(g=0,x.replaceState({...x.state,idx:g},""));function y(){return(x.state||{idx:null}).idx}function v(){m="POP";let A=y(),z=A==null?null:A-g;g=A,h&&h({action:m,location:O.location,delta:z})}function w(A,z){m="PUSH";let V=Id(O.location,A,z);g=y()+1;let N=Yx(V,g),S=O.createHref(V);try{x.pushState(N,"",S)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;d.location.assign(S)}f&&h&&h({action:m,location:O.location,delta:1})}function k(A,z){m="REPLACE";let V=Id(O.location,A,z);g=y();let N=Yx(V,g),S=O.createHref(V);x.replaceState(N,"",S),f&&h&&h({action:m,location:O.location,delta:0})}function E(A){return Fb(A)}let O={get action(){return m},get location(){return l(d,x)},listen(A){if(h)throw new Error("A history only accepts one active listener");return d.addEventListener(Gx,v),h=A,()=>{d.removeEventListener(Gx,v),h=null}},createHref(A){return r(d,A)},createURL:E,encodeLocation(A){let z=E(A);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:w,replace:k,go(A){return x.go(A)}};return O}function Fb(l,r=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ct(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:xi(l);return u=u.replace(/ $/,"%20"),!r&&u.startsWith("//")&&(u=i+u),new URL(u,i)}function Bg(l,r,i="/"){return Jb(l,r,i,!1)}function Jb(l,r,i,u){let d=typeof r=="string"?fr(r):r,f=Ta(d.pathname||"/",i);if(f==null)return null;let x=Qg(l);Ib(x);let m=null;for(let h=0;m==null&&h<x.length;++h){let g=o1(f);m=r1(x[h],g,u)}return m}function Qg(l,r=[],i=[],u="",d=!1){let f=(x,m,h=d,g)=>{let y={relativePath:g===void 0?x.path||"":g,caseSensitive:x.caseSensitive===!0,childrenIndex:m,route:x};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(u)&&h)return;ct(y.relativePath.startsWith(u),`Absolute route path "${y.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(u.length)}let v=Ca([u,y.relativePath]),w=i.concat(y);x.children&&x.children.length>0&&(ct(x.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Qg(x.children,r,w,v,h)),!(x.path==null&&!x.index)&&r.push({path:v,score:l1(v,x.index),routesMeta:w})};return l.forEach((x,m)=>{var h;if(x.path===""||!((h=x.path)!=null&&h.includes("?")))f(x,m);else for(let g of Gg(x.path))f(x,m,!0,g)}),r}function Gg(l){let r=l.split("/");if(r.length===0)return[];let[i,...u]=r,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let x=Gg(u.join("/")),m=[];return m.push(...x.map(h=>h===""?f:[f,h].join("/"))),d&&m.push(...x),m.map(h=>l.startsWith("/")&&h===""?"/":h)}function Ib(l){l.sort((r,i)=>r.score!==i.score?i.score-r.score:s1(r.routesMeta.map(u=>u.childrenIndex),i.routesMeta.map(u=>u.childrenIndex)))}var Wb=/^:[\w-]+$/,Pb=3,e1=2,t1=1,n1=10,a1=-2,$x=l=>l==="*";function l1(l,r){let i=l.split("/"),u=i.length;return i.some($x)&&(u+=a1),r&&(u+=e1),i.filter(d=>!$x(d)).reduce((d,f)=>d+(Wb.test(f)?Pb:f===""?t1:n1),u)}function s1(l,r){return l.length===r.length&&l.slice(0,-1).every((u,d)=>u===r[d])?l[l.length-1]-r[r.length-1]:0}function r1(l,r,i=!1){let{routesMeta:u}=l,d={},f="/",x=[];for(let m=0;m<u.length;++m){let h=u[m],g=m===u.length-1,y=f==="/"?r:r.slice(f.length)||"/",v=au({path:h.relativePath,caseSensitive:h.caseSensitive,end:g},y),w=h.route;if(!v&&g&&i&&!u[u.length-1].route.index&&(v=au({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!v)return null;Object.assign(d,v.params),x.push({params:d,pathname:Ca([f,v.pathname]),pathnameBase:f1(Ca([f,v.pathnameBase])),route:w}),v.pathnameBase!=="/"&&(f=Ca([f,v.pathnameBase]))}return x}function au(l,r){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[i,u]=i1(l.path,l.caseSensitive,l.end),d=r.match(i);if(!d)return null;let f=d[0],x=f.replace(/(.)\/+$/,"$1"),m=d.slice(1);return{params:u.reduce((g,{paramName:y,isOptional:v},w)=>{if(y==="*"){let E=m[w]||"";x=f.slice(0,f.length-E.length).replace(/(.)\/+$/,"$1")}const k=m[w];return v&&!k?g[y]=void 0:g[y]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:x,pattern:l}}function i1(l,r=!1,i=!0){Qn(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let u=[],d="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,m,h)=>(u.push({paramName:m,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(u.push({paramName:"*"}),d+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":l!==""&&l!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,r?void 0:"i"),u]}function o1(l){try{return l.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Qn(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),l}}function Ta(l,r){if(r==="/")return l;if(!l.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,u=l.charAt(i);return u&&u!=="/"?null:l.slice(i)||"/"}var u1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function c1(l,r="/"){let{pathname:i,search:u="",hash:d=""}=typeof l=="string"?fr(l):l,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=Kx(i.substring(1),"/"):f=Kx(i,r)):f=r,{pathname:f,search:h1(u),hash:m1(d)}}function Kx(l,r){let i=r.replace(/\/+$/,"").split("/");return l.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function Td(l,r,i,u){return`Cannot include a '${l}' character in a manually specified \`to.${r}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function d1(l){return l.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function yf(l){let r=d1(l);return r.map((i,u)=>u===r.length-1?i.pathname:i.pathnameBase)}function bf(l,r,i,u=!1){let d;typeof l=="string"?d=fr(l):(d={...l},ct(!d.pathname||!d.pathname.includes("?"),Td("?","pathname","search",d)),ct(!d.pathname||!d.pathname.includes("#"),Td("#","pathname","hash",d)),ct(!d.search||!d.search.includes("#"),Td("#","search","hash",d)));let f=l===""||d.pathname==="",x=f?"/":d.pathname,m;if(x==null)m=i;else{let v=r.length-1;if(!u&&x.startsWith("..")){let w=x.split("/");for(;w[0]==="..";)w.shift(),v-=1;d.pathname=w.join("/")}m=v>=0?r[v]:"/"}let h=c1(d,m),g=x&&x!=="/"&&x.endsWith("/"),y=(f||x===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(g||y)&&(h.pathname+="/"),h}var Ca=l=>l.join("/").replace(/\/\/+/g,"/"),f1=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),h1=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,m1=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,p1=class{constructor(l,r,i,u=!1){this.status=l,this.statusText=r||"",this.internal=u,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function x1(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function g1(l){return l.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Yg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $g(l,r){let i=l;if(typeof i!="string"||!u1.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let u=i,d=!1;if(Yg)try{let f=new URL(window.location.href),x=i.startsWith("//")?new URL(f.protocol+i):new URL(i),m=Ta(x.pathname,r);x.origin===f.origin&&m!=null?i=m+x.search+x.hash:d=!0}catch{Qn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Kg=["POST","PUT","PATCH","DELETE"];new Set(Kg);var v1=["GET",...Kg];new Set(v1);var hr=b.createContext(null);hr.displayName="DataRouter";var iu=b.createContext(null);iu.displayName="DataRouterState";var y1=b.createContext(!1),Xg=b.createContext({isTransitioning:!1});Xg.displayName="ViewTransition";var b1=b.createContext(new Map);b1.displayName="Fetchers";var j1=b.createContext(null);j1.displayName="Await";var yn=b.createContext(null);yn.displayName="Navigation";var wi=b.createContext(null);wi.displayName="Location";var Pn=b.createContext({outlet:null,matches:[],isDataRoute:!1});Pn.displayName="Route";var jf=b.createContext(null);jf.displayName="RouteError";var Vg="REACT_ROUTER_ERROR",N1="REDIRECT",S1="ROUTE_ERROR_RESPONSE";function w1(l){if(l.startsWith(`${Vg}:${N1}:{`))try{let r=JSON.parse(l.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function E1(l){if(l.startsWith(`${Vg}:${S1}:{`))try{let r=JSON.parse(l.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new p1(r.status,r.statusText,r.data)}catch{}}function C1(l,{relative:r}={}){ct(mr(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:u}=b.useContext(yn),{hash:d,pathname:f,search:x}=Ei(l,{relative:r}),m=f;return i!=="/"&&(m=f==="/"?i:Ca([i,f])),u.createHref({pathname:m,search:x,hash:d})}function mr(){return b.useContext(wi)!=null}function bl(){return ct(mr(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(wi).location}var Zg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fg(l){b.useContext(yn).static||b.useLayoutEffect(l)}function Jg(){let{isDataRoute:l}=b.useContext(Pn);return l?q1():k1()}function k1(){ct(mr(),"useNavigate() may be used only in the context of a <Router> component.");let l=b.useContext(hr),{basename:r,navigator:i}=b.useContext(yn),{matches:u}=b.useContext(Pn),{pathname:d}=bl(),f=JSON.stringify(yf(u)),x=b.useRef(!1);return Fg(()=>{x.current=!0}),b.useCallback((h,g={})=>{if(Qn(x.current,Zg),!x.current)return;if(typeof h=="number"){i.go(h);return}let y=bf(h,JSON.parse(f),d,g.relative==="path");l==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Ca([r,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[r,i,f,d,l])}b.createContext(null);function Ei(l,{relative:r}={}){let{matches:i}=b.useContext(Pn),{pathname:u}=bl(),d=JSON.stringify(yf(i));return b.useMemo(()=>bf(l,JSON.parse(d),u,r==="path"),[l,d,u,r])}function T1(l,r){return Ig(l,r)}function Ig(l,r,i,u,d){var V;ct(mr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=b.useContext(yn),{matches:x}=b.useContext(Pn),m=x[x.length-1],h=m?m.params:{},g=m?m.pathname:"/",y=m?m.pathnameBase:"/",v=m&&m.route;{let N=v&&v.path||"";Pg(g,!v||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let w=bl(),k;if(r){let N=typeof r=="string"?fr(r):r;ct(y==="/"||((V=N.pathname)==null?void 0:V.startsWith(y)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${y}" but pathname "${N.pathname}" was given in the \`location\` prop.`),k=N}else k=w;let E=k.pathname||"/",O=E;if(y!=="/"){let N=y.replace(/^\//,"").split("/");O="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let A=Bg(l,{pathname:O});Qn(v||A!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),Qn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let z=_1(A&&A.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:Ca([y,f.encodeLocation?f.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:Ca([y,f.encodeLocation?f.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),x,i,u,d);return r&&z?b.createElement(wi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...k},navigationType:"POP"}},z):z}function M1(){let l=H1(),r=x1(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),i=l instanceof Error?l.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},x=null;return console.error("Error handled by React Router default ErrorBoundary:",l),x=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},r),i?b.createElement("pre",{style:d},i):null,x)}var A1=b.createElement(M1,null),Wg=class extends b.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,r){return r.location!==l.location||r.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:r.error,location:r.location,revalidation:l.revalidation||r.revalidation}}componentDidCatch(l,r){this.props.onError?this.props.onError(l,r):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const i=E1(l.digest);i&&(l=i)}let r=l!==void 0?b.createElement(Pn.Provider,{value:this.props.routeContext},b.createElement(jf.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?b.createElement(R1,{error:l},r):r}};Wg.contextType=y1;var Md=new WeakMap;function R1({children:l,error:r}){let{basename:i}=b.useContext(yn);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let u=w1(r.digest);if(u){let d=Md.get(r);if(d)throw d;let f=$g(u.location,i);if(Yg&&!Md.get(r))if(f.isExternal||u.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const x=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:u.replace}));throw Md.set(r,x),x}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return l}function O1({routeContext:l,match:r,children:i}){let u=b.useContext(hr);return u&&u.static&&u.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Pn.Provider,{value:l},i)}function _1(l,r=[],i=null,u=null,d=null){if(l==null){if(!i)return null;if(i.errors)l=i.matches;else if(r.length===0&&!i.initialized&&i.matches.length>0)l=i.matches;else return null}let f=l,x=i==null?void 0:i.errors;if(x!=null){let y=f.findIndex(v=>v.route.id&&(x==null?void 0:x[v.route.id])!==void 0);ct(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let m=!1,h=-1;if(i)for(let y=0;y<f.length;y++){let v=f[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(h=y),v.route.id){let{loaderData:w,errors:k}=i,E=v.route.loader&&!w.hasOwnProperty(v.route.id)&&(!k||k[v.route.id]===void 0);if(v.route.lazy||E){m=!0,h>=0?f=f.slice(0,h+1):f=[f[0]];break}}}let g=i&&u?(y,v)=>{var w,k;u(y,{location:i.location,params:((k=(w=i.matches)==null?void 0:w[0])==null?void 0:k.params)??{},unstable_pattern:g1(i.matches),errorInfo:v})}:void 0;return f.reduceRight((y,v,w)=>{let k,E=!1,O=null,A=null;i&&(k=x&&v.route.id?x[v.route.id]:void 0,O=v.route.errorElement||A1,m&&(h<0&&w===0?(Pg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,A=null):h===w&&(E=!0,A=v.route.hydrateFallbackElement||null)));let z=r.concat(f.slice(0,w+1)),V=()=>{let N;return k?N=O:E?N=A:v.route.Component?N=b.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=y,b.createElement(O1,{match:v,routeContext:{outlet:y,matches:z,isDataRoute:i!=null},children:N})};return i&&(v.route.ErrorBoundary||v.route.errorElement||w===0)?b.createElement(Wg,{location:i.location,revalidation:i.revalidation,component:O,error:k,children:V(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):V()},null)}function Nf(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function z1(l){let r=b.useContext(hr);return ct(r,Nf(l)),r}function D1(l){let r=b.useContext(iu);return ct(r,Nf(l)),r}function U1(l){let r=b.useContext(Pn);return ct(r,Nf(l)),r}function Sf(l){let r=U1(l),i=r.matches[r.matches.length-1];return ct(i.route.id,`${l} can only be used on routes that contain a unique "id"`),i.route.id}function L1(){return Sf("useRouteId")}function H1(){var u;let l=b.useContext(jf),r=D1("useRouteError"),i=Sf("useRouteError");return l!==void 0?l:(u=r.errors)==null?void 0:u[i]}function q1(){let{router:l}=z1("useNavigate"),r=Sf("useNavigate"),i=b.useRef(!1);return Fg(()=>{i.current=!0}),b.useCallback(async(d,f={})=>{Qn(i.current,Zg),i.current&&(typeof d=="number"?await l.navigate(d):await l.navigate(d,{fromRouteId:r,...f}))},[l,r])}var Xx={};function Pg(l,r,i){!r&&!Xx[l]&&(Xx[l]=!0,Qn(!1,i))}b.memo(B1);function B1({routes:l,future:r,state:i,onError:u}){return Ig(l,void 0,i,u,r)}function Q1({to:l,replace:r,state:i,relative:u}){ct(mr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=b.useContext(yn);Qn(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=b.useContext(Pn),{pathname:x}=bl(),m=Jg(),h=bf(l,yf(f),x,u==="path"),g=JSON.stringify(h);return b.useEffect(()=>{m(JSON.parse(g),{replace:r,state:i,relative:u})},[m,g,u,r,i]),null}function Fn(l){ct(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function G1({basename:l="/",children:r=null,location:i,navigationType:u="POP",navigator:d,static:f=!1,unstable_useTransitions:x}){ct(!mr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=l.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:m,navigator:d,static:f,unstable_useTransitions:x,future:{}}),[m,d,f,x]);typeof i=="string"&&(i=fr(i));let{pathname:g="/",search:y="",hash:v="",state:w=null,key:k="default"}=i,E=b.useMemo(()=>{let O=Ta(g,m);return O==null?null:{location:{pathname:O,search:y,hash:v,state:w,key:k},navigationType:u}},[m,g,y,v,w,k,u]);return Qn(E!=null,`<Router basename="${m}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:b.createElement(yn.Provider,{value:h},b.createElement(wi.Provider,{children:r,value:E}))}function Y1({children:l,location:r}){return T1(Wd(l),r)}function Wd(l,r=[]){let i=[];return b.Children.forEach(l,(u,d)=>{if(!b.isValidElement(u))return;let f=[...r,d];if(u.type===b.Fragment){i.push.apply(i,Wd(u.props.children,f));return}ct(u.type===Fn,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!u.props.index||!u.props.children,"An index route cannot have child routes.");let x={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(x.children=Wd(u.props.children,f)),i.push(x)}),i}var Wo="get",Po="application/x-www-form-urlencoded";function ou(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function $1(l){return ou(l)&&l.tagName.toLowerCase()==="button"}function K1(l){return ou(l)&&l.tagName.toLowerCase()==="form"}function X1(l){return ou(l)&&l.tagName.toLowerCase()==="input"}function V1(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function Z1(l,r){return l.button===0&&(!r||r==="_self")&&!V1(l)}var Vo=null;function F1(){if(Vo===null)try{new FormData(document.createElement("form"),0),Vo=!1}catch{Vo=!0}return Vo}var J1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ad(l){return l!=null&&!J1.has(l)?(Qn(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Po}"`),null):l}function I1(l,r){let i,u,d,f,x;if(K1(l)){let m=l.getAttribute("action");u=m?Ta(m,r):null,i=l.getAttribute("method")||Wo,d=Ad(l.getAttribute("enctype"))||Po,f=new FormData(l)}else if($1(l)||X1(l)&&(l.type==="submit"||l.type==="image")){let m=l.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=l.getAttribute("formaction")||m.getAttribute("action");if(u=h?Ta(h,r):null,i=l.getAttribute("formmethod")||m.getAttribute("method")||Wo,d=Ad(l.getAttribute("formenctype"))||Ad(m.getAttribute("enctype"))||Po,f=new FormData(m,l),!F1()){let{name:g,type:y,value:v}=l;if(y==="image"){let w=g?`${g}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else g&&f.append(g,v)}}else{if(ou(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Wo,u=null,d=Po,x=l}return f&&d==="text/plain"&&(x=f,f=void 0),{action:u,method:i.toLowerCase(),encType:d,formData:f,body:x}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wf(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function W1(l,r,i,u){let d=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return i?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:r&&Ta(d.pathname,r)==="/"?d.pathname=`${r.replace(/\/$/,"")}/_root.${u}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${u}`,d}async function P1(l,r){if(l.id in r)return r[l.id];try{let i=await import(l.module);return r[l.id]=i,i}catch(i){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ej(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function tj(l,r,i){let u=await Promise.all(l.map(async d=>{let f=r.routes[d.route.id];if(f){let x=await P1(f,i);return x.links?x.links():[]}return[]}));return sj(u.flat(1).filter(ej).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Vx(l,r,i,u,d,f){let x=(h,g)=>i[g]?h.route.id!==i[g].route.id:!0,m=(h,g)=>{var y;return i[g].pathname!==h.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==h.params["*"]};return f==="assets"?r.filter((h,g)=>x(h,g)||m(h,g)):f==="data"?r.filter((h,g)=>{var v;let y=u.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(x(h,g)||m(h,g))return!0;if(h.route.shouldRevalidate){let w=h.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(l,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function nj(l,r,{includeHydrateFallback:i}={}){return aj(l.map(u=>{let d=r.routes[u.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),i&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function aj(l){return[...new Set(l)]}function lj(l){let r={},i=Object.keys(l).sort();for(let u of i)r[u]=l[u];return r}function sj(l,r){let i=new Set;return new Set(r),l.reduce((u,d)=>{let f=JSON.stringify(lj(d));return i.has(f)||(i.add(f),u.push({key:f,link:d})),u},[])}function e0(){let l=b.useContext(hr);return wf(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function rj(){let l=b.useContext(iu);return wf(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var Ef=b.createContext(void 0);Ef.displayName="FrameworkContext";function t0(){let l=b.useContext(Ef);return wf(l,"You must render this element inside a <HydratedRouter> element"),l}function ij(l,r){let i=b.useContext(Ef),[u,d]=b.useState(!1),[f,x]=b.useState(!1),{onFocus:m,onBlur:h,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=r,w=b.useRef(null);b.useEffect(()=>{if(l==="render"&&x(!0),l==="viewport"){let O=z=>{z.forEach(V=>{x(V.isIntersecting)})},A=new IntersectionObserver(O,{threshold:.5});return w.current&&A.observe(w.current),()=>{A.disconnect()}}},[l]),b.useEffect(()=>{if(u){let O=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(O)}}},[u]);let k=()=>{d(!0)},E=()=>{d(!1),x(!1)};return i?l!=="intent"?[f,w,{}]:[f,w,{onFocus:di(m,k),onBlur:di(h,E),onMouseEnter:di(g,k),onMouseLeave:di(y,E),onTouchStart:di(v,k)}]:[!1,w,{}]}function di(l,r){return i=>{l&&l(i),i.defaultPrevented||r(i)}}function oj({page:l,...r}){let{router:i}=e0(),u=b.useMemo(()=>Bg(i.routes,l,i.basename),[i.routes,l,i.basename]);return u?b.createElement(cj,{page:l,matches:u,...r}):null}function uj(l){let{manifest:r,routeModules:i}=t0(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return tj(l,r,i).then(x=>{f||d(x)}),()=>{f=!0}},[l,r,i]),u}function cj({page:l,matches:r,...i}){let u=bl(),{future:d,manifest:f,routeModules:x}=t0(),{basename:m}=e0(),{loaderData:h,matches:g}=rj(),y=b.useMemo(()=>Vx(l,r,g,f,u,"data"),[l,r,g,f,u]),v=b.useMemo(()=>Vx(l,r,g,f,u,"assets"),[l,r,g,f,u]),w=b.useMemo(()=>{if(l===u.pathname+u.search+u.hash)return[];let O=new Set,A=!1;if(r.forEach(V=>{var S;let N=f.routes[V.route.id];!N||!N.hasLoader||(!y.some(M=>M.route.id===V.route.id)&&V.route.id in h&&((S=x[V.route.id])!=null&&S.shouldRevalidate)||N.hasClientLoader?A=!0:O.add(V.route.id))}),O.size===0)return[];let z=W1(l,m,d.unstable_trailingSlashAwareDataRequests,"data");return A&&O.size>0&&z.searchParams.set("_routes",r.filter(V=>O.has(V.route.id)).map(V=>V.route.id).join(",")),[z.pathname+z.search]},[m,d.unstable_trailingSlashAwareDataRequests,h,u,f,y,r,l,x]),k=b.useMemo(()=>nj(v,f),[v,f]),E=uj(v);return b.createElement(b.Fragment,null,w.map(O=>b.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...i})),k.map(O=>b.createElement("link",{key:O,rel:"modulepreload",href:O,...i})),E.map(({key:O,link:A})=>b.createElement("link",{key:O,nonce:i.nonce,...A,crossOrigin:A.crossOrigin??i.crossOrigin})))}function dj(...l){return r=>{l.forEach(i=>{typeof i=="function"?i(r):i!=null&&(i.current=r)})}}var fj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fj&&(window.__reactRouterVersion="7.13.0")}catch{}function hj({basename:l,children:r,unstable_useTransitions:i,window:u}){let d=b.useRef();d.current==null&&(d.current=Xb({window:u,v5Compat:!0}));let f=d.current,[x,m]=b.useState({action:f.action,location:f.location}),h=b.useCallback(g=>{i===!1?m(g):b.startTransition(()=>m(g))},[i]);return b.useLayoutEffect(()=>f.listen(h),[f,h]),b.createElement(G1,{basename:l,children:r,location:x.location,navigationType:x.action,navigator:f,unstable_useTransitions:i})}var n0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,a0=b.forwardRef(function({onClick:r,discover:i="render",prefetch:u="none",relative:d,reloadDocument:f,replace:x,state:m,target:h,to:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:w,...k},E){let{basename:O,unstable_useTransitions:A}=b.useContext(yn),z=typeof g=="string"&&n0.test(g),V=$g(g,O);g=V.to;let N=C1(g,{relative:d}),[S,M,U]=ij(u,k),D=xj(g,{replace:x,state:m,target:h,preventScrollReset:y,relative:d,viewTransition:v,unstable_defaultShouldRevalidate:w,unstable_useTransitions:A});function le(I){r&&r(I),I.defaultPrevented||D(I)}let se=b.createElement("a",{...k,...U,href:V.absoluteURL||N,onClick:V.isExternal||f?r:le,ref:dj(E,M),target:h,"data-discover":!z&&i==="render"?"true":void 0});return S&&!z?b.createElement(b.Fragment,null,se,b.createElement(oj,{page:N})):se});a0.displayName="Link";var l0=b.forwardRef(function({"aria-current":r="page",caseSensitive:i=!1,className:u="",end:d=!1,style:f,to:x,viewTransition:m,children:h,...g},y){let v=Ei(x,{relative:g.relative}),w=bl(),k=b.useContext(iu),{navigator:E,basename:O}=b.useContext(yn),A=k!=null&&jj(v)&&m===!0,z=E.encodeLocation?E.encodeLocation(v).pathname:v.pathname,V=w.pathname,N=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;i||(V=V.toLowerCase(),N=N?N.toLowerCase():null,z=z.toLowerCase()),N&&O&&(N=Ta(N,O)||N);const S=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let M=V===z||!d&&V.startsWith(z)&&V.charAt(S)==="/",U=N!=null&&(N===z||!d&&N.startsWith(z)&&N.charAt(z.length)==="/"),D={isActive:M,isPending:U,isTransitioning:A},le=M?r:void 0,se;typeof u=="function"?se=u(D):se=[u,M?"active":null,U?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let I=typeof f=="function"?f(D):f;return b.createElement(a0,{...g,"aria-current":le,className:se,ref:y,style:I,to:x,viewTransition:m},typeof h=="function"?h(D):h)});l0.displayName="NavLink";var mj=b.forwardRef(({discover:l="render",fetcherKey:r,navigate:i,reloadDocument:u,replace:d,state:f,method:x=Wo,action:m,onSubmit:h,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:w,...k},E)=>{let{unstable_useTransitions:O}=b.useContext(yn),A=yj(),z=bj(m,{relative:g}),V=x.toLowerCase()==="get"?"get":"post",N=typeof m=="string"&&n0.test(m),S=M=>{if(h&&h(M),M.defaultPrevented)return;M.preventDefault();let U=M.nativeEvent.submitter,D=(U==null?void 0:U.getAttribute("formmethod"))||x,le=()=>A(U||M.currentTarget,{fetcherKey:r,method:D,navigate:i,replace:d,state:f,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:w});O&&i!==!1?b.startTransition(()=>le()):le()};return b.createElement("form",{ref:E,method:V,action:z,onSubmit:u?h:S,...k,"data-discover":!N&&l==="render"?"true":void 0})});mj.displayName="Form";function pj(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s0(l){let r=b.useContext(hr);return ct(r,pj(l)),r}function xj(l,{target:r,replace:i,state:u,preventScrollReset:d,relative:f,viewTransition:x,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let g=Jg(),y=bl(),v=Ei(l,{relative:f});return b.useCallback(w=>{if(Z1(w,r)){w.preventDefault();let k=i!==void 0?i:xi(y)===xi(v),E=()=>g(l,{replace:k,state:u,preventScrollReset:d,relative:f,viewTransition:x,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>E()):E()}},[y,g,v,i,u,r,l,d,f,x,m,h])}var gj=0,vj=()=>`__${String(++gj)}__`;function yj(){let{router:l}=s0("useSubmit"),{basename:r}=b.useContext(yn),i=L1(),u=l.fetch,d=l.navigate;return b.useCallback(async(f,x={})=>{let{action:m,method:h,encType:g,formData:y,body:v}=I1(f,r);if(x.navigate===!1){let w=x.fetcherKey||vj();await u(w,i,x.action||m,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:y,body:v,formMethod:x.method||h,formEncType:x.encType||g,flushSync:x.flushSync})}else await d(x.action||m,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:y,body:v,formMethod:x.method||h,formEncType:x.encType||g,replace:x.replace,state:x.state,fromRouteId:i,flushSync:x.flushSync,viewTransition:x.viewTransition})},[u,d,r,i])}function bj(l,{relative:r}={}){let{basename:i}=b.useContext(yn),u=b.useContext(Pn);ct(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...Ei(l||".",{relative:r})},x=bl();if(l==null){f.search=x.search;let m=new URLSearchParams(f.search),h=m.getAll("index");if(h.some(y=>y==="")){m.delete("index"),h.filter(v=>v).forEach(v=>m.append("index",v));let y=m.toString();f.search=y?`?${y}`:""}}return(!l||l===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Ca([i,f.pathname])),xi(f)}function jj(l,{relative:r}={}){let i=b.useContext(Xg);ct(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=s0("useViewTransitionState"),d=Ei(l,{relative:r});if(!i.isTransitioning)return!1;let f=Ta(i.currentLocation.pathname,u)||i.currentLocation.pathname,x=Ta(i.nextLocation.pathname,u)||i.nextLocation.pathname;return au(d.pathname,x)!=null||au(d.pathname,f)!=null}/**
61
+ * @license lucide-react v0.474.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Nj=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r0=(...l)=>l.filter((r,i,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===i).join(" ").trim();/**
66
+ * @license lucide-react v0.474.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var Sj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
+ * @license lucide-react v0.474.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const wj=b.forwardRef(({color:l="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:x,...m},h)=>b.createElement("svg",{ref:h,...Sj,width:r,height:r,stroke:l,strokeWidth:u?Number(i)*24/Number(r):i,className:r0("lucide",d),...m},[...x.map(([g,y])=>b.createElement(g,y)),...Array.isArray(f)?f:[f]]));/**
76
+ * @license lucide-react v0.474.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const ke=(l,r)=>{const i=b.forwardRef(({className:u,...d},f)=>b.createElement(wj,{ref:f,iconNode:r,className:r0(`lucide-${Nj(l)}`,u),...d}));return i.displayName=`${l}`,i};/**
81
+ * @license lucide-react v0.474.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const Ej=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],uu=ke("Activity",Ej);/**
86
+ * @license lucide-react v0.474.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Cj=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],kj=ke("ArrowLeftRight",Cj);/**
91
+ * @license lucide-react v0.474.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Tj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Mj=ke("ArrowLeft",Tj);/**
96
+ * @license lucide-react v0.474.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Aj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],or=ke("ArrowRight",Aj);/**
101
+ * @license lucide-react v0.474.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const Rj=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],i0=ke("Brain",Rj);/**
106
+ * @license lucide-react v0.474.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Oj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],_j=ke("ChartColumn",Oj);/**
111
+ * @license lucide-react v0.474.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const zj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],o0=ke("Check",zj);/**
116
+ * @license lucide-react v0.474.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Dj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ma=ke("ChevronDown",Dj);/**
121
+ * @license lucide-react v0.474.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const Uj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Lj=ke("ChevronLeft",Uj);/**
126
+ * @license lucide-react v0.474.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const Hj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],On=ke("ChevronRight",Hj);/**
131
+ * @license lucide-react v0.474.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const qj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Bj=ke("ChevronUp",qj);/**
136
+ * @license lucide-react v0.474.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Qj=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],u0=ke("ChevronsDownUp",Qj);/**
141
+ * @license lucide-react v0.474.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const Gj=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],c0=ke("ChevronsUpDown",Gj);/**
146
+ * @license lucide-react v0.474.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const Yj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],d0=ke("CircleX",Yj);/**
151
+ * @license lucide-react v0.474.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const $j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Zx=ke("Clock",$j);/**
156
+ * @license lucide-react v0.474.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const Kj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Xj=ke("Copy",Kj);/**
161
+ * @license lucide-react v0.474.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Vj=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],f0=ke("DollarSign",Vj);/**
166
+ * @license lucide-react v0.474.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Zj=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Fj=ke("Download",Zj);/**
171
+ * @license lucide-react v0.474.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const Jj=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],ur=ke("FlaskConical",Jj);/**
176
+ * @license lucide-react v0.474.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Ij=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Cf=ke("Layers",Ij);/**
181
+ * @license lucide-react v0.474.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const Wj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pj=ke("LoaderCircle",Wj);/**
186
+ * @license lucide-react v0.474.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const eN=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]],tN=ke("MessageSquarePlus",eN);/**
191
+ * @license lucide-react v0.474.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const nN=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],h0=ke("MessageSquare",nN);/**
196
+ * @license lucide-react v0.474.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const aN=[["path",{d:"M5 12h14",key:"1ays0h"}]],lN=ke("Minus",aN);/**
201
+ * @license lucide-react v0.474.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const sN=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],rN=ke("MonitorSmartphone",sN);/**
206
+ * @license lucide-react v0.474.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const iN=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],oN=ke("Moon",iN);/**
211
+ * @license lucide-react v0.474.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const uN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],cN=ke("PanelLeftClose",uN);/**
216
+ * @license lucide-react v0.474.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const dN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],fN=ke("PanelLeftOpen",dN);/**
221
+ * @license lucide-react v0.474.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const hN=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],mN=ke("Pencil",hN);/**
226
+ * @license lucide-react v0.474.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const pN=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],kf=ke("Play",pN);/**
231
+ * @license lucide-react v0.474.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const xN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],m0=ke("Plus",xN);/**
236
+ * @license lucide-react v0.474.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const gN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],vN=ke("RefreshCw",gN);/**
241
+ * @license lucide-react v0.474.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const yN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],bN=ke("RotateCw",yN);/**
246
+ * @license lucide-react v0.474.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const jN=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Pd=ke("Search",jN);/**
251
+ * @license lucide-react v0.474.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const NN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],SN=ke("Send",NN);/**
256
+ * @license lucide-react v0.474.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const wN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],EN=ke("ShieldCheck",wN);/**
261
+ * @license lucide-react v0.474.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const CN=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],kN=ke("Sun",CN);/**
266
+ * @license lucide-react v0.474.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const TN=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Tf=ke("Trash2",TN);/**
271
+ * @license lucide-react v0.474.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const MN=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],AN=ke("TrendingUp",MN);/**
276
+ * @license lucide-react v0.474.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const RN=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],p0=ke("TriangleAlert",RN);/**
281
+ * @license lucide-react v0.474.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const ON=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],_N=ke("Upload",ON);/**
286
+ * @license lucide-react v0.474.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const zN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],x0=ke("Users",zN);/**
291
+ * @license lucide-react v0.474.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const DN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],g0=ke("Wrench",DN);/**
296
+ * @license lucide-react v0.474.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const UN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],v0=ke("X",UN);function Z(...l){return l.filter(Boolean).join(" ")}function nt(l){if(!Number.isFinite(l)||l===0)return"$0.00";const r=Math.abs(l);if(r<1e-6)return"< $0.000001";if(r<1e-4){const[i,u]=l.toExponential(2).split("e");return`$${i}e${parseInt(u,10)}`}return r<.01?`$${l.toFixed(6)}`:`$${l.toFixed(2)}`}function ot(l){return l<1e3?`${Math.round(l)}ms`:l<6e4?`${(l/1e3).toFixed(1)}s`:`${(l/6e4).toFixed(1)}m`}function An(l){return l.toLocaleString()}function cr(l,r=80){const i=u=>u.length<=r?u:u.slice(0,r-3)+"…";if(typeof l=="string")return i(l);if(typeof l=="object"&&l!==null&&!Array.isArray(l)){const u=l;for(const d of["question","prompt","text","input","query","message","content","name","title"])if(typeof u[d]=="string"&&u[d].length>0)return i(u[d]);for(const d of Object.values(u))if(typeof d=="string"&&d.length>0)return i(d)}return i(JSON.stringify(l))}function LN(l){switch(l){case"running":return"text-blue-500";case"completed":return"text-green-500";case"failed":return"text-red-500";case"waiting":return"text-amber-500";default:return"text-[hsl(var(--muted-foreground))]"}}const HN={auto:{icon:rN,label:"System",ariaLabel:"Theme: follow system. Switch to light."},light:{icon:kN,label:"Light",ariaLabel:"Theme: light. Switch to dark."},dark:{icon:oN,label:"Dark",ariaLabel:"Theme: dark. Switch to system."}};function qN({compact:l=!1}){const[r,i]=b.useState(()=>xf());b.useEffect(()=>qg(x=>i(x)),[]);const u=b.useCallback(()=>{i(x=>{const m=Kb(x);return Gb(m),vf(gf(m)),m})},[]),d=HN[r],f=d.icon;return a.jsxs("button",{type:"button",onClick:u,title:d.ariaLabel,"aria-label":d.ariaLabel,className:Z("inline-flex items-center gap-2 rounded-md text-xs transition-colors","text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",l?"p-2 justify-center":"px-2 py-1.5"),children:[a.jsx(f,{size:14}),!l&&a.jsx("span",{children:d.label})]})}const BN=[{to:"/playground",label:"Playground",icon:h0},{to:"/workflows",label:"Workflows",icon:kf},{to:"/traces",label:"Traces",icon:uu},{to:"/costs",label:"Costs",icon:f0},{to:"/memory",label:"Memory",icon:i0},{to:"/sessions",label:"Sessions",icon:x0},{to:"/tools",label:"Tools",icon:g0},{to:"/evals",label:"Evals",icon:ur}],y0="axl.studio.sidebar.collapsed",b0="(max-width: 767px)";function QN(){try{const l=localStorage.getItem(y0);return l==="1"?!0:l==="0"?!1:null}catch{return null}}function GN(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia(b0).matches}function YN(l){const r=l.tagName;return!!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||l.isContentEditable)}function $N(){const[{collapsed:l,hasExplicitPreference:r},i]=b.useState(()=>{const m=QN();return{collapsed:m??GN(),hasExplicitPreference:m!==null}}),u=b.useRef(r);b.useEffect(()=>{u.current=r},[r]);const d=b.useCallback(()=>{i(m=>{const h=!m.collapsed;try{localStorage.setItem(y0,h?"1":"0")}catch{}return{collapsed:h,hasExplicitPreference:!0}})},[]);b.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const m=window.matchMedia(b0),h=()=>{u.current||i(g=>({...g,collapsed:m.matches}))};return m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]),b.useEffect(()=>{const m=h=>{if(h.shiftKey||h.altKey||!(h.metaKey||h.ctrlKey)||h.key.toLowerCase()!=="b")return;const g=h.target;g&&YN(g)||(h.preventDefault(),d())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[d]);const f=l?fN:cN,x=typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.userAgent)?"⌘B":"Ctrl+B";return a.jsxs("aside",{className:Z("border-r border-[hsl(var(--border))] bg-[hsl(var(--card))] flex flex-col h-screen transition-[width] duration-150 ease-out",l?"w-14":"w-56"),children:[a.jsxs("div",{className:Z("p-4 border-b border-[hsl(var(--border))] flex items-center",l?"justify-center":"justify-between gap-2"),children:[!l&&a.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Axl Studio"}),a.jsx("button",{type:"button",onClick:d,title:`${l?"Expand":"Collapse"} sidebar (${x})`,"aria-label":`${l?"Expand":"Collapse"} sidebar`,"aria-expanded":!l,"aria-controls":"axl-studio-sidebar-nav","aria-keyshortcuts":"Meta+B Control+B",className:"p-2 rounded-md text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] transition-colors",children:a.jsx(f,{size:16})})]}),a.jsx("nav",{id:"axl-studio-sidebar-nav",className:"flex-1 p-2 space-y-0.5",children:BN.map(({to:m,label:h,icon:g})=>a.jsxs(l0,{to:m,title:l?h:void 0,className:({isActive:y})=>Z("flex items-center gap-2.5 rounded-md text-sm transition-colors",l?"justify-center px-2 py-2.5":"px-3 py-2",y?"bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"),children:[a.jsx(g,{size:16}),!l&&h]},m))}),a.jsxs("div",{className:Z("border-t border-[hsl(var(--border))]",l?"p-2 flex justify-center":"p-3 flex items-center justify-between gap-2"),children:[!l&&a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"@axlsdk/studio"}),a.jsx(qN,{compact:l})]})]})}function j0(l){if(l.type==="ask_end")return 0;const r=l.cost;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:0}function ss({title:l,description:r,actions:i,className:u}){return a.jsxs("header",{className:Z("shrink-0 flex flex-wrap items-center justify-between gap-y-3 gap-x-3 sm:gap-x-6 px-4 sm:px-6 py-4 sm:min-h-[68px]","border-b border-[hsl(var(--border))]",u),children:[a.jsxs("div",{className:"min-w-0 flex-1 basis-[200px]",children:[a.jsx("h2",{className:"text-xl font-semibold leading-tight truncate",title:l,children:l}),a.jsx("div",{className:"mt-1 text-xs text-[hsl(var(--muted-foreground))] truncate",children:r??" "})]}),i&&a.jsx("div",{className:"flex items-center gap-2 flex-wrap shrink-0 ml-auto",children:i})]})}function Jt({title:l,description:r,icon:i}){return a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[i&&a.jsx("div",{className:"mb-3 text-[hsl(var(--muted-foreground))]",children:i}),a.jsx("h3",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:l}),r&&a.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))] mt-1 max-w-sm",children:r})]})}function KN({text:l,className:r}){return a.jsxs("div",{className:`whitespace-pre-wrap ${r??""}`,children:[l,a.jsx("span",{className:"animate-pulse",children:"|"})]})}function N0(l){if(l==null)return"null";if(Array.isArray(l))return"array";const r=typeof l;return r==="object"?"object":r==="number"?"number":r==="boolean"?"boolean":"string"}function XN(l,r){if(r==="array"){const i=l;return i.length===0?"[]":`[${i.length}]`}if(r==="object"){const i=Object.keys(l);return i.length===0?"{}":i.length<=4?`{ ${i.join(", ")} }`:`{ ${i.slice(0,3).join(", ")}, …${i.length-3} more }`}return""}function VN(l,r){return r==="array"?l.map((i,u)=>[u,i]):r==="object"?Object.entries(l):[]}const xn={key:"text-[hsl(var(--foreground))]",string:"text-emerald-700 dark:text-emerald-400",number:"text-blue-600 dark:text-blue-400",boolean:"text-amber-600 dark:text-amber-400",null:"text-[hsl(var(--muted-foreground))] italic",punct:"text-[hsl(var(--muted-foreground))]"},fi="w-3.5 shrink-0 flex items-center justify-center pt-0.5",S0="inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer";function ZN({text:l}){const[r,i]=b.useState(!1),u=b.useRef(void 0);b.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const d=b.useCallback(f=>{f.stopPropagation(),navigator.clipboard.writeText(l),i(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>i(!1),2e3)},[l]);return a.jsxs("button",{onClick:d,className:S0,children:[r?a.jsx(o0,{size:10,className:"text-emerald-500"}):a.jsx(Xj,{size:10}),r?"Copied":"Copy"]})}function FN({value:l,type:r}){if(r==="null")return a.jsx("span",{className:xn.null,children:"null"});if(r==="boolean")return a.jsx("span",{className:xn.boolean,children:String(l)});if(r==="number")return a.jsx("span",{className:xn.number,children:String(l)});if(r==="string"){const i=l;return i.includes(`
301
+ `)&&i.length>80?a.jsxs("span",{className:xn.string,children:['"',i,'"']}):a.jsxs("span",{className:xn.string,children:['"',i,'"']})}return null}const Zo=100,JN=b.memo(function l({value:r,label:i,depth:u,expandDepth:d,isLast:f}){const x=N0(r),m=x==="object"||x==="array",[h,g]=b.useState(u<d),[y,v]=b.useState(!1),w=f?"":",",k=i!=null?typeof i=="number"?a.jsxs("span",{className:xn.punct,children:[i,": "]}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:xn.key,children:['"',i,'"']}),a.jsx("span",{className:xn.punct,children:": "})]}):null;if(!m)return a.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded",children:[a.jsx("span",{className:fi}),a.jsxs("span",{children:[k,a.jsx(FN,{value:r,type:x}),a.jsx("span",{className:xn.punct,children:w})]})]});const E=VN(r,x),O=x==="array"?"[":"{",A=x==="array"?"]":"}";return E.length===0?a.jsxs("div",{className:"flex items-start leading-relaxed",children:[a.jsx("span",{className:fi}),a.jsxs("span",{children:[k,a.jsxs("span",{className:xn.punct,children:[O,A,w]})]})]}):a.jsxs("div",{children:[a.jsxs("div",{className:Z("flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",h&&"hidden"),onClick:()=>g(!0),children:[a.jsx("span",{className:fi,children:a.jsx(On,{size:10,className:"text-[hsl(var(--muted-foreground))]"})}),a.jsxs("span",{children:[k,a.jsxs("span",{className:xn.punct,children:[XN(r,x),w]})]})]}),a.jsxs("div",{className:Z(!h&&"hidden"),children:[a.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",onClick:()=>g(!1),children:[a.jsx("span",{className:fi,children:a.jsx(On,{size:10,className:"text-[hsl(var(--muted-foreground))] rotate-90 transition-transform"})}),a.jsxs("span",{children:[k,a.jsx("span",{className:xn.punct,children:O})]})]}),a.jsxs("div",{className:"pl-5 border-l border-[hsl(var(--border))]/40 ml-1.5",children:[(y?E:E.slice(0,Zo)).map(([z,V],N,S)=>a.jsx(l,{value:V,label:z,depth:u+1,expandDepth:d,isLast:!y&&E.length>Zo?!1:N===S.length-1},typeof z=="number"?z:String(z))),!y&&E.length>Zo&&a.jsxs("button",{onClick:z=>{z.stopPropagation(),v(!0)},className:"text-[10px] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] py-1 transition-colors",children:["Show all ",E.length," items (",E.length-Zo," more)"]})]}),a.jsxs("div",{className:"flex items-start leading-relaxed",children:[a.jsx("span",{className:fi}),a.jsxs("span",{className:xn.punct,children:[A,w]})]})]})]})});function qt({data:l,defaultExpandDepth:r,maxHeight:i,className:u,collapsed:d}){const f=r??(d?0:2),x=i??"24rem",m=JSON.stringify(l,null,2),[h,g]=b.useState(0),[y,v]=b.useState(f),w=y===1/0,k=b.useCallback(()=>{v(A=>A===1/0?0:1/0),g(A=>A+1)},[]),E=N0(l),O=E==="object"||E==="array";return a.jsxs("div",{className:Z("relative group/json",u),children:[a.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-1 opacity-0 group-hover/json:opacity-100 transition-opacity z-10",children:[O&&a.jsxs("button",{onClick:A=>{A.stopPropagation(),k()},className:S0,children:[w?a.jsx(u0,{size:10}):a.jsx(c0,{size:10}),w?"Collapse":"Expand"]}),a.jsx(ZN,{text:m})]}),a.jsx("div",{className:"text-xs font-mono overflow-auto rounded-lg bg-[hsl(var(--secondary))] p-3",style:{maxHeight:x},children:a.jsx(JN,{value:l,depth:0,expandDepth:y,isLast:!0},h)})]})}function gi({items:l,value:r,onSelect:i,getKey:u,getLabel:d,getDescription:f,searchMatch:x,placeholder:m="Select…",searchPlaceholder:h="Search…",emptyLabel:g="No results",shortcut:y=!1,variant:v="picker",triggerClassName:w,popoverWidth:k,ariaLabel:E}){const O=k??(v==="filter"?260:440),[A,z]=b.useState(!1),[V,N]=b.useState(""),[S,M]=b.useState(0),U=b.useRef(!1),D=b.useRef(null),le=b.useRef(null),se=b.useRef(null),I=b.useRef(null),[oe,Y]=b.useState(!1),ne=b.useId(),Q=`cmdpicker-pop-${ne}`,G=q=>`cmdpicker-opt-${ne}-${q}`,T=b.useMemo(()=>{const q=V.trim().toLowerCase();return q?x?l.filter(W=>x(W,q)):l.filter(W=>d(W).toLowerCase().includes(q)):l},[l,V,x,d]),H=b.useMemo(()=>{if(!r)return null;const q=l.find(W=>u(W)===r);return q?d(q):null},[l,r,u]);b.useEffect(()=>{if(U.current){M(W=>Math.max(0,Math.min(W,T.length-1)));return}const q=T.findIndex(W=>u(W)===r);M(q>=0?q:0)},[T,r,u]),b.useEffect(()=>{var ie;if(!A){N(""),U.current=!1;return}const q=425,W=(ie=I.current)==null?void 0:ie.getBoundingClientRect();if(W){const fe=window.innerHeight-W.bottom,ye=W.top;Y(fe<q&&ye>fe)}requestAnimationFrame(()=>{var fe;return(fe=se.current)==null?void 0:fe.focus()})},[A]),b.useEffect(()=>{if(!A)return;const q=W=>{var fe,ye;const ie=W.target;(fe=D.current)!=null&&fe.contains(ie)||(ye=le.current)!=null&&ye.contains(ie)||z(!1)};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[A]),b.useEffect(()=>{if(!y)return;const q=W=>{var ie;if((W.metaKey||W.ctrlKey)&&W.key==="k"){const fe=W.target,ye=!!(fe&&((ie=le.current)!=null&&ie.contains(fe)));if(((fe==null?void 0:fe.tagName)==="INPUT"||(fe==null?void 0:fe.tagName)==="TEXTAREA"||(fe==null?void 0:fe.isContentEditable)===!0)&&!ye)return;W.preventDefault(),z(we=>!we)}};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[y]);const J=b.useCallback(q=>{i(q),z(!1),requestAnimationFrame(()=>{var W;return(W=I.current)==null?void 0:W.focus()})},[i]),he=b.useCallback(q=>{var W;if(q.key==="ArrowDown")q.preventDefault(),U.current=!0,M(ie=>Math.min(ie+1,Math.max(0,T.length-1)));else if(q.key==="ArrowUp")q.preventDefault(),U.current=!0,M(ie=>Math.max(ie-1,0));else if(q.key==="Enter"){q.preventDefault();const ie=T[S];ie&&J(u(ie))}else q.key==="Escape"?(q.preventDefault(),z(!1),(W=I.current)==null||W.focus()):q.key==="Tab"&&z(!1)},[T,S,J,u]),de=H??m,C=v==="filter";return a.jsxs("div",{ref:D,className:"relative inline-flex",children:[a.jsxs("button",{ref:I,type:"button",onClick:()=>z(q=>!q),"aria-haspopup":"listbox","aria-expanded":A,"aria-controls":A?Q:void 0,"aria-label":E??(H?`Selected: ${H}`:m),className:Z("group inline-flex items-center gap-2 text-sm cursor-pointer transition-colors","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","hover:bg-[hsl(var(--muted))]",C?"px-3 py-1.5 text-xs":"pl-4 pr-3 py-2 min-w-[240px] max-w-[320px]",w),children:[!C&&a.jsx(Pd,{size:13,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),a.jsx("span",{className:Z("flex-1 text-left truncate",C?"":"font-medium",!H&&"text-[hsl(var(--muted-foreground))] font-normal"),children:de}),C?a.jsx(Ma,{size:12,className:"text-[hsl(var(--muted-foreground))] shrink-0 opacity-70"}):y?a.jsxs("kbd",{className:Z("hidden md:inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-mono rounded","border border-[hsl(var(--border))] bg-[hsl(var(--background))]","text-[hsl(var(--muted-foreground))]"),children:[a.jsx("span",{className:"text-xs leading-none",children:"⌘"}),"K"]}):null]}),A&&a.jsxs("div",{ref:le,id:Q,role:"listbox","aria-label":E??m,"aria-activedescendant":T[S]?G(S):void 0,style:{width:O},className:Z("absolute right-0 z-50",oe?"bottom-[calc(100%+8px)]":"top-[calc(100%+8px)]","rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--background))]","shadow-2xl overflow-hidden popover-enter"),children:[a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[hsl(var(--border))]",children:[a.jsx(Pd,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),a.jsx("input",{ref:se,type:"text",value:V,onChange:q=>{N(q.target.value),U.current=!1},onKeyDown:he,placeholder:h,"aria-label":h,className:Z("flex-1 bg-transparent text-sm focus:outline-none","placeholder:text-[hsl(var(--muted-foreground))]")}),a.jsx("kbd",{className:Z("text-[10px] font-mono px-1.5 py-0.5 rounded","border border-[hsl(var(--border))]","text-[hsl(var(--muted-foreground))]"),children:"ESC"})]}),a.jsx("div",{className:"max-h-[340px] overflow-y-auto py-1.5",children:T.length===0?a.jsx("div",{className:"px-4 py-8 text-center text-xs text-[hsl(var(--muted-foreground))]",children:V?`No results for "${V}"`:g}):T.map((q,W)=>{const ie=u(q),fe=d(q),ye=f==null?void 0:f(q),ce=W===S,we=ie===r;return a.jsxs("button",{id:G(W),type:"button",role:"option","aria-selected":ce,onClick:()=>J(ie),onMouseEnter:()=>{U.current=!0,M(W)},className:Z("w-full flex items-center gap-3 px-4 py-2.5 text-left cursor-pointer","transition-colors",ce&&"bg-[hsl(var(--muted))]"),children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium truncate",children:fe||m}),ye&&a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:ye})]}),we&&a.jsx(o0,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0","aria-label":"Currently selected"})]},ie||`__empty__${W}`)})}),a.jsxs("div",{className:Z("flex items-center justify-between px-4 py-2 border-t border-[hsl(var(--border))]","bg-[hsl(var(--muted))]/40 text-[10px] text-[hsl(var(--muted-foreground))]"),children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"font-mono opacity-70",children:"↑↓"})," navigate"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"font-mono opacity-70",children:"↵"})," select"]})]}),a.jsxs("span",{className:"tabular-nums",children:[T.length," of ",l.length]})]})]})]})}function Bn({cost:l,className:r}){return a.jsx("span",{className:`inline-flex items-center whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${r??""}`,children:nt(l)})}function Mf({ms:l,className:r}){return a.jsx("span",{className:`inline-flex items-center whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${r??""}`,children:ot(l)})}function Rd(l){switch(l){case"schema":return"Schema";case"validate":return"Validate";case"guardrail":return"Guardrail";case"initial":return"Initial"}}function IN(l){const{stage:r,attempt:i,maxAttempts:u,status:d,className:f}=l;let x,m;if(d==="committed")x="bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200",m=`Committed ${i}/${u}`;else if(d==="failed")x="bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200",m=`${Rd(r)} failed (${i}/${u})`;else{const h=r!=="initial";x=h?"bg-amber-100 text-amber-900 dark:bg-amber-900/30 dark:text-amber-200":"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200",m=h?`Retrying — ${Rd(r)} ${i}/${u}`:`${Rd(r)} ${i}/${u}`}return a.jsx("span",{className:Z("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",x,f),"data-testid":"retry-indicator","data-status":d,"data-stage":r,children:m})}function WN(l){var x;const r=new Map,i=new Set;for(const m of l){if(m.type==="log"){const g=m.data;(g==null?void 0:g.event)==="ask_discarded"&&typeof g.askId=="string"&&i.add(g.askId)}if(m.type==="handoff_start"&&m.fromAskId){const g=r.get(m.fromAskId),y=((x=m.data)==null?void 0:x.target)??m.toAskId??"";g&&m.toAskId&&(g.handoffsOut.push({toAskId:m.toAskId,target:y}),r.has(m.toAskId)||r.set(m.toAskId,{askId:m.toAskId,parentAskId:m.fromAskId,depth:typeof m.targetDepth=="number"?m.targetDepth:g.depth+1,agent:y||void 0,cost:0,status:"running",events:[],children:[],handoffsOut:[]}));continue}if(m.type==="handoff_return"||!("askId"in m)||typeof m.askId!="string")continue;let h=r.get(m.askId);switch(h||(h={askId:m.askId,parentAskId:m.parentAskId,depth:m.depth??0,agent:m.agent,cost:0,status:"running",events:[],children:[],handoffsOut:[]},r.set(m.askId,h)),h.events.push(m),m.type){case"ask_start":h.startedAt=m.timestamp,h.agent=h.agent??m.agent;break;case"ask_end":if(h.endedAt=m.timestamp,typeof m.cost=="number"&&(h.cost=m.cost),!m.outcome)break;m.outcome.ok?(h.status="completed",h.outcomeResult=m.outcome.result):(h.status="failed",h.outcomeError=m.outcome.error);break;case"agent_call_start":h.model=h.model??m.model;break;case"agent_call_end":h.status==="running"&&typeof m.cost=="number"&&(h.cost+=m.cost);break;case"tool_call_end":h.status==="running"&&typeof m.cost=="number"&&(h.cost+=m.cost);break;case"pipeline":h.lastPipeline={status:m.status,stage:m.stage,attempt:m.attempt,maxAttempts:m.maxAttempts},m.status==="failed"&&h.status==="running"?h.status="retrying":m.status==="start"&&h.status==="retrying"&&(h.status="running");break}}for(const m of i){const h=r.get(m);h&&h.status==="completed"&&(h.status="discarded")}const u=[];for(const m of r.values()){const h=m.parentAskId?r.get(m.parentAskId):void 0;h?h.children.push(m):u.push(m)}const d=(m,h)=>(m.startedAt??0)-(h.startedAt??0),f=m=>{m.sort(d);for(const h of m)f(h.children)};return f(u),u}function PN(l){switch(l){case"running":return"bg-sky-100 text-sky-900 dark:bg-sky-900/30 dark:text-sky-200";case"retrying":return"bg-amber-100 text-amber-900 dark:bg-amber-900/30 dark:text-amber-200";case"completed":return"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200";case"failed":return"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200";case"discarded":return"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400"}}function w0(l){const{node:r,selectedAskId:i,onSelectAsk:u}=l,d=i===r.askId,[f,x]=b.useState(!0),m=r.children.length>0,h=r.startedAt!==void 0&&r.endedAt!==void 0?r.endedAt-r.startedAt:void 0;return a.jsxs("div",{className:Z("select-none",r.status==="discarded"&&"opacity-60"),"data-ask-id":r.askId,"data-status":r.status,children:[a.jsxs("div",{"data-testid":"ask-node",role:"button",tabIndex:0,onClick:()=>u==null?void 0:u(r.askId),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),u==null||u(r.askId))},className:Z("flex items-center gap-2 rounded px-2 py-1 text-sm cursor-pointer","hover:bg-slate-50 dark:hover:bg-slate-800/50",d&&"bg-sky-50 ring-1 ring-sky-300 dark:bg-sky-900/20 dark:ring-sky-700"),style:{paddingLeft:`${r.depth*16+8}px`},children:[m?a.jsx("button",{type:"button","aria-label":f?"Collapse":"Expand",onClick:g=>{g.stopPropagation(),x(y=>!y)},className:"text-[hsl(var(--muted-foreground))]",children:f?a.jsx(Ma,{className:"h-3.5 w-3.5"}):a.jsx(On,{className:"h-3.5 w-3.5"})}):a.jsx("span",{className:"w-3.5"}),a.jsx("span",{className:Z("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",PN(r.status)),children:r.status}),a.jsx("span",{"data-testid":"ask-node-agent",className:"font-medium truncate",title:r.askId,children:r.agent??"<unknown>"}),r.model&&a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono truncate",children:r.model}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono truncate",title:r.askId,children:r.askId.slice(0,8)}),a.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.lastPipeline&&r.status==="retrying"&&a.jsx(IN,{stage:r.lastPipeline.stage??"initial",attempt:r.lastPipeline.attempt??1,maxAttempts:r.lastPipeline.maxAttempts??1,status:"failed"}),h!==void 0&&a.jsx(Mf,{ms:h}),a.jsx(Bn,{cost:r.cost})]})]}),r.handoffsOut.length>0&&a.jsx("div",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300 mt-0.5",style:{paddingLeft:`${r.depth*16+32}px`},children:r.handoffsOut.map((g,y)=>a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(or,{className:"h-3 w-3"}),"handoff → ",g.target,a.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:["(",g.toAskId.slice(0,8),")"]})]},y))}),f&&r.children.map(g=>a.jsx(w0,{node:g,selectedAskId:i,onSelectAsk:u},g.askId))]})}function e2(l){let r,i,u;for(const d of l)d.type==="workflow_start"?r=d.workflow??r:d.type==="workflow_end"&&(r=d.workflow??r,i=d.data.status??i,u=d.data.duration??u);return!r&&!i?null:{name:r,status:i,duration:u}}function E0(l){const{events:r,selectedAskId:i,onSelectAsk:u}=l,d=b.useMemo(()=>WN(r),[r]),f=b.useMemo(()=>e2(r),[r]);return d.length===0&&!f?a.jsx("div",{className:"text-sm text-[hsl(var(--muted-foreground))] py-4 text-center",children:"No asks recorded yet. Events will appear here as `ctx.ask()` calls fire."}):a.jsxs("div",{"data-testid":"ask-tree",className:"space-y-0.5",children:[f&&a.jsxs("div",{"data-testid":"ask-tree-workflow-header",className:Z("flex items-center gap-2 rounded px-2 py-1 text-xs font-medium","bg-slate-50 dark:bg-slate-800/40 border-l-2 border-slate-400 dark:border-slate-600"),children:[a.jsxs("span",{className:"text-slate-700 dark:text-slate-200",children:["workflow · ",f.name??"(unnamed)"]}),f.status&&a.jsx("span",{className:Z("ml-auto inline-flex items-center rounded px-1.5 py-0.5 text-[10px]",f.status==="completed"?"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200":f.status==="failed"?"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200":"bg-sky-100 text-sky-900 dark:bg-sky-900/30 dark:text-sky-200"),children:f.status}),f.duration!==void 0&&a.jsxs("span",{className:"font-mono text-slate-500 dark:text-slate-400",children:[f.duration,"ms"]})]}),d.map(x=>a.jsx(w0,{node:x,selectedAskId:i,onSelectAsk:u},x.askId))]})}const t2={workflow_start:"bg-green-500",workflow_end:"bg-green-500",ask_start:"bg-sky-500",ask_end:"bg-sky-500",agent_call_start:"bg-blue-500",agent_call_end:"bg-blue-500",tool_call_start:"bg-purple-500",tool_call_end:"bg-purple-500",tool_approval:"bg-purple-400",tool_denied:"bg-red-400",handoff_start:"bg-amber-500",handoff_return:"bg-amber-500",delegate:"bg-amber-500",pipeline:"bg-violet-500",guardrail:"bg-violet-400",schema_check:"bg-violet-400",validate:"bg-violet-400",verify:"bg-teal-500",memory_remember:"bg-emerald-500",memory_recall:"bg-emerald-500",memory_forget:"bg-emerald-500",checkpoint_save:"bg-emerald-400",checkpoint_replay:"bg-emerald-400",await_human:"bg-yellow-500",await_human_resolved:"bg-yellow-500",token:"bg-slate-300",partial_object:"bg-slate-300",log:"bg-slate-400",done:"bg-zinc-700",error:"bg-red-500"},n2="bg-pink-400";function a2(l){var r,i,u,d,f,x;switch(l.type){case"tool_denied":return!0;case"guardrail":return((r=l.data)==null?void 0:r.blocked)===!0;case"schema_check":case"validate":return((i=l.data)==null?void 0:i.valid)===!1;case"pipeline":return l.status==="failed";case"verify":return((u=l.data)==null?void 0:u.passed)===!1;case"tool_approval":return((d=l.data)==null?void 0:d.approved)===!1;case"ask_end":return l.outcome.ok===!1;case"workflow_end":return((f=l.data)==null?void 0:f.status)==="failed"||((x=l.data)==null?void 0:x.aborted)===!0;case"log":{const m=l.data;return m!=null&&typeof m=="object"&&"error"in m&&m.error!=null}default:return!1}}function l2(l){return t2[l]??n2}function Fx(l){return a2(l)?"bg-red-500":l2(l.type)}function C0(l){return"depth"in l&&typeof l.depth=="number"?l.depth:0}function k0(l){return l.type!=="agent_call_start"?null:l.data??null}function T0(l){return l.type!=="agent_call_end"?null:l.data??null}function M0(l){return l.type==="guardrail"||l.type==="schema_check"||l.type==="validate"?l.data??null:null}function s2(l){return l.type!=="tool_approval"?null:l.data??null}function r2(l){var r,i;return l.type==="agent_call_start"?!!((r=l.data)!=null&&r.retryReason):l.type==="agent_call_end"?!!((i=l.data)!=null&&i.retryReason):!1}const Af=b.createContext({level:0,version:0});function A0(l){const{level:r,version:i}=b.useContext(Af),u=r===1;return a.jsx(qt,{...l,defaultExpandDepth:u?1/0:l.defaultExpandDepth,collapsed:u?!1:l.collapsed},`trace-expand-v${i}`)}function Rn({label:l,content:r,tone:i="neutral",defaultOpen:u=!1}){const{level:d,version:f}=b.useContext(Af),[x,m]=b.useState(u);b.useEffect(()=>{f!==0&&m(d===1)},[f,d]);const h={neutral:"border-[hsl(var(--border))] bg-[hsl(var(--background))]",warning:"border-amber-400/40 bg-amber-50 dark:bg-amber-950/20",info:"border-blue-400/40 bg-blue-50 dark:bg-blue-950/20"}[i];return a.jsxs("div",{className:Z("rounded-lg border mb-2",h),children:[a.jsxs("button",{onClick:()=>m(g=>!g),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium text-left hover:bg-[hsl(var(--muted))]/50",children:[x?a.jsx(Ma,{size:11}):a.jsx(On,{size:11}),a.jsx("span",{className:"uppercase tracking-wider opacity-70",children:l}),!x&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal truncate ml-1",children:[r.slice(0,80),r.length>80?"…":""]})]}),x&&a.jsx("pre",{className:"px-3 pb-2.5 text-[11px] font-mono whitespace-pre-wrap break-words max-h-80 overflow-auto",children:r})]})}function i2({label:l,value:r}){return a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] rounded-full bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",children:[a.jsx("span",{className:"opacity-60",children:l}),a.jsx("span",{className:"font-mono text-[hsl(var(--foreground))]",children:typeof r=="object"?JSON.stringify(r):String(r)})]})}function o2({event:l}){const r=k0(l);return r?a.jsxs(a.Fragment,{children:[l.model&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Model:"})," ",l.model,r.turn!=null&&a.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:["· turn ",r.turn]})]}),r.params&&Object.keys(r.params).length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:Object.entries(r.params).map(([i,u])=>a.jsx(i2,{label:i,value:u},i))}),r.toolNames&&r.toolNames.length>0&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Tools:"})," ",a.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:r.toolNames.join(", ")})]}),r.system&&a.jsx(Rn,{label:"System prompt",content:r.system,tone:"info"}),r.prompt&&a.jsx(Rn,{label:"Prompt",content:r.prompt,defaultOpen:!0}),r.messages&&a.jsx(Rn,{label:`Messages (verbose) — ${r.messages.length}`,content:r.messages.map(i=>`[${i.role}]
302
+ ${i.content??""}`).join(`
303
+
304
+ ───
305
+
306
+ `)})]}):null}function u2({event:l}){const r=T0(l);return r?a.jsxs(a.Fragment,{children:[l.model&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Model:"})," ",l.model,r.turn!=null&&a.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:["· turn ",r.turn]})]}),l.promptVersion&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Version:"})," ",l.promptVersion]}),l.tokens&&(l.tokens.input!=null||l.tokens.output!=null)&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Tokens:"}),l.tokens.input!=null?` in=${l.tokens.input}`:"",l.tokens.output!=null?` out=${l.tokens.output}`:"",l.tokens.reasoning?` reasoning=${l.tokens.reasoning}`:""]}),r.thinking&&a.jsx(Rn,{label:"Thinking",content:r.thinking,tone:"info"}),r.response&&a.jsx(Rn,{label:"Response",content:r.response,defaultOpen:!0}),r.error&&a.jsx(Rn,{label:"Provider error",content:r.error,tone:"warning",defaultOpen:!0})]}):null}function c2({event:l}){const r=s2(l);return r?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center gap-2 mb-2 text-xs",children:a.jsx("span",{className:Z("px-2 py-0.5 rounded-full text-[10px] font-medium",r.approved?"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300":"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300"),children:r.approved?"APPROVED":"DENIED"})}),r.reason&&a.jsxs("p",{className:"text-xs mb-2",children:[a.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.args!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mb-1",children:"Arguments"}),a.jsx(A0,{data:r.args})]})]}):null}function d2({event:l}){const r=M0(l);if(!r)return null;const i=r.valid===!1||r.blocked===!0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[a.jsx("span",{className:Z("px-2 py-0.5 rounded-full text-[10px] font-medium",i?"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300":"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300"),children:i?"FAILED":"PASSED"}),r.attempt!=null&&r.maxAttempts!=null&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["attempt ",r.attempt," of ",r.maxAttempts]}),r.guardrailType&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["· ",r.guardrailType]})]}),r.reason&&a.jsxs("p",{className:"text-xs mb-2",children:[a.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.feedbackMessage&&a.jsx(Rn,{label:"Retry feedback sent to LLM",content:r.feedbackMessage,tone:"warning",defaultOpen:!0})]})}function f2({event:l}){if(l.type!=="ask_start")return null;const{prompt:r}=l;return a.jsx(a.Fragment,{children:r.length>0?a.jsx(Rn,{label:"Prompt",content:r,defaultOpen:!0}):a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"(no prompt)"})})}function h2({event:l}){if(l.type!=="ask_end")return null;const{outcome:r,cost:i,duration:u}=l;return a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Outcome:"})," ",a.jsx("span",{className:r.ok?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:r.ok?"ok":"error"})]}),a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Ask cost:"})," ",nt(i)]}),a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Duration:"})," ",u,"ms"]}),r.ok&&r.result!==void 0&&a.jsx(Rn,{label:"Result",content:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2),defaultOpen:!0}),!r.ok&&r.error&&a.jsx(Rn,{label:"Error",content:r.error,tone:"warning",defaultOpen:!0})]})}function m2({event:l}){if(l.type!=="pipeline")return null;const{status:r,stage:i,attempt:u,maxAttempts:d}=l,f=l.status==="failed"?l.reason:void 0;return a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Pipeline:"})," ",i," · ",r," · attempt ",u,"/",d]}),f&&a.jsx(Rn,{label:"Failure reason",content:f,tone:"warning",defaultOpen:!0})]})}function p2({event:l}){if(l.type==="handoff_start"){if(!l.data)return null;const{source:r,target:i,mode:u,message:d}=l.data;return a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Handoff starts:"})," ",r," → ",i,u?` · ${u}`:""]}),d&&a.jsx(Rn,{label:"Prompt to target",content:d,defaultOpen:!0})]})}if(l.type==="handoff_return"){if(!l.data)return null;const{source:r,target:i,duration:u}=l.data;return a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Handoff returns:"})," ",r," → ",i]}),typeof u=="number"&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Round-trip duration:"})," ",u,"ms"]})]})}return null}function x2({event:l}){const r="data"in l?l.data:void 0;return a.jsxs(a.Fragment,{children:[l.model&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Model:"})," ",l.model]}),l.promptVersion&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Version:"})," ",l.promptVersion]}),l.tokens&&(l.tokens.input!=null||l.tokens.output!=null)&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Tokens:"}),l.tokens.input!=null?` in=${l.tokens.input}`:"",l.tokens.output!=null?` out=${l.tokens.output}`:"",l.tokens.reasoning?` reasoning=${l.tokens.reasoning}`:""]}),r!=null&&a.jsx(A0,{data:r,collapsed:!0})]})}function g2({event:l,index:r,isExpanded:i,onToggle:u,maxDuration:d,baseDepth:f}){var w,k;const x=Math.max(0,C0(l)-f),m=r2(l),h=M0(l),g=l.type==="guardrail"||l.type==="schema_check"||l.type==="validate",y=g&&((h==null?void 0:h.valid)===!1||(h==null?void 0:h.blocked)===!0),v=l.step!=null&&l.step!==Number.MAX_SAFE_INTEGER?`#${l.step}`:"";return a.jsxs("div",{children:[a.jsxs("button",{onClick:u,className:Z("w-full flex items-center gap-2 px-3 py-1.5 text-xs rounded-xl cursor-pointer hover:bg-[hsl(var(--accent))] text-left",m||y?"bg-amber-100/60 dark:bg-amber-950/30 ring-1 ring-amber-400/40":"bg-[hsl(var(--secondary))]"),style:{marginLeft:`${x*16}px`},children:[i?a.jsx(Ma,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}):a.jsx(On,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}),a.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))] w-8 truncate",children:v||`#${r}`}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Fx(l)}`}),a.jsx("span",{className:"font-medium w-28 truncate",children:l.type}),m&&a.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[9px] font-medium rounded-full bg-amber-200 text-amber-900 dark:bg-amber-800 dark:text-amber-100",title:`Retry after ${((w=k0(l))==null?void 0:w.retryReason)??((k=T0(l))==null?void 0:k.retryReason)} failure`,children:[a.jsx(bN,{size:9}),"retry"]}),(h==null?void 0:h.attempt)!=null&&h.maxAttempts!=null&&a.jsxs("span",{className:"px-1.5 py-0.5 text-[9px] font-medium rounded-full bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",title:`Attempt ${h.attempt} of ${h.maxAttempts}`,children:[h.attempt,"/",h.maxAttempts]}),l.agent&&a.jsx("span",{className:"text-blue-600 dark:text-blue-400 w-28 truncate",children:l.agent}),"tool"in l&&l.tool&&a.jsx("span",{className:"text-purple-600 dark:text-purple-400 w-28 truncate",children:l.tool}),a.jsx("div",{className:"flex-1 h-3 bg-[hsl(var(--background))] rounded overflow-hidden",children:l.duration!=null&&l.duration>0&&a.jsx("div",{className:`h-full rounded ${Fx(l)}`,style:{width:`${Math.max(l.duration/d*100,2)}%`,opacity:.7}})}),l.duration!=null&&a.jsx(Mf,{ms:l.duration}),l.cost!=null&&l.cost>0&&a.jsx(Bn,{cost:l.cost})]}),i&&a.jsx("div",{className:"mt-1 mb-2 p-3 rounded-xl bg-[hsl(var(--card))] border border-[hsl(var(--border))]",style:{marginLeft:`${x*16+32}px`},children:l.type==="agent_call_start"?a.jsx(o2,{event:l}):l.type==="agent_call_end"?a.jsx(u2,{event:l}):g?a.jsx(d2,{event:l}):l.type==="tool_approval"?a.jsx(c2,{event:l}):l.type==="ask_start"?a.jsx(f2,{event:l}):l.type==="ask_end"?a.jsx(h2,{event:l}):l.type==="pipeline"?a.jsx(m2,{event:l}):l.type==="handoff_start"||l.type==="handoff_return"?a.jsx(p2,{event:l}):a.jsx(x2,{event:l})})]})}function Ci({events:l,maxDuration:r,showToolbar:i=!0,header:u}){const[d,f]=b.useState(new Set),[x,m]=b.useState(0),[h,g]=b.useState(0),y=b.useMemo(()=>r??Math.max(...l.map(O=>O.duration??0),1),[l,r]),v=b.useMemo(()=>{let O=1/0;for(const A of l){const z=C0(A);z<O&&(O=z)}return Number.isFinite(O)?O:0},[l]),w=O=>{f(A=>{const z=new Set(A);return z.has(O)?z.delete(O):z.add(O),z})},k=()=>{const O=l.map((A,z)=>A.step??z);f(new Set(O)),m(1),g(A=>A+1)},E=()=>{f(new Set),m(0),g(O=>O+1)};return a.jsxs(a.Fragment,{children:[i&&a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[l.length," event",l.length!==1?"s":"",u&&a.jsx("span",{className:"ml-2",children:u})]}),l.length>0&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("button",{onClick:k,className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md hover:bg-[hsl(var(--accent))] text-[hsl(var(--muted-foreground))]",title:"Expand all — including inner sections",children:[a.jsx(c0,{size:12}),"Expand"]}),a.jsxs("button",{onClick:E,className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md hover:bg-[hsl(var(--accent))] text-[hsl(var(--muted-foreground))]",title:"Collapse all",children:[a.jsx(u0,{size:12}),"Collapse"]})]})]}),a.jsx(Af.Provider,{value:{level:x,version:h},children:a.jsx("div",{className:"space-y-1",children:l.map((O,A)=>{const z=O.step??A;return a.jsx(g2,{event:O,index:A,isExpanded:d.has(z),onToggle:()=>w(z),maxDuration:y,baseDepth:v},z)})})})]})}const Jx="axl.studio.split.",Ix=2,v2=6;function Wx(l,r){return l<=0?!1:l<2*r+v2}function Od(l,r,i){return Math.min(i,Math.max(r,l))}function pr({left:l,right:r,defaultPercent:i=50,minPercent:u=20,maxPercent:d=80,minPx:f=200,storageKey:x,className:m}){const[h,g]=b.useState(()=>{if(!x)return i;try{const M=localStorage.getItem(Jx+x);if(!M)return i;const U=Number(M);return Number.isFinite(U)?Od(U,u,d):i}catch{return i}}),[y,v]=b.useState(!1),w=b.useRef(null),k=b.useRef(!1),E=b.useRef(null),O=b.useRef(null);b.useEffect(()=>{if(x)try{localStorage.setItem(Jx+x,String(h))}catch{}},[x,h]),b.useEffect(()=>{const M=w.current;if(!M||typeof ResizeObserver>"u"){M&&v(Wx(M.getBoundingClientRect().width,f));return}const U=new ResizeObserver(D=>{const le=D[0];if(!le)return;const se=le.contentRect.width;v(Wx(se,f))});return U.observe(M),()=>U.disconnect()},[f]);const A=b.useCallback(()=>{var D;const M=((D=w.current)==null?void 0:D.getBoundingClientRect().width)??0;if(!M||!Number.isFinite(M))return{min:u,max:d};const U=f/M*100;return{min:Math.max(u,U),max:Math.min(d,100-U)}},[u,d,f]);b.useEffect(()=>()=>{E.current&&(document.removeEventListener("mousemove",E.current),document.removeEventListener("touchmove",E.current)),O.current&&(document.removeEventListener("mouseup",O.current),document.removeEventListener("touchend",O.current),document.removeEventListener("touchcancel",O.current)),k.current&&(document.body.style.cursor="",document.body.style.userSelect="")},[]);const z=b.useCallback(M=>{k.current=!0;const U=M,D=w.current;if(!D)return;const le=D.getBoundingClientRect().width,se=h,I=Y=>{var he;if(!k.current)return;const ne=D.getBoundingClientRect().width||le,T=(("touches"in Y?((he=Y.touches[0])==null?void 0:he.clientX)??U:Y.clientX)-U)/ne*100,{min:H,max:J}=A();g(Od(se+T,H,J))},oe=()=>{k.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("touchmove",I),document.removeEventListener("mouseup",oe),document.removeEventListener("touchend",oe),document.removeEventListener("touchcancel",oe),document.body.style.cursor="",document.body.style.userSelect="",E.current=null,O.current=null};E.current=I,O.current=oe,document.addEventListener("mousemove",I),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("mouseup",oe),document.addEventListener("touchend",oe),document.addEventListener("touchcancel",oe),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[h,A]),V=b.useCallback(M=>{M.preventDefault(),z(M.clientX)},[z]),N=b.useCallback(M=>{const U=M.touches[0];U&&z(U.clientX)},[z]),S=b.useCallback(M=>{if(M.key!=="ArrowLeft"&&M.key!=="ArrowRight")return;M.preventDefault();const U=M.key==="ArrowLeft"?-1:1,D=M.shiftKey?Ix*5:Ix,{min:le,max:se}=A();g(I=>Od(I+U*D,le,se))},[A]);return y?a.jsxs("div",{ref:w,className:Z("flex flex-col min-h-0",m),children:[a.jsx("div",{className:"min-h-0 min-w-0 flex flex-col flex-1 overflow-auto",children:l}),a.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"h-px shrink-0 bg-[hsl(var(--border))]"}),a.jsx("div",{className:"min-h-0 min-w-0 flex flex-col flex-1 overflow-auto",children:r})]}):a.jsxs("div",{ref:w,className:Z("flex min-h-0",m),children:[a.jsx("div",{className:"min-h-0 min-w-0 flex flex-col",style:{width:`${h}%`},children:l}),a.jsx("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":Math.round(h),"aria-valuemin":u,"aria-valuemax":d,tabIndex:0,onMouseDown:V,onTouchStart:N,onKeyDown:S,className:"w-1.5 shrink-0 cursor-col-resize bg-[hsl(var(--border))] hover:bg-[hsl(var(--ring))] focus:bg-[hsl(var(--ring))] focus:outline-none transition-colors"}),a.jsx("div",{className:"min-h-0 min-w-0 flex flex-col",style:{width:`${100-h}%`},children:r})]})}const y2=(window.__AXL_STUDIO_BASE__??"")+"/api";async function Je(l,r){const i=await fetch(`${y2}${l}`,{headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(i.status===413)throw new Error(`Request body too large (HTTP 413). If you're importing a large eval file through an embedded Studio middleware, raise your host framework's JSON body limit on the Studio mount. See the Studio README "Host body limits" section.`);if(!(i.headers.get("content-type")??"").includes("application/json")){const x=(await i.text().catch(()=>"")).slice(0,200).trim();throw new Error(`Server returned HTTP ${i.status} with non-JSON response`+(x?`: ${x}`:""))}let d;try{d=await i.json()}catch(f){throw new Error(`Failed to parse server response as JSON (HTTP ${i.status}): ${f instanceof Error?f.message:String(f)}`)}if(!d.ok)throw new Error(d.error.message);return d.data}const b2=()=>Je("/health"),j2=()=>Je("/workflows"),N2=l=>Je(`/workflows/${encodeURIComponent(l)}`),S2=(l,r,i=!1)=>Je(`/workflows/${encodeURIComponent(l)}/execute`,{method:"POST",body:JSON.stringify({input:r,stream:i})}),w2=()=>Je("/executions"),E2=()=>Je("/sessions"),C2=l=>Je(`/sessions/${encodeURIComponent(l)}`),k2=l=>Je(`/sessions/${encodeURIComponent(l)}`,{method:"DELETE"}),T2=()=>Je("/agents"),M2=()=>Je("/tools"),A2=l=>Je(`/tools/${encodeURIComponent(l)}`),R2=(l,r)=>Je(`/tools/${encodeURIComponent(l)}/test`,{method:"POST",body:JSON.stringify({input:r})}),O2=l=>Je(`/memory/${encodeURIComponent(l)}`),_2=(l,r,i)=>Je(`/memory/${encodeURIComponent(l)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({value:i})}),z2=(l,r)=>Je(`/memory/${encodeURIComponent(l)}/${encodeURIComponent(r)}`,{method:"DELETE"}),D2=(l,r,i)=>Je("/memory/search",{method:"POST",body:JSON.stringify({query:l,scope:r,limit:i})}),U2=(l="7d")=>Je(`/costs?window=${l}`),L2=(l="7d")=>Je(`/eval-trends?window=${l}`),H2=(l="7d")=>Je(`/workflow-stats?window=${l}`),q2=(l="7d")=>Je(`/trace-stats?window=${l}`),B2=()=>Je("/evals"),Q2=()=>Je("/evals/history"),G2=(l,r)=>Je(`/evals/${encodeURIComponent(l)}/run`,{method:"POST",body:JSON.stringify({runs:r==null?void 0:r.runs,stream:!0,captureTraces:r==null?void 0:r.captureTraces})}),R0=l=>Je(`/evals/runs/${encodeURIComponent(l)}/cancel`,{method:"POST"}),Y2=(l,r)=>Je(`/evals/${encodeURIComponent(l)}/rescore`,{method:"POST",body:JSON.stringify({resultId:r})}),$2=(l,r,i)=>Je("/evals/compare",{method:"POST",body:JSON.stringify({baselineId:l,candidateId:r,options:i})}),K2=(l,r)=>Je("/evals/import",{method:"POST",body:JSON.stringify({result:l,eval:r})}),X2=l=>Je(`/evals/history/${encodeURIComponent(l)}`,{method:"DELETE"}),V2=(l,r,i)=>Je("/playground/chat",{method:"POST",body:JSON.stringify({message:l,sessionId:r,agent:i})});class Z2{constructor(){oi(this,"ws",null);oi(this,"listeners",new Map);oi(this,"reconnectTimer",null);oi(this,"url");const r=window.location.protocol==="https:"?"wss:":"ws:",i=window.__AXL_STUDIO_BASE__??"";this.url=`${r}//${window.location.host}${i}/ws`}connect(){var r;((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{for(const i of this.listeners.keys())this.send({type:"subscribe",channel:i})},this.ws.onmessage=i=>{try{const u=JSON.parse(i.data);if(u.type==="event"&&u.channel){const d=this.listeners.get(u.channel);if(d)for(const x of d)x(u.data);const f=u.channel.indexOf(":");if(f>0){const x=u.channel.substring(0,f)+":*",m=this.listeners.get(x);if(m)for(const h of m)h(u.data)}}}catch{}},this.ws.onclose=()=>{this.scheduleReconnect()},this.ws.onerror=()=>{var i;(i=this.ws)==null||i.close()})}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},2e3))}send(r){var i;((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}subscribe(r,i){let u=this.listeners.get(r);return u||(u=new Set,this.listeners.set(r,u),this.send({type:"subscribe",channel:r})),u.add(i),this.connect(),()=>{u.delete(i),u.size===0&&(this.listeners.delete(r),this.send({type:"unsubscribe",channel:r}))}}disconnect(){var r;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(r=this.ws)==null||r.close(),this.ws=null}}const O0=new Z2;function Rf(l,r){const i=b.useRef(r);i.current=r,b.useEffect(()=>{if(l)return O0.subscribe(l,u=>i.current(u))},[l])}const Px={tokens:"",events:[],done:!1,error:null,result:null};function _0(l){const[r,i]=b.useState(Px),u=b.useRef(null);b.useEffect(()=>{if(l===u.current)return;const f=u.current;u.current=l,l!==null?i(Px):f!==null&&i(x=>({...x,done:!1,result:null,error:null}))},[l]);const d=b.useCallback(f=>{const x=f;i(m=>{var h,g;switch(x.type){case"token":{const v=(x.depth??0)===0?m.tokens+(x.data??""):m.tokens;return{...m,tokens:v,events:[...m.events,x]}}case"done":return{...m,done:!0,result:((h=x.data)==null?void 0:h.result)??null,events:[...m.events,x]};case"error":return{...m,done:!0,error:((g=x.data)==null?void 0:g.message)||"Unknown error",events:[...m.events,x]};default:return{...m,events:[...m.events,x]}}})},[]);return Rf(l?`execution:${l}`:null,d),r}const F2=new Set(["tool_call_start","handoff_start","tool_approval"]);function J2(){const[l,r]=b.useState([]),[i,u]=b.useState(""),[d,f]=b.useState(null),[x,m]=b.useState(null),[h,g]=b.useState(""),[y,v]=b.useState(!1),[w,k]=b.useState(0),[E,O]=b.useState({input:0,output:0}),[A,z]=b.useState(!1),V=b.useRef(!1),N=b.useRef(null),S=b.useRef(0),M=b.useRef(0),{data:U=[]}=gn({queryKey:["agents"],queryFn:T2}),D=_0(x);b.useEffect(()=>{if(D.tokens&&y&&r(Q=>{const G=Q[Q.length-1];return(G==null?void 0:G.role)==="assistant"?[...Q.slice(0,-1),{...G,content:D.tokens}]:[...Q,{role:"assistant",content:D.tokens}]}),D.done&&y){if(v(!1),m(null),D.error)r(Q=>{const G=Q[Q.length-1];return(G==null?void 0:G.role)==="assistant"&&!G.content?[...Q.slice(0,-1),{role:"assistant",content:`Error: ${D.error}`}]:[...Q,{role:"assistant",content:`Error: ${D.error}`}]});else if(!D.tokens&&D.result!=null){const Q=typeof D.result=="string"?D.result:JSON.stringify(D.result);r(G=>{const T=G[G.length-1];return(T==null?void 0:T.role)==="assistant"&&!T.content?[...G.slice(0,-1),{...T,content:Q}]:[...G,{role:"assistant",content:Q}]})}}},[D.tokens,D.done,D.error,y]),b.useEffect(()=>{var H,J,he;const Q=[],G=[],T=[];for(const de of D.events)if(de.type==="tool_call_start")Q.push({name:de.tool,args:(H=de.data)==null?void 0:H.args,callId:de.callId});else if(de.type==="tool_call_end"){const C=de.callId?Q.find(q=>q.callId===de.callId):Q.find(q=>q.name===de.tool&&!q.result);C&&(C.result=(J=de.data)==null?void 0:J.result)}else if(de.type==="handoff_start"){const C=de.data;C&&G.push({source:C.source,target:C.target,mode:C.mode})}else de.type==="tool_approval"&&T.push({tool:de.tool,approved:((he=de.data)==null?void 0:he.approved)===!0});(Q.length>0||G.length>0||T.length>0)&&r(de=>{const C=de[de.length-1];return(C==null?void 0:C.role)==="assistant"?[...de.slice(0,-1),{...C,toolCalls:Q.length>0?Q:C.toolCalls,handoffs:G.length>0?G:C.handoffs,approvals:T.length>0?T:C.approvals}]:de})},[D.events]),b.useEffect(()=>{const Q=D.events.slice(S.current);if(Q.length===0)return;S.current=D.events.length;let G=0,T=0,H=0;for(const J of Q)G+=j0(J),J.type==="agent_call_end"&&J.tokens&&(T+=J.tokens.input??0,H+=J.tokens.output??0);G>0&&k(J=>J+G),(T>0||H>0)&&O(J=>({input:J.input+T,output:J.output+H}))},[D.events]),b.useEffect(()=>{if(A||V.current){M.current=D.events.length;return}for(let Q=M.current;Q<D.events.length;Q++){const G=D.events[Q];if(!G)continue;const T="depth"in G&&typeof G.depth=="number"?G.depth:0;if(F2.has(G.type)||T>=1){z(!0),M.current=D.events.length;return}}M.current=D.events.length},[D.events,A]),b.useEffect(()=>{var Q;(Q=N.current)==null||Q.scrollIntoView({behavior:"smooth"})},[l]);const le=b.useCallback(async()=>{if(!i.trim()||y)return;const Q=i.trim();u(""),r(G=>[...G,{role:"user",content:Q}]),v(!0);try{const G=await V2(Q,d??void 0,h||void 0);f(G.sessionId),m(G.executionId)}catch(G){v(!1),r(T=>[...T,{role:"assistant",content:`Error: ${G instanceof Error?G.message:String(G)}`}])}},[i,y,d,h]),se=Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),le())},I=w>0||E.input>0,oe=l.length,Y=D.events.filter(Q=>Q.type!=="token"&&Q.type!=="partial_object"&&Q.type!=="done"&&Q.type!=="error"),ne=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex-1 overflow-auto p-3 sm:p-5 space-y-4",children:[l.length===0&&a.jsx(Jt,{title:"Start a conversation",description:"Type a message below to chat with an agent. Tool calls, handoffs, and streaming responses will be displayed in real-time."}),l.map((Q,G)=>a.jsx("div",{className:`flex ${Q.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-xl px-4 py-2.5 text-sm ${Q.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]":"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]"}`,children:[Q.role==="assistant"&&y&&G===l.length-1?a.jsx(KN,{text:Q.content}):a.jsx("div",{className:"whitespace-pre-wrap",children:Q.content}),Q.handoffs&&Q.handoffs.length>0&&a.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:Q.handoffs.map((T,H)=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx(or,{size:12,className:"text-amber-500"}),a.jsx("span",{className:"font-medium",children:T.source}),a.jsx(or,{size:10}),a.jsx("span",{className:"font-medium",children:T.target}),a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",T.mode,")"]})]},H))}),Q.approvals&&Q.approvals.length>0&&a.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:Q.approvals.map((T,H)=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx(EN,{size:12,className:T.approved?"text-green-500":"text-red-500"}),a.jsxs("span",{children:["Tool ",a.jsx("span",{className:"font-mono",children:T.tool}),":"," ",T.approved?"approved":"denied"]})]},H))}),Q.toolCalls&&Q.toolCalls.length>0&&a.jsx("div",{className:"mt-2 space-y-2 border-t border-[hsl(var(--border))] pt-2",children:Q.toolCalls.map((T,H)=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("div",{className:"font-medium mb-1",children:["Tool: ",T.name]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Input:"}),a.jsx(qt,{data:T.args,collapsed:!0}),T.result!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Output:"}),a.jsx(qt,{data:T.result,collapsed:!0})]})]})]},H))})]})},G)),a.jsx("div",{ref:N})]}),a.jsx("div",{className:"border-t border-[hsl(var(--border))] p-4 shrink-0",children:a.jsxs("div",{className:"flex items-end gap-2 max-w-3xl mx-auto",children:[a.jsx("textarea",{value:i,onChange:Q=>u(Q.target.value),onKeyDown:se,placeholder:"Type a message...",rows:1,className:"flex-1 px-3 py-2.5 text-sm rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] resize-none focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),a.jsx("button",{onClick:le,disabled:!i.trim()||y,className:"p-2.5 rounded-xl bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 disabled:opacity-50 transition-opacity",children:a.jsx(SN,{size:16})})]})})]});return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Agent Playground",description:oe>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[oe," message",oe!==1?"s":""]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{className:"font-mono",children:["session ",d.slice(0,8)]})]})]}):U.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[U.length," registered agent",U.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"pick one or use the default"})]}):"Interactive chat with registered agents",actions:a.jsxs(a.Fragment,{children:[I&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[w>0&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:nt(w)}),E.input>0&&a.jsxs("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:[An(E.input+E.output)," tok"]})]}),a.jsxs("button",{type:"button",onClick:()=>{z(Q=>(Q&&(V.current=!0),!Q))},"aria-pressed":A,title:"Show execution activity (tool calls, handoffs, agent calls)",className:Z("inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs","ring-1 ring-[hsl(var(--input))] hover:ring-[hsl(var(--ring))]",A?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"bg-[hsl(var(--background))] text-[hsl(var(--muted-foreground))]"),children:[a.jsx(uu,{size:12}),"Activity"]}),a.jsxs("div",{className:Z("inline-flex items-stretch rounded-full bg-[hsl(var(--background))]","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[a.jsx(gi,{items:U,value:h,onSelect:g,getKey:Q=>Q.name,getLabel:Q=>Q.name,getDescription:Q=>a.jsxs(a.Fragment,{children:[a.jsx("span",{children:Q.model}),Q.tools.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[Q.tools.length," tool",Q.tools.length!==1?"s":""]})]}),Q.handoffs.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[Q.handoffs.length," handoff",Q.handoffs.length!==1?"s":""]})]})]}),searchMatch:(Q,G)=>Q.name.toLowerCase().includes(G)||Q.model.toLowerCase().includes(G)||Q.tools.some(T=>T.toLowerCase().includes(G)),placeholder:"Default agent",searchPlaceholder:"Search agents…",emptyLabel:"No agents registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an agent"}),a.jsxs("button",{onClick:()=>{r([]),f(null),m(null),k(0),O({input:0,output:0}),z(!1),V.current=!1,S.current=0,M.current=0},className:Z("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","border-l border-[hsl(var(--input))] rounded-r-full","hover:bg-[hsl(var(--muted))] transition-colors","focus:outline-none focus-visible:bg-[hsl(var(--muted))]"),children:[a.jsx(tN,{size:12}),"New chat"]})]})]})}),A?a.jsx(pr,{className:"flex-1",left:ne,right:a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5 space-y-4",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Activity"}),a.jsx(E0,{events:D.events}),Y.length>0?a.jsx(Ci,{events:Y,showToolbar:!1}):a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"Events will appear here as the agent executes."})]})}):a.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:ne})]})}function z0({value:l,onChange:r,placeholder:i,className:u}){const[d,f]=b.useState(!1),[x,m]=b.useState(null),h=b.useRef(null),g=b.useCallback(v=>{const w=v.target.value;r(w);try{w.trim()&&JSON.parse(w),m(null)}catch(k){m(k instanceof Error?k.message:"Invalid JSON")}},[r]);b.useEffect(()=>{var v;d&&((v=h.current)==null||v.focus())},[d]);let y=null;try{y=l.trim()?JSON.parse(l):{}}catch{}return y===null||d?a.jsxs("div",{className:u,children:[a.jsx("textarea",{ref:h,value:l,onChange:g,onBlur:()=>{x||f(!1)},placeholder:i??"{}",className:"w-full h-40 p-3 text-xs font-mono rounded-xl bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] border-none resize-y focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]",spellCheck:!1}),x&&a.jsx("p",{className:"text-xs text-red-500 mt-1",children:x})]}):a.jsx("div",{className:u,children:a.jsxs("div",{children:[a.jsx(qt,{data:y,maxHeight:"12rem"}),a.jsxs("button",{onClick:()=>f(!0),className:"mt-1.5 inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[a.jsx(mN,{size:10}),"Edit"]})]})})}function D0({schema:l,onSubmit:r,submitLabel:i="Submit",className:u}){const[d,f]=b.useState({}),x=l.properties??{},m=new Set(l.required??[]),h=b.useCallback(g=>{g.preventDefault();const y={};for(const[v,w]of Object.entries(x)){const k=d[v]??"";if(!(!k&&!m.has(v)))if(w.type==="number")y[v]=Number(k);else if(w.type==="boolean")y[v]=k==="true";else if(w.type==="object"||w.type==="array")try{y[v]=JSON.parse(k)}catch{y[v]=k}else y[v]=k}r(y)},[d,x,m,r]);return a.jsxs("form",{onSubmit:h,className:`space-y-3 ${u??""}`,children:[Object.entries(x).map(([g,y])=>a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs font-medium text-[hsl(var(--foreground))] mb-1",children:[g,m.has(g)&&a.jsx("span",{className:"text-red-500 ml-0.5",children:"*"}),y.description&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal ml-1",children:["- ",y.description]})]}),y.enum?a.jsxs("select",{value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Select..."}),y.enum.map(v=>a.jsx("option",{value:v,children:v},v))]}):y.type==="boolean"?a.jsxs("select",{value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Select..."}),a.jsx("option",{value:"true",children:"true"}),a.jsx("option",{value:"false",children:"false"})]}):a.jsx("input",{type:y.type==="number"?"number":"text",value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),placeholder:y.type??"string",className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]},g)),a.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-medium rounded-md bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 transition-opacity",children:i})]})}function U0({status:l,className:r}){return a.jsxs("span",{className:Z("inline-flex items-center gap-1.5 whitespace-nowrap px-2 py-0.5 rounded-full text-xs font-medium",LN(l),l==="running"&&"animate-pulse",r),children:[a.jsx("span",{className:Z("w-1.5 h-1.5 rounded-full",l==="running"&&"bg-blue-500",l==="completed"&&"bg-green-500",l==="failed"&&"bg-red-500",l==="waiting"&&"bg-amber-500")}),l]})}function $e({label:l,value:r,subtitle:i,subtitleColor:u,accent:d,tint:f,badge:x}){return a.jsxs("div",{className:Z("px-4 py-3.5 rounded-xl min-w-0",f||"bg-[hsl(var(--card))] border border-[hsl(var(--border))]"),children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] truncate",children:l}),x?a.jsx("div",{className:"mt-1",children:x}):a.jsx("p",{className:Z("text-lg sm:text-2xl font-semibold mt-1 font-mono tracking-tight truncate select-text",d),title:r,children:r}),i&&a.jsx("p",{className:Z("text-xs mt-0.5 truncate",u??"text-[hsl(var(--muted-foreground))]"),title:i,children:i})]})}function I2(l){const{events:r,askId:i,onClose:u,className:d}=l,{filtered:f,summary:x}=b.useMemo(()=>{var O;const m=r.filter(A=>"askId"in A&&A.askId===i||(A.type==="handoff_start"||A.type==="handoff_return")&&(A.fromAskId===i||A.toAskId===i)),h=m.find(A=>A.type==="ask_start"),g=m.find(A=>A.type==="ask_end"),y=(h==null?void 0:h.agent)??((O=m.find(A=>"agent"in A&&!!A.agent))==null?void 0:O.agent),v=h==null?void 0:h.prompt,w=g==null?void 0:g.cost,k=h&&g&&typeof h.timestamp=="number"&&typeof g.timestamp=="number"?g.timestamp-h.timestamp:void 0,E=g==null?void 0:g.outcome;return{filtered:m,summary:{agent:y,prompt:v,cost:w,duration:k,outcome:E}}},[r,i]);return a.jsxs("div",{"data-testid":"ask-details","data-ask-id":i,className:Z("flex flex-col h-full bg-white border-l border-slate-200 dark:bg-slate-900 dark:border-slate-700",d),children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-200 dark:border-slate-700",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium truncate",children:x.agent??"<unknown agent>"}),a.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",title:i,children:i.slice(0,8)})]}),u&&a.jsx("button",{type:"button",onClick:u,"aria-label":"Close ask details",className:"rounded p-1 hover:bg-slate-100 dark:hover:bg-slate-800",children:a.jsx(v0,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"px-4 py-2 border-b border-slate-200 dark:border-slate-700 flex items-center gap-3 text-xs",children:[x.duration!==void 0&&a.jsx(Mf,{ms:x.duration}),typeof x.cost=="number"&&a.jsx(Bn,{cost:x.cost}),x.outcome&&a.jsx("span",{className:Z("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",x.outcome.ok?"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200":"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200"),children:x.outcome.ok?"ok":"failed"})]}),x.prompt&&a.jsxs("div",{className:"px-4 py-2 border-b border-slate-200 text-sm dark:border-slate-700",children:[a.jsx("div",{className:"text-xs uppercase tracking-wide text-[hsl(var(--muted-foreground))] mb-1",children:"Prompt"}),a.jsx("div",{className:"font-mono whitespace-pre-wrap break-words",children:x.prompt})]}),a.jsx("div",{className:"flex-1 overflow-auto px-2 py-2",children:f.length===0?a.jsx("div",{className:"text-sm text-[hsl(var(--muted-foreground))] py-4 text-center",children:"No events for this ask."}):a.jsx(Ci,{events:f})})]})}const L0=[{id:"24h",label:"24h"},{id:"7d",label:"7d"},{id:"30d",label:"30d"},{id:"all",label:"All"}],H0="axl.studio.window";function W2(){try{const l=localStorage.getItem(H0);if(l&&L0.some(r=>r.id===l))return l}catch{}return"7d"}function P2(l){try{localStorage.setItem(H0,l)}catch{}}function vl({value:l,onChange:r}){return a.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-[hsl(var(--muted))]",role:"radiogroup","aria-label":"Time window",children:L0.map(i=>a.jsx("button",{type:"button",role:"radio","aria-checked":l===i.id,"aria-label":`Window: ${i.label}`,onClick:()=>r(i.id),className:Z("px-2.5 py-1 text-xs font-medium rounded-md transition-all cursor-pointer",l===i.id?"bg-[hsl(var(--background))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:i.label},i.id))})}function cu(l,r){const[i,u]=b.useState(W2),[d,f]=b.useState(null),[x,m]=b.useState(null),{data:h}=gn({queryKey:[l,i],queryFn:()=>r(i)});return Rf(l,b.useCallback(y=>{const v=y;v.snapshots&&(f(v.snapshots),typeof v.updatedAt=="number"&&m(v.updatedAt))},[])),{window:i,handleWindowChange:y=>{u(y),P2(y)},data:(d==null?void 0:d[i])??h??null,updatedAt:x}}function eS({onWorkflowClick:l,selectedWorkflow:r}={}){const{window:i,handleWindowChange:u,data:d}=cu("workflow-stats",H2),f=!d||d.totalExecutions===0,x=d?Object.entries(d.byWorkflow).sort(([,m],[,h])=>h.total-m.total):[];return f?a.jsxs("div",{className:"space-y-3 mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),a.jsx(vl,{value:i,onChange:u})]}),a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))] italic",children:["No executions in the ",i," window. Try a wider window."]})]}):a.jsxs("div",{className:"space-y-3 mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),a.jsx(vl,{value:i,onChange:u})]}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx($e,{label:"Total Executions",value:String(d.totalExecutions),subtitle:i}),a.jsx($e,{label:"Failure Rate",value:`${(d.failureRate*100).toFixed(1)}%`,subtitle:d.failureRate>.1?"high":"normal",subtitleColor:d.failureRate>.1?"text-red-500":void 0})]}),x.length>0&&a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs min-w-[560px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("th",{className:"py-2 px-3 text-left font-medium",children:"Workflow"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Total"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Failed"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"50th percentile duration (approximate for workflows with 200+ executions)",children:"p50"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"95th percentile duration (approximate for workflows with 200+ executions)",children:"p95"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Avg"})]})}),a.jsx("tbody",{children:x.map(([m,h])=>a.jsxs("tr",{onClick:l?()=>l(m):void 0,className:Z("border-b last:border-b-0 border-[hsl(var(--border))]",l&&"cursor-pointer hover:bg-[hsl(var(--accent))]",r===m&&"bg-[hsl(var(--accent))]"),title:l?"Click to select this workflow":void 0,children:[a.jsx("td",{className:"py-2 px-3 font-mono",children:m}),a.jsx("td",{className:"py-2 px-3 text-right",children:h.total}),a.jsx("td",{className:"py-2 px-3 text-right",children:h.failed>0?a.jsx("span",{className:"text-red-500",children:h.failed}):"0"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:h.durationP50!=null?ot(h.durationP50):"—"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:h.durationP95!=null?ot(h.durationP95):"—"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:ot(h.avgDuration)})]},m))})]})})]})}function tS(){const[l,r]=b.useState(""),[i,u]=b.useState("{}"),[d,f]=b.useState(!0),[x,m]=b.useState(null),[h,g]=b.useState(void 0),[y,v]=b.useState(null),[w,k]=b.useState("idle"),[E,O]=b.useState("run"),[A,z]=b.useState("tree"),[V,N]=b.useState(void 0),{data:S=[]}=gn({queryKey:["workflows"],queryFn:j2}),{data:M}=gn({queryKey:["workflow",l],queryFn:()=>N2(l),enabled:!!l}),U=_0(x),D=b.useCallback(async H=>{if(l){g(void 0),v(null),k("running");try{const J=await S2(l,H,!0);J.streaming&&J.executionId?m(J.executionId):(g(J.result),k("completed"))}catch(J){v(J instanceof Error?J.message:String(J)),k("failed")}}},[l]),le=b.useCallback(()=>{try{const H=JSON.parse(i);D(H)}catch(H){v(H instanceof Error?H.message:String(H)),k("failed")}},[i,D]),se=b.useCallback(H=>{r(H),u("{}"),g(void 0),v(null),k("idle")},[]),I=S.find(H=>H.name===l),oe=b.useCallback(H=>{D(H)},[D]);b.useEffect(()=>{U.done&&w==="running"&&(k(U.error?"failed":"completed"),U.error&&v(U.error),U.result!==void 0&&g(U.result),m(null))},[U.done,U.error,U.result,w]);const Y=U.events,ne=!!(M!=null&&M.inputSchema),Q=Math.max(...Y.map(H=>H.duration??0),1),G=Y.reduce((H,J)=>H+(J.duration??0),0),T=Y.reduce((H,J)=>H+j0(J),0);return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Workflow Runner",description:I?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:I.name}),(I.hasInputSchema||I.hasOutputSchema)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[I.hasInputSchema&&"input schema",I.hasInputSchema&&I.hasOutputSchema&&" · ",I.hasOutputSchema&&"output schema"]})]})]}):S.length>0?`${S.length} registered workflow${S.length!==1?"s":""} · select one to run`:"No workflows registered",actions:S.length>0&&a.jsxs("div",{className:Z("inline-flex items-stretch rounded-full bg-[hsl(var(--background))] shrink-0","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[a.jsx(gi,{items:S,value:l,onSelect:se,getKey:H=>H.name,getLabel:H=>H.name,getDescription:H=>{const J=[];return H.hasInputSchema&&J.push("input schema"),H.hasOutputSchema&&J.push("output schema"),J.length>0?J.join(" · "):"no schema"},placeholder:"Select workflow",searchPlaceholder:"Search workflows…",emptyLabel:"No workflows registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select a workflow"}),a.jsxs("button",{onClick:le,disabled:!l||w==="running",className:Z("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] rounded-r-full","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-[hsl(var(--foreground))]","disabled:opacity-40 disabled:cursor-not-allowed transition-opacity"),children:[a.jsx(kf,{size:12,className:Z("fill-current",w==="running"&&"animate-spin fill-none")}),w==="running"?"Running…":"Run"]})]})}),a.jsx("div",{role:"tablist","aria-label":"Workflow Runner views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:["run","stats"].map(H=>a.jsx("button",{type:"button",role:"tab","aria-selected":E===H,onClick:()=>O(H),className:Z("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",E===H?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:H.charAt(0).toUpperCase()+H.slice(1)},H))}),E==="stats"&&a.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 sm:p-5",children:a.jsx(eS,{onWorkflowClick:H=>{se(H),O("run")},selectedWorkflow:l})}),E==="run"&&a.jsx(pr,{className:"flex-1",defaultPercent:30,minPercent:15,maxPercent:50,left:a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5 space-y-4",children:[ne&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>f(!0),className:Z("px-3 py-1 text-xs rounded-lg transition-colors",d?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:"Form"}),a.jsx("button",{onClick:()=>f(!1),className:Z("px-3 py-1 text-xs rounded-lg transition-colors",d?"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]":"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]"),children:"JSON"})]}),ne&&d?a.jsx(D0,{schema:M.inputSchema,onSubmit:oe,submitLabel:w==="running"?"Running…":"Execute"}):a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Input (JSON)"}),a.jsx(z0,{value:i,onChange:u})]}),(M==null?void 0:M.outputSchema)!=null&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Output Schema"}),a.jsx(qt,{data:M.outputSchema,collapsed:!0})]})]}),right:a.jsx("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5",children:w==="idle"?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(Jt,{icon:a.jsx(ur,{size:32}),title:"No execution",description:"Select a workflow and click Run to see results."})}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx($e,{label:"Status",badge:a.jsx(U0,{status:w})}),a.jsx($e,{label:"Steps",value:String(Y.length)}),a.jsx($e,{label:"Duration",value:G>0?ot(G):"—"}),a.jsx($e,{label:"Cost",value:T>0?nt(T):"—"})]}),y&&a.jsx("div",{className:"p-4 rounded-xl bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm",children:y}),h!==void 0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),a.jsx(qt,{data:h})]}),Y.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Timeline"}),a.jsxs("div",{className:"flex gap-1 text-xs",children:[a.jsx("button",{type:"button",onClick:()=>z("tree"),className:Z("px-2 py-0.5 rounded",A==="tree"?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--secondary))]/50"),children:"Tree"}),a.jsx("button",{type:"button",onClick:()=>z("flat"),className:Z("px-2 py-0.5 rounded",A==="flat"?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--secondary))]/50"),children:"Flat"})]})]}),A==="tree"?a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_360px] gap-3 max-w-[960px]",children:[a.jsx(E0,{events:Y,selectedAskId:V,onSelectAsk:N}),V&&a.jsx(I2,{events:Y,askId:V,onClose:()=>N(void 0),className:"max-h-[600px] rounded border border-slate-200 dark:border-slate-700"})]}):a.jsx(Ci,{events:Y,maxDuration:Q})]}),w==="running"&&Y.length===0&&a.jsxs("div",{className:"flex items-center justify-center py-12 text-sm text-[hsl(var(--muted-foreground))]",children:[a.jsx(ur,{size:16,className:"animate-pulse mr-2"}),"Executing workflow…"]})]})})})]})}function eg({data:l,maxBars:r,defaultColor:i="hsl(var(--primary))",formatValue:u=f=>String(f),className:d}){const f=[...l].sort((h,g)=>g.value-h.value),x=r?f.slice(0,r):f,m=x.length>0?Math.max(...x.map(h=>h.value)):1;return x.length===0?a.jsx("p",{className:Z("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"}):a.jsx("div",{className:Z("space-y-1",d),children:x.map(h=>{const g=m>0?h.value/m*100:0;return a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:h.label,children:h.label}),a.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))]",children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded",style:{width:`${g}%`,backgroundColor:h.color??i,opacity:.7}})}),a.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:u(h.value)})]},h.label)})})}function tg({data:l,maxBars:r,formatValue:i=f=>String(f),showLegend:u=!0,className:d}){const x=[...l.map(y=>({...y,total:y.segments.reduce((v,w)=>v+w.value,0)}))].sort((y,v)=>v.total-y.total),m=r?x.slice(0,r):x,h=m.length>0?Math.max(...m.map(y=>y.total)):1;if(m.length===0)return a.jsx("p",{className:Z("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"});const g=new Map;for(const y of m)for(const v of y.segments)g.has(v.name)||g.set(v.name,v.color);return a.jsxs("div",{className:Z("space-y-2",d),children:[u&&g.size>0&&a.jsx("div",{className:"flex flex-wrap gap-3 text-[10px] text-[hsl(var(--muted-foreground))]",children:Array.from(g.entries()).map(([y,v])=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:v}}),a.jsx("span",{children:y})]},y))}),a.jsx("div",{className:"space-y-1",children:m.map(y=>{const v=h>0?y.total/h*100:0;return a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:y.label,children:y.label}),a.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))] overflow-hidden",children:a.jsx("div",{className:"absolute inset-y-0 left-0 flex",style:{width:`${v}%`},children:y.segments.map((w,k)=>{const E=y.total>0?w.value/y.total*100:0;return a.jsx("div",{style:{width:`${E}%`,backgroundColor:w.color,opacity:.75},title:`${w.name}: ${w.value}`},`${w.name}-${k}`)})})}),a.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:i(y.total)})]},y.label)})})]})}const _d={schema:"#f59e0b",validate:"#eab308",guardrail:"#ef4444"},nS={agent_call:"#3b82f6",tool_call:"#10b981",tool_approval:"#14b8a6",tool_denied:"#ef4444",workflow_start:"#8b5cf6",workflow_end:"#6366f1",log:"#64748b",guardrail:"#dc2626",schema_check:"#f59e0b",validate:"#eab308",delegate:"#ec4899",handoff:"#f97316",verify:"#06b6d4"};function aS(l){return nS[l]??"#64748b"}function lS(){const{window:l,handleWindowChange:r,data:i}=cu("trace-stats",q2);if(!i||i.totalEvents===0)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),a.jsx(vl,{value:l,onChange:r})]}),a.jsx(Jt,{icon:a.jsx(_j,{size:32}),title:"No trace stats yet",description:"Execute workflows to see trace statistics."})]});const u=Object.entries(i.eventTypeCounts).sort(([,g],[,y])=>y-g),d=Object.entries(i.byTool).sort(([,g],[,y])=>y.calls-g.calls),f=Object.entries(i.retryByAgent).filter(([,g])=>g.schema+g.validate+g.guardrail>0),x=u.map(([g,y])=>({label:g,value:y,color:aS(g)})),m=d.map(([g,y])=>({label:g,value:y.calls})),h=f.map(([g,y])=>({label:g,segments:[{name:"schema",value:y.schema,color:_d.schema},{name:"validate",value:y.validate,color:_d.validate},{name:"guardrail",value:y.guardrail,color:_d.guardrail}].filter(v=>v.value>0)}));return a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),a.jsx(vl,{value:l,onChange:r})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsx($e,{label:"Total Events",value:String(i.totalEvents),subtitle:l}),a.jsx($e,{label:"Event Types",value:String(u.length),subtitle:"distinct types"}),a.jsx($e,{label:"Tools Used",value:String(d.length),subtitle:d.length===1?"tool":"tools"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Event Type Distribution"}),a.jsx(eg,{data:x,formatValue:g=>g.toString()})]}),a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsxs("h4",{className:"text-sm font-medium mb-3",children:["Tool Calls"," ",d.length>10&&a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"(top 10)"})]}),d.length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No tool activity in window"}):a.jsx(eg,{data:m,maxBars:10})]}),f.length>0&&a.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Retries by Agent"}),a.jsx(tg,{data:h,formatValue:g=>g.toString()})]}),d.some(([,g])=>g.approved+g.denied>0)&&a.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Tool Approvals / Denials"}),a.jsx(tg,{data:d.filter(([,g])=>g.approved+g.denied>0).map(([g,y])=>({label:g,segments:[{name:"approved",value:y.approved,color:"#10b981"},{name:"denied",value:y.denied,color:"#ef4444"}].filter(v=>v.value>0)})),formatValue:g=>g.toString()})]})]})]})}const sS={running:"border-l-blue-500",completed:"border-l-green-500",failed:"border-l-red-500"};function rS(l){const r=new Date(l),i=new Date;return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function iS(){const[l,r]=b.useState("events"),[i,u]=b.useState(null),[d,f]=b.useState([]),[x,m]=b.useState(""),[h,g]=b.useState(""),{data:y=[],refetch:v}=gn({queryKey:["executions"],queryFn:w2,refetchInterval:3e3});Rf("trace:*",b.useCallback(S=>{f(M=>[...M.slice(-200),S])},[]));const w=i?i.events:d;let k=w;x&&(k=k.filter(S=>S.type===x)),h&&(k=k.filter(S=>S.agent===h));const E=b.useMemo(()=>[...new Set(w.map(S=>S.type))].sort(),[w]),O=b.useMemo(()=>[...new Set(w.map(S=>S.agent).filter(S=>!!S))].sort(),[w]),A=b.useMemo(()=>[{value:"",label:"All types"},...E.map(S=>({value:S,label:S}))],[E]),z=b.useMemo(()=>[{value:"",label:"All agents"},...O.map(S=>({value:S,label:S}))],[O]),V=Math.max(...k.map(S=>S.duration??0),1),N=b.useMemo(()=>{if(!i)return null;const S=[...new Set(i.events.map(M=>M.model).filter(Boolean))];return{duration:i.duration,eventCount:i.events.length,cost:i.totalCost,models:S}},[i]);return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Trace Explorer",description:i?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:i.workflow}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{className:"font-mono",children:i.executionId.slice(0,8)}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[i.events.length," event",i.events.length!==1?"s":""]})]}):a.jsxs(a.Fragment,{children:[y.length," execution",y.length!==1?"s":"",a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),d.length," live event",d.length!==1?"s":""]}),actions:a.jsxs(a.Fragment,{children:[a.jsx(gi,{items:A,value:x,onSelect:m,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All types",searchPlaceholder:"Filter types…",variant:"filter",triggerClassName:Z("rounded-full shadow-sm ring-1 transition-shadow",x?"ring-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"ring-[hsl(var(--input))]"),ariaLabel:"Filter by event type"}),O.length>0&&a.jsx(gi,{items:z,value:h,onSelect:g,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All agents",searchPlaceholder:"Filter agents…",variant:"filter",triggerClassName:Z("rounded-full shadow-sm ring-1 transition-shadow",h?"ring-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"ring-[hsl(var(--input))]"),ariaLabel:"Filter by agent"}),a.jsxs("button",{onClick:()=>{v(),f([])},className:Z("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","ring-1 ring-[hsl(var(--input))] bg-[hsl(var(--background))] shadow-sm","hover:bg-[hsl(var(--muted))] hover:ring-[hsl(var(--ring))]","focus:outline-none focus-visible:ring-[hsl(var(--ring))] transition-all"),children:[a.jsx(vN,{size:12}),"Refresh"]})]})}),a.jsx("div",{role:"tablist","aria-label":"Trace views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:["events","stats"].map(S=>a.jsx("button",{type:"button",role:"tab","aria-selected":l===S,onClick:()=>r(S),className:Z("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",l===S?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:S.charAt(0).toUpperCase()+S.slice(1)},S))}),l==="stats"&&a.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:a.jsx(lS,{})}),l==="events"&&a.jsx(pr,{className:"flex-1",defaultPercent:25,minPercent:15,maxPercent:40,left:a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-2",children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Executions"}),a.jsxs("button",{onClick:()=>{u(null)},className:Z("w-full text-left px-3 py-2 text-xs rounded-xl border",i?"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]":"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]"),children:["Live Events (",d.length,")"]}),y.map(S=>a.jsxs("button",{onClick:()=>{u(S)},className:Z("w-full text-left px-3 py-2.5 text-xs rounded-xl border border-l-[3px] transition-colors",sS[S.status]??"border-l-slate-400",(i==null?void 0:i.executionId)===S.executionId?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-medium truncate",children:S.workflow}),a.jsx(U0,{status:S.status})]}),a.jsxs("div",{className:"flex items-center justify-between mt-1",children:[a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] truncate",children:[S.executionId.slice(0,8),"… | ",S.events.length," events"]}),S.totalCost>0&&a.jsx(Bn,{cost:S.totalCost})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx("span",{children:rS(S.startedAt)}),S.duration>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[hsl(var(--border))]",children:"·"}),a.jsx("span",{children:ot(S.duration)})]})]})]},S.executionId)),y.length===0&&a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No executions yet"})]}),right:a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[N&&a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[a.jsx($e,{label:"Duration",value:ot(N.duration)}),a.jsx($e,{label:"Events",value:String(N.eventCount)}),a.jsx($e,{label:"Cost",value:N.cost>0?nt(N.cost):"—"}),a.jsx($e,{label:"Model",value:N.models.length>0?N.models[0]:"—",subtitle:N.models.length>1?`+${N.models.length-1} more`:void 0})]}),(i==null?void 0:i.status)==="completed"&&i.result!=null&&a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),a.jsx(qt,{data:i.result})]}),k.length===0?a.jsx(Jt,{icon:a.jsx(uu,{size:32}),title:"No trace events",description:"Execute a workflow to see trace events here."}):a.jsx(Ci,{events:k,maxDuration:V})]})})]})}function ef({title:l,description:r,actions:i,children:u}){return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:l,description:r,actions:i}),a.jsx("main",{className:"flex-1 overflow-auto p-4 sm:p-6",children:u})]})}function ng({tokens:l,label:r,className:i}){return a.jsxs("span",{className:`inline-flex items-center gap-1 whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${i??""}`,children:[r&&a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:r}),An(l)]})}function oS(l,r){const i=Math.max(0,r-l);return i<1e3?"just now":i<6e4?`${Math.floor(i/1e3)}s ago`:i<36e5?`${Math.floor(i/6e4)}m ago`:`${Math.floor(i/36e5)}h ago`}function uS(){const{window:l,handleWindowChange:r,data:i,updatedAt:u}=cu("costs",U2),[d,f]=b.useState(()=>Date.now());if(b.useEffect(()=>{const N=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(N)},[]),!i)return a.jsx(ef,{title:"Cost Dashboard",description:"Spending across agents, models, and workflows",actions:a.jsx(vl,{value:l,onChange:r}),children:a.jsx(Jt,{icon:a.jsx(f0,{size:32}),title:"No cost data",description:"Execute workflows to see cost data."})});const x=i.totalTokens.reasoning>0,m=Object.keys(i.byAgent).length,h=Object.keys(i.byModel).length,g=Object.values(i.byWorkflow).reduce((N,S)=>N+S.executions,0),y=i.retry??{primary:0,primaryCalls:0,schema:0,schemaCalls:0,validate:0,validateCalls:0,guardrail:0,guardrailCalls:0,retryCalls:0},v=y.schema+y.validate+y.guardrail,w=i.totalCost>0?v/i.totalCost*100:0,k=i.byEmbedder??{},E=Object.entries(k),O=E.reduce((N,[,S])=>N+S.cost,0),A=E.reduce((N,[,S])=>N+S.calls,0),z=E.reduce((N,[,S])=>N+S.tokens,0),V=i.totalCost>0?O/i.totalCost*100:0;return a.jsxs(ef,{title:"Cost Dashboard",description:i.totalCost>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[nt(i.totalCost)," total"]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[m," agent",m!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[h," model",h!==1?"s":""]})]}):"Spending across agents, models, and workflows",actions:a.jsx(vl,{value:l,onChange:r}),children:[a.jsxs("div",{className:Z("grid grid-cols-1 sm:grid-cols-2 gap-3 mb-8",x?"lg:grid-cols-4":"lg:grid-cols-3"),children:[a.jsx($e,{label:"Total Cost",value:nt(i.totalCost),subtitle:l}),a.jsx($e,{label:"Input Tokens",value:An(i.totalTokens.input),subtitle:"prompt"}),a.jsx($e,{label:"Output Tokens",value:An(i.totalTokens.output),subtitle:"completion"}),x&&a.jsx($e,{label:"Reasoning Tokens",value:An(i.totalTokens.reasoning),subtitle:"thinking"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Agent"}),Object.keys(i.byAgent).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No agent data"}):a.jsx(hi,{columns:[{label:"Agent",sortKey:N=>N.agent,render:N=>a.jsx("span",{className:"font-mono",children:N.agent})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(Bn,{cost:N.cost})}],rows:Object.entries(i.byAgent).map(([N,S])=>({agent:N,cost:S.cost,calls:S.calls})),rowKey:N=>N.agent,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Model"}),Object.keys(i.byModel).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No model data"}):a.jsx(hi,{columns:[{label:"Model",sortKey:N=>N.model,render:N=>a.jsx("span",{className:"font-mono",children:N.model})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Tokens",sortKey:N=>N.tokens,render:N=>a.jsx(ng,{tokens:N.tokens})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(Bn,{cost:N.cost})}],rows:Object.entries(i.byModel).map(([N,S])=>({model:N,calls:S.calls,tokens:S.tokens.input+S.tokens.output,cost:S.cost})),rowKey:N=>N.model,defaultSort:{index:3,dir:"desc"},costValue:N=>N.cost})]}),a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Workflow"}),Object.keys(i.byWorkflow).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No workflow data"}):a.jsx(hi,{columns:[{label:"Workflow",sortKey:N=>N.workflow,render:N=>a.jsx("span",{className:"font-mono",children:N.workflow})},{label:"Executions",sortKey:N=>N.executions,render:N=>a.jsx("span",{children:N.executions})},{label:"Total Cost",sortKey:N=>N.cost,render:N=>a.jsx(Bn,{cost:N.cost})},{label:"Avg Cost",sortKey:N=>N.avgCost,render:N=>a.jsx(Bn,{cost:N.avgCost})}],rows:Object.entries(i.byWorkflow).map(([N,S])=>({workflow:N,executions:S.executions,cost:S.cost,avgCost:S.executions>0?S.cost/S.executions:0})),rowKey:N=>N.workflow,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]}),E.length>0&&a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Memory (Embedder)"}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[nt(O)," across ",A," call",A!==1?"s":"",a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),An(z)," tokens",V>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),V.toFixed(1),"% of total"]})]})]}),a.jsx(hi,{columns:[{label:"Embedder Model",sortKey:N=>N.model,render:N=>a.jsx("span",{className:"font-mono",children:N.model})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Tokens",sortKey:N=>N.tokens,render:N=>a.jsx(ng,{tokens:N.tokens})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(Bn,{cost:N.cost})}],rows:E.map(([N,S])=>({model:N,calls:S.calls,tokens:S.tokens,cost:S.cost})),rowKey:N=>N.model,defaultSort:{index:3,dir:"desc"},costValue:N=>N.cost})]}),(v>0||y.retryCalls>0)&&a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Retry Overhead"}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[nt(v)," across ",y.retryCalls," retry call",y.retryCalls!==1?"s":"",w>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),w.toFixed(1),"% of total"]})]})]}),a.jsx(hi,{columns:[{label:"Reason",sortKey:N=>N.reason,render:N=>N.reasonLabel},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(Bn,{cost:N.cost})}],rows:[{reason:"primary",reasonLabel:a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"primary (first attempt)"}),calls:y.primaryCalls,cost:y.primary},{reason:"schema",reasonLabel:a.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"schema retry"}),calls:y.schemaCalls,cost:y.schema},{reason:"validate",reasonLabel:a.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"validate retry"}),calls:y.validateCalls,cost:y.validate},{reason:"guardrail",reasonLabel:a.jsx("span",{className:"font-mono text-rose-600 dark:text-rose-400",children:"guardrail retry"}),calls:y.guardrailCalls,cost:y.guardrail}],rowKey:N=>N.reason,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]})]}),a.jsxs("div",{className:"mt-6 pt-3 border-t border-[hsl(var(--border))] text-[11px] text-[hsl(var(--muted-foreground))] flex items-center gap-2 flex-wrap",children:[a.jsxs("span",{children:["Window: ",a.jsx("span",{className:"font-mono",children:l})]}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsxs("span",{children:["Last updated: ",u!=null?oS(u,d):"pending"]}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsxs("span",{children:[g," execution",g!==1?"s":""," in window"]})]})]})}function hi({columns:l,rows:r,rowKey:i,defaultSort:u,costValue:d}){const f=(u==null?void 0:u.index)??l.findIndex(E=>E.sortKey!==void 0),x=(u==null?void 0:u.dir)??"desc",[m,h]=b.useState(f),[g,y]=b.useState(x),v=b.useMemo(()=>{const E=l[m];if(!(E!=null&&E.sortKey))return r;const O=E.sortKey,A=[...r];return A.sort((z,V)=>{const N=O(z),S=O(V);if(typeof N=="number"&&typeof S=="number")return g==="asc"?N-S:S-N;const M=String(N),U=String(S);return g==="asc"?M.localeCompare(U):U.localeCompare(M)}),A},[r,l,m,g]),w=b.useMemo(()=>{if(!d)return 0;let E=0;for(const O of r){const A=d(O);A>E&&(E=A)}return E},[r,d]),k=E=>{l[E].sortKey&&(m===E?y(O=>O==="desc"?"asc":"desc"):(h(E),y("desc")))};return a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs min-w-[480px]",children:[a.jsx("thead",{children:a.jsx("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:l.map((E,O)=>{const A=E.align??(O===0?"left":"right"),z=E.sortKey!==void 0,V=z&&m===O,N=V?g==="asc"?" ↑":" ↓":"";return a.jsxs("th",{"aria-sort":V?g==="asc"?"ascending":"descending":void 0,className:Z("py-2 px-3 font-medium",A==="left"?"text-left":"text-right",z&&"cursor-pointer select-none hover:text-[hsl(var(--foreground))]",z&&!V&&"text-[hsl(var(--muted-foreground))]"),onClick:z?()=>k(O):void 0,title:z?"Click to sort":void 0,children:[E.label,N]},E.label)})})}),a.jsx("tbody",{children:v.map(E=>{const O=d?d(E):0;return a.jsx("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:l.map((A,z)=>{const V=A.align??(z===0?"left":"right");return a.jsxs("td",{className:Z("py-2 px-3 relative",V==="left"?"text-left":"text-right"),children:[z===l.length-1&&w>0&&a.jsx("div",{className:"absolute inset-y-0 right-0 bg-[hsl(var(--primary)/0.08)] rounded-sm",style:{width:`${O/w*100}%`}}),a.jsx("span",{className:"relative",children:A.render(E)})]},A.label)})},i(E))})})]})})}function cS(){const[l,r]=b.useState("session"),[i,u]=b.useState(""),[d,f]=b.useState("{}"),[x,m]=b.useState(!1),[h,g]=b.useState(""),[y,v]=b.useState(null),[w,k]=b.useState(null),E=Si(),{data:O=[]}=gn({queryKey:["memory",l],queryFn:()=>O2(l)}),A=Jd({mutationFn:({key:M,value:U})=>_2(l,M,U),onSuccess:()=>{E.invalidateQueries({queryKey:["memory",l]}),m(!1),u(""),f("{}")}}),z=Jd({mutationFn:M=>z2(l,M),onSuccess:()=>{E.invalidateQueries({queryKey:["memory",l]}),k(null)}}),V=b.useCallback(async()=>{if(!h.trim())return;const M=await D2(h,l);v(M.results)},[h,l]),N=b.useCallback(()=>{if(i.trim())try{const M=JSON.parse(d);A.mutate({key:i,value:M})}catch{A.mutate({key:i,value:d})}},[i,d,A]),S=b.useCallback(M=>{w===M?z.mutate(M):k(M)},[w,z]);return a.jsxs(ef,{title:"Memory Browser",description:O.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[O.length," entr",O.length!==1?"ies":"y"]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[l," scope"]})]}):"Key-value entries stored via ctx.remember()",actions:a.jsxs("button",{type:"button",onClick:()=>m(!x),className:Z("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] shadow-sm","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]","transition-opacity"),children:[a.jsx(m0,{size:12}),"Add entry"]}),children:[a.jsxs("div",{role:"tablist","aria-label":"Memory scope",className:"flex items-center gap-0 mb-4 border-b border-[hsl(var(--border))]",children:[["session","global"].map(M=>a.jsx("button",{type:"button",role:"tab","aria-selected":l===M,onClick:()=>{r(M),v(null),k(null)},className:Z("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors",l===M?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:M.charAt(0).toUpperCase()+M.slice(1)},M)),a.jsx("div",{className:"flex-1"}),a.jsxs("div",{className:"flex items-center gap-1 -mb-px pb-2",children:[a.jsx("input",{value:h,onChange:M=>g(M.target.value),onKeyDown:M=>M.key==="Enter"&&V(),placeholder:"Semantic search...",className:"px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))] w-48"}),a.jsx("button",{onClick:V,className:"p-1.5 rounded-md hover:bg-[hsl(var(--accent))]",children:a.jsx(Pd,{size:14})})]})]}),x&&a.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] space-y-3",children:[a.jsx("input",{value:i,onChange:M=>u(M.target.value),placeholder:"Key",className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]"}),a.jsx(z0,{value:d,onChange:f,placeholder:"Value (JSON)"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:N,disabled:!i.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 disabled:opacity-50",children:"Save"}),a.jsx("button",{onClick:()=>m(!1),className:"px-3 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]})]}),y&&a.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Search Results"}),y.length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No results found"}):a.jsx(qt,{data:y})]}),O.length===0?a.jsx(Jt,{icon:a.jsx(i0,{size:32}),title:"No memory entries",description:`No entries in the ${l} scope. Use ctx.remember() in workflows or add entries manually.`}):a.jsx("div",{className:"space-y-2",children:O.map(M=>a.jsxs("div",{className:"p-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-mono font-medium",children:M.key}),a.jsx("div",{className:"flex items-center gap-1",children:w===M.key?a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>S(M.key),className:"px-2 py-0.5 text-xs rounded bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))]",children:"Confirm"}),a.jsx("button",{onClick:()=>k(null),className:"px-2 py-0.5 text-xs rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]}):a.jsx("button",{onClick:()=>S(M.key),className:"p-1 rounded hover:bg-[hsl(var(--destructive))] hover:text-[hsl(var(--destructive-foreground))] text-[hsl(var(--muted-foreground))]",children:a.jsx(Tf,{size:14})})})]}),a.jsx(qt,{data:M.value,collapsed:!0})]},M.key))})]})}function dS(l){try{return JSON.parse(l)}catch{return l}}function fS(l,r){if(r==="assistant"){const i=l.trim();if(i.startsWith("{")||i.startsWith("["))try{const u=JSON.parse(i);return a.jsx(qt,{data:u,collapsed:!0})}catch{}}return a.jsx("div",{className:"whitespace-pre-wrap",children:l})}function hS(){const[l,r]=b.useState(null),[i,u]=b.useState(null),[d,f]=b.useState(null),x=Si(),{data:m=[]}=gn({queryKey:["sessions"],queryFn:E2,refetchInterval:5e3}),{data:h}=gn({queryKey:["session",l],queryFn:()=>C2(l),enabled:!!l}),g=Jd({mutationFn:k2,onSuccess:()=>{x.invalidateQueries({queryKey:["sessions"]}),r(null),f(null)}}),y=h!=null&&h.history?i!==null?h.history.slice(0,i+1):h.history:[];return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Session Manager",description:m.length>0?l&&h?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-mono",children:h.id.slice(0,16)}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[h.history.length," message",h.history.length!==1?"s":""]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[m.length," active session",m.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"select one to replay"})]}):"Multi-turn conversations tracked via runtime.session()"}),a.jsx(pr,{className:"flex-1",defaultPercent:33,minPercent:20,maxPercent:50,left:a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-2",children:[a.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Sessions (",m.length,")"]}),m.length===0?a.jsx(Jt,{icon:a.jsx(x0,{size:24}),title:"No sessions",description:"Sessions are created when using runtime.session()"}):m.map(v=>a.jsxs("button",{onClick:()=>{r(v.id),u(null)},className:`w-full text-left px-3 py-2.5 text-xs rounded-xl border transition-colors ${l===v.id?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[a.jsx("div",{className:"font-mono truncate text-[11px]",title:v.id,children:v.id}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[hsl(var(--muted-foreground))] mt-1",children:[a.jsx(h0,{size:11}),a.jsxs("span",{children:[v.messageCount," message",v.messageCount!==1?"s":""]})]})]},v.id))]}),right:a.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:h?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium font-mono",children:h.id}),a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[h.history.length," messages"]})]}),d===h.id?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:()=>g.mutate(h.id),className:"px-2 py-1 text-xs rounded-md bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-800",children:"Confirm"}),a.jsx("button",{onClick:()=>f(null),className:"px-2 py-1 text-xs rounded-md border border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]}):a.jsxs("button",{onClick:()=>f(h.id),className:"flex items-center gap-1 px-2 py-1 text-xs rounded-md border border-red-300 text-red-600 hover:bg-red-50 dark:border-red-800 dark:text-red-400 dark:hover:bg-red-950",children:[a.jsx(Tf,{size:12}),"Delete"]})]}),h.handoffHistory&&h.handoffHistory.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mb-2",children:"Handoff Chain"}),a.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.handoffHistory.map((v,w)=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:v.source}),a.jsx(or,{size:12,className:"text-[hsl(var(--muted-foreground))]"}),a.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:v.target}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["(",v.mode,")"]}),w<h.handoffHistory.length-1&&a.jsx("span",{className:"mx-1 text-[hsl(var(--muted-foreground))]",children:"|"})]},w))})]}),h.history.length>1&&a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("label",{className:"text-xs font-medium",children:"Replay"}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:i!==null?`${i+1} / ${h.history.length}`:`${h.history.length} / ${h.history.length}`})]}),a.jsx("input",{type:"range",min:0,max:h.history.length-1,value:i??h.history.length-1,onChange:v=>u(Number(v.target.value)),className:"w-full h-1.5 rounded-full appearance-none cursor-pointer bg-[hsl(var(--secondary))] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3.5 [&::-webkit-slider-thumb]:h-3.5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[hsl(var(--primary))] [&::-webkit-slider-thumb]:shadow-sm [&::-moz-range-thumb]:w-3.5 [&::-moz-range-thumb]:h-3.5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[hsl(var(--primary))] [&::-moz-range-thumb]:border-0"}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Start"}),a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Latest"})]})]}),a.jsx("div",{className:"space-y-3",children:y.map((v,w)=>a.jsxs("div",{className:`p-3 rounded-xl text-sm ${v.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] ml-8":v.role==="assistant"?"bg-[hsl(var(--secondary))] mr-8":"bg-[hsl(var(--muted))] text-xs font-mono"}`,children:[a.jsx("div",{className:"text-xs font-medium mb-1 opacity-70",children:v.role}),fS(v.content,v.role),v.tool_calls&&v.tool_calls.length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:v.tool_calls.map(k=>a.jsxs("details",{className:"text-xs",children:[a.jsx("summary",{className:"cursor-pointer font-mono",children:k.function.name}),a.jsx(qt,{data:dS(k.function.arguments),collapsed:!0})]},k.id))})]},w))})]}):a.jsx(Jt,{title:"Select a session",description:"Click a session to view its history"})})})]})}function mS(){const[l,r]=b.useState(null),[i,u]=b.useState(void 0),[d,f]=b.useState(null),[x,m]=b.useState(!1),[h,g]=b.useState(!1),{data:y=[]}=gn({queryKey:["tools"],queryFn:M2}),{data:v}=gn({queryKey:["tool",l],queryFn:()=>A2(l),enabled:!!l}),w=b.useCallback(async E=>{if(l){u(null),f(null),m(!0);try{const O=await R2(l,E);u(O.result)}catch(O){f(O instanceof Error?O.message:String(O))}finally{m(!1)}}},[l]),k=y.find(E=>E.name===l);return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Tool Inspector",description:k?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-mono",children:k.name}),k.description&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:k.description})]})]}):y.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"whitespace-nowrap",children:[y.length," registered tool",y.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"select one to inspect"})]}):"Registered tools with schemas and direct testing"}),a.jsx(pr,{className:"flex-1",defaultPercent:33,minPercent:20,maxPercent:50,left:a.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Tools (",y.length,")"]}),y.length===0?a.jsx(Jt,{icon:a.jsx(g0,{size:24}),title:"No tools",description:"Register tools with runtime.registerTool()"}):y.map(E=>a.jsxs("button",{onClick:()=>{r(E.name),u(void 0),f(null),g(!1)},className:`w-full text-left px-3 py-2 text-xs rounded-xl border ${l===E.name?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[a.jsx("div",{className:"font-medium",children:E.name}),a.jsx("div",{className:"text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:E.description}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[E.sensitive&&a.jsx("span",{className:"px-1 py-0.5 rounded bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-300 text-[10px]",children:"sensitive"}),E.requireApproval&&a.jsx("span",{className:"px-1 py-0.5 rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 text-[10px]",children:"approval"})]})]},E.name))]})}),right:a.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:l?v?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium",children:v.name}),a.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:v.description})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.sensitive&&a.jsx("span",{className:"px-2 py-1 text-xs rounded-md bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-300",children:"Sensitive"}),v.requireApproval&&a.jsx("span",{className:"px-2 py-1 text-xs rounded-md bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:"Requires Approval"}),v.retry.attempts&&v.retry.attempts>1&&a.jsxs("span",{className:"px-2 py-1 text-xs rounded-md bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-300",children:["Retry: ",v.retry.attempts,"x ",v.retry.backoff]}),v.hasHooks&&v.hooks&&a.jsxs("span",{className:"px-2 py-1 text-xs rounded-md bg-purple-100 dark:bg-purple-900 text-purple-700 dark:text-purple-300",children:["Hooks:"," ",[v.hooks.hasBefore&&"before",v.hooks.hasAfter&&"after"].filter(Boolean).join(" + ")]})]}),a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>g(!h),className:"flex items-center gap-1.5 text-sm font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",children:[a.jsx(On,{size:14,className:Z("transition-transform",h&&"rotate-90")}),"View raw schema"]}),h&&a.jsx("div",{className:"mt-2",children:a.jsx(qt,{data:v.inputSchema})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Test Tool"}),a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:a.jsx(D0,{schema:v.inputSchema,onSubmit:w,submitLabel:x?"Running...":"Run Tool"})})]}),i!==void 0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Result"}),a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:a.jsx(qt,{data:i})})]}),d&&a.jsx("div",{className:"p-3 rounded-xl bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm",children:d})]}):a.jsxs("div",{className:"flex items-center gap-2 text-sm text-[hsl(var(--muted-foreground))]",children:[a.jsx(Pj,{size:16,className:"animate-spin"}),"Loading tool details..."]}):a.jsx(Jt,{title:"Select a tool",description:"Click a tool to view its schema and test it"})})})]})}const lu={status:"idle",evalRunId:null,evalName:null,runCount:1,startedAt:null,progress:null,done:null,error:null},pS=300*1e3;let Ht=lu;const tf=new Set;let eu=null,Vs=null;function Ln(l){Ht=l;for(const r of tf)r()}function xS(){return Ht}function gS(l){return tf.add(l),()=>tf.delete(l)}function Zs(){eu&&(eu(),eu=null),Vs&&(clearTimeout(Vs),Vs=null)}function ag(){Vs&&clearTimeout(Vs),Vs=setTimeout(()=>{Ht.status==="running"&&(Ln({...Ht,status:"error",error:"Lost contact with the server — no progress received. The eval may still be running; check the History tab."}),Zs())},pS)}function vS(){return b.useSyncExternalStore(gS,xS)}async function yS(l,r,i=!1){if(Ht.status==="running"&&Ht.evalRunId)try{await R0(Ht.evalRunId)}catch{}Zs(),Ln({...lu,status:"running",evalName:l,runCount:r,startedAt:Date.now()});let u;try{u=(await G2(l,{runs:r,captureTraces:i})).evalRunId}catch(d){Ln({...lu,status:"error",error:d instanceof Error?d.message:String(d)});return}Ln({...Ht,evalRunId:u}),ag(),eu=O0.subscribe(`eval:${u}`,d=>{var x;const f=d;switch(ag(),f.type){case"item_done":{const m=f.itemIndex,h=f.totalItems,g=typeof f.run=="number"?f.run:1,y=typeof f.totalRuns=="number"?f.totalRuns:1;Ln({...Ht,progress:{completedItems:m+1,totalItems:h,completedRuns:g-1,totalRuns:y}});break}case"run_done":{const m=f.run,h=f.totalRuns;Ln({...Ht,progress:{completedItems:0,totalItems:((x=Ht.progress)==null?void 0:x.totalItems)??0,completedRuns:m,totalRuns:h}});break}case"done":{const m=typeof f.evalResultId=="string"?f.evalResultId:null,h=typeof f.runGroupId=="string"?f.runGroupId:void 0;Ln(m?{...Ht,status:"done",done:h?{evalResultId:m,runGroupId:h}:{evalResultId:m}}:{...Ht,status:"error",error:"Eval completed without a result id — cannot adopt from history."}),Zs();break}case"error":Ln({...Ht,status:"error",error:f.message}),Zs();break}})}async function bS(){if(Ht.evalRunId)try{await R0(Ht.evalRunId)}catch{}Ln({...Ht,status:"error",error:"Cancelled"}),Zs()}function lg(){Ln(lu),Zs()}function jS({series:l,xMin:r,xMax:i,yMin:u,yMax:d,yDomain:f,yClamp:x,height:m=160,padding:h={top:8,right:8,bottom:20,left:32},formatX:g=E=>String(E),formatY:y=E=>E.toFixed(2),onPointClick:v,ariaLabel:w,className:k}){const[E,O]=b.useState(null),[A,z]=b.useState({width:480,height:m}),V=(f==null?void 0:f.strategy)??"data",N=(f==null?void 0:f.minSpan)??.1,S=(f==null?void 0:f.padPct)??.1;let M,U;if(V==="fixed"||u!=null&&d!=null)M=u??0,U=d??1;else{const G=[];for(const T of l)for(const H of T.points)Number.isFinite(H.y)&&G.push(H.y);if(G.length===0)M=u??0,U=d??1;else{let T=Math.min(...G),H=Math.max(...G);if(H-T<N){const q=(T+H)/2;T=q-N/2,H=q+N/2}const he=Math.max(N,H-T)*S;let de=T-he,C=H+he;(x==null?void 0:x.min)!=null&&(de=Math.max(de,x.min)),(x==null?void 0:x.max)!=null&&(C=Math.min(C,x.max)),M=u??de,U=d??C}}const D=Math.max(1,A.width-h.left-h.right),le=Math.max(1,A.height-h.top-h.bottom),se=Math.max(1,i-r),I=Math.max(.001,U-M),oe=G=>h.left+(G-r)/se*D,Y=G=>h.top+le-(G-M)/I*le,ne=G=>{const T=G.currentTarget.getBoundingClientRect(),H=G.clientX-T.left,J=r+(H-h.left)/D*se;let he=null,de=1/0;for(const W of l)for(const ie of W.points){const fe=Math.abs(ie.x-J);fe<de&&(de=fe,he={series:W,point:ie})}if(!he)return;const C=he.point.x,q=[];for(const W of l){const ie=W.points.find(fe=>fe.x===C);ie&&q.push({series:W,point:ie})}O({x:C,points:q})},Q=[M,M+(U-M)*.25,M+(U-M)*.5,M+(U-M)*.75,U];return a.jsxs("div",{className:Z("relative w-full",k),ref:G=>{G&&G.clientWidth>0&&G.clientWidth!==A.width&&z({width:G.clientWidth,height:m})},children:[a.jsxs("svg",{width:"100%",height:A.height,viewBox:`0 0 ${A.width} ${A.height}`,preserveAspectRatio:"none",role:"img","aria-label":w??`Line chart with ${l.length} series and ${l.reduce((G,T)=>G+T.points.length,0)} data points.`,onMouseMove:ne,onMouseLeave:()=>O(null),onClick:v&&E&&E.points.length>0?()=>{const G=E.points[0];v(G.series,G.point)}:void 0,className:Z("block",v&&E&&E.points.length>0&&"cursor-pointer"),children:[Q.map(G=>a.jsxs("g",{children:[a.jsx("line",{x1:h.left,x2:A.width-h.right,y1:Y(G),y2:Y(G),stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"2 3"}),a.jsx("text",{x:h.left-4,y:Y(G)+3,textAnchor:"end",fontSize:9,fill:"currentColor",fillOpacity:.5,children:y(G)})]},G)),(()=>{const G=E?new Set(E.points.map(T=>T.series.name)):null;return l.map(T=>{const H=[...T.points].filter(de=>Number.isFinite(de.x)&&Number.isFinite(de.y)).sort((de,C)=>de.x-C.x);if(H.length===0)return null;const J=H.map((de,C)=>`${C===0?"M":"L"} ${oe(de.x).toFixed(2)} ${Y(de.y).toFixed(2)}`).join(" "),he=!G||G.has(T.name);return a.jsxs("g",{style:{opacity:he?1:.2,transition:"opacity 120ms ease-out"},children:[a.jsx("path",{d:J,stroke:T.color,strokeWidth:he&&G?2:1.5,fill:"none"}),H.map((de,C)=>a.jsx("circle",{cx:oe(de.x),cy:Y(de.y),r:2.5,fill:T.color},C))]},T.name)})})(),E&&a.jsxs("g",{children:[a.jsx("line",{x1:oe(E.x),x2:oe(E.x),y1:h.top,y2:A.height-h.bottom,stroke:"currentColor",strokeOpacity:.15}),E.points.map(({series:G,point:T})=>a.jsx("circle",{cx:oe(T.x),cy:Y(T.y),r:4,fill:G.color,stroke:"hsl(var(--background))",strokeWidth:1.5},G.name))]}),a.jsx("text",{x:h.left,y:A.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"start",children:g(r)}),a.jsx("text",{x:A.width-h.right,y:A.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"end",children:g(i)})]}),E&&(()=>{var de;const G=oe(E.x),T=8,H=240,he=G>A.width/2?{right:`${Math.max(T,A.width-G+T)}px`,top:`${h.top+2}px`,maxWidth:`${H}px`}:{left:`${Math.min(G+T,A.width-T)}px`,top:`${h.top+2}px`,maxWidth:`${H}px`};return a.jsxs("div",{className:"pointer-events-none absolute z-10 rounded border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2 py-1 text-[10px] shadow-sm",style:he,children:[a.jsx("div",{className:"mb-0.5 text-[hsl(var(--muted-foreground))]",children:g(E.x)}),E.points.map(({series:C,point:q})=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{backgroundColor:C.color}}),a.jsx("span",{className:"font-mono truncate",children:C.name}),a.jsx("span",{className:"ml-auto font-mono shrink-0",children:y(q.y)})]},C.name)),((de=E.points[0])==null?void 0:de.point.label)&&a.jsx("div",{className:"mt-0.5 truncate text-[hsl(var(--muted-foreground))]",children:E.points[0].point.label})]})})()]})}function NS({values:l,color:r="hsl(var(--primary))",width:i=120,height:u=24,fill:d=!0,className:f}){if(l.length===0)return a.jsx("div",{className:Z("inline-block",f),style:{width:i,height:u}});if(l.length===1)return a.jsx("svg",{width:i,height:u,className:Z("inline-block",f),children:a.jsx("circle",{cx:i/2,cy:u/2,r:2,fill:r})});const x=Math.min(...l),m=Math.max(...l),h=Math.max(.001,m-x),g=2,y=u-g*2,w=l.map((E,O)=>{const A=O/(l.length-1)*i,z=g+y-(E-x)/h*y;return[A,z]}).map(([E,O],A)=>`${A===0?"M":"L"} ${E.toFixed(1)} ${O.toFixed(1)}`).join(" "),k=d?`${w} L ${i} ${u} L 0 ${u} Z`:null;return a.jsxs("svg",{width:i,height:u,viewBox:`0 0 ${i} ${u}`,className:Z("inline-block",f),children:[k&&a.jsx("path",{d:k,fill:r,fillOpacity:.12}),a.jsx("path",{d:w,stroke:r,strokeWidth:1.25,fill:"none"})]})}function sg(l){return l>=.8?"text-green-600 dark:text-green-400":l>=.5?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function zd(l){return l.toFixed(3)}const rg=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316"];function Xl(l,r){return rg[r%rg.length]??"#64748b"}function SS(l){const r=new Date(l),u=Date.now()-l,d=1440*60*1e3;return u<d?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):u<7*d?r.toLocaleDateString([],{weekday:"short"}):r.toLocaleDateString()}function wS({onViewRun:l}={}){const{window:r,handleWindowChange:i,data:u}=cu("eval-trends",L2),[d,f]=b.useState("scorer");if(!u||u.totalRuns===0)return a.jsxs("div",{className:"flex-1 overflow-auto p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),a.jsx(vl,{value:r,onChange:i})]}),a.jsx(Jt,{icon:a.jsx(AN,{size:32}),title:"No eval trends yet",description:"Run evaluations to see score trends over time."})]});const x=Object.keys(u.byEval).sort();return a.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),a.jsx(vl,{value:r,onChange:i})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsx($e,{label:"Total Runs",value:String(u.totalRuns),subtitle:r}),a.jsx($e,{label:"Evals Tracked",value:String(x.length),subtitle:x.length===1?"eval":"evals"}),a.jsx($e,{label:"Total Cost",value:nt(u.totalCost),subtitle:"all evals"})]}),a.jsxs("div",{className:"flex items-center gap-1 text-xs",role:"group","aria-label":"Trend chart view mode",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] mr-1",children:"View:"}),["scorer","model","duration"].map(m=>a.jsx("button",{onClick:()=>f(m),"aria-pressed":d===m,className:Z("px-2.5 py-1 rounded-md transition-colors",d===m?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:m==="scorer"?"By Scorer":m==="model"?"By Model":"Duration"},m))]}),x.map(m=>{const h=u.byEval[m],g=Object.keys(h.scoreMean).sort(),y=[...h.runs].sort((M,U)=>M.timestamp-U.timestamp);let v=[],w=[],k="",E,O=M=>M.toFixed(2);if(d==="scorer")k="Score Trend by Scorer",E={min:0,max:1},v=g.map((M,U)=>({name:M,color:Xl(M,U),points:y.filter(D=>D.scores[M]!=null).map(D=>({x:D.timestamp,y:D.scores[M],label:D.model?`${D.id.slice(0,8)}… · ${D.model}`:D.id,meta:D}))})),w=g.map((M,U)=>({name:M,color:Xl(M,U)}));else if(d==="model"){k="Score Trend by Model (mean of all scorers)",E={min:0,max:1};const M=new Map;for(const D of y){const le=D.model??"unknown",se=M.get(le)??[];se.push(D),M.set(le,se)}const U=[...M.keys()].sort();v=U.map((D,le)=>{const se=M.get(D)??[];return{name:D,color:Xl(D,le),points:se.map(I=>{const oe=Object.values(I.scores).filter(ne=>Number.isFinite(ne));if(oe.length===0)return null;const Y=oe.reduce((ne,Q)=>ne+Q,0)/oe.length;return{x:I.timestamp,y:Y,label:`${I.id.slice(0,8)}… · ${D}`,meta:I}}).filter(I=>I!==null)}}),w=U.map((D,le)=>({name:D,color:Xl(D,le)}))}else{k="Duration Trend by Model",O=D=>ot(D);const M=new Map;for(const D of y){if(D.duration==null)continue;const le=D.model??"unknown",se=M.get(le)??[];se.push(D),M.set(le,se)}const U=[...M.keys()].sort();v=U.map((D,le)=>{const se=M.get(D)??[];return{name:D,color:Xl(D,le),points:se.map(I=>({x:I.timestamp,y:I.duration,label:`${I.id.slice(0,8)}… · ${D}`,meta:I}))}}),w=U.map((D,le)=>({name:D,color:Xl(D,le)}))}const A=y.length>0?y[0].timestamp:0,z=y.length>0?y[y.length-1].timestamp:1,V=y.map(M=>M.cost),N=v.some(M=>M.points.length>=2),S=d==="duration"&&y.every(M=>M.duration==null)?"No duration metadata recorded on these runs.":(d==="model"||d==="duration")&&y.every(M=>M.model==null)?'No model metadata recorded on these runs — each run will show as "unknown".':null;return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 bg-[hsl(var(--card))] border-b border-[hsl(var(--border))] flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-sm font-medium",children:m}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))] ml-2",children:[h.runCount," run",h.runCount!==1?"s":""]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[V.length>1&&a.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-[hsl(var(--muted-foreground))]",title:"Cost over time",children:[a.jsx("span",{children:"cost"}),a.jsx(NS,{values:V,color:"hsl(var(--primary))",width:80,height:22})]}),a.jsx(Bn,{cost:h.costTotal})]})]}),y.length>1&&a.jsxs("div",{className:"px-4 py-3 border-b border-[hsl(var(--border))]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:k}),a.jsx("div",{className:"flex flex-wrap gap-2 text-[10px]",children:w.map(M=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:M.color}}),a.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:M.name})]},M.name))})]}),S?a.jsx("p",{className:"py-4 text-xs text-[hsl(var(--muted-foreground))] italic",children:S}):N?a.jsx(jS,{series:v,xMin:A,xMax:z,yClamp:E,yDomain:{strategy:"data",minSpan:d==="duration"?100:.1,padPct:.1},height:180,formatX:SS,formatY:O,ariaLabel:`${m}: ${k}, ${v.length} series across ${y.length} runs. Click a point to view that run.`,onPointClick:l?(M,U)=>{const D=U.meta;D!=null&&D.id&&l(D.id)}:void 0}):a.jsx("p",{className:"py-4 text-xs text-[hsl(var(--muted-foreground))] italic",children:d==="scorer"?"Need at least 2 runs to draw a trend.":d==="model"?"Not enough runs per model yet — need at least 2 runs from the same model to draw a trend.":"Not enough runs per model with duration to draw a trend."})]}),y.length===1&&g.length>0&&a.jsx("p",{className:"px-4 py-2 text-[11px] text-[hsl(var(--muted-foreground))] border-b border-[hsl(var(--border))]",children:"Only one run in window — run again to see trend line."}),g.length>0&&a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("th",{className:"py-2 px-4 text-left font-medium",children:"Scorer"}),a.jsx("th",{className:"py-2 px-4 text-right font-medium",children:"Latest"}),a.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:h.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Mean",h.runCount>50?"*":""]}),a.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:h.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Std",h.runCount>50?"*":""]})]})}),a.jsx("tbody",{children:g.map((M,U)=>a.jsxs("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:[a.jsx("td",{className:"py-2 px-4 font-mono",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:d==="scorer"?Xl(M,U):"hsl(var(--muted-foreground) / 0.4)"}}),M]})}),a.jsx("td",{className:Z("py-2 px-4 text-right font-mono",sg(h.latestScores[M]??0)),children:h.latestScores[M]!=null?zd(h.latestScores[M]):"—"}),a.jsx("td",{className:Z("py-2 px-4 text-right font-mono",sg(h.scoreMean[M]??0)),children:zd(h.scoreMean[M]??0)}),a.jsx("td",{className:"py-2 px-4 text-right font-mono text-[hsl(var(--muted-foreground))]",children:zd(h.scoreStd[M]??0)})]},M))})]}),h.runCount>50&&a.jsx("p",{className:"px-4 pt-2 text-[10px] text-[hsl(var(--muted-foreground))]",children:"* Mean and Std computed over the 50 most recent runs"})]},m)})]})}function ig(l){var m,h,g;if(l.length===0)return null;const r=l[0],i=Object.keys(((m=r.summary)==null?void 0:m.scorers)??{}),u={};for(const y of i){const v=l.map(E=>{var O,A,z;return((z=(A=(O=E.summary)==null?void 0:O.scorers)==null?void 0:A[y])==null?void 0:z.mean)??0}),w=v.reduce((E,O)=>E+O,0)/v.length,k=v.length>1?Math.sqrt(v.reduce((E,O)=>E+(O-w)**2,0)/(v.length-1)):0;u[y]={mean:Math.round(w*1e3)/1e3,std:Math.round(k*1e3)/1e3,min:Math.round(Math.min(...v)*1e3)/1e3,max:Math.round(Math.max(...v)*1e3)/1e3}}const d=new Set,f=[];for(const y of l){const v=(h=y.metadata)==null?void 0:h.workflows;if(Array.isArray(v))for(const w of v)typeof w=="string"&&!d.has(w)&&(d.add(w),f.push(w))}const x={runGroupId:((g=r.metadata)==null?void 0:g.runGroupId)??"",runCount:l.length,workflows:f.length>0?f:void 0,scorers:u};return{...r,_multiRun:{aggregate:x,allRuns:l}}}function su(l){return l>=.8?"bg-emerald-100 dark:bg-emerald-900/50 text-emerald-700 dark:text-emerald-300":l>=.5?"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300":"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300"}function du(l){return l>=.8?"bg-emerald-500 dark:bg-emerald-400":l>=.5?"bg-amber-500 dark:bg-amber-400":"bg-red-500 dark:bg-red-400"}function Nt(l){return l>=.8?"text-emerald-600 dark:text-emerald-400":l>=.5?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function og(l){return l>=.8?"bg-emerald-50/60 dark:bg-emerald-950/20":l>=.5?"bg-amber-50/60 dark:bg-amber-950/20":"bg-red-50/60 dark:bg-red-950/20"}function ES(l){var r;return Array.isArray((r=l.metadata)==null?void 0:r.models)?l.metadata.models.filter(i=>typeof i=="string"):[]}function Aa(l){var r;return Array.isArray((r=l.metadata)==null?void 0:r.models)?l.metadata.models.filter(i=>typeof i=="string"):[]}function yl(l){var u;const r=(u=l.metadata)==null?void 0:u.modelCounts;if(!r||typeof r!="object")return null;const i={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(i[d]=f);return Object.keys(i).length>0?i:null}function Fs(l){var d,f;const r=(d=l._multiRun)==null?void 0:d.aggregate.workflows;if(Array.isArray(r)&&r.length>0){const x=r.filter(m=>typeof m=="string");if(x.length>0)return x}const i=(f=l.metadata)==null?void 0:f.workflows;if(Array.isArray(i)){const x=i.filter(m=>typeof m=="string");if(x.length>0)return x}const u=l.workflow;return typeof u=="string"&&u?[u]:[]}function nf(l){var u;const r=(u=l.metadata)==null?void 0:u.workflowCounts;if(!r||typeof r!="object")return null;const i={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(i[d]=f);return Object.keys(i).length>0?i:null}function vn(l){const r=l.indexOf(":");return r>=0?l.slice(r+1):l}function q0(l){var u;const r=(u=l.metadata)==null?void 0:u.tokens;if(!r||typeof r!="object")return null;const i=r;return typeof i.input!="number"?null:{input:i.input,output:typeof i.output=="number"?i.output:0,reasoning:typeof i.reasoning=="number"?i.reasoning:0}}function CS(l){var i;const r=(i=l.metadata)==null?void 0:i.agentCalls;return typeof r=="number"?r:0}function af(l){const r={input:0,output:0,reasoning:0};for(const i of l.items){const u=q0(i);u&&(r.input+=u.input,r.output+=u.output,r.reasoning+=u.reasoning)}return r}function Of(l){const r=new Map;for(const i of l){const u=i.data,d=yl(u);if(d)for(const[f,x]of Object.entries(d))r.set(f,(r.get(f)??0)+x);else for(const f of Aa(u))r.set(f,(r.get(f)??0)+1)}return[...r.entries()].sort((i,u)=>u[1]-i[1])}function ug(l){const r={input:0,output:0,reasoning:0};for(const i of l){const u=af(i);r.input+=u.input,r.output+=u.output,r.reasoning+=u.reasoning}return r}function cg(l){return l.reduce((r,i)=>r+i.totalCost,0)}function kS({summary:l,items:r,totalCost:i,scorerTypes:u}){const d=l.scorers?Object.entries(l.scorers):[];return d.length===0&&!l.timing&&i<=0?null:a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Summary"})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsx("th",{className:"text-left px-4 py-2 font-medium w-48",children:"Metric"}),a.jsx("th",{className:"px-4 py-2 w-28"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Mean"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P50"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P95"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Min"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Max"})]})}),a.jsxs("tbody",{children:[d.map(([f,x])=>{const m=r.some(h=>!h.error&&h.scores[f]!=null);return a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--foreground))]",children:[f,(u==null?void 0:u[f])==="llm"&&a.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]}),m?a.jsxs(a.Fragment,{children:[a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("div",{className:"h-2 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:a.jsx("div",{className:Z("h-full rounded-full transition-all",du(x.mean)),style:{width:`${x.mean*100}%`}})})}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono font-medium",Nt(x.mean)),children:x.mean.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:x.p50.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:x.p95.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:x.min.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:x.max.toFixed(3)})]}):a.jsx("td",{colSpan:6,className:"px-3 py-2.5 text-center text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]},f)}),l.timing&&a.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing"}),a.jsx("td",{className:"px-4 py-2.5"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.mean)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.p50)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.p95)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.min)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.max)})]})]})]})}),i>0&&a.jsx("div",{className:"px-4 py-2 border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Total cost: ",a.jsx("span",{className:"font-mono font-medium",children:nt(i)})]})})]})}function TS({items:l,scorerNames:r,onSelectItem:i,errorFilter:u,onErrorFilterChange:d,scorerFilter:f,onScorerFilterChange:x,threshold:m,onThresholdChange:h,sortField:g,onSortFieldChange:y,sortDir:v,onSortDirChange:w}){const k=m!==""?parseFloat(m):null,E=u!=="all"||f!==""&&k!=null&&!isNaN(k),O=b.useMemo(()=>l.map((N,S)=>({item:N,index:S})),[l]),A=b.useMemo(()=>{let N=O;return u==="errors"?N=N.filter(({item:S})=>!!S.error):u==="no-errors"&&(N=N.filter(({item:S})=>!S.error)),f&&k!=null&&!isNaN(k)&&(N=N.filter(({item:S})=>{const M=S.scores[f];return M!=null&&M<k})),N},[O,u,f,k]),z=b.useMemo(()=>{const N=[...A],S=v==="asc"?1:-1;return N.sort((M,U)=>{let D,le;return g==="index"?(D=M.index,le=U.index):g==="duration"?(D=M.item.duration??1/0,le=U.item.duration??1/0):g==="cost"?(D=M.item.cost??1/0,le=U.item.cost??1/0):(D=M.item.scores[g]??-1/0,le=U.item.scores[g]??-1/0),(D-le)*S}),N},[A,g,v]),V=[{value:"index",label:"Item #"},{value:"duration",label:"Duration"},{value:"cost",label:"Cost"},...r.map(N=>({value:N,label:N}))];return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"All Items"}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono tabular-nums",children:E?`${A.length} of ${l.length}`:String(l.length)}),E&&a.jsx("button",{onClick:()=>{d("all"),x(""),h("")},className:"text-xs text-[hsl(var(--primary))] hover:underline cursor-pointer",children:"Reset"})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("select",{value:u,onChange:N=>d(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"all",children:"All"}),a.jsx("option",{value:"errors",children:"Errors"}),a.jsx("option",{value:"no-errors",children:"Passed"})]}),r.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("select",{value:f,onChange:N=>x(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Score filter…"}),r.map(N=>a.jsx("option",{value:N,children:N},N))]}),f&&a.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",placeholder:"< threshold",value:m,onChange:N=>h(N.target.value),className:"w-20 px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]}),a.jsx("div",{className:"w-px h-4 bg-[hsl(var(--border))]"}),a.jsx("select",{value:g,onChange:N=>y(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:V.map(N=>a.jsx("option",{value:N.value,children:N.label},N.value))}),a.jsx("button",{onClick:()=>w(v==="asc"?"desc":"asc"),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:v==="asc"?"Ascending":"Descending",children:v==="asc"?"↑":"↓"})]})]}),z.length===0&&E&&a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))] py-6 text-center",children:"No items match the current filters."}),z.length>0&&a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[a.jsx("th",{className:"text-left px-3 py-2.5 font-medium w-10",children:"#"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium min-w-[180px]",children:"Input"}),r.map(N=>a.jsx("th",{className:"text-right px-2 py-2.5 font-medium font-mono max-w-24 truncate",title:N,children:N},N)),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Duration"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Cost"}),a.jsx("th",{className:"w-8"})]})}),a.jsx("tbody",{children:z.map(({item:N,index:S})=>a.jsxs("tr",{onClick:()=>i(S),className:"border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors group",children:[a.jsxs("td",{className:"px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:[S+1,N.error&&a.jsx("span",{className:"ml-1 inline-flex items-center text-red-500",title:"Workflow error","aria-label":"Workflow error",children:a.jsx(d0,{size:12})}),!N.error&&N.scorerErrors&&N.scorerErrors.length>0&&a.jsx("span",{className:"ml-1 inline-flex items-center text-amber-500",title:"Scorer errors","aria-label":"Scorer errors",children:a.jsx(p0,{size:12})})]}),a.jsx("td",{className:"px-3 py-2 max-w-xs",children:a.jsx("span",{className:"text-[11px] leading-tight text-[hsl(var(--muted-foreground))] truncate block group-hover:text-[hsl(var(--foreground))] transition-colors",children:cr(N.input)==="[redacted]"?`Item ${S+1}`:cr(N.input)})}),r.map(M=>{const U=N.scores[M];return a.jsx("td",{className:"text-right px-2 py-2 font-mono",children:U!=null?a.jsx("span",{className:Z("font-medium tabular-nums",Nt(U)),children:U.toFixed(2)}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"—"})},M)}),a.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:N.duration!=null?ot(N.duration):"—"}),a.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:N.cost!=null&&N.cost>0?nt(N.cost):"—"}),a.jsx("td",{className:"px-2 py-2",children:a.jsx(On,{size:12,className:"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60 transition-opacity"})})]},S))})]})})})]})}const dg=300;function MS({text:l}){const[r,i]=b.useState(!1),u=l.length>dg;return a.jsxs("div",{children:[a.jsx("pre",{className:"text-xs font-mono p-3 rounded-lg bg-[hsl(var(--secondary))] overflow-auto max-h-96 whitespace-pre-wrap leading-relaxed",children:u&&!r?l.slice(0,dg)+"…":l}),u&&a.jsx("button",{onClick:()=>i(!r),className:"text-xs text-[hsl(var(--primary))] hover:underline mt-1.5 cursor-pointer",children:r?"Show less":"Show more"})]})}function Dd({label:l,data:r}){return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))]/50 border-b border-[hsl(var(--border))]",children:a.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:l})}),a.jsx("div",{className:"p-4",children:a.jsx(qt,{data:r,collapsed:!0})})]})}function AS({traces:l}){const[r,i]=b.useState(!1);return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("button",{onClick:()=>i(u=>!u),className:"w-full flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))]/50 border-b border-[hsl(var(--border))] hover:bg-[hsl(var(--muted))] text-left cursor-pointer",children:[a.jsx("span",{className:Z("text-[11px]",r?"rotate-0":"rotate-90"),children:"▶"}),a.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Trace"}),a.jsxs("span",{className:"text-[11px] text-[hsl(var(--muted-foreground))] ml-1",children:[l.length," event",l.length!==1?"s":""]})]}),!r&&a.jsx("div",{className:"p-2",children:a.jsx(Ci,{events:l})})]})}function RS({item:l,itemIndex:r,scorerNames:i,onBack:u}){const d=l.scorerErrors??[],f=ES(l),x=q0(l),m=CS(l),h=l.cost??0,g=l.scorerCost??0,y=h+g;return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("nav",{className:"flex items-center gap-1.5 text-sm",children:[a.jsx("button",{onClick:u,className:"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:"Overview"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"/"}),a.jsxs("span",{className:"font-medium",children:["Item #",r+1]}),l.error&&a.jsx("span",{className:"ml-1 inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/30",children:"Error"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))] font-mono",children:[f.length>0&&f.map(v=>a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-medium",title:v,children:vn(v)},v)),x&&a.jsxs("span",{title:`Input: ${x.input.toLocaleString()} Output: ${x.output.toLocaleString()}${x.reasoning?` Reasoning: ${x.reasoning.toLocaleString()}`:""}`,children:[(x.input+x.output+x.reasoning).toLocaleString()," tok"]}),m>1&&a.jsxs("span",{title:`${m} agent calls for this item`,children:[m," calls"]}),l.duration!=null&&a.jsx("span",{children:ot(l.duration)}),y>0&&a.jsx("span",{children:nt(y)})]})]}),i.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3 px-4 rounded-xl bg-[hsl(var(--muted))]/50",children:i.map(v=>{const w=l.scores[v];return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:v}),w!=null?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-12 h-1.5 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:a.jsx("div",{className:Z("h-full rounded-full",du(w)),style:{width:`${w*100}%`}})}),a.jsx("span",{className:Z("text-xs font-mono font-medium tabular-nums",Nt(w)),children:w.toFixed(2)})]}):a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:"—"})]},v)})}),l.error&&a.jsx("div",{className:"p-3 rounded-xl bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-xs font-mono",children:l.error}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[a.jsx(Dd,{label:"Input",data:l.input}),a.jsx(Dd,{label:"Output",data:l.output})]}),l.annotations!=null&&a.jsx(Dd,{label:"Expected (Annotations)",data:l.annotations}),y>0&&h>0&&g>0&&a.jsxs("div",{className:"flex items-center gap-3 text-xs text-[hsl(var(--muted-foreground))] font-mono",children:[a.jsxs("span",{children:["Workflow: ",nt(h)]}),a.jsx("span",{children:"+"}),a.jsxs("span",{children:["Scoring: ",nt(g)]}),a.jsx("span",{children:"="}),a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:nt(y)})]}),l.traces&&l.traces.length>0&&a.jsx(AS,{traces:l.traces}),i.length>0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Results"}),i.map(v=>{var O;const w=l.scores[v],k=(O=l.scoreDetails)==null?void 0:O[v],E=d.find(A=>A.includes(`"${v}"`));return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))]/50",children:[a.jsx("span",{className:"font-mono text-xs font-medium",children:v}),w!=null&&a.jsx("span",{className:Z("px-2 py-0.5 rounded-full text-xs font-mono font-medium",su(w)),children:w.toFixed(3)}),w==null&&!E&&a.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",children:"null"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(k==null?void 0:k.duration)!=null&&a.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",children:ot(k.duration)}),(k==null?void 0:k.cost)!=null&&k.cost>0&&a.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",children:nt(k.cost)})]})]}),((k==null?void 0:k.metadata)||E)&&a.jsxs("div",{className:"px-4 py-3 space-y-2",children:[(k==null?void 0:k.metadata)&&typeof k.metadata.reasoning=="string"&&k.metadata.reasoning.length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Reasoning"}),a.jsx(MS,{text:k.metadata.reasoning})]}),(k==null?void 0:k.metadata)&&(()=>{const A=Object.keys(k.metadata).filter(V=>V!=="reasoning");if(A.length===0)return null;const z={};for(const V of A)z[V]=k.metadata[V];return a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Metadata"}),a.jsx(qt,{data:z,collapsed:!0})]})})(),E&&a.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-400 font-mono p-2.5 rounded-lg bg-amber-50 dark:bg-amber-950/30",children:E})]})]},v)})]})]})}function OS(l,r){const i=r.map(u=>l.scores[u]).filter(u=>u!=null);return i.length===0?null:i.reduce((u,d)=>u+d,0)/i.length}function _S({items:l,scorerNames:r,selectedIndex:i,onSelectItem:u,onDeselectItem:d}){const f=b.useMemo(()=>l.map((m,h)=>({item:m,index:h,avg:OS(m,r),label:cr(m.input,60)})),[l,r]),x=l.filter(m=>m.error).length;return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0 px-4 py-3 border-b border-[hsl(var(--border))]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("button",{onClick:d,className:Z("text-xs font-medium transition-colors cursor-pointer",i==null?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:[l.length," items"]}),x>0?a.jsxs("span",{className:"text-[10px] font-medium text-red-600 dark:text-red-400",children:[x," failed"]}):a.jsx("span",{className:"text-[10px] font-medium text-emerald-600 dark:text-emerald-400",children:"all passed"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:f.map(({item:m,index:h,avg:g,label:y})=>{const v=i===h;return a.jsxs("button",{onClick:()=>u(h),className:Z("w-full text-left px-4 py-2.5 flex items-center gap-3 border-b border-[hsl(var(--border))]/50 transition-colors group cursor-pointer",v?"bg-[hsl(var(--accent))] border-l-2 border-l-[hsl(var(--foreground))]":"hover:bg-[hsl(var(--accent))]/50 border-l-2 border-l-transparent"),children:[a.jsx("span",{className:Z("text-[10px] font-mono w-5 shrink-0",v?"text-[hsl(var(--foreground))] font-medium":"text-[hsl(var(--muted-foreground))]"),children:h+1}),a.jsx("span",{className:Z("flex-1 text-xs truncate leading-snug",v?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] group-hover:text-[hsl(var(--foreground))]"),children:y}),m.error&&a.jsx("span",{className:"inline-flex items-center text-red-500 shrink-0",title:"Workflow error","aria-label":"Workflow error",children:a.jsx(d0,{size:11})}),!m.error&&m.scorerErrors&&m.scorerErrors.length>0&&a.jsx("span",{className:"inline-flex items-center text-amber-500 shrink-0",title:"Scorer errors","aria-label":"Scorer errors",children:a.jsx(p0,{size:11})}),g!=null?a.jsx("span",{className:Z("text-[11px] font-mono font-medium shrink-0 tabular-nums",Nt(g)),children:g.toFixed(2)}):a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] shrink-0",children:"-"}),a.jsx(On,{size:12,className:Z("shrink-0 transition-all",v?"text-[hsl(var(--foreground))] opacity-100":"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60")})]},h)})})]})}function zS({name:l,scores:r,mean:i}){return r.length===0?a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-28 text-xs font-mono truncate text-[hsl(var(--muted-foreground))]",title:l,children:l}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-28 text-xs font-mono truncate",title:l,children:l}),a.jsxs("div",{className:"flex-1 h-5 relative bg-[hsl(var(--secondary))] rounded",children:[[.25,.5,.75].map(u=>a.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-[hsl(var(--border))]",style:{left:`${u*100}%`}},u)),r.map((u,d)=>a.jsx("div",{className:Z("absolute w-1 top-[3px] bottom-[3px] rounded-sm",du(u)),style:{left:`${Math.max(1,Math.min(99,u*100))}%`,transform:"translateX(-50%)",opacity:.45},title:u.toFixed(3)},d)),a.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[hsl(var(--foreground))]",style:{left:`${i*100}%`,opacity:.3},title:`Mean: ${i.toFixed(3)}`})]}),a.jsx("span",{className:"w-12 text-xs font-mono text-right text-[hsl(var(--muted-foreground))] tabular-nums",children:i.toFixed(3)})]})}function DS({items:l,scorerNames:r}){const i=b.useMemo(()=>r.map(u=>{const d=[];for(const x of l){const m=x.scores[u];m!=null&&!x.error&&d.push(m)}const f=d.length>0?d.reduce((x,m)=>x+m,0)/d.length:0;return{name:u,scores:d,mean:f}}),[l,r]);return r.length===0?null:a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Score Distribution"})}),a.jsxs("div",{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[a.jsx("span",{className:"w-28"}),a.jsxs("div",{className:"flex-1 flex justify-between text-[10px] font-mono text-[hsl(var(--muted-foreground))]",children:[a.jsx("span",{children:"0"}),a.jsx("span",{children:"0.25"}),a.jsx("span",{children:"0.5"}),a.jsx("span",{children:"0.75"}),a.jsx("span",{children:"1.0"})]}),a.jsx("span",{className:"w-12"})]}),i.map(u=>a.jsx(zS,{name:u.name,scores:u.scores,mean:u.mean},u.name))]})]})}function Fo({field:l,current:r,dir:i,onSort:u,align:d,className:f,children:x}){const m=r===l;return a.jsxs("th",{className:Z(d==="right"?"text-right":"text-left","px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",f,d==="left"&&"px-4"),onClick:()=>u(l),children:[x,m&&a.jsx("span",{className:"ml-0.5",children:i==="desc"?"▼":"▲"})]})}function US({baseline:l,candidate:r,scorerNames:i,baselineRuns:u,candidateRuns:d,scorerTypes:f}){const[x,m]=b.useState(i[0]??""),[h,g]=b.useState("delta"),[y,v]=b.useState("desc"),[w,k]=b.useState(!1),E=u&&u.length>1||d&&d.length>1,O=(u==null?void 0:u.length)??1,A=(d==null?void 0:d.length)??1,[z,V]=b.useState(null),N=U=>{h===U?v(D=>D==="desc"?"asc":"desc"):(g(U),v(U==="index"?"asc":"desc"))},S=Math.min(l.items.length,r.items.length),M=b.useMemo(()=>{var le,se,I,oe;const U=[],D=Math.min((u==null?void 0:u.length)??0,(d==null?void 0:d.length)??0);for(let Y=0;Y<S;Y++){const ne=l.items[Y].scores[x]??null,Q=r.items[Y].scores[x]??null,G=ne!=null&&Q!=null?Q-ne:0;let T;if(D>1){T=[];for(let H=0;H<D;H++){const J=(se=(le=u[H])==null?void 0:le.items[Y])==null?void 0:se.scores[x],he=(oe=(I=d[H])==null?void 0:I.items[Y])==null?void 0:oe.scores[x];J!=null&&he!=null&&T.push(he-J)}}U.push({index:Y,input:l.items[Y].input,baselineScore:ne,candidateScore:Q,delta:G,runDeltas:T})}return U.sort((Y,ne)=>{let Q,G;switch(h){case"index":Q=Y.index,G=ne.index;break;case"baseline":Q=Y.baselineScore??-1,G=ne.baselineScore??-1;break;case"candidate":Q=Y.candidateScore??-1,G=ne.candidateScore??-1;break;case"delta":default:Q=Math.abs(Y.delta),G=Math.abs(ne.delta);break}return y==="desc"?G-Q:Q-G}),U},[l,r,x,h,y,S,u,d]);return i.length===0||S===0?null:a.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>k(U=>!U),className:"w-full flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[w?a.jsx(On,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}):a.jsx(Ma,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}),a.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["All Items (",S,")",E&&a.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," scores averaged across"," ",O===A?`${O} runs`:`${O} / ${A} runs`]})]})]}),!w&&a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] flex-wrap",children:i.map(U=>a.jsxs("button",{onClick:()=>m(U),className:Z("px-2 py-1 text-[11px] font-mono rounded-md transition-colors cursor-pointer",x===U?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))] font-medium":"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"),children:[U,(f==null?void 0:f[U])==="llm"&&a.jsx("span",{className:"ml-1 text-[8px] opacity-70",children:"LLM"})]},U))}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsx(Fo,{field:"index",current:h,dir:y,onSort:N,align:"left",className:"w-10",children:"#"}),a.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Input"}),a.jsxs(Fo,{field:"baseline",current:h,dir:y,onSort:N,align:"right",children:["Baseline",E&&O>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",O,")"]})]}),a.jsxs(Fo,{field:"candidate",current:h,dir:y,onSort:N,align:"right",children:["Candidate",E&&A>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",A,")"]})]}),a.jsx(Fo,{field:"delta",current:h,dir:y,onSort:N,align:"right",children:"Delta"})]})}),a.jsx("tbody",{children:M.map(U=>{const D=z===U.index,le=U.delta>0?"text-emerald-600 dark:text-emerald-400":U.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return a.jsxs("tr",{className:Z("border-b border-[hsl(var(--border))] last:border-b-0 cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",D&&"bg-[hsl(var(--accent))]"),children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",onClick:()=>V(D?null:U.index),children:U.index+1}),a.jsx("td",{className:"px-3 py-2.5 max-w-xs truncate",onClick:()=>V(D?null:U.index),children:cr(U.input)}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",U.baselineScore!=null?Nt(U.baselineScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>V(D?null:U.index),children:U.baselineScore!=null?U.baselineScore.toFixed(3):"—"}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",U.candidateScore!=null?Nt(U.candidateScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>V(D?null:U.index),children:U.candidateScore!=null?U.candidateScore.toFixed(3):"—"}),a.jsxs("td",{className:Z("px-3 py-2.5 text-right",le),onClick:()=>V(D?null:U.index),children:[a.jsx("div",{className:"font-mono",children:U.delta!==0?`${U.delta>0?"+":""}${U.delta.toFixed(3)}`:"—"}),U.runDeltas&&U.runDeltas.length>1&&a.jsxs("div",{className:"flex items-center justify-end gap-0.5 mt-1",title:U.runDeltas.map((se,I)=>`Run ${I+1}: ${se>=0?"+":""}${se.toFixed(3)}`).join(", "),children:[U.runDeltas.map((se,I)=>a.jsx("div",{className:Z("w-1.5 h-1.5 rounded-full",se<0?"bg-red-500 dark:bg-red-400":se>0?"bg-emerald-500 dark:bg-emerald-400":"bg-[hsl(var(--muted-foreground))]")},I)),a.jsxs("span",{className:"text-[9px] text-[hsl(var(--muted-foreground))] ml-0.5",children:[U.runDeltas.filter(se=>U.delta<0?se<0:se>0).length,"/",U.runDeltas.length]})]})]})]},U.index)})})]})}),z!=null&&z<l.items.length&&z<r.items.length&&a.jsx(B0,{baselineItem:l.items[z],candidateItem:r.items[z],scorer:x,baselineRunItems:u==null?void 0:u.map(U=>U.items[z]).filter(Boolean),candidateRunItems:d==null?void 0:d.map(U=>U.items[z]).filter(Boolean)})]})]})}function LS({text:l,children:r}){return a.jsxs("span",{className:"relative group/tip cursor-help",children:[r,a.jsx("span",{className:"invisible group-hover/tip:visible absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 px-2.5 py-1.5 text-[10px] leading-snug rounded-md bg-[hsl(var(--foreground))] text-[hsl(var(--background))] whitespace-normal w-56 z-50 shadow-md pointer-events-none",children:l})]})}function fg({value:l,percent:r,invert:i,format:u}){const d=i?l<0:l>0,f=i?l>0:l<0,x=d?"text-emerald-600 dark:text-emerald-400":f?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]",m=u?`${l>0?"+":l<0?"-":""}${u(Math.abs(l))}`:`${l>0?"+":""}${Math.abs(l)<100?l.toFixed(3):l.toFixed(0)}`,h=`${r>0?"+":""}${r.toFixed(1)}%`;return a.jsx("td",{className:Z("px-3 py-2.5 text-right",x),children:a.jsxs("div",{className:"font-mono",children:[m," (",h,")"]})})}function hg(l){return(l>=0?"+":"")+l.toFixed(4)}function HS({compareResult:l,baseline:r,candidate:i,isGroupComparison:u,baselineRuns:d,candidateRuns:f}){var I,oe;const[x,m]=b.useState(null),[h,g]=b.useState("delta"),[y,v]=b.useState("desc"),[w,k]=b.useState({}),E=(Y,ne)=>{(x==null?void 0:x.type)===Y&&(x==null?void 0:x.index)===ne?m(null):m({type:Y,index:ne})},O=((I=r==null?void 0:r.metadata)==null?void 0:I.scorerTypes)??((oe=i==null?void 0:i.metadata)==null?void 0:oe.scorerTypes),A=(d==null?void 0:d.length)??1,z=(f==null?void 0:f.length)??1,V=u?`averaged across ${A===z?`${A} runs`:`${A} / ${z} runs`}`:null,N=b.useMemo(()=>{const Y=Object.entries(l.scorers);return Y.sort((ne,Q)=>{if(h==="delta"){const H=ne[1].significant===!0?1:0,J=Q[1].significant===!0?1:0;if(H!==J)return J-H}let G,T;switch(h){case"metric":return y==="asc"?ne[0].localeCompare(Q[0]):Q[0].localeCompare(ne[0]);case"baseline":G=ne[1].baselineMean,T=Q[1].baselineMean;break;case"candidate":G=ne[1].candidateMean,T=Q[1].candidateMean;break;case"delta":default:G=Math.abs(ne[1].delta),T=Math.abs(Q[1].delta);break}return y==="desc"?T-G:G-T}),Y},[l.scorers,h,y]),S=N.some(([,Y])=>Y.ci!=null),M=Y=>{h===Y?v(ne=>ne==="desc"?"asc":"desc"):(g(Y),v("desc"))},U=Y=>h===Y?y==="desc"?" ▼":" ▲":"",D=N.filter(([,Y])=>Y.significant===!0).length,le=l.regressions.length,se=l.improvements.length;return a.jsxs("div",{className:"space-y-6",children:[N.length>0&&(()=>{const Y=N.some(([,H])=>H.significant===!0&&H.delta<0),ne=N.some(([,H])=>H.significant===!0&&H.delta>0),Q=l.regressions.length>0,G=N.every(([,H])=>H.significant===!1),T=(H,J)=>{const he=J.delta<0?J.pRegression!=null?`${Math.round(J.pRegression*100)}%`:null:J.pImprovement!=null?`${Math.round(J.pImprovement*100)}%`:null,de=`${J.delta>0?"+":""}${J.delta.toFixed(3)}`;return`${H} ${de}${he?` (${he} probability)`:""}`};if(Y){const H=N.filter(([,J])=>J.significant===!0&&J.delta<0);return a.jsxs("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/30",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-red-600 dark:text-red-400 text-xs font-bold",children:"✕"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:"Significant regression detected"}),a.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-0.5",children:H.map(([J,he])=>T(J,he)).join("; ")})]})]})}if(ne){const H=N.filter(([,J])=>J.significant===!0&&J.delta>0);return a.jsxs("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-emerald-200 dark:border-emerald-900 bg-emerald-50 dark:bg-emerald-950/30",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-emerald-100 dark:bg-emerald-900/50 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-emerald-800 dark:text-emerald-200",children:"Significant improvement detected"}),a.jsx("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 mt-0.5",children:H.map(([J,he])=>T(J,he)).join("; ")})]})]})}return Q&&G?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-xl border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/30",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-amber-100 dark:bg-amber-900/50 flex items-center justify-center shrink-0",children:a.jsx("span",{className:"text-amber-600 dark:text-amber-400 text-xs font-bold",children:"~"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:[l.regressions.length," item regressions, but not statistically significant"]}),a.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:u?"Even with pooled multi-run data, the score differences are within normal variation.":"Score differences are within normal LLM variation. Consider multi-run for stronger confidence."})]})]}):a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-emerald-100 dark:bg-emerald-900/50 flex items-center justify-center shrink-0",children:a.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"No significant changes"}),a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"Scores are stable between baseline and candidate"})]})]})})(),(()=>{const Y=(Se,Ot)=>{const ea=Ot&&Ot.length>0?Ot:Se?[Se]:[],_n=new Set;for(const Gn of ea)for(const jl of Aa(Gn))_n.add(jl);return[..._n]},ne=d&&d.length>0?d:r?[r]:[],Q=f&&f.length>0?f:i?[i]:[],G=(Se,Ot)=>{const ea=Ot&&Ot.length>0?Ot:Se?[Se]:[],_n=new Set,Gn=[];for(const jl of ea)for(const $t of Fs(jl))_n.has($t)||(_n.add($t),Gn.push($t));return Gn},T=Y(r,d),H=Y(i,f),J=G(r,d),he=G(i,f),de=ug(ne),C=ug(Q),q=de.input+de.output+de.reasoning,W=C.input+C.output+C.reasoning,ie=cg(ne),fe=cg(Q),ye=J.length>0||he.length>0,ce=new Set(J),we=new Set(he),Me=ce.size!==we.size||J.some(Se=>!we.has(Se)),ft=T.length>0||H.length>0,Yt=q>0&&W>0,rn=ie>0||fe>0;if(!ye&&!ft&&!Yt&&!rn)return null;const on=new Set(T),At=new Set(H),at=on.size!==At.size||T.some(Se=>!At.has(Se)),Rt=q>0?(W-q)/q*100:0;return a.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg bg-[hsl(var(--muted))]/50 text-xs flex-wrap",children:[ye&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:J.length>1||he.length>1?"Workflows":"Workflow"}),a.jsx("div",{className:"flex items-center gap-1.5",children:J.length>0?J.map(Se=>a.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:Se,children:Se},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("div",{className:"flex items-center gap-1.5",children:he.length>0?he.map(Se=>a.jsx("span",{className:Z("px-1.5 py-0.5 rounded font-mono",Me?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border border-[hsl(var(--border))] bg-[hsl(var(--background))]"),title:Se,children:Se},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),Me&&a.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),ft&&a.jsxs(a.Fragment,{children:[ye&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Models"}),a.jsx("div",{className:"flex items-center gap-1.5",children:T.length>0?T.map(Se=>a.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:Se,children:vn(Se)},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("div",{className:"flex items-center gap-1.5",children:H.length>0?H.map(Se=>a.jsx("span",{className:Z("px-1.5 py-0.5 rounded font-mono",at?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border border-[hsl(var(--border))] bg-[hsl(var(--background))]"),title:Se,children:vn(Se)},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),at&&a.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),Yt&&a.jsxs(a.Fragment,{children:[ft&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Tokens"}),a.jsx("span",{className:"font-mono",children:q.toLocaleString()}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("span",{className:"font-mono",children:W.toLocaleString()}),Math.abs(Rt)>=1&&a.jsxs("span",{className:Z("text-[10px] font-medium",Rt>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[Rt>0?"+":"",Rt.toFixed(0),"%"]})]}),rn&&a.jsxs(a.Fragment,{children:[(ft||Yt)&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Cost"}),a.jsx("span",{className:"font-mono",children:nt(ie)}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("span",{className:"font-mono",children:nt(fe)}),ie>0&&fe>0&&(()=>{const Se=(fe-ie)/ie*100;return Math.abs(Se)>=1?a.jsxs("span",{className:Z("text-[10px] font-medium",Se>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[Se>0?"+":"",Se.toFixed(0),"%"]}):null})()]})]})})(),a.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Significant"}),a.jsx("div",{className:"text-lg font-semibold mt-0.5",children:D})]}),a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Regressions"}),a.jsx("div",{className:Z("text-lg font-semibold mt-0.5",le>0?"text-red-600 dark:text-red-400":""),children:le})]}),a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Improvements"}),a.jsx("div",{className:Z("text-lg font-semibold mt-0.5",se>0?"text-emerald-600 dark:text-emerald-400":""),children:se})]}),l.cost&&a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Cost Delta"}),a.jsxs("div",{className:Z("text-lg font-semibold mt-0.5",l.cost.delta>0?"text-red-600 dark:text-red-400":l.cost.delta<0?"text-emerald-600 dark:text-emerald-400":""),children:[l.cost.delta>0?"+":"",nt(Math.abs(l.cost.delta))]})]})]}),N.length>0&&a.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Scorer Comparison",V&&a.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," ",V]})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsxs("th",{className:"text-left px-4 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>M("metric"),children:["Metric",U("metric")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>M("baseline"),children:["Baseline",u&&A>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",A,")"]}),U("baseline")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>M("candidate"),children:["Candidate",u&&z>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",z,")"]}),U("candidate")]}),a.jsx("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>M("delta"),children:S?a.jsxs(LS,{text:"Score delta with 95% confidence interval via paired bootstrap. If the CI excludes zero and the effect exceeds the practical threshold, the difference is significant (shown with a colored left border).",children:["Delta",U("delta")]}):a.jsxs(a.Fragment,{children:["Delta",U("delta")]})})]})}),a.jsxs("tbody",{children:[N.map(([Y,ne])=>{const Q=ne.delta>0?"+":(ne.delta<0,""),G=ne.delta>0?"text-emerald-600 dark:text-emerald-400":ne.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return a.jsxs("tr",{className:Z("border-b border-[hsl(var(--border))] last:border-b-0",ne.significant===!0&&ne.delta<0&&"border-l-[3px] border-l-red-500",ne.significant===!0&&ne.delta>0&&"border-l-[3px] border-l-emerald-500"),children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[Y,(O==null?void 0:O[Y])==="llm"&&a.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",Nt(ne.baselineMean)),children:ne.baselineMean.toFixed(3)}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",Nt(ne.candidateMean)),children:ne.candidateMean.toFixed(3)}),a.jsxs("td",{className:"px-3 py-2.5 text-right",children:[a.jsxs("div",{className:Z("font-mono",G),children:[Q,Math.abs(ne.delta).toFixed(3)," (",Q,Math.abs(ne.deltaPercent).toFixed(1),"%)"]}),ne.ci&&a.jsxs("div",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))] mt-0.5",children:["CI [",hg(ne.ci.lower),", ",hg(ne.ci.upper),"]"]}),ne.pRegression!=null&&ne.pImprovement!=null&&(()=>{const T=ne.pRegression??0,H=ne.pImprovement??0;if(T===0&&H===0)return null;let J,he,de;if(T>H)he=T,J="regression",de=Math.round(he*100)>=95?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";else if(H>T)he=H,J="improvement",de=Math.round(he*100)>=95?"text-emerald-600 dark:text-emerald-400":"text-[hsl(var(--muted-foreground))]";else return null;const C=Math.round(he*100);return a.jsxs("div",{className:Z("text-[10px] mt-0.5",de),children:[C,"% probability of ",J,ne.n!=null&&a.jsxs("span",{className:"opacity-60 ml-1",children:["(n=",ne.n,")"]})]})})()]})]},Y)}),l.timing&&a.jsxs("tr",{className:"border-t-2 border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing (mean)"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.baselineMean)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(l.timing.candidateMean)}),a.jsx(fg,{value:l.timing.delta,percent:l.timing.deltaPercent,invert:!0,format:ot})]}),l.cost!=null&&a.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Cost (total)"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:nt(l.cost.baselineTotal)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:nt(l.cost.candidateTotal)}),a.jsx(fg,{value:l.cost.delta,percent:l.cost.deltaPercent,invert:!0,format:nt})]})]})]})})]}),[{type:"regression",items:l.regressions,borderColor:"border-red-200 dark:border-red-900",bgColor:"bg-red-50 dark:bg-red-950/30",textColor:"text-red-700 dark:text-red-300",deltaColor:"text-red-600 dark:text-red-400",label:"Regressions",direction:-1},{type:"improvement",items:l.improvements,borderColor:"border-emerald-200 dark:border-emerald-900",bgColor:"bg-emerald-50 dark:bg-emerald-950/30",textColor:"text-emerald-700 dark:text-emerald-300",deltaColor:"text-emerald-600 dark:text-emerald-400",label:"Improvements",direction:1}].filter(Y=>Y.items.length>0).map(Y=>{const ne=d&&f&&d.length>1,Q=ne?Math.min(d.length,f.length):0,G=Y.items.map((ce,we)=>{var ft,Yt,rn,on;let Me=0;if(ne)for(let At=0;At<Q;At++){const at=(Yt=(ft=d[At])==null?void 0:ft.items[ce.itemIndex])==null?void 0:Yt.scores[ce.scorer],Rt=(on=(rn=f[At])==null?void 0:rn.items[ce.itemIndex])==null?void 0:on.scores[ce.scorer];at!=null&&Rt!=null&&(Y.direction<0?Rt<at:Rt>at)&&Me++}return{...ce,originalIndex:we,consistentCount:Me,totalRuns:Q}});ne?G.sort((ce,we)=>we.consistentCount-ce.consistentCount||Math.abs(we.delta)-Math.abs(ce.delta)):G.sort((ce,we)=>Math.abs(we.delta)-Math.abs(ce.delta));const T=[...new Set(Y.items.map(ce=>ce.scorer))],H=T.length===1?T[0]:null,J=new Map;for(const ce of G)J.has(ce.scorer)||J.set(ce.scorer,[]),J.get(ce.scorer).push(ce);const he=ce=>{const we=(x==null?void 0:x.type)===Y.type&&x.index===ce.originalIndex,Me=r==null?void 0:r.items[ce.itemIndex],ft=i==null?void 0:i.items[ce.itemIndex],Yt=ce.input?cr(ce.input,40):`Item #${ce.itemIndex+1}`,rn=ne?ce.consistentCount===Q?"":ce.consistentCount===0?"opacity-40":"opacity-65":"";return a.jsxs("div",{className:rn,children:[a.jsxs("button",{onClick:()=>E(Y.type,ce.originalIndex),className:"w-full text-left flex items-center gap-3 px-4 py-2.5 text-xs hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[ne&&a.jsxs("span",{className:Z("shrink-0 text-[10px] font-mono font-medium px-1.5 py-0.5 rounded",ce.consistentCount===Q?Y.type==="regression"?"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300":"bg-emerald-100 dark:bg-emerald-900/40 text-emerald-700 dark:text-emerald-300":"bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]"),children:[ce.consistentCount,"/",Q]}),a.jsxs("span",{className:"min-w-0 truncate flex-1",children:[a.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:["#",ce.itemIndex+1]})," ",a.jsx("span",{children:Yt})]}),a.jsxs("span",{className:Z("font-mono shrink-0",Y.deltaColor),children:[ce.baselineScore.toFixed(2)," ","→"," ",ce.candidateScore.toFixed(2)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",ce.delta>0?"+":"",ce.delta.toFixed(2),")"]})]})]}),we&&Me&&ft&&a.jsx(B0,{baselineItem:Me,candidateItem:ft,scorer:ce.scorer,baselineRunItems:d==null?void 0:d.map(on=>on.items[ce.itemIndex]).filter(Boolean),candidateRunItems:f==null?void 0:f.map(on=>on.items[ce.itemIndex]).filter(Boolean)})]},ce.originalIndex)},de=5;let C,q;if(ne){const ce=Math.ceil(Q/2);C=G.filter(we=>we.consistentCount>=ce),q=G.filter(we=>we.consistentCount<ce)}else C=G.slice(0,de),q=G.slice(de);const W=w[Y.type]??!1,ie=ne?`${q.length} likely noise (minority of runs)`:`${q.length} more`,fe=ce=>{const we=new Map;for(const Me of ce)we.has(Me.scorer)||we.set(Me.scorer,[]),we.get(Me.scorer).push(Me);return we},ye=ce=>{if(H)return a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:ce.map(he)});const we=fe(ce);return a.jsx("div",{children:[...we.entries()].map(([Me,ft])=>a.jsxs("div",{children:[a.jsxs("div",{className:Z("px-4 py-2 border-b border-t border-[hsl(var(--border))]",Y.type==="regression"?"bg-red-50/30 dark:bg-red-950/5":"bg-emerald-50/30 dark:bg-emerald-950/5"),children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:Me}),a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-1.5",children:["(",ft.length,")"]})]}),a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:ft.map(he)})]},Me))})};return a.jsxs("div",{className:Z("border rounded-lg overflow-hidden",Y.borderColor),children:[a.jsx("div",{className:Z("px-4 py-2.5 border-b",Y.bgColor,Y.borderColor),children:a.jsxs("h3",{className:Z("text-xs font-medium",Y.textColor),children:[Y.label," (",C.length,q.length>0?` + ${q.length} noise`:"",")",V&&a.jsxs("span",{className:"font-normal opacity-70 ml-1",children:[" — ","scores ",V]})]})}),C.length>0?ye(C):a.jsxs("div",{className:"px-4 py-3 text-xs text-[hsl(var(--muted-foreground))]",children:["No reliable ",Y.label.toLowerCase()," detected (all within noise)."]}),q.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>k(ce=>({...ce,[Y.type]:!W})),className:"w-full flex items-center justify-center gap-1.5 px-4 py-2 text-[11px] font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors border-t border-dashed border-[hsl(var(--border))] cursor-pointer",children:[W?a.jsx(Bj,{className:"h-3 w-3"}):a.jsx(Ma,{className:"h-3 w-3"}),W?"Hide":"Show"," ",ie]}),W&&ye(q)]})]},Y.type)}),r&&i&&a.jsx(US,{baseline:r,candidate:i,scorerNames:N.map(([Y])=>Y),baselineRuns:d??void 0,candidateRuns:f??void 0,scorerTypes:O})]})}function mg({label:l,item:r,scorer:i}){var f,x;const u=(f=r.scoreDetails)==null?void 0:f[i],d=typeof((x=u==null?void 0:u.metadata)==null?void 0:x.reasoning)=="string"?u.metadata.reasoning:null;return a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx("h5",{className:"font-medium text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px]",children:l}),a.jsx(qt,{data:r.output,collapsed:!0}),(u==null?void 0:u.score)!=null&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Score:"}),a.jsx("span",{className:Z("px-2 py-0.5 rounded-full font-mono font-medium",su(u.score)),children:u.score.toFixed(3)})]}),d&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Reasoning"}),a.jsx("pre",{className:"text-xs font-mono p-2 rounded-md bg-[hsl(var(--secondary))] overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed",children:d})]})]})}function B0({baselineItem:l,candidateItem:r,scorer:i,baselineRunItems:u,candidateRunItems:d}){var k,E,O,A;const[f,x]=b.useState(0),m=u&&u.length>1||d&&d.length>1,h=Math.max((u==null?void 0:u.length)??1,(d==null?void 0:d.length)??1),g=m&&u?u[f]??l:l,y=m&&d?d[f]??r:r,v=(E=(k=l.scoreDetails)==null?void 0:k[i])==null?void 0:E.score,w=(A=(O=r.scoreDetails)==null?void 0:O[i])==null?void 0:A.score;return a.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[m&&(v!=null||w!=null)&&a.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsxs("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Mean across ",h," runs"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[v!=null&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Baseline:"}),a.jsx("span",{className:Z("font-mono font-medium",Nt(v)),children:v.toFixed(3)})]}),w!=null&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Candidate:"}),a.jsx("span",{className:Z("font-mono font-medium",Nt(w)),children:w.toFixed(3)})]}),v!=null&&w!=null&&a.jsxs("span",{className:Z("font-mono",w-v>0?"text-emerald-600 dark:text-emerald-400":w-v<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]"),children:["(",w-v>0?"+":"",(w-v).toFixed(3),")"]})]})]}),m&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),a.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:h},(z,V)=>a.jsx("button",{onClick:()=>x(V),className:Z("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",V===f?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:V+1},V))}),a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-auto",children:["Showing output and reasoning from run ",f+1," of ",h]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsx("div",{className:"border-r border-[hsl(var(--border))]",children:a.jsx(mg,{label:"Baseline",item:g,scorer:i})}),a.jsx(mg,{label:"Candidate",item:y,scorer:i})]})]})}function ru(l){const r=Date.now()-l;return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:new Date(l).toLocaleDateString()}function _f(l){return l.data.dataset??""}function qS(l){var r;return(r=l.data.metadata)==null?void 0:r.runGroupId}function BS(l){var d;const r=new Map,i=[];for(const f of l){const x=qS(f);x?(r.has(x)||r.set(x,[]),r.get(x).push(f)):i.push(f)}const u=[];for(const[f,x]of r){if(x.length===1){i.push(x[0]);continue}const m=x[0].data,h=Object.keys(((d=m.summary)==null?void 0:d.scorers)??{}),g={};for(const y of h){const v=x.map(w=>{var k,E,O;return((O=(E=(k=w.data.summary)==null?void 0:k.scorers)==null?void 0:E[y])==null?void 0:O.mean)??0});g[y]={mean:v.reduce((w,k)=>w+k,0)/v.length}}u.push({type:"group",groupId:f,entries:x.sort((y,v)=>v.timestamp-y.timestamp),evalName:x[0].eval,timestamp:Math.max(...x.map(y=>y.timestamp)),dataset:_f(x[0]),runCount:x.length,aggregateScorers:g})}for(const f of i)u.push({type:"single",entry:f});return u.sort((f,x)=>{const m=f.type==="group"?f.timestamp:f.entry.timestamp;return(x.type==="group"?x.timestamp:x.entry.timestamp)-m}),u}function zf({scorers:l}){const r=Object.entries(l);return r.length===0?null:a.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:r.map(([i,u])=>a.jsx("div",{className:"relative h-3.5 w-4 rounded-sm bg-[hsl(var(--muted))] overflow-hidden",title:`${i}: ${u.mean.toFixed(3)}`,children:a.jsx("div",{className:Z("absolute bottom-0 left-0 right-0 rounded-sm",du(u.mean)),style:{height:`${Math.max(0,Math.min(100,u.mean*100))}%`}})},i))})}function lf({data:l}){var u;const r=(u=l.summary)==null?void 0:u.scorers;if(!r)return null;const i={};for(const[d,f]of Object.entries(r))i[d]={mean:f.mean};return a.jsx(zf,{scorers:i})}function QS({selection:l,history:r,pickerItems:i,placeholder:u}){if(!l)return a.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:u});if(l.groupIds&&l.groupIds.length>1){const h=i.find(g=>g.type==="group"&&g.entries.some(y=>y.id===l.id));if(h&&h.type==="group"){const g=Of(h.entries);return a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx(zf,{scorers:h.aggregateScorers}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:h.evalName}),a.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300",children:[a.jsx(Cf,{className:"h-2.5 w-2.5"}),h.runCount," runs"]}),g.map(([y,v])=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${y} — ${v} calls`,children:[vn(y)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",v,")"]})]},y))]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx(Zx,{className:"h-2.5 w-2.5"}),ru(h.timestamp)]})]})]})}}const d=r.find(h=>h.id===l.id);if(!d)return a.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:u});const f=d.data,x=Aa(f),m=yl(f);return a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx(lf,{data:f}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:d.eval}),x.map(h=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:m?`${h} — ${m[h]} calls`:h,children:[vn(h),m&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" (",m[h],")"]})]},h))]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx(Zx,{className:"h-2.5 w-2.5"}),ru(d.timestamp),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"font-mono",children:d.id.slice(0,8)})]})]})]})}function pg({label:l,selection:r,pickerItems:i,disabledSelection:u,history:d,onChange:f,filterDataset:x}){const[m,h]=b.useState(!1),[g,y]=b.useState(null),v=b.useRef(null);b.useEffect(()=>{function E(O){v.current&&!v.current.contains(O.target)&&(h(!1),y(null))}return m&&document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[m]);const w=x?i.filter(E=>E.type==="group"?E.dataset===x:_f(E.entry)===x):i,k=new Set((u==null?void 0:u.groupIds)??(u?[u.id]:[]));return a.jsxs("div",{ref:v,className:"flex-1 min-w-0 relative",children:[a.jsx("label",{className:"block text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-1.5",children:l}),a.jsxs("button",{onClick:()=>{h(!m),y(null)},className:Z("w-full px-3 py-2 rounded-lg border text-left flex items-center justify-between gap-2 transition-colors min-h-[44px] cursor-pointer",m?"border-[hsl(var(--foreground))] ring-1 ring-[hsl(var(--foreground))]":"border-[hsl(var(--input))] hover:border-[hsl(var(--foreground))/30]","bg-[hsl(var(--background))]"),children:[a.jsx(QS,{selection:r,history:d,pickerItems:i,placeholder:`Select ${l.toLowerCase()}...`}),a.jsx(Ma,{className:Z("h-3.5 w-3.5 shrink-0 text-[hsl(var(--muted-foreground))] transition-transform",m&&"rotate-180")})]}),m&&a.jsx("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-72 overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--background))] shadow-lg",children:w.length===0?a.jsx("div",{className:"px-3 py-4 text-xs text-center text-[hsl(var(--muted-foreground))]",children:"No matching runs"}):w.map(E=>{var N;if(E.type==="group"){const S=g===E.groupId,M=(N=r==null?void 0:r.groupIds)==null?void 0:N.some(U=>E.entries.some(D=>D.id===U));return a.jsxs("div",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{onClick:()=>{f({id:E.entries[0].id,groupIds:E.entries.map(U=>U.id)}),h(!1),y(null)},className:Z("flex-1 text-left px-3 py-2.5 flex items-center gap-2.5 transition-colors cursor-pointer",M?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"),children:[a.jsx(zf,{scorers:E.aggregateScorers}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium truncate",children:E.evalName}),a.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-medium bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300",children:[a.jsx(Cf,{className:"h-2 w-2"}),E.runCount," runs"]}),Of(E.entries).map(([U,D])=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${U} — ${D} calls`,children:[vn(U)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",D,")"]})]},U))]}),a.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[ru(E.timestamp),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),"pooled comparison"]})]}),M&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]}),a.jsx("button",{onClick:U=>{U.stopPropagation(),y(S?null:E.groupId)},className:"shrink-0 w-8 flex items-center justify-center border-l border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:S?"Hide individual runs":"Show individual runs",children:S?a.jsx(Ma,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"}):a.jsx(On,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"})})]}),S&&E.entries.map(U=>{var I;const D=U.data,le=(r==null?void 0:r.id)===U.id&&!(r!=null&&r.groupIds),se=k.has(U.id);return a.jsxs("button",{onClick:()=>{f({id:U.id}),h(!1),y(null)},disabled:se,className:Z("w-full text-left pl-8 pr-3 py-2 flex items-center gap-2.5 transition-colors border-t border-[hsl(var(--border))] cursor-pointer","bg-[hsl(var(--muted))]/30",le?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",se&&"opacity-30 cursor-not-allowed"),children:[a.jsx(lf,{data:D}),a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsxs("span",{children:["Run ",(((I=D.metadata)==null?void 0:I.runIndex)??0)+1]}),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"font-mono",children:U.id.slice(0,8)}),(()=>{const oe=yl(D);return Aa(D).map(Y=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[9px]",title:oe?`${Y} — ${oe[Y]} calls`:Y,children:[vn(Y),oe&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",oe[Y],")"]})]},Y))})()]})}),le&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},U.id)})]},E.groupId)}const{entry:O}=E,A=O.data,z=(r==null?void 0:r.id)===O.id,V=k.has(O.id);return a.jsxs("button",{onClick:()=>{f({id:O.id}),h(!1),y(null)},disabled:V,className:Z("w-full text-left px-3 py-2.5 flex items-center gap-2.5 transition-colors border-b border-[hsl(var(--border))] last:border-b-0 cursor-pointer",z?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",V&&"opacity-30 cursor-not-allowed"),children:[a.jsx(lf,{data:A}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium truncate",children:O.eval}),(()=>{const S=yl(A);return Aa(A).map(M=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:S?`${M} — ${S[M]} calls`:M,children:[vn(M),S&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",S[M],")"]})]},M))})()]}),a.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[ru(O.timestamp),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),a.jsx("span",{className:"font-mono",children:O.id.slice(0,8)}),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),A.summary.count," items"]})]}),z&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},O.id)})})]})}function GS({history:l,baselineSelection:r,candidateSelection:i,onBaselineChange:u,onCandidateChange:d,onCompare:f,comparing:x}){const m=b.useMemo(()=>BS(l),[l]),h=r?l.find(v=>v.id===r.id):null,g=h?_f(h):null,y=r!=null&&i!=null&&r.id!==i.id&&!x;return a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx(pg,{label:"Baseline",selection:r,pickerItems:m,disabledSelection:i,history:l,onChange:u,filterDataset:null}),a.jsx("button",{onClick:()=>{if(r&&i){const v=r;u(i),d(v)}},disabled:!r||!i,className:"shrink-0 p-2 rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors mb-[1px] cursor-pointer",title:"Swap baseline and candidate",children:a.jsx(kj,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"})}),a.jsx(pg,{label:"Candidate",selection:i,pickerItems:m,disabledSelection:r,history:l,onChange:d,filterDataset:g}),a.jsx("button",{onClick:f,disabled:!y,className:Z("shrink-0 px-5 py-2 text-sm font-medium rounded-lg transition-all cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))]","hover:opacity-90 disabled:opacity-40"),children:x?"Comparing…":"Compare"})]})})}function YS({currentIndex:l,totalRuns:r,aggregate:i,onIndexChange:u}){const d=l===-1,f=l>-1,x=l<r-1;return a.jsx("div",{className:"px-6",children:a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 rounded-lg bg-[hsl(var(--muted))]",children:[a.jsx("button",{onClick:()=>u(l-1),disabled:!f,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:a.jsx(Lj,{size:16})}),a.jsxs("div",{className:"text-center",children:[a.jsx("span",{className:"text-sm font-medium",children:d?`Aggregate (${r} runs)`:`Run ${l+1} of ${r}`}),!d&&a.jsx("button",{onClick:()=>u(-1),className:"ml-3 text-xs text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] underline transition-colors cursor-pointer",children:"View aggregate"}),d&&(()=>{const m=Object.values(i.scorers),h=m.reduce((g,y)=>g+y.mean,0)/Math.max(m.length,1);return a.jsxs("div",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Overall mean: ",h.toFixed(3)," across ",m.length," scorer",m.length!==1?"s":""]})})()]}),a.jsx("button",{onClick:()=>u(l+1),disabled:!x,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:a.jsx(On,{size:16})})]})})}function $S(l){var f;const r={},i=[];for(const x of l){const m=x.data;if(!((f=m.summary)!=null&&f.scorers))continue;const h=[];for(const[g,y]of Object.entries(m.summary.scorers))r[g]||(r[g]=[]),r[g].push(y.mean),h.push(y.mean);h.length>0&&i.push(h.reduce((g,y)=>g+y,0)/h.length)}const u={};for(const[x,m]of Object.entries(r)){const h=m.reduce((y,v)=>y+v,0)/m.length,g=m.length>1?Math.sqrt(m.reduce((y,v)=>y+(v-h)**2,0)/(m.length-1)):0;u[x]={mean:h,std:g}}let d=null;if(i.length>0){const x=i.reduce((h,g)=>h+g,0)/i.length,m=i.length>1?Math.sqrt(i.reduce((h,g)=>h+(g-x)**2,0)/(i.length-1)):0;d={mean:x,std:m}}return{scorers:u,overall:d}}function KS(l){const r=l.eval.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"eval",i=l.id.slice(0,8),u=new Date(l.timestamp).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z"),d=`${r}-${i}-${u}.json`,f=JSON.stringify(l.data,null,2),x=new Blob([f],{type:"application/json"}),m=URL.createObjectURL(x),h=document.createElement("a");h.href=m,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),setTimeout(()=>URL.revokeObjectURL(m),0)}function XS({history:l,evalFilter:r,onEvalFilterChange:i,onSelect:u,onSelectGroup:d,onRescore:f,onDelete:x,registeredEvalNames:m,readOnly:h,expandedGroups:g,onToggleGroup:y}){const[v,w]=b.useState(null),k=[...new Set(l.map(S=>S.eval))].sort(),E=b.useMemo(()=>r?l.filter(S=>S.eval===r):l,[l,r]),{rows:O,scorerCols:A}=b.useMemo(()=>{var le,se;const S=new Map,M=[];for(const I of E){const Y=(le=I.data.metadata)==null?void 0:le.runGroupId;Y?(S.has(Y)||S.set(Y,[]),S.get(Y).push(I)):M.push(I)}const U=[];for(const[I,oe]of S)oe.sort((Y,ne)=>ne.timestamp-Y.timestamp),oe.length===1?U.push({type:"entry",entry:oe[0]}):U.push({type:"group",groupId:I,entries:oe,evalName:oe[0].eval,newestTimestamp:oe[0].timestamp});for(const I of M)U.push({type:"entry",entry:I});U.sort((I,oe)=>{const Y=I.type==="group"?I.newestTimestamp:I.entry.timestamp;return(oe.type==="group"?oe.newestTimestamp:oe.entry.timestamp)-Y});const D=new Set;for(const I of E){const oe=I.data;if((se=oe.summary)!=null&&se.scorers)for(const Y of Object.keys(oe.summary.scorers))D.add(Y)}return{rows:U,scorerCols:[...D].sort()}},[E]),z=b.useMemo(()=>{var M;const S={};for(const U of E){const le=(M=U.data.metadata)==null?void 0:M.scorerTypes;le&&Object.assign(S,le)}return S},[E]),V=8+A.length+(f?1:0),N=(S,M,U)=>{const D=S.data,le=v===S.id;return a.jsxs(b.Fragment,{children:[a.jsxs("tr",{"data-entry-id":S.id,className:Z("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",U&&!M&&"bg-[hsl(var(--accent))]/30",le&&"bg-[hsl(var(--accent))]/40"),onClick:()=>w(le?null:S.id),children:[a.jsx("td",{className:Z("px-3 py-2.5 font-mono",M&&"pl-9"),children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[M&&a.jsx("span",{className:"inline-block w-1 h-3 mr-0.5 rounded-sm bg-[hsl(var(--border))]"}),S.eval]}),(()=>{const se=Fs(D);if(se.length===0||se.length===1&&se[0]===S.eval)return null;const I=nf(D),oe=I?`Workflows: ${se.map(Y=>`${Y} (${I[Y]??"?"} calls)`).join(", ")}`:`Workflows: ${se.join(", ")}`;return a.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px]",title:oe,children:se.join(" · ")})})()]})}),a.jsx("td",{className:"px-3 py-2.5",children:(()=>{const se=Aa(D);if(se.length===0)return a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"});const I=yl(D);return a.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:se.map(oe=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:I?`${oe} — ${I[oe]} calls`:oe,children:[vn(oe),I&&I[oe]!=null&&a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",I[oe],")"]})]},oe))})})()}),a.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(S.timestamp).toLocaleString()}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:D.summary.count}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:D.summary.failures>0?a.jsx("span",{className:"text-red-600 dark:text-red-400",children:D.summary.failures}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"0"})}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:D.duration>0?ot(D.duration):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:D.totalCost>0?nt(D.totalCost):"-"}),(()=>{var oe;const se=Object.values(((oe=D.summary)==null?void 0:oe.scorers)??{}).map(Y=>Y.mean),I=se.length>0?se.reduce((Y,ne)=>Y+ne,0)/se.length:null;return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:I!=null?a.jsx("span",{className:Nt(I),children:I.toFixed(3)}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})})})(),A.map(se=>{var oe,Y;const I=(Y=(oe=D.summary)==null?void 0:oe.scorers)==null?void 0:Y[se];return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:I?a.jsxs("div",{children:[a.jsx("span",{className:Nt(I.mean),children:I.mean.toFixed(3)}),I.min!==I.max&&a.jsxs("div",{className:"text-[9px] text-[hsl(var(--muted-foreground))]",children:[I.min.toFixed(2),"–",I.max.toFixed(2)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},se)}),f&&a.jsx("td",{className:"px-3 py-2.5"})]}),le&&(()=>{var oe,Y,ne;const se=(oe=D.metadata)==null?void 0:oe.scorerTypes,I=(Y=D.metadata)==null?void 0:Y.originalId;return a.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsx("td",{colSpan:V,className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-[hsl(var(--muted-foreground))] flex-wrap",children:[a.jsxs("span",{children:["ID: ",a.jsx("span",{className:"font-mono",children:D.id.slice(0,8)})]}),a.jsxs("span",{children:["Dataset:"," ",a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:D.dataset})]}),(()=>{const Q=Fs(D);return Q.length===0?null:a.jsxs("span",{children:[Q.length>1?"Workflows":"Workflow",":"," ",a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:Q.join(", ")})]})})(),(()=>{const Q=Aa(D);if(Q.length===0)return null;const G=yl(D);return a.jsx("span",{className:"inline-flex items-center gap-1",children:Q.map(T=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono",title:G?`${T} — ${G[T]} calls`:T,children:[vn(T),G&&G[T]!=null&&a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",G[T],")"]})]},T))})})(),!!((ne=D.metadata)!=null&&ne.rescored)&&a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:"Rescored"}),I&&a.jsxs("span",{children:["from"," ",a.jsx("button",{onClick:Q=>{Q.stopPropagation(),w(I),requestAnimationFrame(()=>{var G;(G=document.querySelector(`[data-entry-id="${CSS.escape(I)}"]`))==null||G.scrollIntoView({behavior:"smooth",block:"center"})})},className:"font-mono underline hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:I.slice(0,8)})]}),se&&Object.keys(se).length>0&&a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Scorers:",Object.entries(se).sort(([Q],[G])=>Q.localeCompare(G)).map(([Q,G])=>a.jsx("span",{className:Z("px-1.5 py-0.5 rounded font-mono cursor-default",G==="llm"?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400":"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"),title:G==="llm"?`${Q} — LLM scorer (scores may vary between runs)`:`${Q} — deterministic scorer`,children:Q},Q))]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f&&(()=>{const Q=!m||m.has(S.eval),G=Q&&!h,T=h?"Rescore unavailable — Studio is mounted in read-only mode.":Q?"Re-run scorers on saved outputs without re-executing the workflow":`Rescore unavailable — no registered eval named "${S.eval}". Imported CLI artifacts can only be rescored when the runtime has a matching registered eval config.`;return a.jsx("button",{onClick:H=>{H.stopPropagation(),G&&f(S.eval,S.id)},disabled:!G,className:Z("px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] transition-colors",G?"hover:bg-[hsl(var(--accent))] cursor-pointer":"opacity-40 cursor-not-allowed"),title:T,children:"Rescore"})})(),a.jsx("button",{onClick:Q=>{Q.stopPropagation(),KS(S)},className:"p-1 rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors",title:`Export this result as JSON (${S.eval}-${S.id.slice(0,8)}-...json)`,"aria-label":"Export result as JSON",children:a.jsx(Fj,{size:12})}),x&&a.jsx("button",{onClick:Q=>{Q.stopPropagation(),!h&&x(S)},disabled:h,className:Z("p-1 rounded border border-[hsl(var(--input))] transition-colors",h?"opacity-40 cursor-not-allowed":"hover:bg-red-50 hover:border-red-200 hover:text-red-600 dark:hover:bg-red-950/30 dark:hover:border-red-900 dark:hover:text-red-400 cursor-pointer"),title:h?"Delete unavailable — Studio is mounted in read-only mode.":"Delete this history entry","aria-label":"Delete history entry",children:a.jsx(Tf,{size:12})}),a.jsxs("button",{onClick:Q=>{Q.stopPropagation(),u(D)},className:"inline-flex items-center gap-1 px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:"Open full run details in the Run tab",children:["View Details",a.jsx(or,{size:10})]})]})]})})})})()]},S.id)};return a.jsxs("div",{children:[k.length>1&&a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsxs("select",{value:r,onChange:S=>i(S.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"All evals"}),k.map(S=>a.jsx("option",{value:S,children:S},S))]}),r&&a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[E.length," run",E.length!==1?"s":""]})]}),a.jsx("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Eval"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Model"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Timestamp"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Items"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Failures"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Duration"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Cost"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium border-l border-[hsl(var(--border))]",children:"Overall"}),A.map(S=>a.jsxs("th",{className:"text-right px-3 py-2.5 font-medium font-mono whitespace-nowrap",title:S,children:[S,z[S]==="llm"&&a.jsx("span",{className:"ml-1 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]},S)),f&&a.jsx("th",{className:"px-3 py-2.5 font-medium w-8"})]})}),a.jsx("tbody",{children:O.map((S,M)=>{if(S.type==="group"){const U=g.has(S.groupId),D=$S(S.entries),le=D.scorers,se=S.entries.reduce((Y,ne)=>Y+ne.data.summary.count,0),I=S.entries.reduce((Y,ne)=>Y+ne.data.duration,0),oe=S.entries.reduce((Y,ne)=>Y+ne.data.totalCost,0);return a.jsxs(b.Fragment,{children:[a.jsxs("tr",{className:Z("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",M===0&&"bg-[hsl(var(--accent))]/30"),onClick:()=>y(S.groupId),children:[a.jsx("td",{className:"px-3 py-2.5 font-mono",children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"shrink-0 p-0.5 -m-0.5",children:U?a.jsx(Ma,{size:14}):a.jsx(On,{size:14})}),S.evalName]}),(()=>{const Y=new Set,ne=[];for(const Q of S.entries)for(const G of Fs(Q.data))Y.has(G)||(Y.add(G),ne.push(G));return ne.length===0||ne.length===1&&ne[0]===S.evalName?null:a.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px] pl-[22px]",title:`Workflows: ${ne.join(", ")}`,children:ne.join(" · ")})})()]})}),a.jsx("td",{className:"px-3 py-2.5",children:(()=>{const Y=Of(S.entries);return Y.length===0?a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"}):a.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:Y.map(([ne,Q])=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:`${ne} — ${Q} calls`,children:[vn(ne),a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",Q,")"]})]},ne))})})()}),a.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(S.newestTimestamp).toLocaleString()}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:se}),a.jsx("td",{className:"px-3 py-2.5 text-right",children:a.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",children:[a.jsx(Cf,{size:10}),S.entries.length," runs"]})}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:I>0?ot(I):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:oe>0?nt(oe):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:D.overall?a.jsxs("span",{className:Nt(D.overall.mean),children:[D.overall.mean.toFixed(3),D.overall.std>0&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal",children:[" ± ",D.overall.std.toFixed(3)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})}),A.map(Y=>{const ne=le[Y];return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:ne?a.jsxs("span",{className:Nt(ne.mean),children:[ne.mean.toFixed(3),a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" "," ± ",ne.std.toFixed(3)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},Y)}),f&&a.jsx("td",{className:"px-3 py-2.5"})]}),U&&a.jsxs(a.Fragment,{children:[d&&a.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsx("td",{colSpan:V,className:"px-4 py-2.5",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[S.entries.length," runs in this group"]}),a.jsxs("button",{onClick:Y=>{Y.stopPropagation(),d(S.entries)},className:"inline-flex items-center gap-1 px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:"View combined statistics across all runs in this group",children:["View Aggregate",a.jsx(or,{size:10})]})]})})}),S.entries.map(Y=>N(Y,!0,!1))]})]},S.groupId)}return N(S.entry,!1,M===0)})})]})})})]})}const sf=1,rf=25,VS=5,Jo=l=>Math.max(sf,Math.min(rf,Math.round(l)));function ZS({evals:l,selectedEval:r,onSelectEval:i,runCount:u,onRunCountChange:d,captureTraces:f,onCaptureTracesChange:x,running:m,onRun:h}){return a.jsxs("div",{className:Z("inline-flex items-stretch rounded-full bg-[hsl(var(--background))]","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[a.jsx(gi,{items:l,value:r,onSelect:i,getKey:g=>g.name,getLabel:g=>g.name,getDescription:g=>a.jsxs(a.Fragment,{children:[a.jsx("span",{children:g.workflow}),a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsx("span",{children:g.dataset}),a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[g.scorers.length," scorer",g.scorers.length!==1?"s":""]})]}),searchMatch:(g,y)=>g.name.toLowerCase().includes(y)||g.workflow.toLowerCase().includes(y)||g.dataset.toLowerCase().includes(y),placeholder:"Select eval",searchPlaceholder:"Search evals…",emptyLabel:"No evals registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an eval"}),a.jsx(FS,{value:u,onChange:d,disabled:m}),a.jsx("button",{type:"button",role:"switch","aria-checked":f,"aria-label":"Capture per-item trace events",onClick:()=>x(!f),disabled:m,title:f?"Capturing per-item traces (click to disable) — traces appear inline on each item":"Capture per-item traces — extra memory, but lets you inspect every event per item",className:Z("flex items-center px-2 border-l border-[hsl(var(--input))] transition-colors cursor-pointer","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed",f?"text-[hsl(var(--foreground))] bg-[hsl(var(--muted))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]"),children:a.jsx(uu,{size:12,strokeWidth:2.5})}),a.jsxs("button",{type:"button",onClick:h,disabled:!r||m,className:Z("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] rounded-r-full","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-[hsl(var(--foreground))]","disabled:opacity-40 disabled:cursor-not-allowed transition-opacity"),children:[a.jsx(kf,{size:12,className:Z("fill-current",m&&"animate-spin fill-none")}),m?"Running…":"Run"]})]})}function FS({value:l,onChange:r,disabled:i=!1}){const[u,d]=b.useState(!1),[f,x]=b.useState(""),m=b.useRef(null),h=b.useRef(!1),g=b.useCallback((z,V)=>{const N=(V?VS:1)*z;r(Jo(l+N))},[l,r]),y=b.useCallback(()=>{i||(h.current=!1,x(String(l)),d(!0))},[l,i]);b.useEffect(()=>{u||x(String(l))},[l,u]),b.useEffect(()=>{u&&requestAnimationFrame(()=>{var z,V;(z=m.current)==null||z.focus(),(V=m.current)==null||V.select()})},[u]);const v=b.useCallback(()=>{if(h.current){d(!1);return}h.current=!0;const z=parseInt(f,10);Number.isNaN(z)||r(Jo(z)),d(!1)},[f,r]),w=b.useCallback(()=>{h.current=!0,d(!1)},[]),k=b.useCallback(z=>{if(z.key==="Enter")z.preventDefault(),v();else if(z.key==="Escape")z.preventDefault(),w();else if(z.key==="ArrowUp"){z.preventDefault();const V=parseInt(f,10);Number.isNaN(V)||x(String(Jo(V+1)))}else if(z.key==="ArrowDown"){z.preventDefault();const V=parseInt(f,10);Number.isNaN(V)||x(String(Jo(V-1)))}},[v,w,f]),E=b.useCallback(z=>{i||(z.key==="Enter"||z.key===" "?(z.preventDefault(),y()):z.key==="ArrowUp"?(z.preventDefault(),g(1,z.shiftKey)):z.key==="ArrowDown"&&(z.preventDefault(),g(-1,z.shiftKey)))},[i,y,g]),O=l<=sf,A=l>=rf;return a.jsxs("div",{className:"flex items-stretch border-l border-[hsl(var(--input))]",role:"group","aria-label":"Run count",children:[a.jsx("button",{type:"button",onClick:z=>g(-1,z.shiftKey),disabled:i||O,title:"Decrease runs — Shift+click: −5","aria-label":"Decrease run count",className:Z("flex items-center px-1.5 transition-colors cursor-pointer","text-[hsl(var(--muted-foreground))]","hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[hsl(var(--muted-foreground))]"),children:a.jsx(lN,{size:12,strokeWidth:2.5})}),u?a.jsx("input",{ref:m,type:"text",inputMode:"numeric",value:f,onChange:z=>x(z.target.value.replace(/[^0-9]/g,"").slice(0,2)),onKeyDown:k,onBlur:v,"aria-label":"Run count",className:Z("w-10 text-center text-xs font-semibold tabular-nums bg-transparent","focus:outline-none text-[hsl(var(--foreground))]")}):a.jsxs("button",{type:"button",role:"spinbutton","aria-valuenow":l,"aria-valuemin":sf,"aria-valuemax":rf,"aria-valuetext":`${l} run${l!==1?"s":""}`,onClick:y,onKeyDown:E,disabled:i,title:"Click or press Enter to type a value — Arrow keys step","aria-label":`Run count: ${l}. Press Enter to edit, arrow keys to step.`,className:Z("flex items-center justify-center min-w-[2.5rem] px-1 text-xs tabular-nums cursor-text","transition-colors hover:bg-[hsl(var(--muted))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-60 disabled:cursor-not-allowed",l>1?"text-[hsl(var(--foreground))] font-semibold":"text-[hsl(var(--muted-foreground))]"),children:[a.jsx("span",{className:"opacity-50 mr-0.5",children:"×"}),l]}),a.jsx("button",{type:"button",onClick:z=>g(1,z.shiftKey),disabled:i||A,title:"Increase runs — Shift+click: +5","aria-label":"Increase run count",className:Z("flex items-center px-1.5 transition-colors cursor-pointer","text-[hsl(var(--muted-foreground))]","hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[hsl(var(--muted-foreground))]"),children:a.jsx(m0,{size:12,strokeWidth:2.5})})]})}function JS(){var _i,br,La,ds,na;const l=Si(),[r,i]=b.useState("run"),[u,d]=b.useState(""),f=vS(),x=f.status==="running",[m,h]=b.useState(null),[g,y]=b.useState(null),[v,w]=b.useState(null),[k,E]=b.useState(1),[O,A]=b.useState(!0),[z,V]=b.useState(-1),[N,S]=b.useState(new Set),[M,U]=b.useState(null),[D,le]=b.useState(0),[se,I]=b.useState(null),[oe,Y]=b.useState("all"),[ne,Q]=b.useState(""),[G,T]=b.useState(""),[H,J]=b.useState("index"),[he,de]=b.useState("asc"),[C,q]=b.useState("mean"),[W,ie]=b.useState("asc"),[fe,ye]=b.useState(""),[ce,we]=b.useState(!1),[Me,ft]=b.useState(null),[Yt,rn]=b.useState(null),[on,At]=b.useState(null),[at,Rt]=b.useState(null),[Se,Ot]=b.useState(null),[ea,_n]=b.useState(null),[Gn,jl]=b.useState(null),{data:$t=[]}=gn({queryKey:["evals"],queryFn:B2}),{data:Xe=[]}=gn({queryKey:["evalHistory"],queryFn:Q2}),{data:xr,isLoading:ki,isError:Ti}=gn({queryKey:["health"],queryFn:b2,staleTime:1/0}),Nl=!!(xr!=null&&xr.readOnly),gr=(!ki||Ti)&&!Nl,Mi=b.useRef(null),[Ai,Ra]=b.useState(!1),[Et,Kt]=b.useState(null);b.useEffect(()=>{if(!Et)return;const ee=setTimeout(()=>Kt(null),6e3);return()=>clearTimeout(ee)},[Et]),b.useEffect(()=>{if(g!=="Cancelled")return;const ee=setTimeout(()=>y(null),4e3);return()=>clearTimeout(ee)},[g]);const Xt=b.useCallback(async ee=>{y(null),Kt(null),Ra(!0);try{const re=await ee.text();let ue;try{ue=JSON.parse(re)}catch{throw new Error(`${ee.name} is not valid JSON`)}const{id:pe}=await K2(ue);await l.invalidateQueries({queryKey:["evalHistory"]}),at?Se?Kt(`Imported ${ee.name} — added to history (both compare slots full)`):(Ot({id:pe}),Kt(`Imported ${ee.name} — selected as candidate`)):(Rt({id:pe}),Kt(`Imported ${ee.name} — selected as baseline`))}catch(re){y(re instanceof Error?re.message:String(re))}finally{Ra(!1)}},[l,at,Se]);b.useEffect(()=>{var xe;if(at||Se||Xe.length<2)return;const ee=Xe[0].eval,re=Xe.filter(Ue=>Ue.eval===ee);if(re.length<2)return;const ue=new Set,pe=[];for(const Ue of re){const Ee=(xe=Ue.data.metadata)==null?void 0:xe.runGroupId,Oe=Ee??Ue.id;if(!ue.has(Oe)){if(ue.add(Oe),Ee){const Ve=re.filter(et=>{var st;return((st=et.data.metadata)==null?void 0:st.runGroupId)===Ee}).map(et=>et.id);Ve.length>1?pe.push({id:Ve[0],groupIds:Ve}):pe.push({id:Ve[0]})}else pe.push({id:Ue.id});if(pe.length>=2)break}}pe.length>=2&&(Ot(pe[0]),Rt(pe[1]))},[Xe,at,Se]);const Sl=$t.find(ee=>ee.name===u),fu=b.useMemo(()=>new Set($t.map(ee=>ee.name)),[$t]),lt=m==null?void 0:m._multiRun,Oa=lt!=null&&z===-1,_e=lt&&z>=0?lt.allRuns[z]:m;b.useEffect(()=>{w(null)},[z]);const _a=b.useRef(f.status);b.useEffect(()=>{if(_a.current!==f.status)if(_a.current=f.status,f.status==="done"&&f.done){const{evalResultId:ee,runGroupId:re}=f.done;(async()=>{try{await l.refetchQueries({queryKey:["evalHistory"]});const ue=l.getQueryData(["evalHistory"])??[],pe=ue.find(xe=>xe.id===ee);if(!pe){y(`Eval completed but result ${ee} was not found in history.`);return}if(re){const Ue=ue.filter(Oe=>{var Ve;return((Ve=Oe.data.metadata)==null?void 0:Ve.runGroupId)===re}).map(Oe=>Oe.data),Ee=ig(Ue);h(Ee??pe.data)}else h(pe.data);w(null),V(-1)}catch(ue){y(ue instanceof Error?ue.message:String(ue))}finally{lg()}})()}else f.status==="error"&&f.error&&(_a.current!=="done"&&y(f.error),l.invalidateQueries({queryKey:["evalHistory"]}),lg())},[f.status,f.done,f.error,l]);const ta=b.useCallback(async()=>{if(u){y(null),h(null),w(null),V(-1);try{await yS(u,k,O)}catch(ee){y(ee instanceof Error?ee.message:String(ee))}}},[u,k,O]),rs=b.useCallback(async()=>{if(!(!at||!Se)){we(!0),ft(null);try{const ee=Ee=>Ee.groupIds&&Ee.groupIds.length>1?Ee.groupIds:Ee.id,re=ee(at),ue=ee(Se),pe=Ee=>{var El;const Oe=Xe.find(Ct=>Ct.id===Ee.id);if(!Oe)return null;const Ve=Oe.data;if(!Ee.groupIds||Ee.groupIds.length<=1)return Ve;const et=Ee.groupIds.map(Ct=>{var kt;return(kt=Xe.find(Cl=>Cl.id===Ct))==null?void 0:kt.data}).filter(Ct=>Ct!=null),st=Math.min(...et.map(Ct=>Ct.items.length)),fs=Object.keys(((El=Ve.summary)==null?void 0:El.scorers)??{}),aa=Array.from({length:st},(Ct,kt)=>{const Cl={},zi={};for(const kl of fs){const hs=et.map(Ml=>{var _t;return(_t=Ml.items[kt])==null?void 0:_t.scores[kl]}).filter(Ml=>Ml!=null),Tl=hs.length>0?Math.round(hs.reduce((Ml,_t)=>Ml+_t,0)/hs.length*1e3)/1e3:null;Cl[kl]=Tl,zi[kl]={score:Tl}}return{...Ve.items[kt],scores:Cl,scoreDetails:zi}});return{...Ve,items:aa}};rn(pe(at)),At(pe(Se));const xe=Ee=>!Ee.groupIds||Ee.groupIds.length<=1?null:Ee.groupIds.map(Oe=>{var Ve;return(Ve=Xe.find(et=>et.id===Oe))==null?void 0:Ve.data}).filter(Oe=>Oe!=null);_n(xe(at)),jl(xe(Se));const Ue=await $2(re,ue);ft(Ue)}catch(ee){y(ee instanceof Error?ee.message:String(ee))}finally{we(!1)}}},[Xe,at,Se]),wl=b.useCallback(async(ee,re)=>{y(null);try{const ue=await Y2(ee,re);h(ue),w(null),V(-1),i("run"),l.invalidateQueries({queryKey:["evalHistory"]})}catch(ue){y(ue instanceof Error?ue.message:String(ue))}},[l]),hu=b.useCallback(async ee=>{var pe;y(null);const re=ee.id.slice(0,8);if(window.confirm(`Delete this eval history entry?
307
+
308
+ ${ee.eval} (${re})
309
+
310
+ This cannot be undone.`))try{await X2(ee.id);const xe=Ue=>{var Ee;return Ue?Ue.id===ee.id?!0:!!((Ee=Ue.groupIds)!=null&&Ee.includes(ee.id)):!1};if(xe(at)&&Rt(null),xe(Se)&&Ot(null),m){const Ue=m.id===ee.id,Ee=!!((pe=m._multiRun)!=null&&pe.allRuns.some(Oe=>Oe.id===ee.id));(Ue||Ee)&&(h(null),w(null),V(-1),U(null))}l.invalidateQueries({queryKey:["evalHistory"]})}catch(xe){y(xe instanceof Error?xe.message:String(xe))}},[l,at,Se,m]),Ri=b.useCallback(ee=>{S(re=>{const ue=new Set(re);return ue.has(ee)?ue.delete(ee):ue.add(ee),ue})},[]),za=(_i=m==null?void 0:m.metadata)==null?void 0:_i.scorerTypes,Yn=(br=_e==null?void 0:_e.summary)!=null&&br.scorers?Object.keys(_e.summary.scorers):[],Da=(La=_e==null?void 0:_e.summary)!=null&&La.scorers?Object.entries(_e.summary.scorers):[],is=Da.length>0?Da.reduce((ee,[,re])=>ee+re.mean,0)/Da.length:0,$n=lt?Object.entries(lt.aggregate.scorers):[],os=$n.length>0?$n.reduce((ee,[,re])=>ee+re.mean,0)/$n.length:0,vr=b.useMemo(()=>{if(!lt)return 0;const ee=lt.allRuns,re=Object.keys(lt.aggregate.scorers);if(re.length===0||ee.length<=1)return 0;const ue=ee.map(xe=>{const Ue=re.map(Ee=>{var Oe,Ve,et;return(et=(Ve=(Oe=xe.summary)==null?void 0:Oe.scorers)==null?void 0:Ve[Ee])==null?void 0:et.mean}).filter(Ee=>Ee!=null);return Ue.length>0?Ue.reduce((Ee,Oe)=>Ee+Oe,0)/Ue.length:0}),pe=ue.reduce((xe,Ue)=>xe+Ue,0)/ue.length;return Math.sqrt(ue.reduce((xe,Ue)=>xe+(Ue-pe)**2,0)/(ue.length-1))},[lt]),us=lt?lt.allRuns.reduce((ee,re)=>ee+re.duration,0):0,yr=lt?lt.allRuns.reduce((ee,re)=>ee+re.totalCost,0):0,Oi=b.useMemo(()=>{if(!lt)return[];const ee=Object.entries(lt.aggregate.scorers);return ee.sort((re,ue)=>{let pe,xe;switch(C){case"scorer":return W==="asc"?re[0].localeCompare(ue[0]):ue[0].localeCompare(re[0]);case"mean":pe=re[1].mean,xe=ue[1].mean;break;case"std":pe=re[1].std,xe=ue[1].std;break;case"min":pe=re[1].min,xe=ue[1].min;break;case"max":default:pe=re[1].max,xe=ue[1].max;break}return W==="desc"?xe-pe:pe-xe}),ee},[lt,C,W]),It=ee=>{C===ee?ie(re=>re==="desc"?"asc":"desc"):(q(ee),ie("asc"))},dt=ee=>C===ee?W==="desc"?" ▼":" ▲":"",Bt=(ee,re)=>{if(re===0)return"text-[hsl(var(--muted-foreground))]";const ue=ee/re;return ue<.02?"text-[hsl(var(--muted-foreground))]":ue<=.05?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"},Ua=5,cs=b.useMemo(()=>{var pe;if(!Oa||!m)return[];const ee=m.items,re=Object.keys(((pe=m.summary)==null?void 0:pe.scorers)??{});if(re.length===0||ee.length===0)return[];const ue=ee.map((xe,Ue)=>{const Ee=re.map(Ve=>xe.scores[Ve]).filter(Ve=>Ve!=null),Oe=Ee.length>0?Ee.reduce((Ve,et)=>Ve+et,0)/Ee.length:1;return{item:xe,index:Ue,avgScore:Oe,scores:xe.scores}});return ue.sort((xe,Ue)=>xe.avgScore-Ue.avgScore),ue.slice(0,Ua)},[Oa,m]),mu=["run","history","compare","trends"];return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(ss,{title:"Eval Runner",description:Sl?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:Sl.workflow}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:Sl.dataset}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[Sl.scorers.length," scorer",Sl.scorers.length!==1?"s":""]})]}):$t.length>0?`${$t.length} registered eval${$t.length!==1?"s":""} · select one to run`:"No evals registered",actions:a.jsxs(a.Fragment,{children:[gr&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:Mi,type:"file",accept:"application/json,.json",className:"hidden",onChange:ee=>{var ue;const re=(ue=ee.target.files)==null?void 0:ue[0];re&&Xt(re),ee.target.value=""}}),a.jsxs("button",{type:"button",onClick:()=>{var ee;return(ee=Mi.current)==null?void 0:ee.click()},disabled:Ai,className:Z("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","ring-1 ring-[hsl(var(--input))] bg-[hsl(var(--background))] shadow-sm","hover:bg-[hsl(var(--muted))] hover:ring-[hsl(var(--ring))]","focus:outline-none focus-visible:ring-[hsl(var(--ring))] transition-all","disabled:opacity-40 disabled:cursor-not-allowed"),title:"Import an eval result JSON file (e.g. from `axl-eval --output`). Imported entries persist as long as the runtime's state store does.",children:[a.jsx(_N,{size:12}),Ai?"Importing…":"Import result"]})]}),$t.length>0&&gr&&a.jsx(ZS,{evals:$t,selectedEval:u,onSelectEval:d,runCount:k,onRunCountChange:E,captureTraces:O,onCaptureTracesChange:A,running:x,onRun:ta})]})}),a.jsx("div",{role:"tablist","aria-label":"Eval views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:mu.map(ee=>a.jsx("button",{type:"button",role:"tab","aria-selected":r===ee,onClick:()=>i(ee),className:Z("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",r===ee?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:ee.charAt(0).toUpperCase()+ee.slice(1)},ee))}),g&&a.jsx("div",{className:"shrink-0 px-6 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950/30",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("div",{className:"text-sm text-red-700 dark:text-red-300 whitespace-pre-wrap break-words",children:g}),a.jsx("button",{onClick:()=>y(null),className:"shrink-0 text-xs text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200 cursor-pointer","aria-label":"Dismiss error",children:"Dismiss"})]})}),Et&&a.jsx("div",{className:"shrink-0 px-6 py-2 border-b border-emerald-200 dark:border-emerald-900 bg-emerald-50 dark:bg-emerald-950/30",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("div",{className:"text-xs text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap break-words",children:Et}),a.jsx("button",{onClick:()=>Kt(null),className:"shrink-0 text-xs text-emerald-600 dark:text-emerald-400 hover:text-emerald-900 dark:hover:text-emerald-200 cursor-pointer","aria-label":"Dismiss import status",children:"Dismiss"})]})}),r==="run"&&a.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:$t.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:a.jsx(Jt,{icon:a.jsx(ur,{size:32}),title:"No evals registered",description:"Define evals with defineEval() and load them via the evals middleware option or runtime.registerEval()."})}):m?a.jsxs(a.Fragment,{children:[(se==="history"||se==="trends")&&a.jsx("div",{className:"shrink-0 px-6 pt-4",children:a.jsxs("button",{onClick:()=>{i(se),I(null)},className:"inline-flex items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:[a.jsx(Mj,{size:14}),"Back to ",se==="history"?"History":"Trends"]})}),lt&&a.jsx("div",{className:"shrink-0 pt-4",children:a.jsx(YS,{currentIndex:z,totalRuns:lt.allRuns.length,aggregate:lt.aggregate,onIndexChange:V})}),Oa?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"shrink-0 px-6 py-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-x-4 gap-y-1.5",children:[(()=>{const ee=m?Fs(m):[];if(ee.length===0)return null;const re=m?nf(m):null;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Workflows":"Workflow"}),ee.map(ue=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:re?`${ue} — ${re[ue]} calls`:ue,children:[ue,re&&re[ue]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",re[ue],")"]})]},ue))]})})(),(()=>{const ee=m?Aa(m):[];if(ee.length===0)return null;const re=m?yl(m):null;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Models":"Model"}),ee.map(ue=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:re?`${ue} — ${re[ue]} calls`:ue,children:[vn(ue),re&&re[ue]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",re[ue],")"]})]},ue))]})})()]}),a.jsx("button",{onClick:()=>{var re;const ee=(re=m==null?void 0:m.metadata)==null?void 0:re.runGroupId;if(ee){const ue=Xe.filter(pe=>{var xe;return((xe=pe.data.metadata)==null?void 0:xe.runGroupId)===ee}).map(pe=>pe.id);ue.length>0&&Ot({id:ue[0],groupIds:ue})}else if(m){const ue=Xe.find(pe=>pe.id===m.id);ue&&Ot({id:ue.id})}i("compare")},className:"px-3 py-1.5 text-xs font-medium rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:"Compare with previous..."})]}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[a.jsx($e,{label:"Runs",value:String(lt.aggregate.runCount),subtitle:"individual runs"}),a.jsx($e,{label:"Mean Score",value:$n.length>0?os.toFixed(3):"—",accent:$n.length>0?Nt(os):void 0,tint:$n.length>0?og(os):void 0,subtitle:$n.length>0?`± ${vr.toFixed(3)} across runs`:"across all scorers"}),a.jsx($e,{label:"Total Duration",value:us>0?ot(us):"—",subtitle:"all runs combined"}),a.jsx($e,{label:"Total Cost",value:yr>0?nt(yr):"—",subtitle:"all runs combined"}),(()=>{const ee=lt.allRuns,re={input:0,output:0,reasoning:0};for(const pe of ee){const xe=af(pe);re.input+=xe.input,re.output+=xe.output,re.reasoning+=xe.reasoning}const ue=re.input+re.output+re.reasoning;return ue>0?a.jsx($e,{label:"Total Tokens",value:An(ue),subtitle:`${An(re.input)} in / ${An(re.output)} out`}):null})()]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 pb-6 space-y-6",children:[a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Per-Scorer Aggregate"})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsxs("th",{className:"text-left px-4 py-2 font-medium w-48 cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>It("scorer"),children:["Scorer",dt("scorer")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>It("mean"),children:["Mean",dt("mean")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>It("std"),children:["Std",dt("std")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>It("min"),children:["Min",dt("min")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>It("max"),children:["Max",dt("max")]})]})}),a.jsx("tbody",{children:Oi.map(([ee,re])=>a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[ee,(za==null?void 0:za[ee])==="llm"&&a.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono font-medium",Nt(re.mean)),children:re.mean.toFixed(3)}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",Bt(re.std,re.mean)),children:re.std.toFixed(3)}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",Nt(re.min)),children:re.min.toFixed(3)}),a.jsx("td",{className:Z("px-3 py-2.5 text-right font-mono",Nt(re.max)),children:re.max.toFixed(3)})]},ee))})]})})]}),cs.length>0&&a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Lowest Scoring Items"})}),a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:cs.map(({item:ee,index:re,avgScore:ue,scores:pe})=>{var Ve;const xe=M===re,Ue=lt==null?void 0:lt.allRuns,Ee=(Ue==null?void 0:Ue.length)??0,Oe=xe&&Ue?(Ve=Ue[D])==null?void 0:Ve.items[re]:null;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>{U(xe?null:re),le(0)},className:Z("w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",xe&&"bg-[hsl(var(--accent))]"),children:[a.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-[hsl(var(--muted-foreground))] w-6 text-right",children:["#",re+1]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",children:cr(ee.input,60)}),a.jsx("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:Object.entries(pe).map(([et,st])=>st!=null?a.jsxs("span",{className:Z("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",su(st)),title:et,children:[et,": ",st.toFixed(2)]},et):null)})]}),a.jsx("span",{className:Z("shrink-0 text-xs font-mono font-medium",Nt(ue)),children:ue.toFixed(3)})]}),xe&&a.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[Ee>1&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),a.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:Ee},(et,st)=>a.jsx("button",{onClick:()=>le(st),className:Z("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",st===D?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:st+1},st))})]}),a.jsxs("div",{className:"p-4 space-y-3",children:[Oe&&a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Object.entries(Oe.scores).map(([et,st])=>st!=null?a.jsxs("span",{className:Z("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",su(st)),children:[et,": ",st.toFixed(3)]},et):null)}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Output"}),a.jsx(qt,{data:(Oe==null?void 0:Oe.output)??ee.output,collapsed:!0})]}),(Oe==null?void 0:Oe.scoreDetails)&&Object.entries(Oe.scoreDetails).map(([et,st])=>{var aa;const fs=typeof((aa=st==null?void 0:st.metadata)==null?void 0:aa.reasoning)=="string"?st.metadata.reasoning:null;return fs?a.jsxs("div",{children:[a.jsxs("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:[et," reasoning"]}),a.jsx("pre",{className:"text-xs font-mono p-2 rounded-md bg-[hsl(var(--secondary))] overflow-auto max-h-32 whitespace-pre-wrap leading-relaxed",children:fs})]},et):null})]})]})]},re)})})]})]})]}):_e?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"shrink-0 px-6 py-4",children:[(()=>{const ee=Fs(_e),re=nf(_e),ue=Aa(_e),pe=yl(_e);return ee.length===0&&ue.length===0?null:a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 mb-3",children:[ee.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Workflows":"Workflow"}),ee.map(xe=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:re?`${xe} — ${re[xe]} calls`:xe,children:[xe,re&&re[xe]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",re[xe],")"]})]},xe))]}),ue.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ue.length>1?"Models":"Model"}),ue.map(xe=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:pe?`${xe} — ${pe[xe]} calls`:xe,children:[vn(xe),pe&&pe[xe]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",pe[xe],")"]})]},xe))]})]})})(),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[a.jsx($e,{label:"Items",value:String(_e.summary.count),subtitle:_e.summary.failures>0?`${_e.summary.failures} failed`:"all passed",subtitleColor:_e.summary.failures>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"}),a.jsx($e,{label:"Mean Score",value:Da.length>0?is.toFixed(3):"—",accent:Da.length>0?Nt(is):void 0,tint:Da.length>0?og(is):void 0,subtitle:"across all scorers"}),a.jsx($e,{label:"Duration",value:_e.summary.timing?ot(_e.summary.timing.mean):ot(_e.duration),subtitle:_e.summary.timing?`p95 ${ot(_e.summary.timing.p95)}`:"total"}),a.jsx($e,{label:"Cost",value:_e.totalCost>0?nt(_e.totalCost):"—",subtitle:"total"}),(()=>{const ee=af(_e),re=ee.input+ee.output+ee.reasoning;return re>0?a.jsx($e,{label:"Tokens",value:An(re),subtitle:`${An(ee.input)} in / ${An(ee.output)} out`}):null})()]})]}),a.jsx(pr,{className:"flex-1 border-t border-[hsl(var(--border))]",defaultPercent:30,minPercent:15,maxPercent:50,left:a.jsx("div",{className:"flex-1 overflow-y-auto bg-[hsl(var(--card))]",children:a.jsx(_S,{items:_e.items,scorerNames:Yn,selectedIndex:v,onSelectItem:w,onDeselectItem:()=>w(null)})}),right:a.jsx("div",{className:"flex-1 overflow-y-auto",children:v!=null?a.jsx("div",{className:"p-6",children:a.jsx(RS,{item:_e.items[v],itemIndex:v,scorerNames:Yn,onBack:()=>w(null)})}):a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsx(kS,{summary:_e.summary,items:_e.items,totalCost:_e.totalCost,scorerTypes:za}),a.jsx(DS,{items:_e.items,scorerNames:Yn}),_e.items.length>0&&a.jsx(TS,{items:_e.items,scorerNames:Yn,onSelectItem:w,errorFilter:oe,onErrorFilterChange:Y,scorerFilter:ne,onScorerFilterChange:Q,threshold:G,onThresholdChange:T,sortField:H,onSortFieldChange:J,sortDir:he,onSortDirChange:de})]})})})]}):null]}):x?a.jsx(IS,{exec:f,onCancel:bS}):a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsx(Jt,{icon:a.jsx(ur,{size:32}),title:"No results",description:"Select an eval and run it to see results."})})}),r==="history"&&a.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:Xe.length===0?a.jsx(Jt,{title:"No eval history",description:"Run evaluations to build history."}):a.jsx(XS,{history:Xe,evalFilter:fe,onEvalFilterChange:ye,onSelect:ee=>{h(ee),w(null),V(-1),I("history"),i("run")},onSelectGroup:ee=>{const re=ee.map(pe=>pe.data),ue=ig(re);ue&&(h(ue),w(null),V(-1),I("history"),i("run"))},onRescore:wl,onDelete:hu,registeredEvalNames:fu,readOnly:Nl,expandedGroups:N,onToggleGroup:Ri})}),r==="trends"&&a.jsx(wS,{onViewRun:ee=>{const re=Xe.find(ue=>ue.id===ee);re&&(h(re.data),w(null),V(-1),I("trends"),i("run"))}}),r==="compare"&&a.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:a.jsx("div",{className:"space-y-4",children:Xe.length<2?a.jsx(Jt,{title:"Need at least 2 eval runs",description:"Run evaluations to compare results."}):a.jsxs(a.Fragment,{children:[a.jsx(GS,{history:Xe,baselineSelection:at,candidateSelection:Se,onBaselineChange:Rt,onCandidateChange:Ot,onCompare:rs,comparing:ce}),Me&&a.jsx(HS,{compareResult:Me,baseline:Yt,candidate:on,isGroupComparison:(((ds=at==null?void 0:at.groupIds)==null?void 0:ds.length)??0)>1||(((na=Se==null?void 0:Se.groupIds)==null?void 0:na.length)??0)>1,baselineRuns:ea,candidateRuns:Gn})]})})})]})}function IS({exec:l,onCancel:r}){const[i,u]=b.useState(0);b.useEffect(()=>{if(!l.startedAt)return;u(Math.floor((Date.now()-l.startedAt)/1e3));const E=setInterval(()=>{u(Math.floor((Date.now()-l.startedAt)/1e3))},1e3);return()=>clearInterval(E)},[l.startedAt]);const d=Math.floor(i/60),f=i%60,x=d>0?`${d}m ${f}s`:`${f}s`,m=l.progress,h=(l.runCount??1)>1,g=(m==null?void 0:m.totalItems)??0,y=(m==null?void 0:m.completedItems)??0,v=(m==null?void 0:m.completedRuns)??0,w=(m==null?void 0:m.totalRuns)??l.runCount??1,k=g>0?Math.round(y/g*100):0;return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-5",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ur,{size:28,className:"text-[hsl(var(--muted-foreground))]"}),a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500 animate-ping"}),a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500"})]}),a.jsxs("div",{className:"text-center space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:h?`Run ${v+1} of ${w}`:"Running evaluation…"}),l.evalName&&a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[l.evalName,h?` · ${w} runs`:""]})]}),g>0&&a.jsxs("div",{className:"w-56 space-y-1.5",children:[a.jsx("div",{className:"h-1.5 rounded-full bg-[hsl(var(--muted))] overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-300 ease-out",style:{width:`${k}%`}})}),a.jsxs("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] text-center tabular-nums",children:[y," / ",g," items"]})]}),a.jsx("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] tabular-nums",children:x}),a.jsxs("button",{onClick:r,className:`inline-flex items-center gap-1.5 px-3 py-1 text-xs rounded-md
311
+ border border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))]
312
+ hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]
313
+ transition-colors cursor-pointer`,children:[a.jsx(v0,{size:12}),"Cancel"]})]})}function WS(){return a.jsx(hj,{basename:window.__AXL_STUDIO_BASE__||"/",children:a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsx($N,{}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsxs(Y1,{children:[a.jsx(Fn,{path:"/playground",element:a.jsx(J2,{})}),a.jsx(Fn,{path:"/workflows",element:a.jsx(tS,{})}),a.jsx(Fn,{path:"/traces",element:a.jsx(iS,{})}),a.jsx(Fn,{path:"/costs",element:a.jsx(uS,{})}),a.jsx(Fn,{path:"/memory",element:a.jsx(cS,{})}),a.jsx(Fn,{path:"/sessions",element:a.jsx(hS,{})}),a.jsx(Fn,{path:"/tools",element:a.jsx(mS,{})}),a.jsx(Fn,{path:"/evals",element:a.jsx(JS,{})}),a.jsx(Fn,{path:"*",element:a.jsx(Q1,{to:"/playground",replace:!0})})]})})]})})}vf(gf(xf()));$b();ab.createRoot(document.getElementById("root")).render(a.jsx(b.StrictMode,{children:a.jsx(Tb,{client:Bb,children:a.jsx(WS,{})})}));