vskill 0.4.9 → 0.4.10

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,74 @@
1
+ (function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))u(m);new MutationObserver(m=>{for(const h of m)if(h.type==="childList")for(const p of h.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function d(m){const h={};return m.integrity&&(h.integrity=m.integrity),m.referrerPolicy&&(h.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?h.credentials="include":m.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(m){if(m.ep)return;m.ep=!0;const h=d(m);fetch(m.href,h)}})();var Bc={exports:{}},as={};/**
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 lx;function ah(){if(lx)return as;lx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function d(u,m,h){var p=null;if(h!==void 0&&(p=""+h),m.key!==void 0&&(p=""+m.key),"key"in m){h={};for(var g in m)g!=="key"&&(h[g]=m[g])}else h=m;return m=h.ref,{$$typeof:i,type:u,key:p,ref:m!==void 0?m:null,props:h}}return as.Fragment=c,as.jsx=d,as.jsxs=d,as}var ax;function nh(){return ax||(ax=1,Bc.exports=ah()),Bc.exports}var n=nh(),Uc={exports:{}},fe={};/**
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 sh(){if(nx)return fe;nx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),C=Symbol.iterator;function R(S){return S===null||typeof S!="object"?null:(S=C&&S[C]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,Z={};function W(S,D,X){this.props=S,this.context=D,this.refs=Z,this.updater=X||B}W.prototype.isReactComponent={},W.prototype.setState=function(S,D){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,D,"setState")},W.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function ee(){}ee.prototype=W.prototype;function se(S,D,X){this.props=S,this.context=D,this.refs=Z,this.updater=X||B}var G=se.prototype=new ee;G.constructor=se,V(G,W.prototype),G.isPureReactComponent=!0;var I=Array.isArray;function le(){}var F={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ve(S,D,X){var M=X.ref;return{$$typeof:i,type:S,key:D,ref:M!==void 0?M:null,props:X}}function re(S,D){return ve(S.type,D,S.props)}function ge(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function ye(S){var D={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(X){return D[X]})}var Q=/\/+/g;function ue(S,D){return typeof S=="object"&&S!==null&&S.key!=null?ye(""+S.key):D.toString(36)}function Ee(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(le,le):(S.status="pending",S.then(function(D){S.status==="pending"&&(S.status="fulfilled",S.value=D)},function(D){S.status==="pending"&&(S.status="rejected",S.reason=D)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function N(S,D,X,M,q){var Y=typeof S;(Y==="undefined"||Y==="boolean")&&(S=null);var K=!1;if(S===null)K=!0;else switch(Y){case"bigint":case"string":case"number":K=!0;break;case"object":switch(S.$$typeof){case i:case c:K=!0;break;case E:return K=S._init,N(K(S._payload),D,X,M,q)}}if(K)return q=q(S),K=M===""?"."+ue(S,0):M,I(q)?(X="",K!=null&&(X=K.replace(Q,"$&/")+"/"),N(q,D,X,"",function(Ze){return Ze})):q!=null&&(ge(q)&&(q=re(q,X+(q.key==null||S&&S.key===q.key?"":(""+q.key).replace(Q,"$&/")+"/")+K)),D.push(q)),1;K=0;var de=M===""?".":M+":";if(I(S))for(var me=0;me<S.length;me++)M=S[me],Y=de+ue(M,me),K+=N(M,D,X,Y,q);else if(me=R(S),typeof me=="function")for(S=me.call(S),me=0;!(M=S.next()).done;)M=M.value,Y=de+ue(M,me++),K+=N(M,D,X,Y,q);else if(Y==="object"){if(typeof S.then=="function")return N(Ee(S),D,X,M,q);throw D=String(S),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return K}function A(S,D,X){if(S==null)return S;var M=[],q=0;return N(S,M,"","",function(Y){return D.call(X,Y,q++)}),M}function J(S){if(S._status===-1){var D=S._result;D=D(),D.then(function(X){(S._status===0||S._status===-1)&&(S._status=1,S._result=X)},function(X){(S._status===0||S._status===-1)&&(S._status=2,S._result=X)}),S._status===-1&&(S._status=0,S._result=D)}if(S._status===1)return S._result.default;throw S._result}var ce=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},he={map:A,forEach:function(S,D,X){A(S,function(){D.apply(this,arguments)},X)},count:function(S){var D=0;return A(S,function(){D++}),D},toArray:function(S){return A(S,function(D){return D})||[]},only:function(S){if(!ge(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return fe.Activity=b,fe.Children=he,fe.Component=W,fe.Fragment=d,fe.Profiler=m,fe.PureComponent=se,fe.StrictMode=u,fe.Suspense=y,fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,fe.__COMPILER_RUNTIME={__proto__:null,c:function(S){return F.H.useMemoCache(S)}},fe.cache=function(S){return function(){return S.apply(null,arguments)}},fe.cacheSignal=function(){return null},fe.cloneElement=function(S,D,X){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var M=V({},S.props),q=S.key;if(D!=null)for(Y in D.key!==void 0&&(q=""+D.key),D)!ae.call(D,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&D.ref===void 0||(M[Y]=D[Y]);var Y=arguments.length-2;if(Y===1)M.children=X;else if(1<Y){for(var K=Array(Y),de=0;de<Y;de++)K[de]=arguments[de+2];M.children=K}return ve(S.type,q,M)},fe.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:h,_context:S},S},fe.createElement=function(S,D,X){var M,q={},Y=null;if(D!=null)for(M in D.key!==void 0&&(Y=""+D.key),D)ae.call(D,M)&&M!=="key"&&M!=="__self"&&M!=="__source"&&(q[M]=D[M]);var K=arguments.length-2;if(K===1)q.children=X;else if(1<K){for(var de=Array(K),me=0;me<K;me++)de[me]=arguments[me+2];q.children=de}if(S&&S.defaultProps)for(M in K=S.defaultProps,K)q[M]===void 0&&(q[M]=K[M]);return ve(S,Y,q)},fe.createRef=function(){return{current:null}},fe.forwardRef=function(S){return{$$typeof:g,render:S}},fe.isValidElement=ge,fe.lazy=function(S){return{$$typeof:E,_payload:{_status:-1,_result:S},_init:J}},fe.memo=function(S,D){return{$$typeof:f,type:S,compare:D===void 0?null:D}},fe.startTransition=function(S){var D=F.T,X={};F.T=X;try{var M=S(),q=F.S;q!==null&&q(X,M),typeof M=="object"&&M!==null&&typeof M.then=="function"&&M.then(le,ce)}catch(Y){ce(Y)}finally{D!==null&&X.types!==null&&(D.types=X.types),F.T=D}},fe.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},fe.use=function(S){return F.H.use(S)},fe.useActionState=function(S,D,X){return F.H.useActionState(S,D,X)},fe.useCallback=function(S,D){return F.H.useCallback(S,D)},fe.useContext=function(S){return F.H.useContext(S)},fe.useDebugValue=function(){},fe.useDeferredValue=function(S,D){return F.H.useDeferredValue(S,D)},fe.useEffect=function(S,D){return F.H.useEffect(S,D)},fe.useEffectEvent=function(S){return F.H.useEffectEvent(S)},fe.useId=function(){return F.H.useId()},fe.useImperativeHandle=function(S,D,X){return F.H.useImperativeHandle(S,D,X)},fe.useInsertionEffect=function(S,D){return F.H.useInsertionEffect(S,D)},fe.useLayoutEffect=function(S,D){return F.H.useLayoutEffect(S,D)},fe.useMemo=function(S,D){return F.H.useMemo(S,D)},fe.useOptimistic=function(S,D){return F.H.useOptimistic(S,D)},fe.useReducer=function(S,D,X){return F.H.useReducer(S,D,X)},fe.useRef=function(S){return F.H.useRef(S)},fe.useState=function(S){return F.H.useState(S)},fe.useSyncExternalStore=function(S,D,X){return F.H.useSyncExternalStore(S,D,X)},fe.useTransition=function(){return F.H.useTransition()},fe.version="19.2.4",fe}var sx;function no(){return sx||(sx=1,Uc.exports=sh()),Uc.exports}var v=no(),Hc={exports:{}},ns={},qc={exports:{}},Yc={};/**
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 rx;function rh(){return rx||(rx=1,(function(i){function c(N,A){var J=N.length;N.push(A);e:for(;0<J;){var ce=J-1>>>1,he=N[ce];if(0<m(he,A))N[ce]=A,N[J]=he,J=ce;else break e}}function d(N){return N.length===0?null:N[0]}function u(N){if(N.length===0)return null;var A=N[0],J=N.pop();if(J!==A){N[0]=J;e:for(var ce=0,he=N.length,S=he>>>1;ce<S;){var D=2*(ce+1)-1,X=N[D],M=D+1,q=N[M];if(0>m(X,J))M<he&&0>m(q,X)?(N[ce]=q,N[M]=J,ce=M):(N[ce]=X,N[D]=J,ce=D);else if(M<he&&0>m(q,J))N[ce]=q,N[M]=J,ce=M;else break e}}return A}function m(N,A){var J=N.sortIndex-A.sortIndex;return J!==0?J:N.id-A.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var p=Date,g=p.now();i.unstable_now=function(){return p.now()-g}}var y=[],f=[],E=1,b=null,C=3,R=!1,B=!1,V=!1,Z=!1,W=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,se=typeof setImmediate<"u"?setImmediate:null;function G(N){for(var A=d(f);A!==null;){if(A.callback===null)u(f);else if(A.startTime<=N)u(f),A.sortIndex=A.expirationTime,c(y,A);else break;A=d(f)}}function I(N){if(V=!1,G(N),!B)if(d(y)!==null)B=!0,le||(le=!0,ye());else{var A=d(f);A!==null&&Ee(I,A.startTime-N)}}var le=!1,F=-1,ae=5,ve=-1;function re(){return Z?!0:!(i.unstable_now()-ve<ae)}function ge(){if(Z=!1,le){var N=i.unstable_now();ve=N;var A=!0;try{e:{B=!1,V&&(V=!1,ee(F),F=-1),R=!0;var J=C;try{t:{for(G(N),b=d(y);b!==null&&!(b.expirationTime>N&&re());){var ce=b.callback;if(typeof ce=="function"){b.callback=null,C=b.priorityLevel;var he=ce(b.expirationTime<=N);if(N=i.unstable_now(),typeof he=="function"){b.callback=he,G(N),A=!0;break t}b===d(y)&&u(y),G(N)}else u(y);b=d(y)}if(b!==null)A=!0;else{var S=d(f);S!==null&&Ee(I,S.startTime-N),A=!1}}break e}finally{b=null,C=J,R=!1}A=void 0}}finally{A?ye():le=!1}}}var ye;if(typeof se=="function")ye=function(){se(ge)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ue=Q.port2;Q.port1.onmessage=ge,ye=function(){ue.postMessage(null)}}else ye=function(){W(ge,0)};function Ee(N,A){F=W(function(){N(i.unstable_now())},A)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(N){N.callback=null},i.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<N?Math.floor(1e3/N):5},i.unstable_getCurrentPriorityLevel=function(){return C},i.unstable_next=function(N){switch(C){case 1:case 2:case 3:var A=3;break;default:A=C}var J=C;C=A;try{return N()}finally{C=J}},i.unstable_requestPaint=function(){Z=!0},i.unstable_runWithPriority=function(N,A){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var J=C;C=N;try{return A()}finally{C=J}},i.unstable_scheduleCallback=function(N,A,J){var ce=i.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ce+J:ce):J=ce,N){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=J+he,N={id:E++,callback:A,priorityLevel:N,startTime:J,expirationTime:he,sortIndex:-1},J>ce?(N.sortIndex=J,c(f,N),d(y)===null&&N===d(f)&&(V?(ee(F),F=-1):V=!0,Ee(I,J-ce))):(N.sortIndex=he,c(y,N),B||R||(B=!0,le||(le=!0,ye()))),N},i.unstable_shouldYield=re,i.unstable_wrapCallback=function(N){var A=C;return function(){var J=C;C=A;try{return N.apply(this,arguments)}finally{C=J}}}})(Yc)),Yc}var ix;function ih(){return ix||(ix=1,qc.exports=rh()),qc.exports}var Gc={exports:{}},dt={};/**
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 ch(){if(cx)return dt;cx=1;var i=no();function c(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)f+="&args[]="+encodeURIComponent(arguments[E])}return"Minified React error #"+y+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var u={d:{f:d,r:function(){throw Error(c(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},m=Symbol.for("react.portal");function h(y,f,E){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:b==null?null:""+b,children:y,containerInfo:f,implementation:E}}var p=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,dt.createPortal=function(y,f){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(c(299));return h(y,f,null,E)},dt.flushSync=function(y){var f=p.T,E=u.p;try{if(p.T=null,u.p=2,y)return y()}finally{p.T=f,u.p=E,u.d.f()}},dt.preconnect=function(y,f){typeof y=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,u.d.C(y,f))},dt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},dt.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var E=f.as,b=g(E,f.crossOrigin),C=typeof f.integrity=="string"?f.integrity:void 0,R=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;E==="style"?u.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:C,fetchPriority:R}):E==="script"&&u.d.X(y,{crossOrigin:b,integrity:C,fetchPriority:R,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},dt.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var E=g(f.as,f.crossOrigin);u.d.M(y,{crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&u.d.M(y)},dt.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var E=f.as,b=g(E,f.crossOrigin);u.d.L(y,E,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},dt.preloadModule=function(y,f){if(typeof y=="string")if(f){var E=g(f.as,f.crossOrigin);u.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else u.d.m(y)},dt.requestFormReset=function(y){u.d.r(y)},dt.unstable_batchedUpdates=function(y,f){return y(f)},dt.useFormState=function(y,f,E){return p.H.useFormState(y,f,E)},dt.useFormStatus=function(){return p.H.useHostTransitionStatus()},dt.version="19.2.4",dt}var ox;function oh(){if(ox)return Gc.exports;ox=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Gc.exports=ch(),Gc.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 ux;function uh(){if(ux)return ns;ux=1;var i=ih(),c=no(),d=oh();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(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 y(e){if(h(e)!==e)throw Error(u(188))}function f(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return y(s),e;if(r===a)return y(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var o=!1,x=s.child;x;){if(x===l){o=!0,l=s,a=r;break}if(x===a){o=!0,a=s,l=r;break}x=x.sibling}if(!o){for(x=r.child;x;){if(x===l){o=!0,l=r,a=s;break}if(x===a){o=!0,a=r,l=s;break}x=x.sibling}if(!o)throw Error(u(189))}}if(l.alternate!==a)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,C=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),se=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ve=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),ge=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=ge&&e[ge]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case W:return"Profiler";case Z:return"StrictMode";case I:return"Suspense";case le:return"SuspenseList";case ve:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case se:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var Ee=Array.isArray,N=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ce=[],he=-1;function S(e){return{current:e}}function D(e){0>he||(e.current=ce[he],ce[he]=null,he--)}function X(e,t){he++,ce[he]=e.current,e.current=t}var M=S(null),q=S(null),Y=S(null),K=S(null);function de(e,t){switch(X(Y,t),X(q,e),X(M,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kf(t),e=Tf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(M),X(M,e)}function me(){D(M),D(q),D(Y)}function Ze(e){e.memoizedState!==null&&X(K,e);var t=M.current,l=Tf(t,e.type);t!==l&&(X(q,e),X(M,l))}function et(e){q.current===e&&(D(M),D(q)),K.current===e&&(D(K),Pn._currentValue=J)}var $t,Al;function Wt(e){if($t===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);$t=t&&t[1]||"",Al=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+$t+e+Al}var sl=!1;function rl(e,t){if(!e||sl)return"";sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(O){var z=O}Reflect.construct(e,[],H)}else{try{H.call()}catch(O){z=O}e.call(H.prototype)}}else{try{throw Error()}catch(O){z=O}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(O){if(O&&z&&typeof O.stack=="string")return[O.stack,z.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),o=r[0],x=r[1];if(o&&x){var j=o.split(`
44
+ `),_=x.split(`
45
+ `);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===_.length)for(a=j.length-1,s=_.length-1;1<=a&&0<=s&&j[a]!==_[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==_[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==_[s]){var L=`
46
+ `+j[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=s);break}}}finally{sl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Wt(l):""}function wl(e,t){switch(e.tag){case 26:case 27:case 5:return Wt(e.type);case 16:return Wt("Lazy");case 13:return e.child!==t&&t!==null?Wt("Suspense Fallback"):Wt("Suspense");case 19:return Wt("SuspenseList");case 0:case 15:return rl(e.type,!1);case 11:return rl(e.type.render,!1);case 1:return rl(e.type,!0);case 31:return Wt("Activity");default:return""}}function _l(e){try{var t="",l=null;do t+=wl(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
47
+ Error generating stack: `+a.message+`
48
+ `+a.stack}}var Ft=Object.prototype.hasOwnProperty,Vt=i.unstable_scheduleCallback,Rl=i.unstable_cancelCallback,il=i.unstable_shouldYield,P=i.unstable_requestPaint,ze=i.unstable_now,mt=i.unstable_getCurrentPriorityLevel,Qt=i.unstable_ImmediatePriority,$=i.unstable_UserBlockingPriority,_e=i.unstable_NormalPriority,Xt=i.unstable_LowPriority,Nt=i.unstable_IdlePriority,pt=i.log,It=i.unstable_setDisableYieldValue,Mt=null,Ve=null;function at(e){if(typeof pt=="function"&&It(e),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(Mt,e)}catch{}}var Ge=Math.clz32?Math.clz32:cl,$e=Math.log,Et=Math.LN2;function cl(e){return e>>>=0,e===0?32:31-($e(e)/Et|0)|0}var tt=256,ol=262144,ra=4194304;function Pt(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 ia(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?s=Pt(a):(o&=x,o!==0?s=Pt(o):l||(l=x&~e,l!==0&&(s=Pt(l))))):(x=a&~r,x!==0?s=Pt(x):o!==0?s=Pt(o):l||(l=a&~e,l!==0&&(s=Pt(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function Ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rs(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 fn(){var e=ra;return ra<<=1,(ra&62914560)===0&&(ra=4194304),e}function xn(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xx(e,t,l,a,s,r){var o=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var x=e.entanglements,j=e.expirationTimes,_=e.hiddenUpdates;for(l=o&~l;0<l;){var L=31-Ge(l),H=1<<L;x[L]=0,j[L]=-1;var z=_[L];if(z!==null)for(_[L]=null,L=0;L<z.length;L++){var O=z[L];O!==null&&(O.lane&=-536870913)}l&=~H}a!==0&&so(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(o&~t))}function so(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ge(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function ro(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Ge(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function io(e,t){var l=t&-t;return l=(l&42)!==0?1:Tr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Tr(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 Cr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function co(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:$f(e.type))}function oo(e,t){var l=A.p;try{return A.p=e,t()}finally{A.p=l}}var zl=Math.random().toString(36).slice(2),rt="__reactFiber$"+zl,ht="__reactProps$"+zl,Ta="__reactContainer$"+zl,Ar="__reactEvents$"+zl,Zx="__reactListeners$"+zl,Kx="__reactHandles$"+zl,uo="__reactResources$"+zl,mn="__reactMarker$"+zl;function wr(e){delete e[rt],delete e[ht],delete e[Ar],delete e[Zx],delete e[Kx]}function Ca(e){var t=e[rt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ta]||l[rt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=zf(e);e!==null;){if(l=e[rt])return l;e=zf(e)}return t}e=l,l=e.parentNode}return null}function Aa(e){if(e=e[rt]||e[Ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function wa(e){var t=e[uo];return t||(t=e[uo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[mn]=!0}var fo=new Set,xo={};function oa(e,t){_a(e,t),_a(e+"Capture",t)}function _a(e,t){for(xo[e]=t,e=0;e<t.length;e++)fo.add(t[e])}var Jx=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]*$"),mo={},po={};function $x(e){return Ft.call(po,e)?!0:Ft.call(mo,e)?!1:Jx.test(e)?po[e]=!0:(mo[e]=!0,!1)}function is(e,t,l){if($x(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function cs(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function ul(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ho(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wx(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){l=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(o){l=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=ho(e)?"checked":"value";e._valueTracker=Wx(e,t,""+e[t])}}function vo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=ho(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function os(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 Fx=/[\n"\\]/g;function Ot(e){return e.replace(Fx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rr(e,t,l,a,s,r,o,x){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Mr(e,o,zt(t)):l!=null?Mr(e,o,zt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+zt(x):e.removeAttribute("name")}function yo(e,t,l,a,s,r,o,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){_r(e);return}l=l!=null?""+zt(l):"",t=t!=null?""+zt(t):l,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),_r(e)}function Mr(e,t,l){t==="number"&&os(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ra(e,t,l,a){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&a&&(e[l].defaultSelected=!0)}else{for(l=""+zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function go(e,t,l){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+zt(l):""}function bo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(Ee(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),_r(e)}function Ma(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Ix=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 jo(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||Ix.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function So(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&jo(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&jo(e,r,t[r])}function zr(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 Px=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"]]),em=/^[\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 us(e){return em.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function dl(){}var Or=null;function Dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,Oa=null;function No(e){var t=Aa(e);if(t&&(e=t.stateNode)){var l=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[ht]||null;if(!s)throw Error(u(90));Rr(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&vo(a)}break e;case"textarea":go(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ra(e,!!l.multiple,t,!1)}}}var Lr=!1;function Eo(e,t,l){if(Lr)return e(t,l);Lr=!0;try{var a=e(t);return a}finally{if(Lr=!1,(za!==null||Oa!==null)&&(Fs(),za&&(t=za,e=Oa,Oa=za=null,No(t),e)))for(t=0;t<e.length;t++)No(e[t])}}function hn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[ht]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var fl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Br=!1;if(fl)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Br=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Br=!1}var Ol=null,Ur=null,ds=null;function ko(){if(ds)return ds;var e,t=Ur,l=t.length,a,s="value"in Ol?Ol.value:Ol.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var o=l-e;for(a=1;a<=o&&t[l-a]===s[r-a];a++);return ds=s.slice(e,1<a?1-a:void 0)}function fs(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 xs(){return!0}function To(){return!1}function vt(e){function t(l,a,s,r,o){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=o,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(l=e[x],this[x]=l?l(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?xs:To,this.isPropagationStopped=To,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=xs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=xs)},persist:function(){},isPersistent:xs}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=vt(ua),yn=b({},ua,{view:0,detail:0}),tm=vt(yn),Hr,qr,gn,ps=b({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gr,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!==gn&&(gn&&e.type==="mousemove"?(Hr=e.screenX-gn.screenX,qr=e.screenY-gn.screenY):qr=Hr=0,gn=e),Hr)},movementY:function(e){return"movementY"in e?e.movementY:qr}}),Co=vt(ps),lm=b({},ps,{dataTransfer:0}),am=vt(lm),nm=b({},yn,{relatedTarget:0}),Yr=vt(nm),sm=b({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),rm=vt(sm),im=b({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cm=vt(im),om=b({},ua,{data:0}),Ao=vt(om),um={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dm={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"},fm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fm[e])?!!t[e]:!1}function Gr(){return xm}var mm=b({},yn,{key:function(e){if(e.key){var t=um[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gr,charCode:function(e){return e.type==="keypress"?fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pm=vt(mm),hm=b({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wo=vt(hm),vm=b({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gr}),ym=vt(vm),gm=b({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),bm=vt(gm),jm=b({},ps,{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}),Sm=vt(jm),Nm=b({},ua,{newState:0,oldState:0}),Em=vt(Nm),km=[9,13,27,32],Vr=fl&&"CompositionEvent"in window,bn=null;fl&&"documentMode"in document&&(bn=document.documentMode);var Tm=fl&&"TextEvent"in window&&!bn,_o=fl&&(!Vr||bn&&8<bn&&11>=bn),Ro=" ",Mo=!1;function zo(e,t){switch(e){case"keyup":return km.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Da=!1;function Cm(e,t){switch(e){case"compositionend":return Oo(t);case"keypress":return t.which!==32?null:(Mo=!0,Ro);case"textInput":return e=t.data,e===Ro&&Mo?null:e;default:return null}}function Am(e,t){if(Da)return e==="compositionend"||!Vr&&zo(e,t)?(e=ko(),ds=Ur=Ol=null,Da=!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 _o&&t.locale!=="ko"?null:t.data;default:return null}}var wm={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 Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wm[e.type]:t==="textarea"}function Lo(e,t,l,a){za?Oa?Oa.push(a):Oa=[a]:za=a,t=nr(t,"onChange"),0<t.length&&(l=new ms("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var jn=null,Sn=null;function _m(e){gf(e,0)}function hs(e){var t=pn(e);if(vo(t))return e}function Bo(e,t){if(e==="change")return t}var Uo=!1;if(fl){var Qr;if(fl){var Xr="oninput"in document;if(!Xr){var Ho=document.createElement("div");Ho.setAttribute("oninput","return;"),Xr=typeof Ho.oninput=="function"}Qr=Xr}else Qr=!1;Uo=Qr&&(!document.documentMode||9<document.documentMode)}function qo(){jn&&(jn.detachEvent("onpropertychange",Yo),Sn=jn=null)}function Yo(e){if(e.propertyName==="value"&&hs(Sn)){var t=[];Lo(t,Sn,e,Dr(e)),Eo(_m,t)}}function Rm(e,t,l){e==="focusin"?(qo(),jn=t,Sn=l,jn.attachEvent("onpropertychange",Yo)):e==="focusout"&&qo()}function Mm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hs(Sn)}function zm(e,t){if(e==="click")return hs(t)}function Om(e,t){if(e==="input"||e==="change")return hs(t)}function Dm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Dm;function Nn(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!Ft.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function Go(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vo(e,t){var l=Go(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Go(l)}}function Qo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=os(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=os(e.document)}return t}function Zr(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 Lm=fl&&"documentMode"in document&&11>=document.documentMode,La=null,Kr=null,En=null,Jr=!1;function Zo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||La==null||La!==os(a)||(a=La,"selectionStart"in a&&Zr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),En&&Nn(En,a)||(En=a,a=nr(Kr,"onSelect"),0<a.length&&(t=new ms("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=La)))}function da(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ba={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionrun:da("Transition","TransitionRun"),transitionstart:da("Transition","TransitionStart"),transitioncancel:da("Transition","TransitionCancel"),transitionend:da("Transition","TransitionEnd")},$r={},Ko={};fl&&(Ko=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function fa(e){if($r[e])return $r[e];if(!Ba[e])return e;var t=Ba[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Ko)return $r[e]=t[l];return e}var Jo=fa("animationend"),$o=fa("animationiteration"),Wo=fa("animationstart"),Bm=fa("transitionrun"),Um=fa("transitionstart"),Hm=fa("transitioncancel"),Fo=fa("transitionend"),Io=new Map,Wr="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(" ");Wr.push("scrollEnd");function Zt(e,t){Io.set(e,t),oa(t,[e])}var vs=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)},Dt=[],Ua=0,Fr=0;function ys(){for(var e=Ua,t=Fr=Ua=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var o=a.pending;o===null?s.next=s:(s.next=o.next,o.next=s),a.pending=s}r!==0&&Po(l,s,r)}}function gs(e,t,l,a){Dt[Ua++]=e,Dt[Ua++]=t,Dt[Ua++]=l,Dt[Ua++]=a,Fr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ir(e,t,l,a){return gs(e,t,l,a),bs(e)}function xa(e,t){return gs(e,null,null,t),bs(e)}function Po(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,r=e.return;r!==null;)r.childLanes|=l,a=r.alternate,a!==null&&(a.childLanes|=l),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Ge(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function bs(e){if(50<Zn)throw Zn=0,ic=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ha={};function qm(e,t,l,a){this.tag=e,this.key=l,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,l,a){return new qm(e,t,l,a)}function Pr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xl(e,t){var l=e.alternate;return l===null?(l=Tt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function eu(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function js(e,t,l,a,s,r){var o=0;if(a=e,typeof e=="function")Pr(e)&&(o=1);else if(typeof e=="string")o=Xp(e,l,M.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ve:return e=Tt(31,l,t,s),e.elementType=ve,e.lanes=r,e;case V:return ma(l.children,s,r,t);case Z:o=8,s|=24;break;case W:return e=Tt(12,l,t,s|2),e.elementType=W,e.lanes=r,e;case I:return e=Tt(13,l,t,s),e.elementType=I,e.lanes=r,e;case le:return e=Tt(19,l,t,s),e.elementType=le,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case se:o=10;break e;case ee:o=9;break e;case G:o=11;break e;case F:o=14;break e;case ae:o=16,a=null;break e}o=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Tt(o,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function ma(e,t,l,a){return e=Tt(7,e,a,t),e.lanes=l,e}function ei(e,t,l){return e=Tt(6,e,null,t),e.lanes=l,e}function tu(e){var t=Tt(18,null,null,0);return t.stateNode=e,t}function ti(e,t,l){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var lu=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var l=lu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:_l(t)},lu.set(e,t),t)}return{value:e,source:t,stack:_l(t)}}var qa=[],Ya=0,Ss=null,kn=0,Bt=[],Ut=0,Dl=null,el=1,tl="";function ml(e,t){qa[Ya++]=kn,qa[Ya++]=Ss,Ss=e,kn=t}function au(e,t,l){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,Dl=e;var a=el;e=tl;var s=32-Ge(a)-1;a&=~(1<<s),l+=1;var r=32-Ge(t)+s;if(30<r){var o=s-s%5;r=(a&(1<<o)-1).toString(32),a>>=o,s-=o,el=1<<32-Ge(t)+s|l<<s|a,tl=r+e}else el=1<<r|l<<s|a,tl=e}function li(e){e.return!==null&&(ml(e,1),au(e,1,0))}function ai(e){for(;e===Ss;)Ss=qa[--Ya],qa[Ya]=null,kn=qa[--Ya],qa[Ya]=null;for(;e===Dl;)Dl=Bt[--Ut],Bt[Ut]=null,tl=Bt[--Ut],Bt[Ut]=null,el=Bt[--Ut],Bt[Ut]=null}function nu(e,t){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,el=t.id,tl=t.overflow,Dl=e}var it=null,Ue=null,ke=!1,Ll=null,Ht=!1,ni=Error(u(519));function Bl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tn(Lt(t,e)),ni}function su(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[rt]=e,t[ht]=a,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<Jn.length;l++)je(Jn[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),yo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),bo(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Nf(t.textContent,l)?(a.popover!=null&&(je("beforetoggle",t),je("toggle",t)),a.onScroll!=null&&je("scroll",t),a.onScrollEnd!=null&&je("scrollend",t),a.onClick!=null&&(t.onclick=dl),t=!0):t=!1,t||Bl(e,!0)}function ru(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:it=it.return}}function Ga(e){if(e!==it)return!1;if(!ke)return ru(e),ke=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Sc(e.type,e.memoizedProps)),l=!l),l&&Ue&&Bl(e),ru(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Mf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Mf(e)}else t===27?(t=Ue,Fl(e.type)?(e=Cc,Cc=null,Ue=e):Ue=t):Ue=it?Yt(e.stateNode.nextSibling):null;return!0}function pa(){Ue=it=null,ke=!1}function si(){var e=Ll;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),Ll=null),e}function Tn(e){Ll===null?Ll=[e]:Ll.push(e)}var ri=S(null),ha=null,pl=null;function Ul(e,t,l){X(ri,t._currentValue),t._currentValue=l}function hl(e){e._currentValue=ri.current,D(ri)}function ii(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var o=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var j=0;j<t.length;j++)if(x.context===t[j]){r.lanes|=l,x=r.alternate,x!==null&&(x.lanes|=l),ii(r.return,l,e),a||(o=null);break e}r=x.next}}else if(s.tag===18){if(o=s.return,o===null)throw Error(u(341));o.lanes|=l,r=o.alternate,r!==null&&(r.lanes|=l),ii(o,l,e),o=null}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}}function Va(e,t,l,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var o=s.alternate;if(o===null)throw Error(u(387));if(o=o.memoizedProps,o!==null){var x=s.type;kt(s.pendingProps.value,o.value)||(e!==null?e.push(x):e=[x])}}else if(s===K.current){if(o=s.alternate,o===null)throw Error(u(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}s=s.return}e!==null&&ci(t,e,l,a),t.flags|=262144}function Ns(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ha=e,pl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return iu(ha,e)}function Es(e,t){return ha===null&&va(e),iu(e,t)}function iu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},pl===null){if(e===null)throw Error(u(308));pl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pl=pl.next=t;return l}var Ym=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Gm=i.unstable_scheduleCallback,Vm=i.unstable_NormalPriority,We={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oi(){return{controller:new Ym,data:new Map,refCount:0}}function Cn(e){e.refCount--,e.refCount===0&&Gm(Vm,function(){e.controller.abort()})}var An=null,ui=0,Qa=0,Xa=null;function Qm(e,t){if(An===null){var l=An=[];ui=0,Qa=xc(),Xa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ui++,t.then(cu,cu),t}function cu(){if(--ui===0&&An!==null){Xa!==null&&(Xa.status="fulfilled");var e=An;An=null,Qa=0,Xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Xm(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var ou=N.S;N.S=function(e,t){Zd=ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qm(e,t),ou!==null&&ou(e,t)};var ya=S(null);function di(){var e=ya.current;return e!==null?e:Be.pooledCache}function ks(e,t){t===null?X(ya,ya.current):X(ya,t.pool)}function uu(){var e=di();return e===null?null:{parent:We._currentValue,pool:e}}var Za=Error(u(460)),fi=Error(u(474)),Ts=Error(u(542)),Cs={then:function(){}};function du(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(dl,dl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,mu(e),e;default:if(typeof t.status=="string")t.then(dl,dl);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,mu(e),e}throw ba=t,Za}}function ga(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ba=l,Za):l}}var ba=null;function xu(){if(ba===null)throw Error(u(459));var e=ba;return ba=null,e}function mu(e){if(e===Za||e===Ts)throw Error(u(483))}var Ka=null,wn=0;function As(e){var t=wn;return wn+=1,Ka===null&&(Ka=[]),fu(Ka,e,t)}function _n(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===C?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pu(e){function t(T,k){if(e){var w=T.deletions;w===null?(T.deletions=[k],T.flags|=16):w.push(k)}}function l(T,k){if(!e)return null;for(;k!==null;)t(T,k),k=k.sibling;return null}function a(T){for(var k=new Map;T!==null;)T.key!==null?k.set(T.key,T):k.set(T.index,T),T=T.sibling;return k}function s(T,k){return T=xl(T,k),T.index=0,T.sibling=null,T}function r(T,k,w){return T.index=w,e?(w=T.alternate,w!==null?(w=w.index,w<k?(T.flags|=67108866,k):w):(T.flags|=67108866,k)):(T.flags|=1048576,k)}function o(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function x(T,k,w,U){return k===null||k.tag!==6?(k=ei(w,T.mode,U),k.return=T,k):(k=s(k,w),k.return=T,k)}function j(T,k,w,U){var ie=w.type;return ie===V?L(T,k,w.props.children,U,w.key):k!==null&&(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type)?(k=s(k,w.props),_n(k,w),k.return=T,k):(k=js(w.type,w.key,w.props,null,T.mode,U),_n(k,w),k.return=T,k)}function _(T,k,w,U){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=ti(w,T.mode,U),k.return=T,k):(k=s(k,w.children||[]),k.return=T,k)}function L(T,k,w,U,ie){return k===null||k.tag!==7?(k=ma(w,T.mode,U,ie),k.return=T,k):(k=s(k,w),k.return=T,k)}function H(T,k,w){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ei(""+k,T.mode,w),k.return=T,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case R:return w=js(k.type,k.key,k.props,null,T.mode,w),_n(w,k),w.return=T,w;case B:return k=ti(k,T.mode,w),k.return=T,k;case ae:return k=ga(k),H(T,k,w)}if(Ee(k)||ye(k))return k=ma(k,T.mode,w,null),k.return=T,k;if(typeof k.then=="function")return H(T,As(k),w);if(k.$$typeof===se)return H(T,Es(T,k),w);ws(T,k)}return null}function z(T,k,w,U){var ie=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ie!==null?null:x(T,k,""+w,U);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case R:return w.key===ie?j(T,k,w,U):null;case B:return w.key===ie?_(T,k,w,U):null;case ae:return w=ga(w),z(T,k,w,U)}if(Ee(w)||ye(w))return ie!==null?null:L(T,k,w,U,null);if(typeof w.then=="function")return z(T,k,As(w),U);if(w.$$typeof===se)return z(T,k,Es(T,w),U);ws(T,w)}return null}function O(T,k,w,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return T=T.get(w)||null,x(k,T,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case R:return T=T.get(U.key===null?w:U.key)||null,j(k,T,U,ie);case B:return T=T.get(U.key===null?w:U.key)||null,_(k,T,U,ie);case ae:return U=ga(U),O(T,k,w,U,ie)}if(Ee(U)||ye(U))return T=T.get(w)||null,L(k,T,U,ie,null);if(typeof U.then=="function")return O(T,k,w,As(U),ie);if(U.$$typeof===se)return O(T,k,w,Es(k,U),ie);ws(k,U)}return null}function te(T,k,w,U){for(var ie=null,Ce=null,ne=k,pe=k=0,Ne=null;ne!==null&&pe<w.length;pe++){ne.index>pe?(Ne=ne,ne=null):Ne=ne.sibling;var Ae=z(T,ne,w[pe],U);if(Ae===null){ne===null&&(ne=Ne);break}e&&ne&&Ae.alternate===null&&t(T,ne),k=r(Ae,k,pe),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae,ne=Ne}if(pe===w.length)return l(T,ne),ke&&ml(T,pe),ie;if(ne===null){for(;pe<w.length;pe++)ne=H(T,w[pe],U),ne!==null&&(k=r(ne,k,pe),Ce===null?ie=ne:Ce.sibling=ne,Ce=ne);return ke&&ml(T,pe),ie}for(ne=a(ne);pe<w.length;pe++)Ne=O(ne,T,pe,w[pe],U),Ne!==null&&(e&&Ne.alternate!==null&&ne.delete(Ne.key===null?pe:Ne.key),k=r(Ne,k,pe),Ce===null?ie=Ne:Ce.sibling=Ne,Ce=Ne);return e&&ne.forEach(function(la){return t(T,la)}),ke&&ml(T,pe),ie}function oe(T,k,w,U){if(w==null)throw Error(u(151));for(var ie=null,Ce=null,ne=k,pe=k=0,Ne=null,Ae=w.next();ne!==null&&!Ae.done;pe++,Ae=w.next()){ne.index>pe?(Ne=ne,ne=null):Ne=ne.sibling;var la=z(T,ne,Ae.value,U);if(la===null){ne===null&&(ne=Ne);break}e&&ne&&la.alternate===null&&t(T,ne),k=r(la,k,pe),Ce===null?ie=la:Ce.sibling=la,Ce=la,ne=Ne}if(Ae.done)return l(T,ne),ke&&ml(T,pe),ie;if(ne===null){for(;!Ae.done;pe++,Ae=w.next())Ae=H(T,Ae.value,U),Ae!==null&&(k=r(Ae,k,pe),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return ke&&ml(T,pe),ie}for(ne=a(ne);!Ae.done;pe++,Ae=w.next())Ae=O(ne,T,pe,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&ne.delete(Ae.key===null?pe:Ae.key),k=r(Ae,k,pe),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return e&&ne.forEach(function(lh){return t(T,lh)}),ke&&ml(T,pe),ie}function Le(T,k,w,U){if(typeof w=="object"&&w!==null&&w.type===V&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case R:e:{for(var ie=w.key;k!==null;){if(k.key===ie){if(ie=w.type,ie===V){if(k.tag===7){l(T,k.sibling),U=s(k,w.props.children),U.return=T,T=U;break e}}else if(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type){l(T,k.sibling),U=s(k,w.props),_n(U,w),U.return=T,T=U;break e}l(T,k);break}else t(T,k);k=k.sibling}w.type===V?(U=ma(w.props.children,T.mode,U,w.key),U.return=T,T=U):(U=js(w.type,w.key,w.props,null,T.mode,U),_n(U,w),U.return=T,T=U)}return o(T);case B:e:{for(ie=w.key;k!==null;){if(k.key===ie)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){l(T,k.sibling),U=s(k,w.children||[]),U.return=T,T=U;break e}else{l(T,k);break}else t(T,k);k=k.sibling}U=ti(w,T.mode,U),U.return=T,T=U}return o(T);case ae:return w=ga(w),Le(T,k,w,U)}if(Ee(w))return te(T,k,w,U);if(ye(w)){if(ie=ye(w),typeof ie!="function")throw Error(u(150));return w=ie.call(w),oe(T,k,w,U)}if(typeof w.then=="function")return Le(T,k,As(w),U);if(w.$$typeof===se)return Le(T,k,Es(T,w),U);ws(T,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,k!==null&&k.tag===6?(l(T,k.sibling),U=s(k,w),U.return=T,T=U):(l(T,k),U=ei(w,T.mode,U),U.return=T,T=U),o(T)):l(T,k)}return function(T,k,w,U){try{wn=0;var ie=Le(T,k,w,U);return Ka=null,ie}catch(ne){if(ne===Za||ne===Ts)throw ne;var Ce=Tt(29,ne,null,T.mode);return Ce.lanes=U,Ce.return=T,Ce}finally{}}}var ja=pu(!0),hu=pu(!1),Hl=!1;function xi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mi(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 ql(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(we&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=bs(e),Po(e,null,l),t}return gs(e,a,t,l),bs(e)}function Rn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,ro(e,l)}}function pi(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var o={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=o:r=r.next=o,l=l.next}while(l!==null);r===null?s=r=t:r=r.next=t}else s=r=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var hi=!1;function Mn(){if(hi){var e=Xa;if(e!==null)throw e}}function zn(e,t,l,a){hi=!1;var s=e.updateQueue;Hl=!1;var r=s.firstBaseUpdate,o=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var j=x,_=j.next;j.next=null,o===null?r=_:o.next=_,o=j;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==o&&(x===null?L.firstBaseUpdate=_:x.next=_,L.lastBaseUpdate=j))}if(r!==null){var H=s.baseState;o=0,L=_=j=null,x=r;do{var z=x.lane&-536870913,O=z!==x.lane;if(O?(Se&z)===z:(a&z)===z){z!==0&&z===Qa&&(hi=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var te=e,oe=x;z=t;var Le=l;switch(oe.tag){case 1:if(te=oe.payload,typeof te=="function"){H=te.call(Le,H,z);break e}H=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=oe.payload,z=typeof te=="function"?te.call(Le,H,z):te,z==null)break e;H=b({},H,z);break e;case 2:Hl=!0}}z=x.callback,z!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[z]:O.push(z))}else O={lane:z,tag:x.tag,payload:x.payload,callback:x.callback,next:null},L===null?(_=L=O,j=H):L=L.next=O,o|=z;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;O=x,x=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);L===null&&(j=H),s.baseState=j,s.firstBaseUpdate=_,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Zl|=o,e.lanes=o,e.memoizedState=H}}function vu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function yu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)vu(l[e],t)}var Ja=S(null),_s=S(0);function gu(e,t){e=kl,X(_s,e),X(Ja,t),kl=e|t.baseLanes}function vi(){X(_s,kl),X(Ja,Ja.current)}function yi(){kl=_s.current,D(Ja),D(_s)}var Ct=S(null),qt=null;function Gl(e){var t=e.alternate;X(Ke,Ke.current&1),X(Ct,e),qt===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(qt=e)}function gi(e){X(Ke,Ke.current),X(Ct,e),qt===null&&(qt=e)}function bu(e){e.tag===22?(X(Ke,Ke.current),X(Ct,e),qt===null&&(qt=e)):Vl()}function Vl(){X(Ke,Ke.current),X(Ct,Ct.current)}function At(e){D(Ct),qt===e&&(qt=null),D(Ke)}var Ke=S(0);function Rs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||kc(l)||Tc(l)))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 vl=0,xe=null,Oe=null,Fe=null,Ms=!1,$a=!1,Sa=!1,zs=0,On=0,Wa=null,Zm=0;function Qe(){throw Error(u(321))}function bi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!kt(e[l],t[l]))return!1;return!0}function ji(e,t,l,a,s,r){return vl=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?ad:Li,Sa=!1,r=l(a,s),Sa=!1,$a&&(r=Su(t,l,a,s)),ju(e),r}function ju(e){N.H=Bn;var t=Oe!==null&&Oe.next!==null;if(vl=0,Fe=Oe=xe=null,Ms=!1,On=0,Wa=null,t)throw Error(u(300));e===null||Ie||(e=e.dependencies,e!==null&&Ns(e)&&(Ie=!0))}function Su(e,t,l,a){xe=e;var s=0;do{if($a&&(Wa=null),On=0,$a=!1,25<=s)throw Error(u(301));if(s+=1,Fe=Oe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}N.H=nd,r=t(l,a)}while($a);return r}function Km(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?Dn(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(xe.flags|=1024),t}function Si(){var e=zs!==0;return zs=0,e}function Ni(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ei(e){if(Ms){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ms=!1}vl=0,Fe=Oe=xe=null,$a=!1,On=zs=0,Wa=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Je(){if(Oe===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Fe===null?xe.memoizedState:Fe.next;if(t!==null)Fe=t,Oe=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dn(e){var t=On;return On+=1,Wa===null&&(Wa=[]),e=fu(Wa,e,t),t=xe,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?ad:Li),e}function Ds(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dn(e);if(e.$$typeof===se)return ct(e)}throw Error(u(438,String(e)))}function ki(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Os(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=re;return t.index++,l}function yl(e,t){return typeof t=="function"?t(e):t}function Ls(e){var t=Je();return Ti(t,Oe,e)}function Ti(e,t,l){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var o=s.next;s.next=r.next,r.next=o}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=o=null,j=null,_=t,L=!1;do{var H=_.lane&-536870913;if(H!==_.lane?(Se&H)===H:(vl&H)===H){var z=_.revertLane;if(z===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),H===Qa&&(L=!0);else if((vl&z)===z){_=_.next,z===Qa&&(L=!0);continue}else H={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=H,o=r):j=j.next=H,xe.lanes|=z,Zl|=z;H=_.action,Sa&&l(r,H),r=_.hasEagerState?_.eagerState:l(r,H)}else z={lane:H,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=z,o=r):j=j.next=z,xe.lanes|=H,Zl|=H;_=_.next}while(_!==null&&_!==t);if(j===null?o=r:j.next=x,!kt(r,e.memoizedState)&&(Ie=!0,L&&(l=Xa,l!==null)))throw l;e.memoizedState=r,e.baseState=o,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ci(e){var t=Je(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var o=s=s.next;do r=e(r,o.action),o=o.next;while(o!==s);kt(r,t.memoizedState)||(Ie=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function Nu(e,t,l){var a=xe,s=Je(),r=ke;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var o=!kt((Oe||s).memoizedState,l);if(o&&(s.memoizedState=l,Ie=!0),s=s.queue,_i(Tu.bind(null,a,s,e),[e]),s.getSnapshot!==t||o||Fe!==null&&Fe.memoizedState.tag&1){if(a.flags|=2048,Fa(9,{destroy:void 0},ku.bind(null,a,s,l,t),null),Be===null)throw Error(u(349));r||(vl&127)!==0||Eu(a,t,l)}return l}function Eu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=Os(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function ku(e,t,l,a){t.value=l,t.getSnapshot=a,Cu(t)&&Au(e)}function Tu(e,t,l){return l(function(){Cu(t)&&Au(e)})}function Cu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!kt(e,l)}catch{return!0}}function Au(e){var t=xa(e,2);t!==null&&St(t,e,2)}function Ai(e){var t=ft();if(typeof e=="function"){var l=e;if(e=l(),Sa){at(!0);try{l()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:e},t}function wu(e,t,l,a){return e.baseState=l,Ti(e,Oe,typeof a=="function"?a:yl)}function Jm(e,t,l,a,s){if(Hs(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){r.listeners.push(o)}};N.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,_u(t,r)):(r.next=l.next,t.pending=l.next=r)}}function _u(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=N.T,o={};N.T=o;try{var x=l(s,a),j=N.S;j!==null&&j(o,x),Ru(e,t,x)}catch(_){wi(e,t,_)}finally{r!==null&&o.types!==null&&(r.types=o.types),N.T=r}}else try{r=l(s,a),Ru(e,t,r)}catch(_){wi(e,t,_)}}function Ru(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Mu(e,t,a)},function(a){return wi(e,t,a)}):Mu(e,t,l)}function Mu(e,t,l){t.status="fulfilled",t.value=l,zu(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,_u(e,l)))}function wi(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,zu(t),t=t.next;while(t!==a)}e.action=null}function zu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ou(e,t){return t}function Du(e,t){if(ke){var l=Be.formState;if(l!==null){e:{var a=xe;if(ke){if(Ue){t:{for(var s=Ue,r=Ht;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ue=Yt(s.nextSibling),a=s.data==="F!";break e}}Bl(a)}a=!1}a&&(t=l[0])}}return l=ft(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:t},l.queue=a,l=ed.bind(null,xe,a),a.dispatch=l,a=Ai(!1),r=Di.bind(null,xe,!1,a.queue),a=ft(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Jm.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Lu(e){var t=Je();return Bu(t,Oe,e)}function Bu(e,t,l){if(t=Ti(e,t,Ou)[0],e=Ls(yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Dn(t)}catch(o){throw o===Za?Ts:o}else a=t;t=Je();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Fa(9,{destroy:void 0},$m.bind(null,s,l),null)),[a,r,e]}function $m(e,t){e.action=t}function Uu(e){var t=Je(),l=Oe;if(l!==null)return Bu(t,l,e);Je(),t=t.memoizedState,l=Je();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Fa(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Os(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Hu(){return Je().memoizedState}function Bs(e,t,l,a){var s=ft();xe.flags|=e,s.memoizedState=Fa(1|t,{destroy:void 0},l,a===void 0?null:a)}function Us(e,t,l,a){var s=Je();a=a===void 0?null:a;var r=s.memoizedState.inst;Oe!==null&&a!==null&&bi(a,Oe.memoizedState.deps)?s.memoizedState=Fa(t,r,l,a):(xe.flags|=e,s.memoizedState=Fa(1|t,r,l,a))}function qu(e,t){Bs(8390656,8,e,t)}function _i(e,t){Us(2048,8,e,t)}function Wm(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Os(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Yu(e){var t=Je().memoizedState;return Wm({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Gu(e,t){return Us(4,2,e,t)}function Vu(e,t){return Us(4,4,e,t)}function Qu(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xu(e,t,l){l=l!=null?l.concat([e]):null,Us(4,4,Qu.bind(null,t,e),l)}function Ri(){}function Zu(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&bi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Ku(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&bi(t,a[1]))return a[0];if(a=e(),Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a}function Mi(e,t,l){return l===void 0||(vl&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Jd(),xe.lanes|=e,Zl|=e,l)}function Ju(e,t,l,a){return kt(l,t)?l:Ja.current!==null?(e=Mi(e,l,a),kt(e,t)||(Ie=!0),e):(vl&42)===0||(vl&1073741824)!==0&&(Se&261930)===0?(Ie=!0,e.memoizedState=l):(e=Jd(),xe.lanes|=e,Zl|=e,t)}function $u(e,t,l,a,s){var r=A.p;A.p=r!==0&&8>r?r:8;var o=N.T,x={};N.T=x,Di(e,!1,t,l);try{var j=s(),_=N.S;if(_!==null&&_(x,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var L=Xm(j,a);Ln(e,t,L,Rt(e))}else Ln(e,t,a,Rt(e))}catch(H){Ln(e,t,{then:function(){},status:"rejected",reason:H},Rt())}finally{A.p=r,o!==null&&x.types!==null&&(o.types=x.types),N.T=o}}function Fm(){}function zi(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Wu(e).queue;$u(e,s,t,J,l===null?Fm:function(){return Fu(e),l(a)})}function Wu(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:yl,lastRenderedState:J},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fu(e){var t=Wu(e);t.next===null&&(t=e.alternate.memoizedState),Ln(e,t.next.queue,{},Rt())}function Oi(){return ct(Pn)}function Iu(){return Je().memoizedState}function Pu(){return Je().memoizedState}function Im(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Rt();e=ql(l);var a=Yl(t,e,l);a!==null&&(St(a,t,l),Rn(a,t,l)),t={cache:oi()},e.payload=t;return}t=t.return}}function Pm(e,t,l){var a=Rt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)?td(t,l):(l=Ir(e,t,l,a),l!==null&&(St(l,e,a),ld(l,t,a)))}function ed(e,t,l){var a=Rt();Ln(e,t,l,a)}function Ln(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))td(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,x=r(o,l);if(s.hasEagerState=!0,s.eagerState=x,kt(x,o))return gs(e,t,s,0),Be===null&&ys(),!1}catch{}finally{}if(l=Ir(e,t,s,a),l!==null)return St(l,e,a),ld(l,t,a),!0}return!1}function Di(e,t,l,a){if(a={lane:2,revertLane:xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(u(479))}else t=Ir(e,l,a,2),t!==null&&St(t,e,2)}function Hs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function td(e,t){$a=Ms=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function ld(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,ro(e,l)}}var Bn={readContext:ct,use:Ds,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Bn.useEffectEvent=Qe;var ad={readContext:ct,use:Ds,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:qu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Bs(4194308,4,Qu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var l=ft();t=t===void 0?null:t;var a=e();if(Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ft();if(l!==void 0){var s=l(t);if(Sa){at(!0);try{l(t)}finally{at(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=Pm.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ed.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ri,useDeferredValue:function(e,t){var l=ft();return Mi(l,e,t)},useTransition:function(){var e=Ai(!1);return e=$u.bind(null,xe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=ft();if(ke){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Be===null)throw Error(u(349));(Se&127)!==0||Eu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,qu(Tu.bind(null,a,r,e),[e]),a.flags|=2048,Fa(9,{destroy:void 0},ku.bind(null,a,r,l,t),null),l},useId:function(){var e=ft(),t=Be.identifierPrefix;if(ke){var l=tl,a=el;l=(a&~(1<<32-Ge(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Zm++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oi,useFormState:Du,useActionState:Du,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Di.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:ki,useCacheRefresh:function(){return ft().memoizedState=Im.bind(null,xe)},useEffectEvent:function(e){var t=ft(),l={impl:e};return t.memoizedState=l,function(){if((we&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Li={readContext:ct,use:Ds,useCallback:Zu,useContext:ct,useEffect:_i,useImperativeHandle:Xu,useInsertionEffect:Gu,useLayoutEffect:Vu,useMemo:Ku,useReducer:Ls,useRef:Hu,useState:function(){return Ls(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Ju(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ls(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Nu,useId:Iu,useHostTransitionStatus:Oi,useFormState:Lu,useActionState:Lu,useOptimistic:function(e,t){var l=Je();return wu(l,Oe,e,t)},useMemoCache:ki,useCacheRefresh:Pu};Li.useEffectEvent=Yu;var nd={readContext:ct,use:Ds,useCallback:Zu,useContext:ct,useEffect:_i,useImperativeHandle:Xu,useInsertionEffect:Gu,useLayoutEffect:Vu,useMemo:Ku,useReducer:Ci,useRef:Hu,useState:function(){return Ci(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Oe===null?Mi(l,e,t):Ju(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ci(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Nu,useId:Iu,useHostTransitionStatus:Oi,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=Je();return Oe!==null?wu(l,Oe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ki,useCacheRefresh:Pu};nd.useEffectEvent=Yu;function Bi(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ui={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Rt(),s=ql(a);s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Rt(),s=ql(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Rt(),a=ql(l);a.tag=2,t!=null&&(a.callback=t),t=Yl(e,a,l),t!==null&&(St(t,e,l),Rn(t,e,l))}};function sd(e,t,l,a,s,r,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,o):t.prototype&&t.prototype.isPureReactComponent?!Nn(l,a)||!Nn(s,r):!0}function rd(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function Na(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function id(e){vs(e)}function cd(e){console.error(e)}function od(e){vs(e)}function qs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ud(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Hi(e,t,l){return l=ql(l),l.tag=3,l.payload={element:null},l.callback=function(){qs(e,t)},l}function dd(e){return e=ql(e),e.tag=3,e}function fd(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){ud(t,l,a)}}var o=l.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){ud(t,l,a),typeof s!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function ep(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Va(t,l,s,!0),l=Ct.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Is():l.alternate===null&&Xe===0&&(Xe=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),uc(e,a,s)),!1;case 22:return l.flags|=65536,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),uc(e,a,s)),!1}throw Error(u(435,l.tag))}return uc(e,a,s),Is(),!1}if(ke)return t=Ct.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==ni&&(e=Error(u(422),{cause:a}),Tn(Lt(e,l)))):(a!==ni&&(t=Error(u(423),{cause:a}),Tn(Lt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Lt(a,l),s=Hi(e.stateNode,a,s),pi(e,s),Xe!==4&&(Xe=2)),!1;var r=Error(u(520),{cause:a});if(r=Lt(r,l),Xn===null?Xn=[r]:Xn.push(r),Xe!==4&&(Xe=2),t===null)return!0;a=Lt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Hi(l.stateNode,a,e),pi(l,e),!1;case 1:if(t=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Kl===null||!Kl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=dd(s),fd(s,e,l,a),pi(l,s),!1}l=l.return}while(l!==null);return!1}var qi=Error(u(461)),Ie=!1;function ot(e,t,l,a){t.child=e===null?hu(t,null,l,a):ja(t,e.child,l,a)}function xd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var o={};for(var x in a)x!=="ref"&&(o[x]=a[x])}else o=a;return va(t),a=ji(e,t,l,o,r,s),x=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&x&&li(t),t.flags|=1,ot(e,t,a,s),t.child)}function md(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Pr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,pd(e,t,r,a,s)):(e=js(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Ji(e,s)){var o=r.memoizedProps;if(l=l.compare,l=l!==null?l:Nn,l(o,a)&&e.ref===t.ref)return gl(e,t,s)}return t.flags|=1,e=xl(r,a),e.ref=t.ref,e.return=t,t.child=e}function pd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(Nn(r,a)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=a=r,Ji(e,s))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,gl(e,t,s)}return Yi(e,t,l,a,s)}function hd(e,t,l,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return vd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ks(t,r!==null?r.cachePool:null),r!==null?gu(t,r):vi(),bu(t);else return a=t.lanes=536870912,vd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(ks(t,r.cachePool),gu(t,r),Vl(),t.memoizedState=null):(e!==null&&ks(t,null),vi(),Vl());return ot(e,t,s,l),t.child}function Un(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function vd(e,t,l,a,s){var r=di();return r=r===null?null:{parent:We._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&ks(t,null),vi(),bu(t),e!==null&&Va(e,t,a,!0),t.childLanes=s,null}function Ys(e,t){return t=Vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function yd(e,t,l){return ja(t,e.child,null,l),e=Ys(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function tp(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=Ys(t,a),t.lanes=536870912,Un(null,e);if(gi(t),(e=Ue)?(e=Rf(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=tu(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return t.lanes=536870912,null}return Ys(t,a)}var r=e.memoizedState;if(r!==null){var o=r.dehydrated;if(gi(t),s)if(t.flags&256)t.flags&=-257,t=yd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(Ie||Va(e,t,l,!1),s=(l&e.childLanes)!==0,Ie||s){if(a=Be,a!==null&&(o=io(a,l),o!==0&&o!==r.retryLane))throw r.retryLane=o,xa(e,o),St(a,e,o),qi;Is(),t=yd(e,t,l)}else e=r.treeContext,Ue=Yt(o.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&nu(t,e),t=Ys(t,a),t.flags|=4096;return t}return e=xl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Yi(e,t,l,a,s){return va(t),l=ji(e,t,l,a,void 0,s),a=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,s),t.child)}function gd(e,t,l,a,s,r){return va(t),t.updateQueue=null,l=Su(t,a,l,s),ju(e),a=Si(),e!==null&&!Ie?(Ni(e,t,r),gl(e,t,r)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,r),t.child)}function bd(e,t,l,a,s){if(va(t),t.stateNode===null){var r=Ha,o=l.contextType;typeof o=="object"&&o!==null&&(r=ct(o)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ui,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},xi(t),o=l.contextType,r.context=typeof o=="object"&&o!==null?ct(o):Ha,r.state=t.memoizedState,o=l.getDerivedStateFromProps,typeof o=="function"&&(Bi(t,l,o,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(o=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),o!==r.state&&Ui.enqueueReplaceState(r,r.state,null),zn(t,a,r,s),Mn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,j=Na(l,x);r.props=j;var _=r.context,L=l.contextType;o=Ha,typeof L=="object"&&L!==null&&(o=ct(L));var H=l.getDerivedStateFromProps;L=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||_!==o)&&rd(t,r,a,o),Hl=!1;var z=t.memoizedState;r.state=z,zn(t,a,r,s),Mn(),_=t.memoizedState,x||z!==_||Hl?(typeof H=="function"&&(Bi(t,l,H,a),_=t.memoizedState),(j=Hl||sd(t,l,j,a,z,_,o))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),r.props=a,r.state=_,r.context=o,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,mi(e,t),o=t.memoizedProps,L=Na(l,o),r.props=L,H=t.pendingProps,z=r.context,_=l.contextType,j=Ha,typeof _=="object"&&_!==null&&(j=ct(_)),x=l.getDerivedStateFromProps,(_=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o!==H||z!==j)&&rd(t,r,a,j),Hl=!1,z=t.memoizedState,r.state=z,zn(t,a,r,s),Mn();var O=t.memoizedState;o!==H||z!==O||Hl||e!==null&&e.dependencies!==null&&Ns(e.dependencies)?(typeof x=="function"&&(Bi(t,l,x,a),O=t.memoizedState),(L=Hl||sd(t,l,L,a,z,O,j)||e!==null&&e.dependencies!==null&&Ns(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,O,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,O,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),r.props=a,r.state=O,r.context=j,a=L):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Gs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=ja(t,e.child,null,s),t.child=ja(t,null,l,s)):ot(e,t,l,s),t.memoizedState=r.state,e=t.child):e=gl(e,t,s),e}function jd(e,t,l,a){return pa(),t.flags|=256,ot(e,t,l,a),t.child}var Gi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vi(e){return{baseLanes:e,cachePool:uu()}}function Qi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=_t),e}function Sd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,o;if((o=r)||(o=e!==null&&e.memoizedState===null?!1:(Ke.current&2)!==0),o&&(s=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Gl(t):Vl(),(e=Ue)?(e=Rf(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=tu(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return Tc(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,s?(Vl(),s=t.mode,x=Vs({mode:"hidden",children:x},s),a=ma(a,s,l,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(null,a)):(Gl(t),Xi(t,x))}var j=e.memoizedState;if(j!==null&&(x=j.dehydrated,x!==null)){if(r)t.flags&256?(Gl(t),t.flags&=-257,t=Zi(e,t,l)):t.memoizedState!==null?(Vl(),t.child=e.child,t.flags|=128,t=null):(Vl(),x=a.fallback,s=t.mode,a=Vs({mode:"visible",children:a.children},s),x=ma(x,s,l,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,ja(t,e.child,null,l),a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,t=Un(null,a));else if(Gl(t),Tc(x)){if(o=x.nextSibling&&x.nextSibling.dataset,o)var _=o.dgst;o=_,a=Error(u(419)),a.stack="",a.digest=o,Tn({value:a,source:null,stack:null}),t=Zi(e,t,l)}else if(Ie||Va(e,t,l,!1),o=(l&e.childLanes)!==0,Ie||o){if(o=Be,o!==null&&(a=io(o,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,xa(e,a),St(o,e,a),qi;kc(x)||Is(),t=Zi(e,t,l)}else kc(x)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ue=Yt(x.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&nu(t,e),t=Xi(t,a.children),t.flags|=4096);return t}return s?(Vl(),x=a.fallback,s=t.mode,j=e.child,_=j.sibling,a=xl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,_!==null?x=xl(_,x):(x=ma(x,s,l,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Un(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Vi(l):(s=x.cachePool,s!==null?(j=We._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=uu(),x={baseLanes:x.baseLanes|l,cachePool:s}),a.memoizedState=x,a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(e.child,a)):(Gl(t),l=e.child,e=l.sibling,l=xl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=l,t.memoizedState=null,l)}function Xi(e,t){return t=Vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vs(e,t){return e=Tt(22,e,null,t),e.lanes=0,e}function Zi(e,t,l){return ja(t,e.child,null,l),e=Xi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ii(e.return,t,l)}function Ki(e,t,l,a,s,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=l,o.tailMode=s,o.treeForkCount=r)}function Ed(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var o=Ke.current,x=(o&2)!==0;if(x?(o=o&1|2,t.flags|=128):o&=1,X(Ke,o),ot(e,t,a,l),a=ke?kn:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nd(e,l,t);else if(e.tag===19)Nd(e,l,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(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&Rs(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Ki(t,!1,s,l,r,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Rs(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Ki(t,!0,l,null,r,a);break;case"together":Ki(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function gl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Zl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Va(e,t,l,!1),(l&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,l=xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=xl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ji(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ns(e)))}function lp(e,t,l){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ul(t,We,e.memoizedState.cache),pa();break;case 27:case 5:Ze(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Gl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Sd(e,t,l):(Gl(t),e=gl(e,t,l),e!==null?e.sibling:null);Gl(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Va(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Ed(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),X(Ke,Ke.current),a)break;return null;case 22:return t.lanes=0,hd(e,t,l,t.pendingProps);case 24:Ul(t,We,e.memoizedState.cache)}return gl(e,t,l)}function kd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return Ie=!1,lp(e,t,l);Ie=(e.flags&131072)!==0}else Ie=!1,ke&&(t.flags&1048576)!==0&&au(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e=="function")Pr(e)?(a=Na(e,a),t.tag=1,t=bd(null,t,e,a,l)):(t.tag=0,t=Yi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===G){t.tag=11,t=xd(null,t,e,a,l);break e}else if(s===F){t.tag=14,t=md(null,t,e,a,l);break e}}throw t=ue(e)||e,Error(u(306,t,""))}}return t;case 0:return Yi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=Na(a,t.pendingProps),bd(e,t,a,s,l);case 3:e:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,mi(e,t),zn(t,a,null,l);var o=t.memoizedState;if(a=o.cache,Ul(t,We,a),a!==r.cache&&ci(t,[We],l,!0),Mn(),a=o.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=jd(e,t,a,l);break e}else if(a!==s){s=Lt(Error(u(424)),t),Tn(s),t=jd(e,t,a,l);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(Ue=Yt(e.firstChild),it=t,ke=!0,Ll=null,Ht=!0,l=hu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(pa(),a===s){t=gl(e,t,l);break e}ot(e,t,a,l)}t=t.child}return t;case 26:return Gs(e,t),e===null?(l=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=l:ke||(l=t.type,e=t.pendingProps,a=sr(Y.current).createElement(l),a[rt]=t,a[ht]=e,ut(a,l,e),nt(a),t.stateNode=a):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ze(t),e===null&&ke&&(a=t.stateNode=Of(t.type,t.pendingProps,Y.current),it=t,Ht=!0,s=Ue,Fl(t.type)?(Cc=s,Ue=Yt(a.firstChild)):Ue=s),ot(e,t,t.pendingProps.children,l),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=a=Ue)&&(a=Mp(a,t.type,t.pendingProps,Ht),a!==null?(t.stateNode=a,it=t,Ue=Yt(a.firstChild),Ht=!1,s=!0):s=!1),s||Bl(t)),Ze(t),s=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,a=r.children,Sc(s,r)?a=null:o!==null&&Sc(s,o)&&(t.flags|=32),t.memoizedState!==null&&(s=ji(e,t,Km,null,null,l),Pn._currentValue=s),Gs(e,t),ot(e,t,a,l),t.child;case 6:return e===null&&ke&&((e=l=Ue)&&(l=zp(l,t.pendingProps,Ht),l!==null?(t.stateNode=l,it=t,Ue=null,e=!0):e=!1),e||Bl(t)),null;case 13:return Sd(e,t,l);case 4:return de(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ja(t,null,a,l):ot(e,t,a,l),t.child;case 11:return xd(e,t,t.type,t.pendingProps,l);case 7:return ot(e,t,t.pendingProps,l),t.child;case 8:return ot(e,t,t.pendingProps.children,l),t.child;case 12:return ot(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Ul(t,t.type,a.value),ot(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,va(t),s=ct(s),a=a(s),t.flags|=1,ot(e,t,a,l),t.child;case 14:return md(e,t,t.type,t.pendingProps,l);case 15:return pd(e,t,t.type,t.pendingProps,l);case 19:return Ed(e,t,l);case 31:return tp(e,t,l);case 22:return hd(e,t,l,t.pendingProps);case 24:return va(t),a=ct(We),e===null?(s=di(),s===null&&(s=Be,r=oi(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},xi(t),Ul(t,We,s)):((e.lanes&l)!==0&&(mi(e,t),zn(t,null,null,l),Mn()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ul(t,We,a)):(a=r.cache,Ul(t,We,a),a!==s.cache&&ci(t,[We],l,!0))),ot(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function bl(e){e.flags|=4}function $i(e,t,l,a,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Id())e.flags|=8192;else throw ba=Cs,fi}else e.flags&=-16777217}function Td(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t))if(Id())e.flags|=8192;else throw ba=Cs,fi}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fn():536870912,e.lanes|=t,tn|=t)}function Hn(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function ap(e,t,l){var a=t.pendingProps;switch(ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hl(We),me(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ga(t)?bl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,si())),He(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(bl(t),r!==null?(He(t),Td(t,r)):(He(t),$i(t,s,null,a,l))):r?r!==e.memoizedState?(bl(t),He(t),Td(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&bl(t),He(t),$i(t,s,e,a,l)),null;case 27:if(et(t),l=Y.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}e=M.current,Ga(t)?su(t):(e=Of(s,a,l),t.stateNode=e,bl(t))}return He(t),null;case 5:if(et(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}if(r=M.current,Ga(t))su(t);else{var o=sr(Y.current);switch(r){case 1:r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=o.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?o.createElement(s,{is:a.is}):o.createElement(s)}}r[rt]=t,r[ht]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)r.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=r;e:switch(ut(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&bl(t)}}return He(t),$i(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=Y.current,Ga(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=it,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[rt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Nf(e.nodeValue,l)),e||Bl(t,!0)}else e=sr(e).createTextNode(a),e[rt]=t,t.stateNode=e}return He(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ga(t),l!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else l=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(At(t),t):(At(t),null);if((t.flags&128)!==0)throw Error(u(558))}return He(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ga(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),s=!1}else s=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(At(t),t):(At(t),null)}return At(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Qs(t,t.updateQueue),He(t),null);case 4:return me(),e===null&&vc(t.stateNode.containerInfo),He(t),null;case 10:return hl(t.type),He(t),null;case 19:if(D(Ke),a=t.memoizedState,a===null)return He(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Hn(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Rs(e),r!==null){for(t.flags|=128,Hn(a,!1),e=r.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)eu(l,e),l=l.sibling;return X(Ke,Ke.current&1|2),ke&&ml(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ze()>$s&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Rs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!ke)return He(t),null}else 2*ze()-a.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ze(),e.sibling=null,l=Ke.current,X(Ke,s?l&1|2:l&1),ke&&ml(t,a.treeForkCount),e):(He(t),null);case 22:case 23:return At(t),yi(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),l=t.updateQueue,l!==null&&Qs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(ya),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),hl(We),He(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function np(e,t){switch(ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hl(We),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return et(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(u(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ke),null;case 4:return me(),null;case 10:return hl(t.type),null;case 22:case 23:return At(t),yi(),e!==null&&D(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hl(We),null;case 25:return null;default:return null}}function Cd(e,t){switch(ai(t),t.tag){case 3:hl(We),me();break;case 26:case 27:case 5:et(t);break;case 4:me();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:D(Ke);break;case 10:hl(t.type);break;case 22:case 23:At(t),yi(),e!==null&&D(ya);break;case 24:hl(We)}}function qn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var r=l.create,o=l.inst;a=r(),o.destroy=a}l=l.next}while(l!==s)}}catch(x){Me(t,t.return,x)}}function Ql(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var o=a.inst,x=o.destroy;if(x!==void 0){o.destroy=void 0,s=t;var j=l,_=x;try{_()}catch(L){Me(s,j,L)}}}a=a.next}while(a!==r)}}catch(L){Me(t,t.return,L)}}function Ad(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{yu(t,l)}catch(a){Me(e,e.return,a)}}}function wd(e,t,l){l.props=Na(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Me(e,t,a)}}function Yn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){Me(e,t,s)}}function ll(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Me(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Me(e,t,s)}else l.current=null}function _d(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){Me(e,e.return,s)}}function Wi(e,t,l){try{var a=e.stateNode;Tp(a,e.type,l,t),a[ht]=t}catch(s){Me(e,e.return,s)}}function Rd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fl(e.type)||e.tag===4}function Fi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rd(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&&Fl(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 Ii(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=dl));else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Ii(e,t,l),e=e.sibling;e!==null;)Ii(e,t,l),e=e.sibling}function Xs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Xs(e,t,l),e=e.sibling;e!==null;)Xs(e,t,l),e=e.sibling}function Md(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ut(t,a,l),t[rt]=e,t[ht]=l}catch(r){Me(e,e.return,r)}}var jl=!1,Pe=!1,Pi=!1,zd=typeof WeakSet=="function"?WeakSet:Set,st=null;function sp(e,t){if(e=e.containerInfo,bc=fr,e=Xo(e),Zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break e}var o=0,x=-1,j=-1,_=0,L=0,H=e,z=null;t:for(;;){for(var O;H!==l||s!==0&&H.nodeType!==3||(x=o+s),H!==r||a!==0&&H.nodeType!==3||(j=o+a),H.nodeType===3&&(o+=H.nodeValue.length),(O=H.firstChild)!==null;)z=H,H=O;for(;;){if(H===e)break t;if(z===l&&++_===s&&(x=o),z===r&&++L===a&&(j=o),(O=H.nextSibling)!==null)break;H=z,z=H.parentNode}H=O}l=x===-1||j===-1?null:{start:x,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(jc={focusedElem:e,selectionRange:l},fr=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,r=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(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,l=t,s=r.memoizedProps,r=r.memoizedState,a=l.stateNode;try{var te=Na(l.type,s);e=a.getSnapshotBeforeUpdate(te,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Me(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ec(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ec(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,st=e;break}st=t.return}}function Od(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Nl(e,l),a&4&&qn(5,l);break;case 1:if(Nl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(o){Me(l,l.return,o)}else{var s=Na(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Me(l,l.return,o)}}a&64&&Ad(l),a&512&&Yn(l,l.return);break;case 3:if(Nl(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{yu(e,t)}catch(o){Me(l,l.return,o)}}break;case 27:t===null&&a&4&&Md(l);case 26:case 5:Nl(e,l),t===null&&a&4&&_d(l),a&512&&Yn(l,l.return);break;case 12:Nl(e,l);break;case 31:Nl(e,l),a&4&&Bd(e,l);break;case 13:Nl(e,l),a&4&&Ud(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=mp.bind(null,l),Op(e,l))));break;case 22:if(a=l.memoizedState!==null||jl,!a){t=t!==null&&t.memoizedState!==null||Pe,s=jl;var r=Pe;jl=a,(Pe=t)&&!r?El(e,l,(l.subtreeFlags&8772)!==0):Nl(e,l),jl=s,Pe=r}break;case 30:break;default:Nl(e,l)}}function Dd(e){var t=e.alternate;t!==null&&(e.alternate=null,Dd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wr(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 Ye=null,yt=!1;function Sl(e,t,l){for(l=l.child;l!==null;)Ld(e,t,l),l=l.sibling}function Ld(e,t,l){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(Mt,l)}catch{}switch(l.tag){case 26:Pe||ll(l,t),Sl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pe||ll(l,t);var a=Ye,s=yt;Fl(l.type)&&(Ye=l.stateNode,yt=!1),Sl(e,t,l),Wn(l.stateNode),Ye=a,yt=s;break;case 5:Pe||ll(l,t);case 6:if(a=Ye,s=yt,Ye=null,Sl(e,t,l),Ye=a,yt=s,Ye!==null)if(yt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(l.stateNode)}catch(r){Me(l,t,r)}else try{Ye.removeChild(l.stateNode)}catch(r){Me(l,t,r)}break;case 18:Ye!==null&&(yt?(e=Ye,wf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),un(e)):wf(Ye,l.stateNode));break;case 4:a=Ye,s=yt,Ye=l.stateNode.containerInfo,yt=!0,Sl(e,t,l),Ye=a,yt=s;break;case 0:case 11:case 14:case 15:Ql(2,l,t),Pe||Ql(4,l,t),Sl(e,t,l);break;case 1:Pe||(ll(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&wd(l,t,a)),Sl(e,t,l);break;case 21:Sl(e,t,l);break;case 22:Pe=(a=Pe)||l.memoizedState!==null,Sl(e,t,l),Pe=a;break;default:Sl(e,t,l)}}function Bd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{un(e)}catch(l){Me(t,t.return,l)}}}function Ud(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{un(e)}catch(l){Me(t,t.return,l)}}function rp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zd),t;default:throw Error(u(435,e.tag))}}function Zs(e,t){var l=rp(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=pp.bind(null,e,a);a.then(s,s)}})}function gt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,o=t,x=o;e:for(;x!==null;){switch(x.tag){case 27:if(Fl(x.type)){Ye=x.stateNode,yt=!1;break e}break;case 5:Ye=x.stateNode,yt=!1;break e;case 3:case 4:Ye=x.stateNode.containerInfo,yt=!0;break e}x=x.return}if(Ye===null)throw Error(u(160));Ld(r,o,s),Ye=null,yt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Hd(t,e),t=t.sibling}var Kt=null;function Hd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),bt(e),a&4&&(Ql(3,e,e.return),qn(3,e),Ql(5,e,e.return));break;case 1:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&64&&jl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=Kt;if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&4){var r=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[mn]||r[rt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ut(r,a,l),r[rt]=e,nt(r),a=r;break e;case"link":var o=qf("link","href",s).get(a+(l.href||""));if(o){for(var x=0;x<o.length;x++)if(r=o[x],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;case"meta":if(o=qf("meta","content",s).get(a+(l.content||""))){for(x=0;x<o.length;x++)if(r=o[x],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[rt]=e,nt(r),a=r}e.stateNode=a}else Yf(s,e.type,e.stateNode);else e.stateNode=Hf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Yf(s,e.type,e.stateNode):Hf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Wi(e,e.memoizedProps,l.memoizedProps)}break;case 27:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),l!==null&&a&4&&Wi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),e.flags&32){s=e.stateNode;try{Ma(s,"")}catch(te){Me(e,e.return,te)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Wi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Pi=!0);break;case 6:if(gt(t,e),bt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(te){Me(e,e.return,te)}}break;case 3:if(cr=null,s=Kt,Kt=rr(t.containerInfo),gt(t,e),Kt=s,bt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(te){Me(e,e.return,te)}Pi&&(Pi=!1,qd(e));break;case 4:a=Kt,Kt=rr(e.stateNode.containerInfo),gt(t,e),bt(e),Kt=a;break;case 12:gt(t,e),bt(e);break;case 31:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 13:gt(t,e),bt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Js=ze()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,_=jl,L=Pe;if(jl=_||s,Pe=L||j,gt(t,e),Pe=L,jl=_,bt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||jl||Pe||Ea(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{x=j.stateNode;var H=j.memoizedProps.style,z=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(te){Me(j,j.return,te)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(te){Me(j,j.return,te)}}}else if(t.tag===18){if(l===null){j=t;try{var O=j.stateNode;s?_f(O,!0):_f(j.stateNode,!1)}catch(te){Me(j,j.return,te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Zs(e,l))));break;case 19:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 30:break;case 21:break;default:gt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Rd(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Fi(e);Xs(e,r,s);break;case 5:var o=l.stateNode;l.flags&32&&(Ma(o,""),l.flags&=-33);var x=Fi(e);Xs(e,x,o);break;case 3:case 4:var j=l.stateNode.containerInfo,_=Fi(e);Ii(e,_,j);break;default:throw Error(u(161))}}catch(L){Me(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Od(e,t.alternate,t),t=t.sibling}function Ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ql(4,t,t.return),Ea(t);break;case 1:ll(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&wd(t,t.return,l),Ea(t);break;case 27:Wn(t.stateNode);case 26:case 5:ll(t,t.return),Ea(t);break;case 22:t.memoizedState===null&&Ea(t);break;case 30:Ea(t);break;default:Ea(t)}e=e.sibling}}function El(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,o=r.flags;switch(r.tag){case 0:case 11:case 15:El(s,r,l),qn(4,r);break;case 1:if(El(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){Me(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var x=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)vu(j[s],x)}catch(_){Me(a,a.return,_)}}l&&o&64&&Ad(r),Yn(r,r.return);break;case 27:Md(r);case 26:case 5:El(s,r,l),l&&a===null&&o&4&&_d(r),Yn(r,r.return);break;case 12:El(s,r,l);break;case 31:El(s,r,l),l&&o&4&&Bd(s,r);break;case 13:El(s,r,l),l&&o&4&&Ud(s,r);break;case 22:r.memoizedState===null&&El(s,r,l),Yn(r,r.return);break;case 30:break;default:El(s,r,l)}t=t.sibling}}function ec(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Cn(l))}function tc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e))}function Jt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yd(e,t,l,a),t=t.sibling}function Yd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,l,a),s&2048&&qn(9,t);break;case 1:Jt(e,t,l,a);break;case 3:Jt(e,t,l,a),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e)));break;case 12:if(s&2048){Jt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,o=r.id,x=r.onPostCommit;typeof x=="function"&&x(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Me(t,t.return,j)}}else Jt(e,t,l,a);break;case 31:Jt(e,t,l,a);break;case 13:Jt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,o=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,l,a):Gn(e,t):r._visibility&2?Jt(e,t,l,a):(r._visibility|=2,Ia(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&ec(o,t);break;case 24:Jt(e,t,l,a),s&2048&&tc(t.alternate,t);break;default:Jt(e,t,l,a)}}function Ia(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,o=t,x=l,j=a,_=o.flags;switch(o.tag){case 0:case 11:case 15:Ia(r,o,x,j,s),qn(8,o);break;case 23:break;case 22:var L=o.stateNode;o.memoizedState!==null?L._visibility&2?Ia(r,o,x,j,s):Gn(r,o):(L._visibility|=2,Ia(r,o,x,j,s)),s&&_&2048&&ec(o.alternate,o);break;case 24:Ia(r,o,x,j,s),s&&_&2048&&tc(o.alternate,o);break;default:Ia(r,o,x,j,s)}t=t.sibling}}function Gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,s=a.flags;switch(a.tag){case 22:Gn(l,a),s&2048&&ec(a.alternate,a);break;case 24:Gn(l,a),s&2048&&tc(a.alternate,a);break;default:Gn(l,a)}t=t.sibling}}var Vn=8192;function Pa(e,t,l){if(e.subtreeFlags&Vn)for(e=e.child;e!==null;)Gd(e,t,l),e=e.sibling}function Gd(e,t,l){switch(e.tag){case 26:Pa(e,t,l),e.flags&Vn&&e.memoizedState!==null&&Zp(l,Kt,e.memoizedState,e.memoizedProps);break;case 5:Pa(e,t,l);break;case 3:case 4:var a=Kt;Kt=rr(e.stateNode.containerInfo),Pa(e,t,l),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Vn,Vn=16777216,Pa(e,t,l),Vn=a):Pa(e,t,l));break;default:Pa(e,t,l)}}function Vd(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 Qn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,Xd(a,e)}Vd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qd(e),e=e.sibling}function Qd(e){switch(e.tag){case 0:case 11:case 15:Qn(e),e.flags&2048&&Ql(9,e,e.return);break;case 3:Qn(e);break;case 12:Qn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ks(e)):Qn(e);break;default:Qn(e)}}function Ks(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,Xd(a,e)}Vd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ql(8,t,t.return),Ks(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ks(t));break;default:Ks(t)}e=e.sibling}}function Xd(e,t){for(;st!==null;){var l=st;switch(l.tag){case 0:case 11:case 15:Ql(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Cn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,st=a;else e:for(l=e;st!==null;){a=st;var s=a.sibling,r=a.return;if(Dd(a),a===l){st=null;break e}if(s!==null){s.return=r,st=s;break e}st=r}}}var ip={getCacheForType:function(e){var t=ct(We),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ct(We).controller.signal}},cp=typeof WeakMap=="function"?WeakMap:Map,we=0,Be=null,be=null,Se=0,Re=0,wt=null,Xl=!1,en=!1,lc=!1,kl=0,Xe=0,Zl=0,ka=0,ac=0,_t=0,tn=0,Xn=null,jt=null,nc=!1,Js=0,Zd=0,$s=1/0,Ws=null,Kl=null,lt=0,Jl=null,ln=null,Tl=0,sc=0,rc=null,Kd=null,Zn=0,ic=null;function Rt(){return(we&2)!==0&&Se!==0?Se&-Se:N.T!==null?xc():co()}function Jd(){if(_t===0)if((Se&536870912)===0||ke){var e=ol;ol<<=1,(ol&3932160)===0&&(ol=262144),_t=e}else _t=536870912;return e=Ct.current,e!==null&&(e.flags|=32),_t}function St(e,t,l){(e===Be&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(an(e,0),$l(e,Se,_t,!1)),ca(e,l),((we&2)===0||e!==Be)&&(e===Be&&((we&2)===0&&(ka|=l),Xe===4&&$l(e,Se,_t,!1)),al(e))}function $d(e,t,l){if((we&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Ml(e,t),s=a?dp(e,t):oc(e,t,!0),r=a;do{if(s===0){en&&!a&&$l(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!op(l)){s=oc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var x=e;s=Xn;var j=x.current.memoizedState.isDehydrated;if(j&&(an(x,o).flags|=256),o=oc(x,o,!1),o!==2){if(lc&&!j){x.errorRecoveryDisabledLanes|=r,ka|=r,s=4;break e}r=jt,jt=s,r!==null&&(jt===null?jt=r:jt.push.apply(jt,r))}s=o}if(r=!1,s!==2)continue}}if(s===1){an(e,0),$l(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:$l(a,t,_t,!Xl);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Js+300-ze(),10<s)){if($l(a,t,_t,!Xl),ia(a,0,!0)!==0)break e;Tl=t,a.timeoutHandle=Cf(Wd.bind(null,a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,"Throttled",-0,0),s);break e}Wd(a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,null,-0,0)}}break}while(!0);al(e)}function Wd(e,t,l,a,s,r,o,x,j,_,L,H,z,O){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dl},Gd(t,r,H);var te=(r&62914560)===r?Js-ze():(r&4194048)===r?Zd-ze():0;if(te=Kp(H,te),te!==null){Tl=r,e.cancelPendingCommit=te(nf.bind(null,e,t,r,l,a,s,o,x,j,L,H,null,z,O)),$l(e,r,o,!_);return}}nf(e,t,r,l,a,s,o,x,j)}function op(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var s=l[a],r=s.getSnapshot;s=s.value;try{if(!kt(r(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 $l(e,t,l,a){t&=~ac,t&=~ka,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Ge(s),o=1<<r;a[r]=-1,s&=~o}l!==0&&so(e,l,t)}function Fs(){return(we&6)===0?(Kn(0),!1):!0}function cc(){if(be!==null){if(Re===0)var e=be.return;else e=be,pl=ha=null,Ei(e),Ka=null,wn=0,e=be;for(;e!==null;)Cd(e.alternate,e),e=e.return;be=null}}function an(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,wp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Tl=0,cc(),Be=e,be=l=xl(e.current,null),Se=t,Re=0,wt=null,Xl=!1,en=Ml(e,t),lc=!1,tn=_t=ac=ka=Zl=Xe=0,jt=Xn=null,nc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Ge(a),r=1<<s;t|=e[s],a&=~r}return kl=t,ys(),l}function Fd(e,t){xe=null,N.H=Bn,t===Za||t===Ts?(t=xu(),Re=3):t===fi?(t=xu(),Re=4):Re=t===qi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wt=t,be===null&&(Xe=1,qs(e,Lt(t,e.current)))}function Id(){var e=Ct.current;return e===null?!0:(Se&4194048)===Se?qt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===qt:!1}function Pd(){var e=N.H;return N.H=Bn,e===null?Bn:e}function ef(){var e=N.A;return N.A=ip,e}function Is(){Xe=4,Xl||(Se&4194048)!==Se&&Ct.current!==null||(en=!0),(Zl&134217727)===0&&(ka&134217727)===0||Be===null||$l(Be,Se,_t,!1)}function oc(e,t,l){var a=we;we|=2;var s=Pd(),r=ef();(Be!==e||Se!==t)&&(Ws=null,an(e,t)),t=!1;var o=Xe;e:do try{if(Re!==0&&be!==null){var x=be,j=wt;switch(Re){case 8:cc(),o=6;break e;case 3:case 2:case 9:case 6:Ct.current===null&&(t=!0);var _=Re;if(Re=0,wt=null,nn(e,x,j,_),l&&en){o=0;break e}break;default:_=Re,Re=0,wt=null,nn(e,x,j,_)}}up(),o=Xe;break}catch(L){Fd(e,L)}while(!0);return t&&e.shellSuspendCounter++,pl=ha=null,we=a,N.H=s,N.A=r,be===null&&(Be=null,Se=0,ys()),o}function up(){for(;be!==null;)tf(be)}function dp(e,t){var l=we;we|=2;var a=Pd(),s=ef();Be!==e||Se!==t?(Ws=null,$s=ze()+500,an(e,t)):en=Ml(e,t);e:do try{if(Re!==0&&be!==null){t=be;var r=wt;t:switch(Re){case 1:Re=0,wt=null,nn(e,t,r,1);break;case 2:case 9:if(du(r)){Re=0,wt=null,lf(t);break}t=function(){Re!==2&&Re!==9||Be!==e||(Re=7),al(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:du(r)?(Re=0,wt=null,lf(t)):(Re=0,wt=null,nn(e,t,r,7));break;case 5:var o=null;switch(be.tag){case 26:o=be.memoizedState;case 5:case 27:var x=be;if(o?Gf(o):x.stateNode.complete){Re=0,wt=null;var j=x.sibling;if(j!==null)be=j;else{var _=x.return;_!==null?(be=_,Ps(_)):be=null}break t}}Re=0,wt=null,nn(e,t,r,5);break;case 6:Re=0,wt=null,nn(e,t,r,6);break;case 8:cc(),Xe=6;break e;default:throw Error(u(462))}}fp();break}catch(L){Fd(e,L)}while(!0);return pl=ha=null,N.H=a,N.A=s,we=l,be!==null?0:(Be=null,Se=0,ys(),Xe)}function fp(){for(;be!==null&&!il();)tf(be)}function tf(e){var t=kd(e.alternate,e,kl);e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function lf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=gd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=gd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Ei(t);default:Cd(l,t),t=be=eu(t,kl),t=kd(l,t,kl)}e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function nn(e,t,l,a){pl=ha=null,Ei(t),Ka=null,wn=0;var s=t.return;try{if(ep(e,s,t,l,Se)){Xe=1,qs(e,Lt(l,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Xe=1,qs(e,Lt(l,e.current)),be=null;return}t.flags&32768?(ke||a===1?e=!0:en||(Se&536870912)!==0?e=!1:(Xl=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ct.current,a!==null&&a.tag===13&&(a.flags|=16384))),af(t,e)):Ps(t)}function Ps(e){var t=e;do{if((t.flags&32768)!==0){af(t,Xl);return}e=t.return;var l=ap(t.alternate,t,kl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Xe===0&&(Xe=5)}function af(e,t){do{var l=np(e.alternate,e);if(l!==null){l.flags&=32767,be=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=l}while(e!==null);Xe=6,be=null}function nf(e,t,l,a,s,r,o,x,j){e.cancelPendingCommit=null;do er();while(lt!==0);if((we&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Fr,Xx(e,l,r,o,x,j),e===Be&&(be=Be=null,Se=0),ln=t,Jl=e,Tl=l,sc=r,rc=s,Kd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,hp(_e,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=N.T,N.T=null,s=A.p,A.p=2,o=we,we|=4;try{sp(e,t,l)}finally{we=o,A.p=s,N.T=a}}lt=1,sf(),rf(),cf()}}function sf(){if(lt===1){lt=0;var e=Jl,t=ln,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Hd(t,e);var r=jc,o=Xo(e.containerInfo),x=r.focusedElem,j=r.selectionRange;if(o!==x&&x&&x.ownerDocument&&Qo(x.ownerDocument.documentElement,x)){if(j!==null&&Zr(x)){var _=j.start,L=j.end;if(L===void 0&&(L=_),"selectionStart"in x)x.selectionStart=_,x.selectionEnd=Math.min(L,x.value.length);else{var H=x.ownerDocument||document,z=H&&H.defaultView||window;if(z.getSelection){var O=z.getSelection(),te=x.textContent.length,oe=Math.min(j.start,te),Le=j.end===void 0?oe:Math.min(j.end,te);!O.extend&&oe>Le&&(o=Le,Le=oe,oe=o);var T=Vo(x,oe),k=Vo(x,Le);if(T&&k&&(O.rangeCount!==1||O.anchorNode!==T.node||O.anchorOffset!==T.offset||O.focusNode!==k.node||O.focusOffset!==k.offset)){var w=H.createRange();w.setStart(T.node,T.offset),O.removeAllRanges(),oe>Le?(O.addRange(w),O.extend(k.node,k.offset)):(w.setEnd(k.node,k.offset),O.addRange(w))}}}}for(H=[],O=x;O=O.parentNode;)O.nodeType===1&&H.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var U=H[x];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}fr=!!bc,jc=bc=null}finally{we=s,A.p=a,N.T=l}}e.current=t,lt=2}}function rf(){if(lt===2){lt=0;var e=Jl,t=ln,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Od(e,t.alternate,t)}finally{we=s,A.p=a,N.T=l}}lt=3}}function cf(){if(lt===4||lt===3){lt=0,P();var e=Jl,t=ln,l=Tl,a=Kd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,ln=Jl=null,of(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Kl=null),Cr(l),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(Mt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=N.T,s=A.p,A.p=2,N.T=null;try{for(var r=e.onRecoverableError,o=0;o<a.length;o++){var x=a[o];r(x.value,{componentStack:x.stack})}}finally{N.T=t,A.p=s}}(Tl&3)!==0&&er(),al(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===ic?Zn++:(Zn=0,ic=e):Zn=0,Kn(0)}}function of(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cn(t)))}function er(){return sf(),rf(),cf(),uf()}function uf(){if(lt!==5)return!1;var e=Jl,t=sc;sc=0;var l=Cr(Tl),a=N.T,s=A.p;try{A.p=32>l?32:l,N.T=null,l=rc,rc=null;var r=Jl,o=Tl;if(lt=0,ln=Jl=null,Tl=0,(we&6)!==0)throw Error(u(331));var x=we;if(we|=4,Qd(r.current),Yd(r,r.current,o,l),we=x,Kn(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(Mt,r)}catch{}return!0}finally{A.p=s,N.T=a,of(e,t)}}function df(e,t,l){t=Lt(l,t),t=Hi(e.stateNode,t,2),e=Yl(e,t,2),e!==null&&(ca(e,2),al(e))}function Me(e,t,l){if(e.tag===3)df(e,e,l);else for(;t!==null;){if(t.tag===3){df(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Kl===null||!Kl.has(a))){e=Lt(l,e),l=dd(2),a=Yl(t,l,2),a!==null&&(fd(l,a,t,e),ca(a,2),al(a));break}}t=t.return}}function uc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new cp;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(lc=!0,s.add(l),e=xp.bind(null,e,t,l),t.then(e,e))}function xp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Be===e&&(Se&l)===l&&(Xe===4||Xe===3&&(Se&62914560)===Se&&300>ze()-Js?(we&2)===0&&an(e,0):ac|=l,tn===Se&&(tn=0)),al(e)}function ff(e,t){t===0&&(t=fn()),e=xa(e,t),e!==null&&(ca(e,t),al(e))}function mp(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),ff(e,l)}function pp(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),ff(e,l)}function hp(e,t){return Vt(e,t)}var tr=null,sn=null,dc=!1,lr=!1,fc=!1,Wl=0;function al(e){e!==sn&&e.next===null&&(sn===null?tr=sn=e:sn=sn.next=e),lr=!0,dc||(dc=!0,yp())}function Kn(e,t){if(!fc&&lr){fc=!0;do for(var l=!1,a=tr;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var o=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-Ge(42|e)+1)-1,r&=s&~(o&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,hf(a,r))}else r=Se,r=ia(a,a===Be?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||Ml(a,r)||(l=!0,hf(a,r));a=a.next}while(l);fc=!1}}function vp(){xf()}function xf(){lr=dc=!1;var e=0;Wl!==0&&Ap()&&(e=Wl);for(var t=ze(),l=null,a=tr;a!==null;){var s=a.next,r=mf(a,t);r===0?(a.next=null,l===null?tr=s:l.next=s,s===null&&(sn=l)):(l=a,(e!==0||(r&3)!==0)&&(lr=!0)),a=s}lt!==0&&lt!==5||Kn(e),Wl!==0&&(Wl=0)}function mf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var o=31-Ge(r),x=1<<o,j=s[o];j===-1?((x&l)===0||(x&a)!==0)&&(s[o]=rs(x,t)):j<=t&&(e.expiredLanes|=x),r&=~x}if(t=Be,l=Se,l=ia(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Rl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ml(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Rl(a),Cr(l)){case 2:case 8:l=$;break;case 32:l=_e;break;case 268435456:l=Nt;break;default:l=_e}return a=pf.bind(null,e),l=Vt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Rl(a),e.callbackPriority=2,e.callbackNode=null,2}function pf(e,t){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(er()&&e.callbackNode!==l)return null;var a=Se;return a=ia(e,e===Be?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:($d(e,a,t),mf(e,ze()),e.callbackNode!=null&&e.callbackNode===l?pf.bind(null,e):null)}function hf(e,t){if(er())return null;$d(e,t,!0)}function yp(){_p(function(){(we&6)!==0?Vt(Qt,vp):xf()})}function xc(){if(Wl===0){var e=Qa;e===0&&(e=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Wl=e}return Wl}function vf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:us(""+e)}function yf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function gp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=vf((s[ht]||null).action),o=a.submitter;o&&(t=(t=o[ht]||null)?vf(t.formAction):o.getAttribute("formAction"),t!==null&&(r=t,o=null));var x=new ms("action","action",null,a,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Wl!==0){var j=o?yf(s,o):new FormData(s);zi(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(x.preventDefault(),j=o?yf(s,o):new FormData(s),zi(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var mc=0;mc<Wr.length;mc++){var pc=Wr[mc],bp=pc.toLowerCase(),jp=pc[0].toUpperCase()+pc.slice(1);Zt(bp,"on"+jp)}Zt(Jo,"onAnimationEnd"),Zt($o,"onAnimationIteration"),Zt(Wo,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Bm,"onTransitionRun"),Zt(Um,"onTransitionStart"),Zt(Hm,"onTransitionCancel"),Zt(Fo,"onTransitionEnd"),_a("onMouseEnter",["mouseout","mouseover"]),_a("onMouseLeave",["mouseout","mouseover"]),_a("onPointerEnter",["pointerout","pointerover"]),_a("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),Sp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function gf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var o=a.length-1;0<=o;o--){var x=a[o],j=x.instance,_=x.currentTarget;if(x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}else for(o=0;o<a.length;o++){if(x=a[o],j=x.instance,_=x.currentTarget,x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}}}}function je(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var a=e+"__bubble";l.has(a)||(bf(t,e,2,!1),l.add(a))}function hc(e,t,l){var a=0;t&&(a|=4),bf(l,e,a,t)}var ar="_reactListening"+Math.random().toString(36).slice(2);function vc(e){if(!e[ar]){e[ar]=!0,fo.forEach(function(l){l!=="selectionchange"&&(Sp.has(l)||hc(l,!1,e),hc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ar]||(t[ar]=!0,hc("selectionchange",!1,t))}}function bf(e,t,l,a){switch($f(t)){case 2:var s=Wp;break;case 8:s=Fp;break;default:s=Mc}l=s.bind(null,t,l,e),s=void 0,!Br||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function yc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var o=a.tag;if(o===3||o===4){var x=a.stateNode.containerInfo;if(x===s)break;if(o===4)for(o=a.return;o!==null;){var j=o.tag;if((j===3||j===4)&&o.stateNode.containerInfo===s)return;o=o.return}for(;x!==null;){if(o=Ca(x),o===null)return;if(j=o.tag,j===5||j===6||j===26||j===27){a=r=o;continue e}x=x.parentNode}}a=a.return}Eo(function(){var _=r,L=Dr(l),H=[];e:{var z=Io.get(e);if(z!==void 0){var O=ms,te=e;switch(e){case"keypress":if(fs(l)===0)break e;case"keydown":case"keyup":O=pm;break;case"focusin":te="focus",O=Yr;break;case"focusout":te="blur",O=Yr;break;case"beforeblur":case"afterblur":O=Yr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Co;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=am;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ym;break;case Jo:case $o:case Wo:O=rm;break;case Fo:O=bm;break;case"scroll":case"scrollend":O=tm;break;case"wheel":O=Sm;break;case"copy":case"cut":case"paste":O=cm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=wo;break;case"toggle":case"beforetoggle":O=Em}var oe=(t&4)!==0,Le=!oe&&(e==="scroll"||e==="scrollend"),T=oe?z!==null?z+"Capture":null:z;oe=[];for(var k=_,w;k!==null;){var U=k;if(w=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||w===null||T===null||(U=hn(k,T),U!=null&&oe.push($n(k,U,w))),Le)break;k=k.return}0<oe.length&&(z=new O(z,te,null,l,L),H.push({event:z,listeners:oe}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",z&&l!==Or&&(te=l.relatedTarget||l.fromElement)&&(Ca(te)||te[Ta]))break e;if((O||z)&&(z=L.window===L?L:(z=L.ownerDocument)?z.defaultView||z.parentWindow:window,O?(te=l.relatedTarget||l.toElement,O=_,te=te?Ca(te):null,te!==null&&(Le=h(te),oe=te.tag,te!==Le||oe!==5&&oe!==27&&oe!==6)&&(te=null)):(O=null,te=_),O!==te)){if(oe=Co,U="onMouseLeave",T="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(oe=wo,U="onPointerLeave",T="onPointerEnter",k="pointer"),Le=O==null?z:pn(O),w=te==null?z:pn(te),z=new oe(U,k+"leave",O,l,L),z.target=Le,z.relatedTarget=w,U=null,Ca(L)===_&&(oe=new oe(T,k+"enter",te,l,L),oe.target=w,oe.relatedTarget=Le,U=oe),Le=U,O&&te)t:{for(oe=Np,T=O,k=te,w=0,U=T;U;U=oe(U))w++;U=0;for(var ie=k;ie;ie=oe(ie))U++;for(;0<w-U;)T=oe(T),w--;for(;0<U-w;)k=oe(k),U--;for(;w--;){if(T===k||k!==null&&T===k.alternate){oe=T;break t}T=oe(T),k=oe(k)}oe=null}else oe=null;O!==null&&jf(H,z,O,oe,!1),te!==null&&Le!==null&&jf(H,Le,te,oe,!0)}}e:{if(z=_?pn(_):window,O=z.nodeName&&z.nodeName.toLowerCase(),O==="select"||O==="input"&&z.type==="file")var Ce=Bo;else if(Do(z))if(Uo)Ce=Om;else{Ce=Mm;var ne=Rm}else O=z.nodeName,!O||O.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?_&&zr(_.elementType)&&(Ce=Bo):Ce=zm;if(Ce&&(Ce=Ce(e,_))){Lo(H,Ce,l,L);break e}ne&&ne(e,z,_),e==="focusout"&&_&&z.type==="number"&&_.memoizedProps.value!=null&&Mr(z,"number",z.value)}switch(ne=_?pn(_):window,e){case"focusin":(Do(ne)||ne.contentEditable==="true")&&(La=ne,Kr=_,En=null);break;case"focusout":En=Kr=La=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Zo(H,l,L);break;case"selectionchange":if(Lm)break;case"keydown":case"keyup":Zo(H,l,L)}var pe;if(Vr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Da?zo(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(_o&&l.locale!=="ko"&&(Da||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Da&&(pe=ko()):(Ol=L,Ur="value"in Ol?Ol.value:Ol.textContent,Da=!0)),ne=nr(_,Ne),0<ne.length&&(Ne=new Ao(Ne,e,null,l,L),H.push({event:Ne,listeners:ne}),pe?Ne.data=pe:(pe=Oo(l),pe!==null&&(Ne.data=pe)))),(pe=Tm?Cm(e,l):Am(e,l))&&(Ne=nr(_,"onBeforeInput"),0<Ne.length&&(ne=new Ao("onBeforeInput","beforeinput",null,l,L),H.push({event:ne,listeners:Ne}),ne.data=pe)),gp(H,e,_,l,L)}gf(H,t)})}function $n(e,t,l){return{instance:e,listener:t,currentTarget:l}}function nr(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=hn(e,l),s!=null&&a.unshift($n(e,s,r)),s=hn(e,t),s!=null&&a.push($n(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jf(e,t,l,a,s){for(var r=t._reactName,o=[];l!==null&&l!==a;){var x=l,j=x.alternate,_=x.stateNode;if(x=x.tag,j!==null&&j===a)break;x!==5&&x!==26&&x!==27||_===null||(j=_,s?(_=hn(l,r),_!=null&&o.unshift($n(l,_,j))):s||(_=hn(l,r),_!=null&&o.push($n(l,_,j)))),l=l.return}o.length!==0&&e.push({event:t,listeners:o})}var Ep=/\r\n?/g,kp=/\u0000|\uFFFD/g;function Sf(e){return(typeof e=="string"?e:""+e).replace(Ep,`
49
+ `).replace(kp,"")}function Nf(e,t){return t=Sf(t),Sf(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ma(e,""+a);break;case"className":cs(e,"class",a);break;case"tabIndex":cs(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(e,l,a);break;case"style":So(e,a,r);break;case"data":if(t!=="object"){cs(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"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 r=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=dl);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=us(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":je("beforetoggle",e),je("toggle",e),is(e,"popover",a);break;case"xlinkActuate":ul(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ul(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ul(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ul(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ul(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ul(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ul(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ul(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ul(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":is(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Px.get(l)||l,is(e,l,a))}}function gc(e,t,l,a,s,r){switch(l){case"style":So(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&Ma(e,""+a);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"onClick":a!=null&&(e.onclick=dl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),r=e[ht]||null,r=r!=null?r[l]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):is(e,l,a)}}}function ut(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var o=l[r];if(o!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:De(e,t,r,o,l,null)}}s&&De(e,t,"srcSet",l.srcSet,l,null),a&&De(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var x=r=o=s=null,j=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":s=L;break;case"type":o=L;break;case"checked":j=L;break;case"defaultChecked":_=L;break;case"value":r=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:De(e,t,a,L,l,null)}}yo(e,r,x,j,_,o,s,!1);return;case"select":je("invalid",e),a=o=r=null;for(s in l)if(l.hasOwnProperty(s)&&(x=l[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":o=x;break;case"multiple":a=x;default:De(e,t,s,x,l,null)}t=r,l=o,e.multiple=!!a,t!=null?Ra(e,!!a,t,!1):l!=null&&Ra(e,!!a,l,!0);return;case"textarea":je("invalid",e),r=s=a=null;for(o in l)if(l.hasOwnProperty(o)&&(x=l[o],x!=null))switch(o){case"value":a=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(91));break;default:De(e,t,o,x,l,null)}bo(e,a,s,r);return;case"option":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:De(e,t,j,a,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(a=0;a<Jn.length;a++)je(Jn[a],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(_ in l)if(l.hasOwnProperty(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:De(e,t,_,a,l,null)}return;default:if(zr(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&gc(e,t,L,a,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(a=l[x],a!=null&&De(e,t,x,a,l,null))}function Tp(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,o=null,x=null,j=null,_=null,L=null;for(O in l){var H=l[O];if(l.hasOwnProperty(O)&&H!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":j=H;default:a.hasOwnProperty(O)||De(e,t,O,null,a,H)}}for(var z in a){var O=a[z];if(H=l[z],a.hasOwnProperty(z)&&(O!=null||H!=null))switch(z){case"type":r=O;break;case"name":s=O;break;case"checked":_=O;break;case"defaultChecked":L=O;break;case"value":o=O;break;case"defaultValue":x=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:O!==H&&De(e,t,z,O,a,H)}}Rr(e,o,x,j,_,L,r,s);return;case"select":O=o=x=z=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":O=j;default:a.hasOwnProperty(r)||De(e,t,r,null,a,j)}for(s in a)if(r=a[s],j=l[s],a.hasOwnProperty(s)&&(r!=null||j!=null))switch(s){case"value":z=r;break;case"defaultValue":x=r;break;case"multiple":o=r;default:r!==j&&De(e,t,s,r,a,j)}t=x,l=o,a=O,z!=null?Ra(e,!!l,z,!1):!!a!=!!l&&(t!=null?Ra(e,!!l,t,!0):Ra(e,!!l,l?[]:"",!1));return;case"textarea":O=z=null;for(x in l)if(s=l[x],l.hasOwnProperty(x)&&s!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:De(e,t,x,null,a,s)}for(o in a)if(s=a[o],r=l[o],a.hasOwnProperty(o)&&(s!=null||r!=null))switch(o){case"value":z=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&De(e,t,o,s,a,r)}go(e,z,O);return;case"option":for(var te in l)if(z=l[te],l.hasOwnProperty(te)&&z!=null&&!a.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:De(e,t,te,null,a,z)}for(j in a)if(z=a[j],O=l[j],a.hasOwnProperty(j)&&z!==O&&(z!=null||O!=null))switch(j){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:De(e,t,j,z,a,O)}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 oe in l)z=l[oe],l.hasOwnProperty(oe)&&z!=null&&!a.hasOwnProperty(oe)&&De(e,t,oe,null,a,z);for(_ in a)if(z=a[_],O=l[_],a.hasOwnProperty(_)&&z!==O&&(z!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(u(137,t));break;default:De(e,t,_,z,a,O)}return;default:if(zr(t)){for(var Le in l)z=l[Le],l.hasOwnProperty(Le)&&z!==void 0&&!a.hasOwnProperty(Le)&&gc(e,t,Le,void 0,a,z);for(L in a)z=a[L],O=l[L],!a.hasOwnProperty(L)||z===O||z===void 0&&O===void 0||gc(e,t,L,z,a,O);return}}for(var T in l)z=l[T],l.hasOwnProperty(T)&&z!=null&&!a.hasOwnProperty(T)&&De(e,t,T,null,a,z);for(H in a)z=a[H],O=l[H],!a.hasOwnProperty(H)||z===O||z==null&&O==null||De(e,t,H,z,a,O)}function Ef(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Cp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],r=s.transferSize,o=s.initiatorType,x=s.duration;if(r&&x&&Ef(o)){for(o=0,x=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],_=j.startTime;if(_>x)break;var L=j.transferSize,H=j.initiatorType;L&&Ef(H)&&(j=j.responseEnd,o+=L*(j<x?1:(x-_)/(j-_)))}if(--a,t+=8*(r+o)/(s.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 bc=null,jc=null;function sr(e){return e.nodeType===9?e:e.ownerDocument}function kf(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 Tf(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 Sc(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 Nc=null;function Ap(){var e=window.event;return e&&e.type==="popstate"?e===Nc?!1:(Nc=e,!0):(Nc=null,!1)}var Cf=typeof setTimeout=="function"?setTimeout:void 0,wp=typeof clearTimeout=="function"?clearTimeout:void 0,Af=typeof Promise=="function"?Promise:void 0,_p=typeof queueMicrotask=="function"?queueMicrotask:typeof Af<"u"?function(e){return Af.resolve(null).then(e).catch(Rp)}:Cf;function Rp(e){setTimeout(function(){throw e})}function Fl(e){return e==="head"}function wf(e,t){var l=t,a=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(s),un(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Wn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wn(l);for(var r=l.firstChild;r;){var o=r.nextSibling,x=r.nodeName;r[mn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=o}}else l==="body"&&Wn(e.ownerDocument.body);l=s}while(l);un(t)}function _f(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ec(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ec(l),wr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Mp(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[mn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function zp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function Rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function kc(e){return e.data==="$?"||e.data==="$~"}function Tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Op(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(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 Cc=null;function Mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function zf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Of(e,t,l){switch(t=sr(l),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 Wn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wr(e)}var Gt=new Map,Df=new Set;function rr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cl=A.d;A.d={f:Dp,r:Lp,D:Bp,C:Up,L:Hp,m:qp,X:Gp,S:Yp,M:Vp};function Dp(){var e=Cl.f(),t=Fs();return e||t}function Lp(e){var t=Aa(e);t!==null&&t.tag===5&&t.type==="form"?Fu(t):Cl.r(e)}var rn=typeof document>"u"?null:document;function Lf(e,t,l){var a=rn;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Df.has(s)||(Df.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function Bp(e){Cl.D(e),Lf("dns-prefetch",e,null)}function Up(e,t){Cl.C(e,t),Lf("preconnect",e,t)}function Hp(e,t,l){Cl.L(e,t,l);var a=rn;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=cn(e);break;case"script":r=on(e)}Gt.has(r)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Gt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Fn(r))||t==="script"&&a.querySelector(In(r))||(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function qp(e,t){Cl.m(e,t);var l=rn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=on(e)}if(!Gt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Gt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(In(r)))return}a=l.createElement("link"),ut(a,"link",e),nt(a),l.head.appendChild(a)}}}function Yp(e,t,l){Cl.S(e,t,l);var a=rn;if(a&&e){var s=wa(a).hoistableStyles,r=cn(e);t=t||"default";var o=s.get(r);if(!o){var x={loading:0,preload:null};if(o=a.querySelector(Fn(r)))x.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Gt.get(r))&&Ac(e,l);var j=o=a.createElement("link");nt(j),ut(j,"link",e),j._p=new Promise(function(_,L){j.onload=_,j.onerror=L}),j.addEventListener("load",function(){x.loading|=1}),j.addEventListener("error",function(){x.loading|=2}),x.loading|=4,ir(o,t,a)}o={type:"stylesheet",instance:o,count:1,state:x},s.set(r,o)}}}function Gp(e,t){Cl.X(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=b({src:e,async:!0},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Vp(e,t){Cl.M(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Bf(e,t,l,a){var s=(s=Y.current)?rr(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=cn(l.href),l=wa(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=cn(l.href);var r=wa(s).hoistableStyles,o=r.get(e);if(o||(s=s.ownerDocument||s,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,o),(r=s.querySelector(Fn(e)))&&!r._p&&(o.instance=r,o.state.loading=5),Gt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gt.set(e,l),r||Qp(s,e,l,o.state))),t&&a===null)throw Error(u(528,""));return o}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=on(l),l=wa(s).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function cn(e){return'href="'+Ot(e)+'"'}function Fn(e){return'link[rel="stylesheet"]['+e+"]"}function Uf(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Qp(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",l),nt(t),e.head.appendChild(t))}function on(e){return'[src="'+Ot(e)+'"]'}function In(e){return"script[async]"+e}function Hf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,nt(a),a;var s=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),nt(a),ut(a,"style",s),ir(a,l.precedence,e),t.instance=a;case"stylesheet":s=cn(l.href);var r=e.querySelector(Fn(s));if(r)return t.state.loading|=4,t.instance=r,nt(r),r;a=Uf(l),(s=Gt.get(s))&&Ac(a,s),r=(e.ownerDocument||e).createElement("link"),nt(r);var o=r;return o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),t.state.loading|=4,ir(r,l.precedence,e),t.instance=r;case"script":return r=on(l.src),(s=e.querySelector(In(r)))?(t.instance=s,nt(s),s):(a=l,(s=Gt.get(r))&&(a=b({},l),wc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),nt(s),ut(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ir(a,l.precedence,e));return t.instance}function ir(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,o=0;o<a.length;o++){var x=a[o];if(x.dataset.precedence===t)r=x;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cr=null;function qf(e,t,l){if(cr===null){var a=new Map,s=cr=new Map;s.set(l,a)}else s=cr,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var r=l[s];if(!(r[mn]||r[rt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var o=r.getAttribute(t)||"";o=e+o;var x=a.get(o);x?x.push(r):a.set(o,[r])}}return a}function Yf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Xp(e,t,l){if(l===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 Gf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Zp(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=cn(a.href),r=t.querySelector(Fn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=or.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,nt(r);return}r=t.ownerDocument||t,a=Uf(a),(s=Gt.get(s))&&Ac(a,s),r=r.createElement("link"),nt(r);var o=r;o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),l.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=or.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var _c=0;function Kp(e,t){return e.stylesheets&&e.count===0&&dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*Cp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ur=null;function dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ur=new Map,t.forEach(Jp,e),ur=null,or.call(e))}function Jp(e,t){if(!(t.state.loading&4)){var l=ur.get(e);if(l)var a=l.get(null);else{l=new Map,ur.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var o=s[r];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(l.set(o.dataset.precedence,o),a=o)}a&&l.set(null,a)}s=t.instance,o=s.getAttribute("data-precedence"),r=l.get(o)||a,r===a&&l.set(null,s),l.set(o,s),this.count++,a=or.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:se,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function $p(e,t,l,a,s,r,o,x,j){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=xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.hiddenUpdates=xn(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Vf(e,t,l,a,s,r,o,x,j,_,L,H){return e=new $p(e,t,l,o,j,_,L,H,x),t=1,r===!0&&(t|=24),r=Tt(3,null,null,t),e.current=r,r.stateNode=e,t=oi(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},xi(r),e}function Qf(e){return e?(e=Ha,e):Ha}function Xf(e,t,l,a,s,r){s=Qf(s),a.context===null?a.context=s:a.pendingContext=s,a=ql(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Yl(e,a,t),l!==null&&(St(l,e,t),Rn(l,e,t))}function Zf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Rc(e,t){Zf(e,t),(e=e.alternate)&&Zf(e,t)}function Kf(e){if(e.tag===13||e.tag===31){var t=xa(e,67108864);t!==null&&St(t,e,67108864),Rc(e,67108864)}}function Jf(e){if(e.tag===13||e.tag===31){var t=Rt();t=Tr(t);var l=xa(e,t);l!==null&&St(l,e,t),Rc(e,t)}}var fr=!0;function Wp(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=2,Mc(e,t,l,a)}finally{A.p=r,N.T=s}}function Fp(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=8,Mc(e,t,l,a)}finally{A.p=r,N.T=s}}function Mc(e,t,l,a){if(fr){var s=zc(a);if(s===null)yc(e,t,a,xr,l),Wf(e,a);else if(Pp(s,e,t,l,a))a.stopPropagation();else if(Wf(e,a),t&4&&-1<Ip.indexOf(e)){for(;s!==null;){var r=Aa(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var o=Pt(r.pendingLanes);if(o!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;o;){var j=1<<31-Ge(o);x.entanglements[1]|=j,o&=~j}al(r),(we&6)===0&&($s=ze()+500,Kn(0))}}break;case 31:case 13:x=xa(r,2),x!==null&&St(x,r,2),Fs(),Rc(r,2)}if(r=zc(a),r===null&&yc(e,t,a,xr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else yc(e,t,a,null,l)}}function zc(e){return e=Dr(e),Oc(e)}var xr=null;function Oc(e){if(xr=null,e=Ca(e),e!==null){var t=h(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=p(t),e!==null)return e;e=null}else if(l===31){if(e=g(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xr=e,null}function $f(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(mt()){case Qt:return 2;case $:return 8;case _e:case Xt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Dc=!1,Il=null,Pl=null,ea=null,es=new Map,ts=new Map,ta=[],Ip="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 Wf(e,t){switch(e){case"focusin":case"focusout":Il=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function ls(e,t,l,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Aa(t),t!==null&&Kf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Pp(e,t,l,a,s){switch(t){case"focusin":return Il=ls(Il,e,t,l,a,s),!0;case"dragenter":return Pl=ls(Pl,e,t,l,a,s),!0;case"mouseover":return ea=ls(ea,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return es.set(r,ls(es.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,ts.set(r,ls(ts.get(r)||null,e,t,l,a,s)),!0}return!1}function Ff(e){var t=Ca(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,oo(e.priority,function(){Jf(l)});return}}else if(t===31){if(t=g(l),t!==null){e.blockedOn=t,oo(e.priority,function(){Jf(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=zc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Or=a,l.target.dispatchEvent(a),Or=null}else return t=Aa(l),t!==null&&Kf(t),e.blockedOn=l,!1;t.shift()}return!0}function If(e,t,l){mr(e)&&l.delete(t)}function eh(){Dc=!1,Il!==null&&mr(Il)&&(Il=null),Pl!==null&&mr(Pl)&&(Pl=null),ea!==null&&mr(ea)&&(ea=null),es.forEach(If),ts.forEach(If)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,eh)))}var hr=null;function Pf(e){hr!==e&&(hr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){hr===e&&(hr=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(Oc(a||l)===null)continue;break}var r=Aa(l);r!==null&&(e.splice(t,3),t-=3,zi(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function un(e){function t(j){return pr(j,e)}Il!==null&&pr(Il,e),Pl!==null&&pr(Pl,e),ea!==null&&pr(ea,e),es.forEach(t),ts.forEach(t);for(var l=0;l<ta.length;l++){var a=ta[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ta.length&&(l=ta[0],l.blockedOn===null);)Ff(l),l.blockedOn===null&&ta.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],o=s[ht]||null;if(typeof r=="function")o||Pf(l);else if(o){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,o=r[ht]||null)x=o.formAction;else if(Oc(s)!==null)continue}else x=o.action;typeof x=="function"?l[a+1]=x:(l.splice(a,3),a-=3),Pf(l)}}}function ex(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(o){return s=o})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Lc(e){this._internalRoot=e}vr.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=Rt();Xf(l,a,e,t,null,null)},vr.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xf(e.current,2,null,e,null,null),Fs(),t[Ta]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=co();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ta.length&&t!==0&&t<ta[l].priority;l++);ta.splice(l,0,e),l===0&&Ff(e)}};var tx=c.version;if(tx!=="19.2.4")throw Error(u(527,tx,"19.2.4"));A.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=f(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var th={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yr.isDisabled&&yr.supportsFiber)try{Mt=yr.inject(th),Ve=yr}catch{}}return ns.createRoot=function(e,t){if(!m(e))throw Error(u(299));var l=!1,a="",s=id,r=cd,o=od;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Vf(e,1,!1,null,null,l,a,null,s,r,o,ex),e[Ta]=t.current,vc(e),new Lc(t)},ns.hydrateRoot=function(e,t,l){if(!m(e))throw Error(u(299));var a=!1,s="",r=id,o=cd,x=od,j=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(o=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Vf(e,1,!0,t,l??null,a,s,j,r,o,x,ex),t.context=Qf(null),l=t.current,a=Rt(),a=Tr(a),s=ql(a),s.callback=null,Yl(l,s,a),l=a,t.current.lanes=l,ca(t,l),al(t),e[Ta]=t.current,vc(e),new vr(t)},ns.version="19.2.4",ns}var dx;function dh(){if(dx)return Hc.exports;dx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Hc.exports=uh(),Hc.exports}var fh=dh();const _x="";class Rx extends Error{constructor(c,d){super(c),this.name="ApiError",this.status=d}}async function qe(i,c){const d=await fetch(`${_x}${i}`,c);if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Rx(u.error||`HTTP ${d.status}`,d.status)}return d.json()}const Te={getConfig(){return qe("/api/config")},setConfig(i,c){return qe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:c})})},getSkills(){return qe("/api/skills")},getSkillDetail(i,c){return qe(`/api/skills/${i}/${c}`)},getEvals(i,c){return qe(`/api/skills/${i}/${c}/evals`)},saveEvals(i,c,d){return qe(`/api/skills/${i}/${c}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},generateEvals(i,c){return qe(`/api/skills/${i}/${c}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,c){const d=await fetch(`${_x}/api/skills/${i}/${c}/benchmark/latest`);if(d.status===404)return null;if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Rx(u.error||`HTTP ${d.status}`,d.status)}return d.json()},getHistory(i,c,d){const u=new URLSearchParams;d!=null&&d.model&&u.set("model",d.model),d!=null&&d.type&&u.set("type",d.type),d!=null&&d.from&&u.set("from",d.from),d!=null&&d.to&&u.set("to",d.to);const m=u.toString();return qe(`/api/skills/${i}/${c}/history${m?"?"+m:""}`)},getHistoryEntry(i,c,d){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(d)}`)},compareRuns(i,c,d,u){return qe(`/api/skills/${i}/${c}/history-compare?a=${encodeURIComponent(d)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,c,d,u){const m=new URLSearchParams;u&&m.set("model",u);const h=m.toString();return qe(`/api/skills/${i}/${c}/history/case/${d}${h?"?"+h:""}`)},deleteHistoryEntry(i,c,d){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(d)}`,{method:"DELETE"})},deleteSkill(i,c){return qe(`/api/skills/${i}/${c}`,{method:"DELETE"})},improveSkill(i,c,d){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},instructEdit(i,c,d){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...d})})},applyImprovement(i,c,d){return qe(`/api/skills/${i}/${c}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:d})})},getStats(i,c){return qe(`/api/skills/${i}/${c}/stats`)},getDependencies(i,c){return qe(`/api/skills/${i}/${c}/dependencies`)},getProjectLayout(){return qe("/api/project-layout")},createSkill(i){return qe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return qe("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return qe("/api/skill-creator-status")},generateSkill(i){return qe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,c){return qe(`/api/skills/${i}/${c}/files`)},getSkillFile(i,c,d){return qe(`/api/skills/${i}/${c}/file?path=${encodeURIComponent(d)}`)}};function xh(i){const[c,d]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const u=window.matchMedia(i);d(u.matches);const m=h=>d(h.matches);return u.addEventListener("change",m),()=>u.removeEventListener("change",m)},[i]),c}const mh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function ph(i,c){switch(c.type){case"SELECT_SKILL":return{...i,selectedSkill:c.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:c.mode,selectedSkill:c.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:c.query};case"SET_SKILLS":return{...i,skills:c.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:c.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:c.loading};case"SET_MOBILE":return{...i,isMobile:c.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:c.view};default:return i}}const Mx=v.createContext(null);function sa(){const i=v.useContext(Mx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function hh({children:i}){const[c,d]=v.useReducer(ph,mh),u=xh("(max-width: 767px)");v.useEffect(()=>{d({type:"SET_MOBILE",isMobile:u})},[u]);const m=v.useCallback(()=>{d({type:"SET_SKILLS_LOADING",loading:!0}),Te.getSkills().then(b=>{d({type:"SET_SKILLS",skills:b});const R=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(R){const[,B,V]=R,Z=b.find(W=>W.plugin===B&&W.skill===V);Z&&d({type:"SELECT_SKILL",skill:{plugin:B,skill:V,origin:Z.origin}})}}).catch(b=>d({type:"SET_SKILLS_ERROR",error:b.message}))},[]);v.useEffect(()=>{m()},[m]);const h=v.useCallback(b=>{d({type:"SELECT_SKILL",skill:b}),window.location.hash=`/skills/${b.plugin}/${b.skill}`},[]),p=v.useCallback(()=>{d({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),g=v.useCallback(b=>{d({type:"SET_MODE",mode:b})},[]),y=v.useCallback(b=>{d({type:"SET_SEARCH",query:b})},[]),f=v.useCallback(b=>{d({type:"SET_MOBILE_VIEW",view:b})},[]),E=v.useMemo(()=>({state:c,selectSkill:h,clearSelection:p,setMode:g,setSearch:y,setMobileView:f,refreshSkills:m}),[c,h,p,g,y,f,m]);return n.jsx(Mx.Provider,{value:E,children:i})}const vh={config:null,loading:!0};function yh(i,c){switch(c.type){case"SET_CONFIG":return{config:c.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const zx=v.createContext(null);function dn(){const i=v.useContext(zx);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function gh({children:i}){const[c,d]=v.useReducer(yh,vh),u=v.useCallback(()=>{Te.getConfig().then(p=>d({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);v.useEffect(()=>{u()},[u]);const m=v.useCallback(async(p,g)=>{const y=await Te.setConfig(p,g);return d({type:"SET_CONFIG",config:y}),y},[]),h=v.useMemo(()=>({config:c.config,loading:c.loading,updateConfig:m,refreshConfig:u}),[c,m,u]);return n.jsx(zx.Provider,{value:h,children:i})}function bh({left:i,right:c}){const{state:d}=sa();return d.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:d.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:c})}):n.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:i}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:c})]})}function jh(){const{state:i,setSearch:c}=sa(),[d,u]=v.useState(i.searchQuery),m=v.useRef(null);v.useEffect(()=>(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c(d)},200),()=>{m.current&&clearTimeout(m.current)}),[d,c]),v.useEffect(()=>{i.searchQuery===""&&d!==""&&u("")},[i.searchQuery]);const h=new Set(i.skills.map(p=>p.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:d,onChange:p=>u(p.target.value),placeholder:"Search skills...",className:"w-full py-2 pl-8 pr-3 rounded-lg text-[13px] transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none"},onFocus:p=>{p.currentTarget.style.borderColor="var(--accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--border-subtle)"}}),d&&n.jsx("button",{onClick:()=>{u(""),c("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!i.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[i.skills.length," skill",i.skills.length!==1?"s":""," across ",h," plugin",h!==1?"s":""]})]})}const fx={pass:{bg:"var(--green-muted)",text:"var(--green)",dot:"var(--green)",label:"Passing"},fail:{bg:"var(--red-muted)",text:"var(--red)",dot:"var(--red)",label:"Failing"},pending:{bg:"var(--yellow-muted)",text:"var(--yellow)",dot:"var(--yellow)",label:"Pending"},stale:{bg:"var(--orange-muted)",text:"var(--orange)",dot:"var(--orange)",label:"Stale"},missing:{bg:"var(--surface-3)",text:"var(--text-tertiary)",dot:"var(--text-tertiary)",label:"No evals"}};function xx({skill:i,isSelected:c,onSelect:d}){const u=fx[i.benchmarkStatus]||fx.missing,m=i.origin==="installed";return n.jsxs("button",{onClick:d,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:c?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:c?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:m?.7:1},onMouseEnter:h=>{c||(h.currentTarget.style.background="var(--surface-2)")},onMouseLeave:h=>{c||(h.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[m&&n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.skill]}),n.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex-shrink-0 ml-2",style:{background:u.bg,color:u.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:u.dot}}),u.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[i.evalCount," eval",i.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[i.assertionCount," assert",i.assertionCount!==1?"s":""]}),i.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(i.lastBenchmark).toLocaleDateString()})]})]})]})}function mx(i){var d;const c={};for(const u of i)(c[d=u.plugin]||(c[d]=[])).push(u);return c}function Sh(){const{state:i,selectSkill:c}=sa(),{skills:d,searchQuery:u,selectedSkill:m}=i,[h,p]=v.useState(!1),[g,y]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:E}=v.useMemo(()=>{const b=u.toLowerCase(),C=b?d.filter(V=>V.skill.toLowerCase().includes(b)||V.plugin.toLowerCase().includes(b)):d,R=C.filter(V=>V.origin==="source"),B=C.filter(V=>V.origin==="installed");return{sourceGroups:Object.entries(mx(R)),installedGroups:Object.entries(mx(B))}},[d,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(b=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},b))}):f.length===0&&E.length===0?n.jsx("div",{className:"px-4 py-8 text-center",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):n.jsxs("div",{className:"flex-1",children:[f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Nh,{title:"Your Skills",count:f.reduce((b,[,C])=>b+C.length,0)}),f.map(([b,C])=>n.jsxs("div",{children:[n.jsx(px,{plugin:b,count:C.length}),C.map(R=>{const B=(m==null?void 0:m.plugin)===R.plugin&&(m==null?void 0:m.skill)===R.skill;return n.jsx(xx,{skill:R,isSelected:B,onSelect:()=>c({plugin:R.plugin,skill:R.skill,origin:R.origin})},`${R.plugin}/${R.skill}`)})]},b))]}),E.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>p(b=>!b),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:h?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",E.reduce((b,[,C])=>b+C.length,0),")"]}),n.jsx("div",{className:"flex-1"}),n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),h&&n.jsxs(n.Fragment,{children:[!g&&n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("p",{className:"flex-1 text-[10px] leading-relaxed",style:{color:"var(--text-tertiary)",margin:0},children:"Skills inside agent folders (.claude/, .cursor/, etc.) are installed copies for consuming. Edit skills in your project root instead."}),n.jsx("button",{onClick:()=>{y(!0);try{sessionStorage.setItem("vskill-origin-banner-dismissed","1")}catch{}},className:"flex-shrink-0 mt-0.5",style:{background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),E.map(([b,C])=>n.jsxs("div",{children:[n.jsx(px,{plugin:b,count:C.length}),C.map(R=>{const B=(m==null?void 0:m.plugin)===R.plugin&&(m==null?void 0:m.skill)===R.skill;return n.jsx(xx,{skill:R,isSelected:B,onSelect:()=>c({plugin:R.plugin,skill:R.skill,origin:R.origin})},`${R.plugin}/${R.skill}`)})]},b))]})]})]})}function Nh({title:i,count:c}){return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]})]})}function px({plugin:i,count:c}){const[d,u]=v.useState(!1),m=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[d?n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):n.jsx("img",{src:m,width:16,height:16,alt:"",onError:()=>u(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Eh(){const{config:i,updateConfig:c,refreshConfig:d}=dn(),[u,m]=v.useState(!1),[h,p]=v.useState(!1),g=v.useRef(null);v.useEffect(()=>{function b(C){g.current&&!g.current.contains(C.target)&&m(!1)}return u&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[u]);async function y(b,C){p(!0);try{await c(b.id,C.id),m(!1)}catch{d()}finally{p(!1)}}if(!i)return null;const f=Th(i),E=kh(i);return n.jsxs("div",{ref:g,className:"relative",children:[n.jsxs("button",{onClick:()=>m(!u),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:u?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${u?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:b=>{u||(b.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:b=>{u||(b.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:E!=null&&E.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:u?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),u&&n.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(b=>n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:b.available?"var(--green)":"var(--text-tertiary)",opacity:b.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:b.available?1:.5},children:b.label})]}),b.models.map(C=>{const R=Ox(i,b.id,C.id),B=!b.available||h;return n.jsxs("button",{onClick:()=>!B&&y(b,C),disabled:B,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:R?"var(--accent-muted)":"transparent",color:B?"var(--text-tertiary)":"var(--text-primary)",opacity:B?.4:1,cursor:B?"not-allowed":"pointer"},onMouseEnter:V=>{!B&&!R&&(V.currentTarget.style.background="var(--surface-3)")},onMouseLeave:V=>{R||(V.currentTarget.style.background="transparent")},children:[n.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${R?"var(--accent)":"var(--border-subtle)"}`},children:R&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:R?600:400},title:C.id,children:C.label})]},`${b.id}-${C.id}`)})]},b.id))})]})]})}function Ox(i,c,d){return i.provider!==c?!1:c==="claude-cli"?i.model===`claude-${d}`:i.model===d}function kh(i){return i.providers.find(c=>c.id===i.provider)}function Th(i){for(const c of i.providers)for(const d of c.models)if(Ox(i,c.id,d.id))return d.label;return i.model}function Ch(){const{state:i,setMode:c}=sa(),{config:d}=dn(),[u,m]=v.useState(null),[h,p]=v.useState(!1);return v.useEffect(()=>{Te.getSkillCreatorStatus().then(m).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(d==null?void 0:d.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(Eh,{})})]}),n.jsx(jh,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("button",{onClick:()=>c("create"),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:i.mode==="create"?"var(--accent)":"var(--surface-3)",color:i.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:g=>{i.mode!=="create"&&(g.currentTarget.style.background="var(--surface-4)",g.currentTarget.style.color="var(--text-primary)")},onMouseLeave:g=>{i.mode!=="create"&&(g.currentTarget.style.background="var(--surface-3)",g.currentTarget.style.color="var(--text-secondary)")},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),u&&(()=>{const g=(d==null?void 0:d.provider)==="claude-cli";return u.installed&&g?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):u.installed&&!g?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!u.installed&&g?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),n.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),n.jsx("button",{onClick:()=>{navigator.clipboard.writeText(u.installCommand).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}).catch(()=>{})},className:"w-full text-left px-2 py-1 rounded text-[10px] font-mono cursor-pointer transition-colors duration-150",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},title:"Click to copy",onMouseEnter:y=>{y.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:y=>{y.currentTarget.style.borderColor="var(--border-subtle)"},children:h?"Copied!":u.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Sh,{})})]})}const Ah="modulepreload",wh=function(i){return"/"+i},hx={},_h=function(c,d,u){let m=Promise.resolve();if(d&&d.length>0){let p=function(f){return Promise.all(f.map(E=>Promise.resolve(E).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),y=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));m=p(d.map(f=>{if(f=wh(f),f in hx)return;hx[f]=!0;const E=f.endsWith(".css"),b=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const C=document.createElement("link");if(C.rel=E?"stylesheet":Ah,E||(C.as="script"),C.crossOrigin="",C.href=f,y&&C.setAttribute("nonce",y),document.head.appendChild(C),E)return new Promise((R,B)=>{C.addEventListener("load",R),C.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(p){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=p,window.dispatchEvent(g),!g.defaultPrevented)throw p}return m.then(p=>{for(const g of p||[])g.status==="rejected"&&h(g.reason);return c().catch(h)})};function Vc(){const[i,c]=v.useState([]),[d,u]=v.useState(!1),[m,h]=v.useState(!1),[p,g]=v.useState(null),y=v.useRef(null),f=v.useCallback(async(b,C)=>{c([]),u(!0),h(!1),g(null);const R=new AbortController;y.current=R;try{const B=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:C?JSON.stringify(C):void 0,signal:R.signal});if(!B.ok||!B.body){let se=`HTTP ${B.status}`;try{const G=await B.json();G.error&&(se=G.error)}catch{}throw new Error(se)}const V=B.body.getReader(),Z=new TextDecoder;let W="",ee="";for(;;){const{done:se,value:G}=await V.read();if(se)break;W+=Z.decode(G,{stream:!0});const I=W.split(`
50
+ `);W=I.pop()||"";for(const le of I)if(le.startsWith("event: "))ee=le.slice(7).trim();else if(le.startsWith("data: ")){try{const F=JSON.parse(le.slice(6)),ae={event:ee,data:F};ee==="done"?(h(!0),c(ve=>[...ve,ae])):c(ve=>[...ve,ae])}catch{}ee=""}}}catch(B){B.name!=="AbortError"&&g(B.message)}finally{u(!1),y.current=null}},[]),E=v.useCallback(()=>{var b;(b=y.current)==null||b.abort()},[]);return{events:i,running:d,done:m,error:p,start:f,stop:E}}function Rh(i){const c=v.useRef(i);c.current=i;const[d,u]=v.useState(new Set),m=v.useRef(new Map),h=v.useCallback(async(f,E,b)=>{var R;(R=m.current.get(f))==null||R.abort();const C=new AbortController;m.current.set(f,C),u(B=>{const V=new Set(B);return V.add(f),V});try{const B=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:b?JSON.stringify(b):void 0,signal:C.signal});if(!B.ok||!B.body){let se=`HTTP ${B.status}`;try{const G=await B.json();G.error&&(se=G.error)}catch{}throw new Error(se)}const V=B.body.getReader(),Z=new TextDecoder;let W="",ee="";for(;;){const{done:se,value:G}=await V.read();if(se)break;W+=Z.decode(G,{stream:!0});const I=W.split(`
51
+ `);W=I.pop()||"";for(const le of I)if(le.startsWith("event: "))ee=le.slice(7).trim();else if(le.startsWith("data: ")){try{const F=JSON.parse(le.slice(6)),ae={event:ee,data:F};c.current.onEvent(f,ae)}catch{}ee=""}}c.current.onDone(f)}catch(B){B.name!=="AbortError"&&c.current.onError(f,B.message)}finally{u(B=>{const V=new Set(B);return V.delete(f),V}),m.current.delete(f)}},[]),p=v.useCallback(f=>{var E;(E=m.current.get(f))==null||E.abort()},[]),g=v.useCallback(()=>{for(const f of m.current.values())f.abort()},[]),y=d.size>0;return{runningSet:d,startCase:h,stopCase:p,stopAll:g,isAnyCaseRunning:y}}const Mh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,evalsError:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,loading:!0,error:null};function zh(i,c){var d,u;switch(c.type){case"SET_LOADING":return{...i,loading:c.loading};case"SET_ERROR":return{...i,error:c.error};case"INIT_DATA":{const m=new Map;if(c.benchmark)for(const p of c.benchmark.cases)m.set(p.eval_id,{status:p.status,passRate:p.pass_rate,errorMessage:p.error_message||void 0,durationMs:p.durationMs,tokens:p.tokens,output:p.output,assertions:p.assertions.map(g=>({assertion_id:g.id,text:g.text,pass:g.pass,reasoning:g.reasoning}))});const h=((u=(d=c.evals)==null?void 0:d.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:c.skillContent,savedContent:c.skillContent,isDirty:!1,evals:c.evals,evalsError:c.evalsError??null,latestBenchmark:c.benchmark,inlineResults:m,selectedCaseId:h,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:c.panel};case"SET_CONTENT":return{...i,skillContent:c.content,isDirty:c.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:c.evals};case"SELECT_CASE":return{...i,selectedCaseId:c.caseId};case"CASE_RUN_START":{const m=new Map(i.caseRunStates);return m.set(c.caseId,{status:"running",startedAt:Date.now(),mode:c.mode}),{...i,caseRunStates:m,runMode:c.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"complete",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,c.result),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_ERROR":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"error",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,{status:"error",errorMessage:c.error,assertions:[]}),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_CANCEL":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);return m.set(c.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:m}}case"BULK_RUN_START":{const m=new Map(i.caseRunStates);for(const h of c.caseIds)m.set(h,{status:"queued",mode:c.mode});return{...i,caseRunStates:m,bulkRunActive:!0,runMode:c.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:c.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const m=new Map(i.caseRunStates);for(const[h,p]of m)(p.status==="running"||p.status==="queued")&&m.set(h,{status:"cancelled"});return{...i,caseRunStates:m,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const m=new Map(i.inlineResults);return m.set(c.evalId,c.result),{...i,inlineResults:m}}case"OPEN_IMPROVE":return{...i,improveTarget:c.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...i,improveTarget:null};case"OPEN_AI_EDIT":return{...i,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...i,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...i,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...i,aiEditProgress:[...i.aiEditProgress,c.entry]};case"AI_EDIT_RESULT":{const m=c.evalChanges??[],h=new Map;for(let p=0;p<m.length;p++)h.set(p,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:c.improved,reasoning:c.reasoning,evalChanges:m},aiEditEvalChanges:m,aiEditEvalSelections:h}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:c.message,aiEditClassifiedError:c.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,c.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:c.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:c.classified};case"TOGGLE_EVAL_CHANGE":{const m=new Map(i.aiEditEvalSelections);return m.set(c.index,!m.get(c.index)),{...i,aiEditEvalSelections:m}}case"SELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!0);return{...i,aiEditEvalSelections:m}}case"DESELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!1);return{...i,aiEditEvalSelections:m}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:c.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:c.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:c.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,c.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:c.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:c.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};default:return i}}const Dx=v.createContext(null);function nl(){const i=v.useContext(Dx);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Oh({plugin:i,skill:c,origin:d,children:u}){const m=d==="installed",[h,p]=v.useReducer(zh,{...Mh,plugin:i,skill:c}),g=v.useRef(new Set),y=v.useRef(new Set),f=v.useRef(new Map),E=v.useCallback((M,q)=>{const Y=q.data;let K=f.current.get(M);if(K||(K={assertions:[]},f.current.set(M,K)),q.event==="output_ready"&&(K.output=Y.output,Y.durationMs!=null&&(K.durationMs=Y.durationMs),Y.tokens!=null&&(K.tokens=Y.tokens)),q.event==="assertion_result"){const de={assertion_id:Y.assertion_id,text:Y.text,pass:Y.pass,reasoning:Y.reasoning};K.assertions.find(me=>me.assertion_id===de.assertion_id)||K.assertions.push(de)}q.event==="case_complete"&&(K.status=Y.status,K.passRate=Y.pass_rate,K.errorMessage=Y.error_message||void 0,K.classifiedError=Y.classified_error||void 0),p({type:"UPDATE_INLINE_RESULT",evalId:M,result:{...K,assertions:[...K.assertions]}})},[]),b=v.useCallback(M=>{if(y.current.has(M))return;y.current.add(M);const q=f.current.get(M)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:M,result:{...q,assertions:[...q.assertions]}}),g.current.has(M)&&(g.current.delete(M),g.current.size===0&&Te.getLatestBenchmark(i,c).then(Y=>p({type:"BULK_RUN_COMPLETE",benchmark:Y})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,c]),C=v.useCallback((M,q)=>{y.current.has(M)||(y.current.add(M),p({type:"CASE_RUN_ERROR",caseId:M,error:q}),g.current.has(M)&&(g.current.delete(M),g.current.size===0&&Te.getLatestBenchmark(i,c).then(Y=>p({type:"BULK_RUN_COMPLETE",benchmark:Y})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,c]),{startCase:R,stopCase:B,stopAll:V}=Rh({onEvent:E,onDone:b,onError:C});v.useEffect(()=>()=>{V()},[V]),v.useEffect(()=>{let M=!1;async function q(){try{const[Y,K,de]=await Promise.allSettled([Te.getSkillDetail(i,c),Te.getEvals(i,c),Te.getLatestBenchmark(i,c)]);if(M)return;let me=null,Ze=null;if(K.status==="fulfilled")me=K.value;else{const et=K.reason;(et==null?void 0:et.status)!==404&&(Ze=(et==null?void 0:et.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:Y.status==="fulfilled"?Y.value.skillContent:"",evals:me,evalsError:Ze,benchmark:de.status==="fulfilled"?de.value:null})}catch(Y){M||p({type:"SET_ERROR",error:Y.message})}}return q(),()=>{M=!0}},[i,c]);const Z=v.useCallback(async()=>{if(!m)try{await Te.applyImprovement(i,c,h.skillContent),p({type:"CONTENT_SAVED"})}catch(M){p({type:"SET_ERROR",error:M.message})}},[m,i,c,h.skillContent]),W=v.useCallback(async M=>{if(!m)try{const q=await Te.saveEvals(i,c,M);p({type:"SET_EVALS",evals:q})}catch(q){p({type:"SET_ERROR",error:q.message})}},[m,i,c]),ee=v.useCallback((M,q="benchmark")=>{if(m)return;const Y=h.caseRunStates.get(M);if((Y==null?void 0:Y.status)!=="running")if(f.current.delete(M),y.current.delete(M),p({type:"CASE_RUN_START",caseId:M,mode:q}),q==="comparison"){const K=`/api/skills/${i}/${c}/compare`;R(M,K,{eval_ids:[M]})}else{const K=`/api/skills/${i}/${c}/benchmark/case/${M}`;R(M,K,q==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.caseRunStates,R]),se=v.useCallback((M="benchmark")=>{var K;if(m)return;const q=((K=h.evals)==null?void 0:K.evals)??[];if(q.length===0)return;const Y=q.map(de=>de.id);for(const de of Y)f.current.delete(de),y.current.delete(de);p({type:"BULK_RUN_START",caseIds:Y,mode:M}),g.current=new Set(Y);for(const de of Y)if(M==="comparison")R(de,`/api/skills/${i}/${c}/compare`,{eval_ids:[de]});else{const me=`/api/skills/${i}/${c}/benchmark/case/${de}`;R(de,me,M==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.evals,R]),G=v.useCallback(M=>{B(M),p({type:"CASE_RUN_CANCEL",caseId:M}),g.current.delete(M),y.current.add(M)},[B]),I=v.useCallback(()=>{V(),p({type:"CANCEL_ALL"}),g.current.clear()},[V]),le=v.useCallback(async(M,q)=>{p({type:"OPEN_IMPROVE",evalId:M})},[]),F=v.useCallback(async(M,q)=>{try{await Te.applyImprovement(i,c,q),p({type:"SET_CONTENT",content:q}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),ee(M,"benchmark")}catch(Y){p({type:"SET_ERROR",error:Y.message})}},[i,c,ee]),ae=Vc(),ve=v.useRef(null);v.useEffect(()=>{if(ae.events.length)for(const M of ae.events){const q=M.data;if(M.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:q.phase,message:q.message}}),M.event==="done"){const Y=q.improved,K=q.reasoning,de=q.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:Y,reasoning:K,evalChanges:de})}if(M.event==="error"){const Y=q;p({type:"AI_EDIT_ERROR",message:Y.description||"Unknown error",classified:Y})}}},[ae.events]),v.useEffect(()=>{ae.error&&p({type:"AI_EDIT_ERROR",message:ae.error})},[ae.error]),v.useEffect(()=>()=>{ae.stop()},[ae.stop]);const re=v.useCallback(async(M,q,Y)=>{m||(p({type:"AI_EDIT_LOADING"}),ve.current=ae.stop,ae.start(`/api/skills/${i}/${c}/improve?sse`,{mode:"instruct",instruction:M,content:h.skillContent,evals:h.evals??{skill_name:c,evals:[]},provider:q,model:Y}))},[m,i,c,h.skillContent,h.evals,ae]),ge=v.useCallback(()=>{ae.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[ae]),ye=v.useCallback(async()=>{const M=h.aiEditResult;if(M!=null&&M.improved)try{if(await Te.applyImprovement(i,c,M.improved),p({type:"SET_CONTENT",content:M.improved}),p({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:Y}=await _h(async()=>{const{mergeEvalChanges:me}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:me}},[]),K=h.evals??{skill_name:c,evals:[]},de=Y(K,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const me=await Te.saveEvals(i,c,de);p({type:"SET_EVALS",evals:me})}catch(me){p({type:"SET_EVALS_RETRY",evalsFile:de}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${me.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(q){p({type:"SET_ERROR",error:q.message})}},[i,c,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),Q=v.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),ue=v.useCallback(M=>{p({type:"TOGGLE_EVAL_CHANGE",index:M})},[]),Ee=v.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),N=v.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),A=v.useCallback(async()=>{const M=h.aiEditEvalsRetry;if(M)try{const q=await Te.saveEvals(i,c,M);p({type:"SET_EVALS",evals:q}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(q){p({type:"SET_ERROR",error:`Retry failed: ${q.message}`})}},[i,c,h.aiEditEvalsRetry]),J=v.useCallback(async()=>{try{const M=await Te.getSkillDetail(i,c);p({type:"SET_CONTENT",content:M.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[i,c]),ce=Vc();v.useEffect(()=>{if(ce.events.length)for(const M of ce.events){const q=M.data;if(M.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:q.phase,message:q.message}}),M.event==="done"){const Y=q;Te.saveEvals(i,c,Y).then(K=>p({type:"GENERATE_EVALS_DONE",evals:K})).catch(K=>p({type:"SET_ERROR",error:K.message}))}M.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:q})}},[ce.events,i,c]),v.useEffect(()=>{ce.error&&p({type:"SET_ERROR",error:ce.error})},[ce.error]),v.useEffect(()=>()=>{ce.stop()},[ce.stop]);const he=v.useCallback(async()=>{m||(p({type:"GENERATE_EVALS_START"}),ce.start(`/api/skills/${i}/${c}/generate-evals?sse`))},[m,i,c,ce]),S=Vc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const M of S.events)M.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:M.data}),M.event==="done"&&p({type:"ACTIVATION_DONE",summary:M.data})},[S.events]),v.useEffect(()=>{S.error&&p({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const D=v.useCallback(M=>{const Y=M.trim().split(`
52
+ `).filter(Boolean).map(K=>K.startsWith("!")?{prompt:K.slice(1).trim(),expected:"should_not_activate"}:K.startsWith("+")?{prompt:K.slice(1).trim(),expected:"should_activate"}:{prompt:K.trim(),expected:"auto"});p({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${c}/activation-test`,{prompts:Y})},[i,c,S]),X=v.useMemo(()=>({state:h,dispatch:p,isReadOnly:m,saveContent:Z,saveEvals:W,runCase:ee,runAll:se,cancelCase:G,cancelAll:I,improveForCase:le,applyImproveAndRerun:F,refreshSkillContent:J,generateEvals:he,runActivationTest:D,submitAiEdit:re,cancelAiEdit:ge,applyAiEdit:ye,discardAiEdit:Q,toggleEvalChange:ue,selectAllEvalChanges:Ee,deselectAllEvalChanges:N,retryEvalsSave:A}),[h,m,Z,W,ee,se,G,I,le,F,J,he,D,re,ge,ye,Q,ue,Ee,N,A]);return n.jsx(Dx.Provider,{value:X,children:u})}function Dh({state:i,isReadOnly:c,onDelete:d}){const{plugin:u,skill:m,evals:h,latestBenchmark:p,isDirty:g,caseRunStates:y,regressions:f,iterationCount:E}=i,b=Array.from(y.values()).some(W=>W.status==="running"||W.status==="queued"),C=p==null?void 0:p.overall_pass_rate,R=(h==null?void 0:h.evals.reduce((W,ee)=>W+ee.assertions.length,0))??0,B=(h==null?void 0:h.evals.length)??0,V=C!=null?C>=80?"var(--green)":C>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",Z=C!=null?C>=80?"var(--green-muted)":C>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:u}),n.jsx(Lh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:m}),c&&n.jsxs("span",{className:"ml-2 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),g&&n.jsx("span",{className:"ml-2 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--yellow-muted)",color:"var(--yellow)"},children:"unsaved"}),b&&n.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!c&&d&&n.jsx("button",{disabled:b,onClick:()=>{window.confirm(`Delete skill "${m}"? This cannot be undone.`)&&d()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:b?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:b?.4:1,borderRadius:4},onMouseEnter:W=>{b||(W.currentTarget.style.color="var(--red)")},onMouseLeave:W=>{W.currentTarget.style.color="var(--text-tertiary)"},children:n.jsx(Bh,{})}),f.length>0&&n.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),n.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),n.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),f.length," regression",f.length>1?"s":""]}),E>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",E]}),n.jsx("span",{className:"pill",style:{background:Z,color:V},children:C!=null?`${Math.round(C*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[B," case",B!==1?"s":""," / ",R," assert",R!==1?"s":""]})]})]})}function Lh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Bh(){return n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),n.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Uh=[{label:"Build",tabs:[{id:"editor",label:"Editor",shortcut:"1"},{id:"tests",label:"Tests",shortcut:"2"}]},{label:"Evaluate",tabs:[{id:"run",label:"Run",shortcut:"3"},{id:"activation",label:"Activation",shortcut:"4"}]},{label:"Insights",tabs:[{id:"history",label:"History",shortcut:"5"},{id:"deps",label:"Deps",shortcut:"6"}]}];function Hh({id:i}){const c={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(i){case"editor":return n.jsxs("svg",{...c,children:[n.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"tests":return n.jsxs("svg",{...c,children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]});case"run":return n.jsx("svg",{...c,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...c,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return n.jsxs("svg",{...c,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"deps":return n.jsxs("svg",{...c,children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}}function qh({activePanel:i,onPanelChange:c,isDirty:d,isRunning:u,hasRegressions:m,isActivationRunning:h}){return n.jsx("div",{className:"flex items-center gap-0.5 px-3 overflow-x-auto",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:Uh.map((p,g)=>n.jsxs("div",{className:"flex items-center",children:[g>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),p.tabs.map(y=>{const f=i===y.id,E=y.id==="editor"&&d||y.id==="run"&&u||y.id==="activation"&&h||y.id==="history"&&m,b=y.id==="run"||y.id==="activation"?"var(--accent)":y.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>c(y.id),title:`${y.label} (Ctrl+${y.shortcut})`,className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[12px] font-medium transition-colors duration-150",style:{background:"transparent",color:f?"var(--text-primary)":"var(--text-tertiary)",borderBottom:f?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:f?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:C=>{f||(C.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:C=>{f||(C.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(Hh,{id:y.id}),y.label,E&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:b}})]},y.id)})]},p.label))})}function Yh(i){const c=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!c)return{metadata:{},body:i};const d=c[1],u=c[2].trim(),m={},h=d.split(`
53
+ `);let p="",g=!1;for(const y of h){const f=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&g){const C=f[1],R=f[2].trim();let B=m[p];if((typeof B!="object"||Array.isArray(B))&&(B={},m[p]=B),!R)B[C]=[];else{const V=R.match(/^\[(.+)\]$/);V?B[C]=V[1].split(",").map(Z=>Z.trim().replace(/^["']|["']$/g,"")).filter(Boolean):B[C]=R.replace(/^["']|["']$/g,"")}continue}const E=y.match(/^\s+-\s+(.+)$/);if(E&&p){g=!1;const C=m[p];Array.isArray(C)?C.push(E[1].trim().replace(/^["']|["']$/g,"")):m[p]=[E[1].trim().replace(/^["']|["']$/g,"")];continue}const b=y.match(/^([\w-]+):\s*(.*)$/);if(b){p=b[1];const C=b[2].trim();if(g=!1,!C){m[p]={},g=!0;continue}const R=C.match(/^\[(.+)\]$/);if(R){m[p]=R[1].split(",").map(B=>B.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}m[p]=C.replace(/^["']|["']$/g,"")}}return{metadata:m,body:u}}function Nr(i){if(!i)return"";try{let c=i.replace(/^---\n[\s\S]*?\n---\n?/,""),d=Gh(c);return d=d.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:var(--surface-2);padding:0.75rem;border-radius:6px;overflow-x:auto;font-size:12px;line-height:1.5;margin:0.5rem 0;border:1px solid var(--border-subtle)"><code>$2</code></pre>'),d=d.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),d=d.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),d=d.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),d=d.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),d=d.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),d=d.replace(/\*([^*]+)\*/g,"<em>$1</em>"),d=d.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),d=d.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),d=d.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),d=d.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),d=d.replace(/\n/g,"<br/>"),d}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</pre>`}}function Gh(i){const c=i.split(`
54
+ `),d=[];let u=0;for(;u<c.length;)if(c[u].trim().startsWith("|")&&u+1<c.length&&c[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(c[u+1])){const m=vx(c[u]);u+=2;const h=[];for(;u<c.length&&c[u].trim().startsWith("|");)h.push(vx(c[u])),u++;const p='style="text-align:left;padding:0.4rem 0.6rem;font-weight:600;font-size:12px;color:var(--text-primary);border-bottom:1px solid var(--border-default)"',g='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let y='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';y+="<thead><tr>";for(const f of m)y+=`<th ${p}>${f}</th>`;y+="</tr></thead><tbody>";for(const f of h){y+="<tr>";for(const E of f)y+=`<td ${g}>${E}</td>`;y+="</tr>"}y+="</tbody></table>",d.push(y)}else d.push(c[u]),u++;return d.join(`
55
+ `)}function vx(i){return i.split("|").map(c=>c.trim()).filter(c=>c.length>0)}function Er(i,c){const d=i.split(`
56
+ `),u=c.split(`
57
+ `);if(d.length>1e3||u.length>1e3)return[...d.map(E=>({type:"unchanged",content:E}))];const m=d.length,h=u.length,p=Array.from({length:m+1},()=>new Array(h+1).fill(0));for(let E=1;E<=m;E++)for(let b=1;b<=h;b++)d[E-1]===u[b-1]?p[E][b]=p[E-1][b-1]+1:p[E][b]=Math.max(p[E-1][b],p[E][b-1]);const g=[];let y=m,f=h;for(;y>0||f>0;)y>0&&f>0&&d[y-1]===u[f-1]?(g.push({type:"unchanged",content:d[y-1]}),y--,f--):f>0&&(y===0||p[y][f-1]>=p[y-1][f])?(g.push({type:"added",content:u[f-1]}),f--):(g.push({type:"removed",content:d[y-1]}),y--);return g.reverse()}function Vh(i,c){if(c&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(i))return n.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const u=new Set(["generating","comparing","preparing","generating_skill","generating_baseline","scoring","action_items"]);return n.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u.has(i)?"var(--accent)":"var(--green)"}})}function ss({entries:i,isRunning:c}){const[d,u]=v.useState(!1),m=v.useRef(null);return v.useEffect(()=>{m.current&&!d&&(m.current.scrollTop=m.current.scrollHeight)},[i,d]),i.length===0&&!c?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>u(!d),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-tertiary)"},children:[n.jsxs("span",{className:"flex items-center gap-2",children:[c&&n.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",i.length,")"]}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:d?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!d&&n.jsx("div",{ref:m,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((h,p)=>{const g=p===i.length-1&&c,y=p===0?"0s":`+${((h.timestamp-i[0].timestamp)/1e3).toFixed(1)}s`;return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:g?1:.7},children:[Vh(h.phase,g),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:y}),n.jsx("span",{style:{color:g?"var(--text-primary)":"var(--text-secondary)"},children:h.message}),h.current!=null&&h.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",h.current,"/",h.total,"]"]})]},p)})})]})}const yx={rate_limit:{icon:"⏱",color:"var(--amber, #f59e0b)"},context_window:{icon:"⚠",color:"var(--amber, #f59e0b)"},auth:{icon:"🔒",color:"var(--red, #ef4444)"},timeout:{icon:"⌛",color:"var(--amber, #f59e0b)"},provider_unavailable:{icon:"⚡",color:"var(--red, #ef4444)"},parse_error:{icon:"❓",color:"var(--amber, #f59e0b)"},unknown:{icon:"❌",color:"var(--red, #ef4444)"}};function kr({error:i,onRetry:c,onDismiss:d}){const[u,m]=v.useState(null),h=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?m(Math.ceil(i.retryAfterMs/1e3)):m(null),()=>{h.current&&clearInterval(h.current)}),[i]),v.useEffect(()=>{if(!(u==null||u<=0))return h.current=setInterval(()=>{m(y=>y==null||y<=1?(h.current&&clearInterval(h.current),0):y-1)},1e3),()=>{h.current&&clearInterval(h.current)}},[u!=null&&u>0]);const p=yx[i.category]||yx.unknown,g=u!=null&&u>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${p.color} 30%, transparent)`,background:`color-mix(in srgb, ${p.color} 6%, var(--surface-1))`},children:[n.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{style:{fontSize:14},children:p.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:p.color},children:i.title})]}),d&&n.jsx("button",{onClick:d,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(c||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:c&&n.jsx("button",{onClick:c,disabled:g,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:g?.5:1},children:g?`Retry in ${u}s`:"Retry"})})]})]})}function Qh({plugin:i,skill:c,skillContent:d,onApplied:u}){const[m,h]=v.useState("closed"),{config:p}=dn(),[g,y]=v.useState("claude-cli"),[f,E]=v.useState("opus"),[b,C]=v.useState([]),[R,B]=v.useState(""),[V,Z]=v.useState(""),[W,ee]=v.useState(null),[se,G]=v.useState(null),[I,le]=v.useState([]),[F,ae]=v.useState(!1),ve=v.useRef(null);v.useEffect(()=>{if(!p)return;p.providers.find(A=>A.id==="claude-cli"&&A.available)&&(y("claude-cli"),E("opus"))},[p]),v.useEffect(()=>()=>{var N;(N=ve.current)==null||N.abort()},[]);function re(){return p==null?void 0:p.providers.find(N=>N.id===g&&N.available)}const ge=v.useCallback(()=>{var N;(N=ve.current)==null||N.abort(),h("open")},[]);async function ye(){h("loading"),ee(null),G(null),le([]);const N=new AbortController;ve.current=N;try{const A=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(c)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:g,model:f}),signal:N.signal});if(!A.ok||!A.body){let D=`HTTP ${A.status}`;try{const X=await A.json();X.error&&(D=X.error)}catch{}throw new Error(D)}const J=A.body.getReader(),ce=new TextDecoder;let he="",S="";for(;;){const{done:D,value:X}=await J.read();if(D)break;he+=ce.decode(X,{stream:!0});const M=he.split(`
58
+ `);he=M.pop()||"";for(const q of M)if(q.startsWith("event: "))S=q.slice(7).trim();else if(q.startsWith("data: ")){try{const Y=JSON.parse(q.slice(6));S==="progress"?le(K=>[...K,{phase:Y.phase,message:Y.message,timestamp:Date.now()}]):S==="done"||S==="complete"?(B(Y.improved),Z(Y.reasoning||""),C(Er(Y.original||d,Y.improved)),h("diff_shown")):S==="error"&&(ee(Y.message||Y.description||"Unknown error"),Y.category&&G(Y),h("open"))}catch{}S=""}}}catch(A){A.name!=="AbortError"&&(ee(A.message),h("open"))}finally{ve.current=null}}async function Q(){ae(!0);try{await Te.applyImprovement(i,c,R),u(R),h("closed")}catch(N){ee(N.message)}finally{ae(!1)}}function ue(){h("closed"),C([]),B(""),Z(""),ee(null)}if(m==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!d,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const Ee=re();return n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),n.jsx("button",{onClick:ue,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:N=>{N.currentTarget.style.background="var(--surface-3)"},onMouseLeave:N=>{N.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(m==="open"||m==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:g,onChange:N=>{y(N.target.value);const A=p==null?void 0:p.providers.find(J=>J.id===N.target.value);A!=null&&A.models[0]&&E(A.models[0].id)},disabled:m==="loading",children:p==null?void 0:p.providers.filter(N=>N.available).map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:N=>E(N.target.value),disabled:m==="loading",children:Ee==null?void 0:Ee.models.map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),m==="loading"?n.jsx("button",{onClick:ge,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ye,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),m==="loading"&&I.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(ss,{entries:I,isRunning:!0})})]}),W&&n.jsx("div",{className:"mb-4",children:se?n.jsx(kr,{error:se,onRetry:ye,onDismiss:()=>{ee(null),G(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:W})}),m==="diff_shown"&&n.jsxs(n.Fragment,{children:[V&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),V]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:b.map((N,A)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:N.type==="added"?"rgba(34,197,94,0.1)":N.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:N.type==="added"?"var(--green)":N.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:N.type==="added"?"3px solid var(--green)":N.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:N.type==="added"?"+":N.type==="removed"?"-":" "}),N.content]},A))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:Q,disabled:F,className:"btn btn-primary",children:F?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),n.jsx("button",{onClick:ue,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const gx={remove:{bg:"var(--red-muted)",color:"var(--red)",label:"REMOVE"},modify:{bg:"rgba(251,191,36,0.15)",color:"#fbbf24",label:"MODIFY"},add:{bg:"var(--green-muted)",color:"var(--green)",label:"ADD"}},Xh={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function Zh({change:i,index:c,selected:d,onToggle:u,originalEval:m}){var b;const[h,p]=v.useState(!1),g=gx[i.action]??gx.add,y=Xh[i.action]??"var(--border-subtle)",f=i.action==="remove"?(m==null?void 0:m.name)??`Eval #${i.evalId}`:((b=i.eval)==null?void 0:b.name)??"Unnamed",E=v.useCallback(()=>u(c),[u,c]);return n.jsxs("div",{className:"rounded-lg transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderLeft:`3px solid ${y}`,opacity:d?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:d,onChange:E,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:g.bg,color:g.color,padding:"1px 6px"},children:g.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>p(!h),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:C=>{C.currentTarget.style.background="var(--surface-3)"},onMouseLeave:C=>{C.currentTarget.style.background="transparent"},children:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:h?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&n.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[i.action==="add"&&i.eval&&n.jsx(Kh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&m&&n.jsx(Jh,{original:m,proposed:i.eval}),i.action==="remove"&&m&&n.jsx($h,{evalCase:m})]})]})}function Kh({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Pc,{label:"Prompt",value:i.prompt}),n.jsx(Pc,{label:"Expected",value:i.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(d=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",d.text]},d.id))})]})]})}function Jh({original:i,proposed:c}){const d=[];i.name!==c.name&&d.push({label:"Name",old:i.name,new:c.name}),i.prompt!==c.prompt&&d.push({label:"Prompt",old:i.prompt,new:c.prompt}),i.expected_output!==c.expected_output&&d.push({label:"Expected",old:i.expected_output,new:c.expected_output});const u=i.assertions??[],m=c.assertions??[],h=new Set(u.map(f=>f.text)),p=new Set(m.map(f=>f.text)),g=m.filter(f=>!h.has(f.text)),y=u.filter(f=>!p.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[d.map(f=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),n.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[n.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",eo(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",eo(f.new,120)]})]})]},f.label)),(g.length>0||y.length>0)&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),n.jsxs("div",{className:"mt-1 space-y-0.5",children:[y.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),g.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),d.length===0&&g.length===0&&y.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function $h({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Pc,{label:"Prompt",value:i.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(d=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:d.text},d.id))})]})]})}function Pc({label:i,value:c}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),n.jsx("div",{className:"mt-0.5 text-[11px] p-2 rounded font-mono",style:{background:"var(--surface-1)",color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:eo(c,300)})]})}function eo(i,c){return i.length>c?i.slice(0,c)+"...":i}const bx={remove:0,modify:1,add:2};function Wh({changes:i,selections:c,currentEvals:d,onToggle:u,onSelectAll:m,onDeselectAll:h}){if(i.length===0)return null;const p=i.map((y,f)=>({change:y,originalIndex:f}));p.sort((y,f)=>(bx[y.change.action]??2)-(bx[f.change.action]??2));const g=Array.from(c.values()).filter(Boolean).length;return n.jsxs("div",{className:"mt-3 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",g,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:m,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Select All"}),n.jsx("button",{onClick:h,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--surface-3)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:p.map(({change:y,originalIndex:f})=>n.jsx(Zh,{change:y,index:f,selected:c.get(f)??!1,onToggle:u,originalEval:y.evalId!=null?d.find(E=>E.id===y.evalId):void 0},f))})]})}function Fh(){var N;const{state:i,dispatch:c,submitAiEdit:d,applyAiEdit:u,discardAiEdit:m,cancelAiEdit:h,toggleEvalChange:p,selectAllEvalChanges:g,deselectAllEvalChanges:y,retryEvalsSave:f}=nl(),{aiEditLoading:E,aiEditResult:b,aiEditError:C,aiEditClassifiedError:R,aiEditProgress:B,aiEditEvalChanges:V,aiEditEvalSelections:Z,aiEditEvalsRetry:W}=i,[ee,se]=v.useState(""),{config:G}=dn(),[I,le]=v.useState("claude-cli"),[F,ae]=v.useState("opus"),ve=v.useRef(null);v.useEffect(()=>{var A;(A=ve.current)==null||A.focus()},[]),v.useEffect(()=>{if(!G)return;G.providers.find(J=>J.id==="claude-cli"&&J.available)&&(le("claude-cli"),ae("opus"))},[G]);const re=G==null?void 0:G.providers.find(A=>A.id===I&&A.available),ge=v.useCallback(()=>{const A=ee.trim();!A||E||d(A,I,F)},[ee,E,d,I,F]),ye=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ge()),A.key==="Escape"&&(A.preventDefault(),E?h():m())},[ge,E,h,m]),Q=v.useCallback(()=>{c({type:"CLOSE_AI_EDIT"}),c({type:"OPEN_AI_EDIT"})},[c]),ue=b?Er(i.skillContent,b.improved):[],Ee=((N=i.evals)==null?void 0:N.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:m,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:A=>{A.currentTarget.style.background="var(--surface-3)"},onMouseLeave:A=>{A.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:ve,value:ee,onChange:A=>se(A.target.value),onKeyDown:ye,placeholder:"e.g., Add an error handling section...",disabled:E,rows:1,className:"w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"8px 12px",fontSize:12.5,lineHeight:1.5,fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",minHeight:36,maxHeight:96},onInput:A=>{const J=A.currentTarget;J.style.height="auto",J.style.height=Math.min(J.scrollHeight,96)+"px"}})}),n.jsxs("div",{style:{minWidth:100},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:I,onChange:A=>{le(A.target.value);const J=G==null?void 0:G.providers.find(ce=>ce.id===A.target.value);J!=null&&J.models[0]&&ae(J.models[0].id)},disabled:E,style:{width:"100%"},children:G==null?void 0:G.providers.filter(A=>A.available).map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:F,onChange:A=>ae(A.target.value),disabled:E,style:{width:"100%"},children:re==null?void 0:re.models.map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),E?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:ge,disabled:!ee.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),E&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(ss,{entries:B,isRunning:!0})})]}),C&&n.jsx("div",{className:"mt-3",children:R?n.jsx(kr,{error:R,onRetry:Q,onDismiss:m}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:C})}),b&&n.jsxs("div",{className:"animate-fade-in",children:[b.reasoning&&n.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),b.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:ue.map((A,J)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:A.type==="added"?"rgba(34,197,94,0.1)":A.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:A.type==="added"?"var(--green)":A.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:A.type==="added"?"3px solid var(--green)":A.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:A.type==="added"?"+":A.type==="removed"?"-":" "}),A.content]},J))}),n.jsx(Wh,{changes:V,selections:Z,currentEvals:Ee,onToggle:p,onSelectAll:g,onDeselectAll:y}),W&&n.jsxs("div",{className:"mt-3 px-3 py-2.5 rounded-lg text-[12px] flex items-center justify-between",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.3)",color:"#fbbf24"},children:[n.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),n.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("button",{onClick:u,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:m,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:Q,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function Ih(i,c){const[d,u]=v.useState([]),[m,h]=v.useState("SKILL.md"),[p,g]=v.useState(null),[y,f]=v.useState(!1),[E,b]=v.useState(null),C=v.useCallback(async()=>{try{const V=await Te.getSkillFiles(i,c);u(V.files)}catch{u([])}},[i,c]);v.useEffect(()=>{h("SKILL.md"),g(null),b(null),C()},[i,c,C]);const R=v.useCallback(async V=>{if(h(V),V==="SKILL.md"){g(null),b(null);return}f(!0),b(null);try{const Z=await Te.getSkillFile(i,c,V);g(Z)}catch(Z){b(`Unable to open file: ${Z.message}`),g(null)}finally{f(!1)}},[i,c]),B=v.useCallback(()=>{C()},[C]);return{files:d,activeFile:m,secondaryContent:p,loading:y,error:E,selectFile:R,refresh:B,isSkillMd:m==="SKILL.md"}}function Ph(i){const c=[],d=new Map;for(const u of i){const m=u.path.split("/"),p={name:m[m.length-1],path:u.path,type:u.type,children:[]};d.set(u.path,p)}for(const u of i){const m=u.path.split("/");if(m.length===1){const h=d.get(u.path);h&&c.push(h)}else{const h=m.slice(0,-1).join("/"),p=d.get(h),g=d.get(u.path);p&&g&&p.children.push(g)}}return c}function Lx({expanded:i}){return n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Bx(){return n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function ev(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function tv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("polyline",{points:"1 20 1 14 7 14"}),n.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Ux({node:i,depth:c,activeFile:d,onSelect:u}){const[m,h]=v.useState(!0),p=i.path===d;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>h(!m),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left"},children:[n.jsx(Lx,{expanded:m}),n.jsx(Bx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),m&&i.children.map(g=>n.jsx(Ux,{node:g,depth:c+1,activeFile:d,onSelect:u},g.path))]}):n.jsxs("button",{onClick:()=>u(i.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:p?"var(--accent-muted)":"none",border:"none",cursor:"pointer",color:p?"var(--accent)":"var(--text-tertiary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left",borderRadius:3},children:[n.jsx("span",{style:{width:10}}),n.jsx(ev,{}),n.jsx("span",{children:i.name})]})}function lv({files:i,activeFile:c,onSelect:d,onRefresh:u}){const[m,h]=v.useState(!1),p=v.useMemo(()=>Ph(i),[i]);return n.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>h(!m),children:[n.jsx(Lx,{expanded:m}),n.jsx(Bx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),n.jsx("button",{onClick:g=>{g.stopPropagation(),u()},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"2px 4px",display:"flex",alignItems:"center",borderRadius:3},title:"Refresh file list",children:n.jsx(tv,{})})]}),m&&n.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?n.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(g=>n.jsx(Ux,{node:g,depth:0,activeFile:c,onSelect:y=>{d(y),h(!1)}},g.path))})]})}function gr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function av(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function nv(i){const c=i.toLowerCase();return c.endsWith(".json")?"json":c.endsWith(".md")?"md":"other"}function jx({content:i}){return n.jsx("textarea",{readOnly:!0,value:i,style:{flex:1,width:"100%",resize:"none",background:"var(--surface-1)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}})}function Sx({content:i,fileType:c}){if(c==="json"){const d=av(i);return n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:d})}return c==="md"?n.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px 20px",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:13,lineHeight:1.6},dangerouslySetInnerHTML:{__html:Nr(i)}}):n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})}function sv({file:i,loading:c,error:d,viewMode:u}){const[m,h]=v.useState(u),p=u!==m?u:m;if(c)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(d)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:n.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[n.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),n.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:d})]})});if(!i)return null;if(i.binary)return n.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",gr(i.size),") — cannot be displayed"]});const g=i.content??"",y=nv(i.path);return n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[i.truncated&&n.jsxs("div",{style:{padding:"4px 12px",background:"var(--warning-muted, #fef3c7)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:"var(--warning-text, #92400e)"},children:["File truncated at ",gr(512*1024)," — ",gr(i.size)," total"]}),y!=="other"&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[["raw","split","preview"].map(f=>n.jsx("button",{onClick:()=>h(f),style:{padding:"2px 8px",fontSize:11,background:p===f?"var(--accent-muted)":"none",color:p===f?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:f},f)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center"},children:[gr(i.size)," · read-only"]})]}),n.jsx("div",{style:{flex:1,display:"flex",minHeight:0},children:p==="split"&&y!=="other"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:n.jsx(jx,{content:g})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:n.jsx(Sx,{content:g,fileType:y})})]}):p==="preview"&&y!=="other"?n.jsx(Sx,{content:g,fileType:y}):n.jsx(jx,{content:g})})]})}function rv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function iv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function cv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function ov({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}function Qc({size:i=15}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function uv(){const{state:i,dispatch:c,saveContent:d,isReadOnly:u}=nl(),{plugin:m,skill:h,skillContent:p,isDirty:g,improveTarget:y,aiEditOpen:f}=i,[E,b]=v.useState("split"),[C,R]=v.useState(!1),B=v.useRef(null),[V,Z]=v.useState(!1),[W,ee]=v.useState(""),[se,G]=v.useState(!1),[I,le]=v.useState(null),[F,ae]=v.useState([]),[ve,re]=v.useState([]),[ge,ye]=v.useState(null),Q=v.useRef(null),{config:ue}=dn(),{files:Ee,activeFile:N,secondaryContent:A,loading:J,error:ce,selectFile:he,refresh:S,isSkillMd:D}=Ih(m??"",h??"");v.useEffect(()=>()=>{var P;(P=Q.current)==null||P.abort()},[]);const{metadata:X,body:M}=Yh(p),q=X["allowed-tools"],Y=Array.isArray(q)?q:typeof q=="string"?[q]:[],K=X.name,de=X.description,me=X.metadata,Ze=typeof me=="object"&&!Array.isArray(me)?me:null,et=X.version||(Ze==null?void 0:Ze.version),$t=X.tags||(Ze==null?void 0:Ze.tags),Al=Array.isArray($t)?$t:typeof $t=="string"?$t.split(",").map(P=>P.trim()).filter(Boolean):[],Wt=new Set(["name","description","metadata","allowed-tools","version","tags"]),sl=Object.entries(X).filter(([P])=>!Wt.has(P)),rl=v.useCallback(async()=>{R(!0),await d(),R(!1)},[d]),wl=v.useCallback(P=>{(P.ctrlKey||P.metaKey)&&P.key==="s"&&(P.preventDefault(),P.stopPropagation(),g&&rl()),(P.ctrlKey||P.metaKey)&&P.key==="k"&&(P.preventDefault(),P.stopPropagation(),c({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[g,rl,f,c]),_l=v.useCallback(async()=>{var ze,mt;if(!W.trim())return;(ze=Q.current)==null||ze.abort();const P=new AbortController;Q.current=P,G(!0),ye(null),re([]),le(null),ae([]);try{const Qt=(ue==null?void 0:ue.provider)||"claude-cli",$=(ue==null?void 0:ue.model)||"sonnet",_e=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:W,provider:Qt,model:$}),signal:P.signal});if(!_e.ok||!_e.body){let Mt=`HTTP ${_e.status}`;try{const Ve=await _e.json();Ve.error&&(Mt=Ve.error)}catch{}throw new Error(Mt)}const Xt=_e.body.getReader(),Nt=new TextDecoder;let pt="",It="";for(;;){const{done:Mt,value:Ve}=await Xt.read();if(Mt)break;pt+=Nt.decode(Ve,{stream:!0});const at=pt.split(`
59
+ `);pt=at.pop()||"";for(const Ge of at)if(Ge.startsWith("event: "))It=Ge.slice(7).trim();else if(Ge.startsWith("data: ")){try{const $e=JSON.parse(Ge.slice(6));if(It==="progress")re(Et=>[...Et,{phase:$e.phase,message:$e.message,timestamp:Date.now()}]);else if(It==="done"||It==="complete"){const Et=["---"];$e.name&&Et.push(`name: ${$e.name}`),$e.description&&Et.push(`description: "${$e.description.replace(/"/g,'\\"')}"`),$e.model&&Et.push(`model: ${$e.model}`),(mt=$e.allowedTools)!=null&&mt.trim()&&Et.push(`allowed-tools: ${$e.allowedTools.trim()}`),Et.push("---","",$e.body||"");const cl=Et.join(`
60
+ `);le(cl),ae(Er(p,cl)),G(!1)}else It==="error"&&(ye($e.message||$e.description||"Generation failed"),G(!1))}catch{}It=""}}}catch(Qt){Qt.name!=="AbortError"&&ye(Qt.message)}finally{G(!1),Q.current=null}},[W,ue,p]),Ft=v.useCallback(()=>{I&&c({type:"SET_CONTENT",content:I}),Z(!1),le(null),ae([]),ee(""),re([])},[I,c]),Vt=v.useCallback(()=>{Z(!1),le(null),ae([]),ee(""),re([]),ye(null)},[]),Rl=v.useCallback(()=>{var P;V?((P=Q.current)==null||P.abort(),Vt()):(f&&c({type:"CLOSE_AI_EDIT"}),Z(!0))},[V,f,c,Vt]),il=[{mode:"raw",icon:n.jsx(rv,{}),label:"Editor"},{mode:"split",icon:n.jsx(iv,{}),label:"Split"},{mode:"preview",icon:n.jsx(cv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:wl,tabIndex:-1,children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:il.map(({mode:P,icon:ze,label:mt})=>n.jsxs("button",{onClick:()=>b(P),title:mt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:E===P?"var(--surface-4)":"transparent",color:E===P?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:E===P?600:400,border:"none",cursor:"pointer"},children:[ze,n.jsx("span",{style:{letterSpacing:"0.01em"},children:mt})]},P))}),D?u?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{f?c({type:"CLOSE_AI_EDIT"}):(V&&Vt(),c({type:"OPEN_AI_EDIT"}))},title:"Edit with AI (Ctrl+K)",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:f?600:400,border:"none",cursor:"pointer",color:f?"#a855f7":"var(--text-tertiary)",background:f?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(ov,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Rl,title:"Regenerate skill from prompt",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:V?600:400,border:"none",cursor:"pointer",color:V?"#a855f7":"var(--text-tertiary)",background:V?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Qc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),g&&n.jsx("button",{onClick:()=>c({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:rl,disabled:!g||C,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:C?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),m&&h&&n.jsx(lv,{files:Ee,activeFile:N,onSelect:he,onRefresh:S}),!D&&n.jsx(sv,{file:A,loading:J,error:ce,viewMode:E}),D&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:E==="raw"||E==="preview"?"1fr":"1fr 1fr"},children:[E!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:E==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:p,onChange:P=>{u||c({type:"SET_CONTENT",content:P.target.value})},onKeyDown:wl,spellCheck:!1,readOnly:u,className:"flex-1 w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",fontSize:12.5,lineHeight:1.7,tabSize:2,border:"none",padding:"16px 20px",opacity:u?.7:1}})}),E!=="raw"&&n.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(K||et||de)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[K&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:K}),et&&n.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4,letterSpacing:"0.03em",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:["v",et]})]}),de&&n.jsx("p",{style:{fontSize:12.5,lineHeight:1.65,color:"var(--text-secondary)",margin:0,paddingLeft:12,borderLeft:"2px solid var(--accent)",maxWidth:600},children:de})]}),Al.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:Al.map(P=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:P},P))}),Y.length>0&&n.jsx("div",{style:{marginBottom:16},children:n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),Y.map(P=>n.jsx("span",{style:{fontSize:10.5,fontFamily:"var(--font-mono, ui-monospace, monospace)",color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4},children:P},P))]})}),sl.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:sl.map(([P,ze],mt)=>{const Qt=Array.isArray(ze)?ze.join(", "):typeof ze=="object"?Object.entries(ze).map(([$,_e])=>`${$}: ${Array.isArray(_e)?_e.join(", "):_e}`).join(" | "):ze;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:mt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:P}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Qt})]},P)})}),(K||de||Al.length>0||Y.length>0||sl.length>0)&&M&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),M&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(M)}})]})})]}),D&&f&&n.jsx(Fh,{}),D&&V&&n.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:n.jsxs("div",{className:"px-4 py-3",children:[!I&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),n.jsx("div",{className:"flex gap-2 mb-2",children:n.jsx("textarea",{value:W,onChange:P=>ee(P.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:se,className:"flex-1 px-3 py-2 rounded-lg text-[12px] resize-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none",opacity:se?.5:1},onKeyDown:P=>{P.key==="Enter"&&(P.ctrlKey||P.metaKey)&&W.trim()&&!se&&(P.preventDefault(),_l())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[se?n.jsx("button",{onClick:()=>{var P;(P=Q.current)==null||P.abort(),G(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:_l,disabled:!W.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Vt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),se&&ve.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(ss,{entries:ve,isRunning:!0})}),ge&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ge,n.jsx("button",{onClick:_l,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),I&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:F.map((P,ze)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:P.type==="added"?"rgba(34,197,94,0.1)":P.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:P.type==="added"?"var(--green)":P.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:P.type==="added"?"3px solid var(--green)":P.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:P.type==="added"?"+":P.type==="removed"?"-":" "}),P.content]},ze))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Ft,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:Vt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),D&&y!==null&&m&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Qh,{plugin:m,skill:h,skillContent:p,onApplied:P=>{c({type:"SET_CONTENT",content:P}),c({type:"CONTENT_SAVED"}),c({type:"CLOSE_IMPROVE"})}})})]})}function to(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Hx(i){const c=new Date(i);return c.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function qx(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}function Yx({entries:i}){if(i.length<2)return null;const c=80,d=24,u=2,m=i.slice().reverse(),h=m.length,p=m.map((g,y)=>{const f=u+y/(h-1)*(c-u*2),E=u+(d-u*2)-g.pass_rate*(d-u*2);return`${f},${E}`});return n.jsxs("svg",{width:c,height:d,style:{display:"block",flexShrink:0},children:[n.jsx("polyline",{points:p.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),p.length>0&&n.jsx("circle",{cx:parseFloat(p[p.length-1].split(",")[0]),cy:parseFloat(p[p.length-1].split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function dv(i,c,d){const[u,m]=v.useState(null),[h,p]=v.useState(!1),g=v.useRef("");v.useEffect(()=>{const f=`${i}/${c}/${d}`;g.current!==f&&(g.current=f,p(!0),Te.getCaseHistory(i,c,d).then(E=>m(E)).catch(()=>m([])).finally(()=>p(!1)))},[i,c,d]);const y=v.useCallback(()=>{p(!0),g.current="",Te.getCaseHistory(i,c,d).then(f=>m(f)).catch(()=>m([])).finally(()=>p(!1))},[i,c,d]);return{entries:u,loading:h,refetch:y}}function fv(i,c,d){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!d||d.length===0)return u;const h=d.slice(0,10).map(y=>y.assertions.find(f=>f.id===i)).filter(Boolean);if(h.length>=2){const f=h.filter(E=>E.pass).length/h.length;f>=.3&&f<=.7&&(u.flaky=!0)}const p=d.find(y=>y.type==="benchmark"),g=d.find(y=>y.type==="baseline");if(p&&g){const y=p.assertions.find(E=>E.id===i),f=g.assertions.find(E=>E.id===i);y!=null&&y.pass&&(f!=null&&f.pass)&&(u.nonDiscriminating=!0)}if(c&&!c.pass&&d.length>=1){const f=d[0].assertions.find(E=>E.id===i);f!=null&&f.pass&&(u.regression=!0)}return u}function xv(){var ve;const{state:i,dispatch:c,saveEvals:d,runCase:u,runAll:m,cancelCase:h,cancelAll:p,generateEvals:g,isReadOnly:y}=nl(),{evals:f,evalsError:E,selectedCaseId:b,inlineResults:C,caseRunStates:R,generateEvalsLoading:B,generateEvalsProgress:V,generateEvalsError:Z}=i,W=v.useMemo(()=>{for(const re of R.values())if(re.status==="running"||re.status==="queued")return!0;return!1},[R]),[ee,se]=v.useState(!1),G={skill_name:i.skill,evals:[]},I=f??G,le=I.evals,F=le.find(re=>re.id===b)??null,ae=v.useCallback(()=>{g()},[g]);return!f||le.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:E?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:E?n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--error, #f87171)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsx("div",{className:"text-center",children:E?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),n.jsx("div",{className:"text-[11px] font-mono px-3 py-2 rounded mt-1 max-w-sm text-left break-words",style:{color:"var(--text-secondary)",background:"var(--surface-2)"},children:E}),n.jsx("div",{className:"text-[12px] mt-2",style:{color:"var(--text-tertiary)"},children:"Fix the evals.json file and reload, or regenerate test cases with AI"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>se(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:ae,disabled:B||y,className:"btn btn-secondary text-[12px]",children:B?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),B&&V.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(ss,{entries:V,isRunning:!0})}),Z&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(kr,{error:Z,onRetry:ae})}),ee&&n.jsx(Nx,{evals:I,onSave:re=>{d(re),se(!1)},onCancel:()=>se(!1)})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[n.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",le.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:W?n.jsx("button",{onClick:p,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m("benchmark"),disabled:le.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>m("comparison"),disabled:le.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:le.map(re=>{const ge=C.get(re.id),ye=b===re.id;return n.jsxs("button",{onClick:()=>c({type:"SELECT_CASE",caseId:re.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:ye?"var(--accent-muted)":"transparent",borderLeft:ye?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:Q=>{ye||(Q.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Q=>{ye||(Q.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:ye?"var(--text-primary)":"var(--text-secondary)"},children:["#",re.id," ",re.name]}),n.jsx(Gx,{result:ge})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[re.assertions.length," assertion",re.assertions.length!==1?"s":"",(ge==null?void 0:ge.passRate)!=null&&n.jsx(hv,{passRate:ge.passRate})]})]},re.id)})}),n.jsx("div",{className:"px-3 py-2",children:!y&&n.jsx("button",{onClick:()=>se(!0),className:"w-full py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{border:"1px dashed var(--border-default)",color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:re=>{re.currentTarget.style.borderColor="var(--accent)",re.currentTarget.style.color="var(--accent)"},onMouseLeave:re=>{re.currentTarget.style.borderColor="var(--border-default)",re.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:F?n.jsx(mv,{evalCase:F,result:C.get(F.id),evals:f,caseStatus:((ve=R.get(F.id))==null?void 0:ve.status)??"idle",onSaveEvals:d,onRun:re=>u(re,"benchmark"),onCompare:re=>u(re,"comparison"),onCancel:re=>h(re),onImprove:re=>c({type:"OPEN_IMPROVE",evalId:re})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),ee&&n.jsx(Nx,{evals:I,onSave:re=>{d(re),se(!1)},onCancel:()=>se(!1)})]})}function mv({evalCase:i,result:c,evals:d,caseStatus:u,onSaveEvals:m,onRun:h,onCompare:p,onCancel:g,onImprove:y}){const{state:f,isReadOnly:E}=nl(),{plugin:b,skill:C}=f,{entries:R,loading:B}=dv(b,C,i.id),[V,Z]=v.useState(!1),[W,ee]=v.useState(i.prompt),[se,G]=v.useState(!1),[I,le]=v.useState(i.expected_output);v.useState(()=>{ee(i.prompt),le(i.expected_output)});const F=v.useCallback(N=>{m({...d,evals:d.evals.map(A=>A.id===N.id?N:A)})},[d,m]),ae=v.useCallback(()=>{F({...i,prompt:W}),Z(!1)},[i,W,F]),ve=v.useCallback(()=>{F({...i,expected_output:I}),G(!1)},[i,I,F]),re=v.useCallback(()=>{F({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,F]),ge=v.useCallback((N,A)=>{F({...i,assertions:i.assertions.map(J=>J.id===N?{...J,text:A}:J)})},[i,F]),ye=v.useCallback(N=>{F({...i,assertions:i.assertions.filter(A=>A.id!==N)})},[i,F]),Q=v.useCallback(()=>{confirm("Delete this test case?")&&m({...d,evals:d.evals.filter(N=>N.id!==i.id)})},[d,i.id,m]),ue=c&&c.assertions.length>0&&c.assertions.every(N=>N.pass),Ee=c&&c.assertions.some(N=>!N.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(Gx,{result:c})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>g(i.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>h(i.id),disabled:E,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>p(i.id),disabled:E,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),Ee&&!E&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>y(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!E&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:Q,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),ue&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Xc,{title:"Prompt",children:V?n.jsxs("div",{children:[n.jsx("textarea",{value:W,onChange:N=>ee(N.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:ae,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ee(i.prompt),Z(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:E?"default":"pointer"},onClick:()=>{E||Z(!0)},onMouseEnter:N=>{E||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:E?"No prompt":"Click to edit prompt..."})})}),n.jsx(Xc,{title:"Expected Output",children:se?n.jsxs("div",{children:[n.jsx("textarea",{value:I,onChange:N=>le(N.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:ve,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{le(i.expected_output),G(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:E?"default":"pointer"},onClick:()=>{E||G(!0)},onMouseEnter:N=>{E||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:E?"No expected output":"Click to edit expected output..."})})}),n.jsx(Xc,{title:`Assertions (${i.assertions.length})`,action:E?void 0:n.jsx("button",{onClick:re,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:i.assertions.length===0?n.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):n.jsx("div",{className:"space-y-2",children:i.assertions.map(N=>{const A=c==null?void 0:c.assertions.find(ce=>ce.assertion_id===N.id),J=fv(N.id,A,R);return n.jsx(pv,{assertion:N,result:A,badges:J,isReadOnly:E,onUpdate:ce=>ge(N.id,ce),onDelete:()=>ye(N.id)},N.id)})})}),(c==null?void 0:c.output)&&n.jsx(vv,{output:c.output,durationMs:c.durationMs,tokens:c.tokens}),n.jsx(yv,{evalId:i.id,sharedEntries:R,sharedLoading:B})]},i.id)}function pv({assertion:i,result:c,badges:d,isReadOnly:u,onUpdate:m,onDelete:h}){const[p,g]=v.useState(!1),[y,f]=v.useState(i.text),[E,b]=v.useState(!1),C=()=>{m(y),g(!1)};return n.jsx("div",{className:"rounded-lg px-3 py-2.5 transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:n.jsxs("div",{className:"flex items-start gap-2",children:[c?n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:c.pass?"var(--green-muted)":"var(--red-muted)"},children:c.pass?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,border:"1.5px dashed var(--text-tertiary)",background:"transparent"},title:"Not run yet"}),(d==null?void 0:d.regression)&&n.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(d==null?void 0:d.flaky)&&n.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(d==null?void 0:d.nonDiscriminating)&&n.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),p?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:y,onChange:R=>f(R.target.value),onKeyDown:R=>{R.key==="Enter"&&C(),R.key==="Escape"&&g(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:C,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:u?"default":"pointer"},onClick:()=>{u||(f(i.text),g(!0))},children:i.text}),(c==null?void 0:c.reasoning)&&n.jsx("button",{onClick:()=>b(!E),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide reasoning":"Show reasoning"}),E&&(c==null?void 0:c.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:c.reasoning})]}),!u&&n.jsx("button",{onClick:h,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:R=>{R.currentTarget.style.color="var(--red)",R.currentTarget.style.opacity="1"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-tertiary)",R.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Xc({title:i,action:c,children:d}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),c]}),d]})}function Gx({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const c=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:c?"var(--green-muted)":"var(--red-muted)",color:c?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function hv({passRate:i}){const c=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${c}%`,background:c>=80?"var(--green)":c>=50?"var(--yellow)":"var(--red)"}})})})}function vv({output:i,durationMs:c,tokens:d}){const[u,m]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>m(!u),className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:u?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(c/1e3).toFixed(1),"s)"]}),d!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",d," tokens)"]})]}),u&&n.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})]})}function yv({evalId:i,sharedEntries:c,sharedLoading:d}){const{state:u,dispatch:m}=nl(),{plugin:h,skill:p}=u,[g,y]=v.useState(!0),f=c??null,E=d??!1,b=v.useCallback(()=>{y(!g)},[g]),C=f?f.slice(0,10):[];return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:b,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:g?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),g&&n.jsx("div",{className:"animate-fade-in",children:E?n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?n.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):n.jsxs("div",{children:[C.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Yx,{entries:C})}),n.jsx("div",{className:"space-y-2",children:C.map((R,B)=>n.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Hx(R.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:R.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:R.type==="benchmark"?"rgba(99,131,255,0.15)":R.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:R.type==="benchmark"?"#6383ff":R.type==="comparison"?"var(--purple)":"#fb923c"},children:R.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:to(R.pass_rate)},children:[Math.round(R.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[R.durationMs!=null&&n.jsx("span",{children:qx(R.durationMs)}),R.tokens!=null&&n.jsxs("span",{children:[R.tokens>=1e3?`${(R.tokens/1e3).toFixed(1)}k`:R.tokens," tok"]})]}),n.jsx("div",{className:"space-y-0.5",children:R.assertions.map(V=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:V.pass?"var(--green-muted)":"var(--red-muted)"},children:V.pass?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:V.text})]},V.id))})]},B))}),n.jsx("button",{onClick:()=>m({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:R=>{R.currentTarget.style.textDecoration="underline"},onMouseLeave:R=>{R.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function Nx({evals:i,onSave:c,onCancel:d}){const[u,m]=v.useState(""),[h,p]=v.useState(""),[g,y]=v.useState(""),[f,E]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),b=Math.max(0,...i.evals.map(R=>R.id))+1,C=()=>{if(!u.trim()||!h.trim())return;const R={id:b,name:u.trim(),prompt:h.trim(),expected_output:g.trim(),files:[],assertions:f.filter(B=>B.text.trim())};c({...i,evals:[...i.evals,R]})};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:n.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:u,onChange:R=>m(R.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:h,onChange:R=>p(R.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:g,onChange:R=>y(R.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((R,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:R.text,onChange:V=>E(f.map((Z,W)=>W===B?{...Z,text:V.target.value}:Z)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>E(f.filter((V,Z)=>Z!==B)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},R.id)),n.jsx("button",{onClick:()=>E([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:d,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:C,disabled:!u.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function gv(i,c){const d=i+c,u=d*10,m=d*25,h=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${h(u)}–${h(m)}`}function bv(){const{state:i,runCase:c,runAll:d,cancelCase:u,cancelAll:m,isReadOnly:h}=nl(),{evals:p,caseRunStates:g,bulkRunActive:y,latestBenchmark:f,inlineResults:E}=i,b=(p==null?void 0:p.evals)??[],C=v.useMemo(()=>{for(const G of g.values())if(G.status==="running"||G.status==="queued")return!0;return!1},[g]),R=b.filter(G=>{const I=g.get(G.id);return I&&(I.status==="complete"||I.status==="error"||I.status==="cancelled")}).length,B=b.filter(G=>{const I=g.get(G.id);return I&&(I.status==="running"||I.status==="queued")}).length,V=v.useRef(null),[Z,W]=v.useState(0);v.useEffect(()=>{if(C&&!V.current&&(V.current=Date.now()),!C){V.current=null,W(0);return}const G=setInterval(()=>{V.current&&W(Math.round((Date.now()-V.current)/1e3))},1e3);return()=>clearInterval(G)},[C]);const ee=b.reduce((G,I)=>G+I.assertions.length,0),se=v.useMemo(()=>gv(b.length,ee),[b.length,ee]);return n.jsxs("div",{className:"p-5",children:[h&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-4 text-[11px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),n.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),C&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[B," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[C&&n.jsxs("button",{onClick:m,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||C||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>d("benchmark"),disabled:b.length===0||C||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>d("baseline"),disabled:b.length===0||C||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),C&&b.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",R,"/",b.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(R/b.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${R/b.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",Z>=60?`${Math.floor(Z/60)}m ${Z%60}s`:`${Z}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",se]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:b.map(G=>{const I=E.get(G.id),le=g.get(G.id),F=(le==null?void 0:le.status)??"idle";return n.jsx(Sv,{name:G.name,evalId:G.id,result:I,caseStatus:F,runMode:(le==null?void 0:le.mode)??null,isReadOnly:h,onRun:ae=>c(ae,"benchmark"),onBaseline:ae=>c(ae,"baseline"),onCompare:ae=>c(ae,"comparison"),onCancel:ae=>u(ae)},G.id)})}),!C&&f&&f.cases.length>0&&n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),n.jsx("span",{className:"text-[20px] font-bold",style:{color:(f.overall_pass_rate??0)>=.8?"var(--green)":(f.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:f.overall_pass_rate!=null?`${Math.round(f.overall_pass_rate*100)}%`:"--"})]}),f.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(f.totalDurationMs/1e3).toFixed(1),"s",f.model&&` | Model: ${f.model}`]}),f.overall_pass_rate===1&&!f.comparison&&n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||h,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:b.length===0?.5:1},children:"Run Final A/B Comparison"})]}),f.comparison&&n.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Ex,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(Ex,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:f.comparison.delta>0?"var(--green)":f.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",f.comparison.delta>0?"+":"",(f.comparison.delta*100).toFixed(1),"%",f.verdict&&` | ${f.verdict}`]})]})]})]})}const jv={benchmark:{label:"Skill",bg:"var(--accent-muted)",color:"var(--accent)"},baseline:{label:"Baseline",bg:"var(--surface-3)",color:"var(--text-tertiary)"},comparison:{label:"Compare",bg:"rgba(168,85,247,0.12)",color:"rgb(168,85,247)"}};function Sv({name:i,evalId:c,result:d,caseStatus:u,runMode:m,isReadOnly:h,onRun:p,onBaseline:g,onCompare:y,onCancel:f}){const[E,b]=v.useState(!1),C=u==="running"||u==="queued",R=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:C?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:C?"0 0 12px rgba(99, 131, 255, 0.15)":"none"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),u==="queued"&&n.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),n.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",c," ",i]}),m&&(C||R)&&(()=>{const B=jv[m];return B?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:B.bg,color:B.color,padding:"1px 6px"},children:B.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[C?n.jsx("button",{onClick:()=>f(c),className:"btn text-[10px] px-2 py-1",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>y(c),disabled:h,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>p(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>g(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),d&&d.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:d.status==="pass"?"var(--green-muted)":(d.status==="error","var(--red-muted)"),color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.passRate!=null?`${Math.round(d.passRate*100)}%`:d.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),d&&d.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:d.assertions.map(B=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:B.pass?"var(--green)":"var(--red)"},children:B.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:B.text})]},B.assertion_id))}),d.output&&n.jsx("button",{onClick:()=>b(!E),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide output":"Show output"}),E&&d.output&&n.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:d.output})]}),d&&d.errorMessage&&n.jsx(Nv,{errorMessage:d.errorMessage,classifiedError:d.classifiedError})]})}const Zc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Nv({errorMessage:i,classifiedError:c}){const[d,u]=v.useState(!1),m=(c==null?void 0:c.title)??"Error",h=c==null?void 0:c.hint,p=c?Zc[c.category]??Zc.unknown:Zc.unknown;return n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[n.jsx("span",{style:{fontSize:12},children:p}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:m}),n.jsx("button",{onClick:()=>u(!d),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:d?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),d&&n.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:i})]})})}function Ex({label:i,value:c,color:d}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:d},children:[Math.round(c*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c*100}%`,background:d}})})]})}const kx={TP:{bg:"var(--green-muted)",text:"var(--green)"},TN:{bg:"rgba(52,211,153,0.06)",text:"rgba(52,211,153,0.6)"},FP:{bg:"var(--red-muted)",text:"var(--red)"},FN:{bg:"rgba(248,113,113,0.06)",text:"rgba(248,113,113,0.6)"}},Ev=[{label:"Should activate",prompts:["+How do I use this feature?","+Show me best practices for this","+What's the recommended approach?"]},{label:"Should NOT activate",prompts:["!What's the weather today?","!Write me a poem","!How do I cook pasta?"]}];function kv(){const{state:i,dispatch:c,runActivationTest:d}=nl(),{plugin:u,skill:m,activationPrompts:h,activationResults:p,activationSummary:g,activationRunning:y,activationError:f}=i,[E,b]=v.useState(h),[C,R]=v.useState(null);v.useEffect(()=>{c({type:"SET_ACTIVATION_PROMPTS",prompts:E})},[E,c]),v.useEffect(()=>{fetch(`/api/skills/${u}/${m}/description`).then(G=>G.json()).then(G=>R(G.rawContent||G.description||null)).catch(()=>R(null))},[u,m]);function B(){d(E)}function V(G){const I=E.trim(),le=I?`${I}
61
+ ${G.join(`
62
+ `)}`:G.join(`
63
+ `);b(le)}const Z=E.trim().split(`
64
+ `).filter(Boolean).length,W=p.filter(G=>G.classification==="TP"||G.classification==="TN"),ee=p.filter(G=>G.classification==="FP"||G.classification==="FN"),se=(C==null?void 0:C.replace(/^---[\s\S]*?---\s*/,"").trim())??null;return n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-0.5",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[n.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:Ev.map(G=>n.jsxs("button",{onClick:()=>V(G.prompts),className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},onMouseEnter:I=>{I.currentTarget.style.color="var(--text-primary)",I.currentTarget.style.background="var(--surface-3)"},onMouseLeave:I=>{I.currentTarget.style.color="var(--text-tertiary)",I.currentTarget.style.background="var(--surface-2)"},children:["+ ",G.label]},G.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:E,onChange:G=>b(G.target.value),placeholder:`How do I write a unit test?
65
+ What edge cases should I test?
66
+ +Deploy this to production
67
+ !What's the weather like today?
68
+ !Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx(br,{}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),n.jsx(br,{}),n.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[Z," prompt",Z!==1?"s":""]})]}),n.jsx("button",{onClick:B,disabled:y||!E.trim(),className:"btn btn-primary self-start",children:y?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})})]}),n.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[n.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),n.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:se?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Nr(se)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),f&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:f}),y&&p.length===0&&n.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),p.length>0&&n.jsxs("div",{className:"space-y-5",children:[ee.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),n.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",ee.length,")"]}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:ee.map((G,I)=>n.jsx(Tx,{result:G},`incorrect-${I}`))})]}),W.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"16 10 11 15 8 12"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",W.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:W.map((G,I)=>n.jsx(Tx,{result:G},`correct-${I}`))})]})]}),g&&n.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),g.autoClassifiedCount!=null&&g.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[g.autoClassifiedCount," of ",g.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(Kc,{label:"Precision",value:g.precision,description:"Of all activations, how many were correct?",detail:`${g.tp} true / ${g.tp+g.fp} total activations`}),n.jsx(Kc,{label:"Recall",value:g.recall,description:"Of expected activations, how many fired?",detail:`${g.tp} activated / ${g.tp+g.fn} expected`}),n.jsx(Kc,{label:"Reliability",value:g.reliability,description:"Overall correct classification rate",detail:`${g.tp+g.tn} correct / ${g.total} total`})]}),n.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[n.jsx(jr,{label:"True Positive",abbr:"TP",count:g.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(jr,{label:"False Positive",abbr:"FP",count:g.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(jr,{label:"False Negative",abbr:"FN",count:g.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(jr,{label:"True Negative",abbr:"TN",count:g.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]})]})}function br(){return n.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function Tx({result:i}){const c=kx[i.classification]||kx.FN,d=i.classification==="TP"||i.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:c.bg,border:"1px solid transparent"},children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:`color-mix(in srgb, ${c.text} 20%, transparent)`},children:d?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:i.prompt})}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[n.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:c.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:i.classification}),n.jsx("span",{style:{color:i.activate?"var(--green)":"var(--text-tertiary)"},children:i.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",i.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[i.confidence," confidence"]}),i.autoClassified&&n.jsx("span",{className:"pill",style:{background:"rgba(139,92,246,0.1)",color:"rgba(139,92,246,0.8)",fontSize:"9px",padding:"1px 5px"},children:"auto"})]}),i.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:i.reasoning})]})]})}function Kc({label:i,value:c,description:d,detail:u}){const m=Math.round(c*100),h=m>=80?"var(--green)":m>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:h},children:[m,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:d}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function jr({abbr:i,count:c,bg:d,color:u,description:m}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:d},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:c}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:u},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:m})]})}const Jc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},Cx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},lo=600,ao=180,xt=40,$c=lo-xt*2,aa=ao-xt*2,Tv=[25,50,75,100];function Ax(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Cv({entries:i}){const[c,d]=v.useState(null);if(i.length<2)return null;const u=i.length,m=i.map((g,y)=>{const f=xt+y/(u-1)*$c,E=g.passRate*100,b=xt+aa-E/100*aa;return{x:f,y:b,pct:E,entry:g}}),h=m.map(g=>`${g.x},${g.y}`).join(" "),p=Array.from(new Set(i.map(g=>g.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:p.map(g=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Jc[g]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Cx[g]??g})]},g))}),n.jsxs("svg",{width:lo,height:ao,viewBox:`0 0 ${lo} ${ao}`,style:{display:"block",overflow:"visible"},children:[Tv.map(g=>{const y=xt+aa-g/100*aa;return n.jsxs("g",{children:[n.jsx("line",{x1:xt,y1:y,x2:xt+$c,y2:y,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:xt-8,y:y+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[g,"%"]})]},g)}),n.jsx("line",{x1:xt,y1:xt+aa,x2:xt+$c,y2:xt+aa,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:xt-8,y:xt+aa+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:h,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),m.map((g,y)=>n.jsx("circle",{cx:g.x,cy:g.y,r:5,fill:Jc[g.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:f=>{f.currentTarget.setAttribute("r","7"),d({x:g.x,y:g.y,entry:g.entry})},onMouseLeave:f=>{f.currentTarget.setAttribute("r","5"),d(null)}},y)),Av(u).map(g=>n.jsx("text",{x:m[g].x,y:xt+aa+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:Ax(i[g].timestamp)},g))]}),c&&n.jsxs("div",{style:{position:"absolute",left:c.x,top:c.y-12,transform:"translate(-50%, -100%)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"8px 12px",pointerEvents:"none",zIndex:10,whiteSpace:"nowrap"},children:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:Ax(c.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:c.entry.model}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Jc[c.entry.type]??"var(--text-tertiary)",color:"#fff"},children:Cx[c.entry.type]??c.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(c.entry.passRate*100),"%"]})]})]})]})}function Av(i){return i<=3?Array.from({length:i},(c,d)=>d):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function Sr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function wv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function _v({rate:i,label:c}){const d=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:c}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(i)},children:[d,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${d}%`,background:Sr(i)}})})]})})}function Rv({points:i}){if(i.length<2)return null;const c=200,d=48,u=4,m=i.length,h=i.map((y,f)=>{const E=u+f/(m-1)*(c-u*2),b=u+(d-u*2)-y.passRate*(d-u*2);return{x:E,y:b}}),p=`M ${h[0].x},${d-u} `+h.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${h[h.length-1].x},${d-u} Z`,g=h.map((y,f)=>`${f===0?"M":"L"} ${y.x},${y.y}`).join(" ");return n.jsxs("svg",{width:c,height:d,style:{display:"block"},children:[n.jsx("path",{d:p,fill:"var(--accent-muted)"}),n.jsx("path",{d:g,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:h[h.length-1].x,cy:h[h.length-1].y,r:3,fill:"var(--accent)"})]})}function Mv({plugin:i,skill:c}){const[d,u]=v.useState(null),[m,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),Te.getStats(i,c).then(u).catch(()=>u(null)).finally(()=>h(!1))},[i,c]),m)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!d||d.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const p=d.trendPoints.length>0?d.trendPoints[d.trendPoints.length-1].passRate:0,g=d.trendPoints.length>0?d.trendPoints[0].passRate:0,y=p-g,f=d.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:Sr(p)},children:[Math.round(p*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:y>=0?"var(--green)":"var(--red)"},children:[y>=0?"+":"",Math.round(y*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.modelStats.length})]})]}),d.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(Rv,{points:d.trendPoints})]}),d.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:d.modelStats.map(E=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:E.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:E.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:Sr(E.avgPassRate)},children:[Math.round(E.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:wv(E.avgDurationMs)})]},E.model))})]})]}),f.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),n.jsx("div",{className:"space-y-3",children:f.map(E=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--surface-2)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",E.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:E.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[E.totalRuns," runs"]})]}),n.jsx(_v,{rate:E.passRate,label:E.text})]},`${E.evalId}:${E.id}`))})]})]})}function zv({plugin:i,skill:c}){const[d,u]=v.useState(null),[m,h]=v.useState(null),[p,g]=v.useState({}),[y,f]=v.useState({});v.useEffect(()=>{Te.getEvals(i,c).then(u).catch(()=>u(null))},[i,c]);async function E(b){if(m===b){h(null);return}if(h(b),!p[b]){f(C=>({...C,[b]:!0}));try{const C=await Te.getCaseHistory(i,c,b);g(R=>({...R,[b]:C}))}catch{g(C=>({...C,[b]:[]}))}finally{f(C=>({...C,[b]:!1}))}}}return d?n.jsx("div",{className:"space-y-2 stagger-children",children:d.evals.map(b=>{const C=p[b.id]||[],R=m===b.id,B=y[b.id],V=C.length>0?C[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>E(b.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:R?"var(--surface-2)":"transparent"},onMouseEnter:Z=>{R||(Z.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Z=>{R||(Z.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:R?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",b.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:b.name}),C.length>=2&&n.jsx(Yx,{entries:C}),V!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:to(V)},children:[Math.round(V*100),"%"]}),C.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[C.length," runs"]})]}),R&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:B?n.jsxs("div",{className:"p-4 flex items-center gap-2",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):C.length===0?n.jsx("div",{className:"p-4",children:n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):n.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:C.map((Z,W)=>n.jsxs("div",{className:"p-4",style:{background:W===0?"var(--surface-2)":"transparent"},children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Hx(Z.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Z.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:Z.type==="benchmark"?"rgba(99,131,255,0.15)":Z.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:Z.type==="benchmark"?"#6383ff":Z.type==="comparison"?"var(--purple)":"#fb923c"},children:Z.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:to(Z.pass_rate)},children:[Math.round(Z.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[Z.durationMs!=null&&n.jsx("span",{children:qx(Z.durationMs)}),Z.tokens!=null&&n.jsxs("span",{children:[Z.tokens>=1e3?`${(Z.tokens/1e3).toFixed(1)}k`:Z.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:Z.assertions.map(ee=>n.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[n.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:ee.pass?"var(--green)":"var(--red)"},children:n.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:ee.pass?n.jsx("polyline",{points:"20 6 9 17 4 12"}):n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:ee.text}),ee.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:ee.reasoning})]})]},ee.id))})]},W))})})]},b.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function Ov(){const{state:i,dispatch:c}=nl(),{plugin:d,skill:u}=i,[m,h]=v.useState("timeline"),[p,g]=v.useState([]),[y,f]=v.useState(!0),[E,b]=v.useState(""),[C,R]=v.useState(""),[B,V]=v.useState(!1),[Z,W]=v.useState([]),[ee,se]=v.useState(null),[G,I]=v.useState(!1),[le,F]=v.useState(null),[ae,ve]=v.useState(!1);v.useEffect(()=>{f(!0),Te.getHistory(d,u,{model:E||void 0,type:C||void 0}).then(Q=>{g(Q),Q.length>=2&&Te.compareRuns(d,u,Q[0].timestamp,Q[1].timestamp).then(ue=>{const Ee=ue.regressions.filter(N=>N.change==="regression");c({type:"SET_REGRESSIONS",regressions:Ee})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[d,u,E,C]);const re=v.useCallback(async Q=>{if(B){W(ue=>ue.includes(Q)?ue.filter(Ee=>Ee!==Q):ue.length>=2?[ue[1],Q]:[...ue,Q]);return}ve(!0);try{const ue=await Te.getHistoryEntry(d,u,Q);F(ue)}catch{}finally{ve(!1)}},[d,u,B]),ge=v.useCallback(async()=>{if(Z.length===2){I(!0);try{const Q=await Te.compareRuns(d,u,Z[0],Z[1]);se(Q)}catch{}finally{I(!1)}}},[d,u,Z]),ye=[...new Set(p.map(Q=>Q.model))];return y?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"skeleton h-12 rounded-lg"}),n.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(Q=>n.jsx("button",{onClick:()=>h(Q),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:m===Q?"var(--accent-muted)":"transparent",color:m===Q?"var(--accent)":"var(--text-tertiary)"},children:Q==="timeline"?"Timeline":Q==="per-eval"?"Per Eval":"Statistics"},Q))}),m==="timeline"&&n.jsxs("div",{children:[p.length>0&&n.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:n.jsx(Cv,{entries:p})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:E,onChange:Q=>b(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ye.map(Q=>n.jsx("option",{value:Q,children:Q},Q))]}),n.jsxs("select",{value:C,onChange:Q=>R(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"benchmark",children:"Benchmark"}),n.jsx("option",{value:"comparison",children:"Comparison"}),n.jsx("option",{value:"baseline",children:"Baseline"}),n.jsx("option",{value:"model-compare",children:"Model Compare"}),n.jsx("option",{value:"improve",children:"AI Improve"}),n.jsx("option",{value:"instruct",children:"AI Edit"}),n.jsx("option",{value:"ai-generate",children:"AI Generate"}),n.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{V(!B),W([]),se(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&Z.length===2&&n.jsx("button",{onClick:ge,disabled:G,className:"btn btn-primary text-[12px]",children:G?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:p.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(Q=>{const ue=Z.includes(Q.timestamp);return n.jsx("button",{onClick:()=>re(Q.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ue?"var(--accent-muted)":"var(--surface-1)",border:ue?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-subtle)")},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:ue?"var(--accent)":"var(--border-default)",background:ue?"var(--accent)":"transparent"},children:ue&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(Q.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:Q.type==="comparison"?"var(--purple-muted)":Q.type==="baseline"?"var(--surface-3)":Q.type==="model-compare"?"rgba(56,189,248,0.15)":Q.type==="improve"||Q.type==="instruct"?"rgba(168,85,247,0.15)":Q.type==="ai-generate"?"rgba(34,197,94,0.15)":Q.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:Q.type==="comparison"?"var(--purple)":Q.type==="baseline"?"var(--text-tertiary)":Q.type==="model-compare"?"#38bdf8":Q.type==="improve"||Q.type==="instruct"?"#a855f7":Q.type==="ai-generate"?"#22c55e":Q.type==="eval-generate"?"#fb923c":"var(--accent)"},children:Q.type==="model-compare"?"model compare":Q.type==="improve"?"ai improve":Q.type==="instruct"?"ai edit":Q.type==="ai-generate"?"ai generate":Q.type==="eval-generate"?"eval generate":Q.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Q.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:Q.passRate>=.8?"var(--green)":Q.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(Q.passRate*100),"%"]})]})]})},Q.timestamp)})}),ee&&n.jsx(Dv,{result:ee}),le&&!B&&n.jsx(Lv,{run:le,onClose:()=>F(null)})]}),m==="per-eval"&&n.jsx(zv,{plugin:d,skill:u}),m==="statistics"&&n.jsx(Mv,{plugin:d,skill:u})]})}function Dv({result:i}){const c=i.regressions.filter(u=>u.change==="regression"),d=i.regressions.filter(u=>u.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),c.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",c.length,")"]}),c.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:u.assertionId})," (was passing, now failing)"]},`${u.evalId}-${u.assertionId}`))]}),d.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",d.length,")"]}),d.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(u=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function Lv({run:i,onClose:c}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Bv,{run:i,onClose:c}):n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(i.timestamp).toLocaleString()]}),n.jsx("button",{onClick:c,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",i.model," | Cases: ",i.cases.length," | Pass Rate: ",i.overall_pass_rate!=null?`${Math.round(i.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:i.cases.map(d=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.pass_rate!=null?`${Math.round(d.pass_rate*100)}%`:d.status})]})},d.eval_id))})]})}function Bv({run:i,onClose:c}){var h;const d=v.useMemo(()=>i.improve?Er(i.improve.original,i.improve.improved):[],[i.improve]),u=v.useMemo(()=>{const p=d.filter(y=>y.type==="added").length,g=d.filter(y=>y.type==="removed").length;return{added:p,removed:g}},[d]),m=v.useMemo(()=>{let p=0,g=0;return d.map(y=>y.type==="removed"?(p++,{...y,origNum:p,newNum:null}):y.type==="added"?(g++,{...y,origNum:null,newNum:g}):(p++,g++,{...y,origNum:p,newNum:g}))},[d]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),n.jsx("button",{onClick:c,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--surface-3)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((h=i.improve)==null?void 0:h.reasoning)&&n.jsxs("div",{className:"mx-4 mt-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.06)",border:"1px solid rgba(168,85,247,0.15)",color:"var(--text-secondary)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),i.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:m.map((p,g)=>n.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:p.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:p.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"transparent",borderRight:p.type==="added"?"2px solid var(--green)":p.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:p.type==="added"?"+":p.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"var(--text-secondary)"},children:p.content||"​"})]},g))})})})]})}function Uv({plugin:i,skill:c}){const[d,u]=v.useState([]),[m,h]=v.useState([]),[p,g]=v.useState(!0),[y,f]=v.useState(null);v.useEffect(()=>{Te.getDependencies(i,c).then(b=>{u(b.mcpDependencies),h(b.skillDependencies)}).catch(()=>{}).finally(()=>g(!1))},[i,c]);async function E(b,C){try{await navigator.clipboard.writeText(C),f(b),setTimeout(()=>f(null),2e3)}catch{}}return p?null:d.length===0&&m.length===0?n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:d.length+m.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[d.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),d.map(b=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:b.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.transport})]}),n.jsx("button",{onClick:()=>E(b.server,b.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:y===b.server?"var(--green)":"var(--accent)"},children:y===b.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:b.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.matchedTools.map(C=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:C},C))})]},b.server))]}),m.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:m.map(b=>n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.source==="frontmatter"?"frontmatter":"referenced"})]},b.name))})]})]})]})}function Hv(){const{state:i}=nl(),{plugin:c,skill:d}=i,[u,m]=v.useState(null),[h,p]=v.useState(!0);return v.useEffect(()=>{Te.getDependencies(c,d).then(m).catch(()=>{}).finally(()=>p(!1))},[c,d]),h?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):u?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(Uv,{plugin:c,skill:d})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const qv=["editor","tests","run","activation","history","deps"];function Yv(i){return i!=null&&qv.includes(i)}function Gv(){const{state:i,dispatch:c,saveContent:d,isReadOnly:u}=nl(),{refreshSkills:m,clearSelection:h}=sa(),p=v.useCallback(async()=>{try{await Te.deleteSkill(i.plugin,i.skill),m(),h()}catch(f){const E=f instanceof Error?f.message:String(f);c({type:"SET_ERROR",error:`Failed to delete skill: ${E}`})}},[i.plugin,i.skill,m,h,c]);v.useEffect(()=>{const E=new URLSearchParams(window.location.search).get("panel");Yv(E)&&E!==i.activePanel&&c({type:"SET_PANEL",panel:E})},[]),v.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const E=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",E)},[i.activePanel]);const g=v.useCallback(f=>{const E=f.ctrlKey||f.metaKey;if(E&&f.key>="1"&&f.key<="6"){f.preventDefault(),c({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(f.key)-1]});return}if(E&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&d();return}},[i.isDirty,d,c]);if(v.useEffect(()=>(window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)),[g]),i.loading)return n.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"spinner spinner-lg"}),n.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const y=Array.from(i.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Dh,{state:i,isReadOnly:u,onDelete:u?void 0:p}),n.jsx(qh,{activePanel:i.activePanel,onPanelChange:f=>c({type:"SET_PANEL",panel:f}),isDirty:i.isDirty,isRunning:y,hasRegressions:i.regressions.length>0,isActivationRunning:i.activationRunning}),n.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[i.activePanel==="editor"&&n.jsx(uv,{}),i.activePanel==="tests"&&n.jsx(xv,{}),i.activePanel==="run"&&n.jsx(bv,{}),i.activePanel==="activation"&&n.jsx(kv,{}),i.activePanel==="history"&&n.jsx(Ov,{}),i.activePanel==="deps"&&n.jsx(Hv,{})]},i.activePanel)})]})}function Vx(){return n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function Vv(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Qx({node:i,depth:c=0}){var d;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${c*16}px`,color:i.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[i.type==="dir"?n.jsx(Vx,{}):n.jsx(Vv,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(d=i.children)==null?void 0:d.map(u=>n.jsx(Qx,{node:u,depth:c+1},u.name))]})}function Qv(i,c,d){const u=[];c&&u.push({name:"evals.json",type:"file"}),u.push({name:"history",type:"dir"});const m=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:u}];return d&&m.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:m}}function Xv({skillName:i,hasEvals:c,isDraft:d}){const u=Qv(i,c,d);return n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsx(Vx,{})}),"Skill Structure"]}),n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:n.jsx(Qx,{node:u})})]})}function Wc(i,c=!0){let d=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return c&&(d=d.replace(/^-+|-+$/g,"")),d}function Zv(i,c,d,u){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(c){case 1:return`${h}/${d}/skills/${u}/SKILL.md`;case 2:return`${h}/plugins/${d}/skills/${u}/SKILL.md`;case 3:return`${h}/skills/${u}/SKILL.md`}}const na={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Fc({size:i=14,color:c="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function Kv({onCreated:i,onCancel:c}){const[d,u]=v.useState("manual"),[m,h]=v.useState(null),[p,g]=v.useState(!0),{config:y}=dn(),[f,E]=v.useState(""),[b,C]=v.useState(3),[R,B]=v.useState(""),[V,Z]=v.useState(""),[W,ee]=v.useState(""),[se,G]=v.useState(""),[I,le]=v.useState(""),[F,ae]=v.useState(""),[ve,re]=v.useState(null),[ge,ye]=v.useState("write"),[Q,ue]=v.useState(!1),[Ee,N]=v.useState(null),[A,J]=v.useState(""),[ce,he]=v.useState(!1),[S,D]=v.useState(!1),[X,M]=v.useState(null),[q,Y]=v.useState(null),[K,de]=v.useState([]),me=v.useRef(null),Ze=v.useRef(null),et=v.useRef(null),[$t,Al]=v.useState(!1),[Wt,sl]=v.useState([]),[rl,wl]=v.useState(!1);v.useEffect(()=>{Te.getProjectLayout().then($=>{h($),C($.suggestedLayout);const _e=$.detectedLayouts.find(Xt=>Xt.layout===$.suggestedLayout);_e!=null&&_e.existingPlugins.length&&B(_e.existingPlugins[0])}).catch(()=>{}).finally(()=>g(!1))},[]),v.useEffect(()=>{var $;d==="ai"&&(($=me.current)==null||$.focus())},[d]),v.useEffect(()=>()=>{var $;($=Ze.current)==null||$.abort()},[]);const _l=v.useMemo(()=>{var $;return m?(($=m.detectedLayouts.find(_e=>_e.layout===b))==null?void 0:$.existingPlugins)||[]:[]},[m,b]),Ft=R==="__new__"?V:R,Vt=m?Zv(m.root,b,Ft||"{plugin}",f||"{skill}"):"",Rl=v.useMemo(()=>m?m.detectedLayouts.filter($=>$.layout!==4):[],[m]),il=v.useMemo(()=>{if(!m)return null;const $=m.detectedLayouts.find(Nt=>Nt.layout===2&&Nt.existingPlugins.length>0),_e=m.detectedLayouts.find(Nt=>Nt.layout===1&&Nt.existingPlugins.length>0),Xt=$||_e;return Xt?{layout:Xt.layout,plugins:Xt.existingPlugins}:null},[m]),P=v.useCallback(()=>{if(!y)return{provider:"claude-cli",model:"sonnet"};const $=y.provider||"claude-cli";let _e=y.model||"sonnet";return $==="claude-cli"&&_e.startsWith("claude-")&&(_e=_e.replace("claude-","")),{provider:$,model:_e}},[y]),ze=v.useCallback(()=>{var $;($=Ze.current)==null||$.abort(),he(!1)},[]);async function mt(){var Nt;if(M(null),Y(null),de([]),et.current=null,!A.trim()){M("Describe what your skill should do");return}he(!0);const $=new AbortController;Ze.current=$;const{provider:_e,model:Xt}=P();try{const pt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:A.trim(),provider:_e,model:Xt}),signal:$.signal});if(!pt.ok||!pt.body){let Ge=`HTTP ${pt.status}`;try{const $e=await pt.json();$e.error&&(Ge=$e.error)}catch{}throw new Error(Ge)}const It=pt.body.getReader(),Mt=new TextDecoder;let Ve="",at="";for(;;){const{done:Ge,value:$e}=await It.read();if(Ge)break;Ve+=Mt.decode($e,{stream:!0});const Et=Ve.split(`
69
+ `);Ve=Et.pop()||"";for(const cl of Et)if(cl.startsWith("event: "))at=cl.slice(7).trim();else if(cl.startsWith("data: ")){try{const tt=JSON.parse(cl.slice(6));if(at==="progress")de(ol=>[...ol,{phase:tt.phase,message:tt.message,timestamp:Date.now()}]);else if(at==="done"||at==="complete"){const ol=tt.name,ra=tt.description,Pt=tt.model||"",ia=tt.allowedTools||"",Ml=tt.body,rs=(Nt=tt.evals)!=null&&Nt.length?tt.evals:null,fn={prompt:A.trim(),provider:P().provider,model:P().model,reasoning:tt.reasoning||""};E(ol),ee(ra),G(Pt),le(ia),ae(Ml),re(rs),D(!0),et.current=fn,u("manual"),b===3&&il&&wl(!0);const xn={name:ol,plugin:Ft||"",layout:b,description:ra,model:Pt||void 0,allowedTools:ia||void 0,body:Ml,evals:rs||void 0,aiMeta:fn};Te.saveDraft(xn).then(ca=>{Al(!0),sl(ca.files)}).catch(()=>{})}else at==="error"&&(M(tt.message||tt.description||"Unknown error"),tt.category&&Y(tt))}catch{}at=""}}}catch(pt){pt.name!=="AbortError"&&M(pt.message)}finally{he(!1),Ze.current=null}}async function Qt(){if(N(null),!f.trim()){N("Skill name is required");return}if(!W.trim()){N("Description is required");return}if(b!==3&&!Ft.trim()){N("Plugin name is required");return}ue(!0);try{const $=await Te.createSkill({name:Wc(f),plugin:Ft||"",layout:b,description:W,model:se||void 0,allowedTools:I||void 0,body:F,evals:ve||void 0,aiMeta:et.current||void 0});i($.plugin,$.skill)}catch($){N($.message)}finally{ue(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>u("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:d==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:d==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>u("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="ai"?"rgba(168,85,247,0.15)":"transparent",color:d==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:d==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Fc,{size:12}),"AI-Assisted"]})})]})})]}),p&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!p&&m&&d==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Fc,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:me,value:A,onChange:$=>J($.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
70
+
71
+ Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:ce,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...na,minHeight:"120px"},onKeyDown:$=>{$.key==="Enter"&&($.metaKey||$.ctrlKey)&&($.preventDefault(),mt())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),ce&&K.length>0&&n.jsx(ss,{entries:K,isRunning:!0}),X&&n.jsx("div",{children:q?n.jsx(kr,{error:q,onRetry:mt,onDismiss:()=>{M(null),Y(null)}}):n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:X}),n.jsx("button",{onClick:mt,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[ce?n.jsx("button",{onClick:ze,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)",border:"none",cursor:"pointer"},children:"Cancel Generation"}):n.jsxs("button",{onClick:mt,disabled:!A.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:A.trim()?"#a855f7":"var(--surface-3)",color:A.trim()?"#fff":"var(--text-tertiary)",cursor:A.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Fc,{size:14}),"Generate"]}),n.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"}),!ce&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>u("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!p&&m&&d==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),Rl.length>1&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),n.jsx("div",{className:"flex gap-2",children:Rl.map($=>n.jsx("button",{onClick:()=>{C($.layout),B($.existingPlugins[0]||""),Z("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:b===$.layout?"var(--accent)":"var(--surface-3)",color:b===$.layout?"#fff":"var(--text-secondary)",border:`1px solid ${b===$.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:$.label},$.layout))})]}),b!==3&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),n.jsxs("select",{value:R,onChange:$=>{B($.target.value),Z("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na,children:[_l.map($=>n.jsx("option",{value:$,children:$},$)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),R==="__new__"&&n.jsx("input",{type:"text",value:V,onChange:$=>Z(Wc($.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:na})]}),n.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:Vt})]}),rl&&il&&b===3&&n.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex items-center justify-between gap-3",style:{background:"rgba(59,130,246,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(59,130,246,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),n.jsxs("span",{children:["Plugins detected (",n.jsx("strong",{children:il.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:()=>{C(il.layout),B(il.plugins[0]),wl(!1)},className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),n.jsx("button",{onClick:()=>wl(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("input",{type:"text",value:f,onChange:$=>E(Wc($.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("textarea",{value:W,onChange:$=>ee($.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...na,minHeight:"72px"}})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsxs("select",{value:se,onChange:$=>G($.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na,children:[n.jsx("option",{value:"",children:"Any"}),n.jsx("option",{value:"opus",children:"Opus"}),n.jsx("option",{value:"sonnet",children:"Sonnet"}),n.jsx("option",{value:"haiku",children:"Haiku"})]})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),n.jsx("input",{type:"text",value:I,onChange:$=>le($.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na})]})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),n.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map($=>n.jsxs("button",{onClick:()=>ye($),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:ge===$?"var(--surface-4)":"transparent",color:ge===$?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:ge===$?600:400,border:"none",cursor:"pointer"},children:[$==="write"?n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]}):n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),n.jsx("span",{children:$==="write"?"Write":"Preview"})]},$))})]}),ge==="write"?n.jsx("textarea",{value:F,onChange:$=>ae($.target.value),placeholder:`# /my-skill
72
+
73
+ You are an expert at...
74
+ `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...na,minHeight:"150px"}}):F.trim()?n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:Nr(F)}}):n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},children:n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),n.jsx(Xv,{skillName:f||"{skill}",hasEvals:!!(ve&&ve.length>0),isDraft:$t}),Ee&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:Ee}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Qt,disabled:Q||!f||!W,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:Q||!f||!W?"var(--surface-3)":"var(--accent)",color:Q||!f||!W?"var(--text-tertiary)":"#fff",cursor:Q||!f||!W?"not-allowed":"pointer",border:"none"},children:Q?"Saving...":S?"Save":"Create Skill"}),n.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})}function Jv(){return n.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),n.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),n.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function Ic({variant:i,message:c,onRetry:d}){const{setMode:u,setSearch:m}=sa(),[h,p]=v.useState(!1);return i==="no-selection"?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[n.jsx("div",{className:"mb-5",children:h?n.jsx(Jv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>p(!0),style:{objectFit:"contain"}})}),n.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):i==="no-skills"?n.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),n.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),n.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",n.jsx("code",{className:"px-1.5 py-0.5 rounded text-[11px]",style:{background:"var(--surface-2)"},children:"--root"})," directory, or create your first skill"]}),n.jsxs("button",{onClick:()=>u("create"),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:"var(--accent)",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:g=>{g.currentTarget.style.opacity="0.9"},onMouseLeave:g=>{g.currentTarget.style.opacity="1"},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):i==="error"?n.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:n.jsxs("div",{className:"px-5 py-4 rounded-lg text-center max-w-sm",style:{background:"var(--red-muted)",border:"1px solid rgba(248,113,113,0.2)"},children:[n.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:c||"Failed to load skill data"}),d&&n.jsx("button",{onClick:d,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>m(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function wx(){const{state:i,setMobileView:c}=sa();return i.isMobile?n.jsxs("button",{onClick:()=>c("list"),className:"flex items-center gap-1.5 px-3 py-2 text-[12px] font-medium",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"none",borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",width:"100%"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function $v(){const{state:i,selectSkill:c,setMode:d,refreshSkills:u}=sa();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(wx,{}),n.jsx(Kv,{onCreated:(g,y)=>{d("browse"),u(),c({plugin:g,skill:y,origin:"source"})},onCancel:()=>d("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Ic,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Ic,{variant:"no-skills"}):n.jsx(Ic,{variant:"no-selection"});const{plugin:m,skill:h,origin:p}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(wx,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Oh,{plugin:m,skill:h,origin:p,children:n.jsx(Gv,{})},`${m}/${h}`)})]})}function Wv(){return n.jsx(gh,{children:n.jsx(hh,{children:n.jsx(bh,{left:n.jsx(Ch,{}),right:n.jsx($v,{})})})})}fh.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(Wv,{})}));