vskill 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/eval/sweep.d.ts +1 -0
- package/dist/commands/eval/sweep.js +78 -18
- package/dist/commands/eval/sweep.js.map +1 -1
- package/dist/commands/eval.d.ts +1 -0
- package/dist/commands/eval.js +1 -0
- package/dist/commands/eval.js.map +1 -1
- package/dist/eval/activation-history.d.ts +21 -0
- package/dist/eval/activation-history.js +41 -0
- package/dist/eval/activation-history.js.map +1 -0
- package/dist/eval-server/api-routes.js +104 -1
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/skill-create-routes.d.ts +11 -0
- package/dist/eval-server/skill-create-routes.js +131 -4
- package/dist/eval-server/skill-create-routes.js.map +1 -1
- package/dist/eval-server/sweep-routes.js +1 -0
- package/dist/eval-server/sweep-routes.js.map +1 -1
- package/dist/eval-server/sweep-runner.d.ts +33 -0
- package/dist/eval-server/sweep-runner.js +233 -84
- package/dist/eval-server/sweep-runner.js.map +1 -1
- package/dist/eval-ui/assets/index-BM579QSw.js +73 -0
- package/dist/eval-ui/assets/index-DcbzllbY.css +1 -0
- package/dist/eval-ui/index.html +2 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-C9_Pey9T.css +0 -1
- package/dist/eval-ui/assets/index-KfkLPyh3.js +0 -74
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))u(x);new MutationObserver(x=>{for(const v of x)if(v.type==="childList")for(const p of v.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function c(x){const v={};return x.integrity&&(v.integrity=x.integrity),x.referrerPolicy&&(v.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?v.credentials="include":x.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function u(x){if(x.ep)return;x.ep=!0;const v=c(x);fetch(x.href,v)}})();var Uc={exports:{}},ts={};/**
|
|
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 sx;function oh(){if(sx)return ts;sx=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,x,v){var p=null;if(v!==void 0&&(p=""+v),x.key!==void 0&&(p=""+x.key),"key"in x){v={};for(var S in x)S!=="key"&&(v[S]=x[S])}else v=x;return x=v.ref,{$$typeof:i,type:u,key:p,ref:x!==void 0?x:null,props:v}}return ts.Fragment=o,ts.jsx=c,ts.jsxs=c,ts}var rx;function uh(){return rx||(rx=1,Uc.exports=oh()),Uc.exports}var n=uh(),Hc={exports:{}},xe={};/**
|
|
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 ix;function dh(){if(ix)return xe;ix=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),p=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),T=Symbol.iterator;function M(j){return j===null||typeof j!="object"?null:(j=T&&j[T]||j["@@iterator"],typeof j=="function"?j:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,Y={};function G(j,_,J){this.props=j,this.context=_,this.refs=Y,this.updater=J||D}G.prototype.isReactComponent={},G.prototype.setState=function(j,_){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,_,"setState")},G.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function W(){}W.prototype=G.prototype;function le(j,_,J){this.props=j,this.context=_,this.refs=Y,this.updater=J||D}var X=le.prototype=new W;X.constructor=le,U(X,G.prototype),X.isPureReactComponent=!0;var te=Array.isArray;function K(){}var V={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function fe(j,_,J){var ee=J.ref;return{$$typeof:i,type:j,key:_,ref:ee!==void 0?ee:null,props:J}}function ke(j,_){return fe(j.type,_,j.props)}function we(j){return typeof j=="object"&&j!==null&&j.$$typeof===i}function ye(j){var _={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(J){return _[J]})}var Z=/\/+/g;function oe(j,_){return typeof j=="object"&&j!==null&&j.key!=null?ye(""+j.key):_.toString(36)}function me(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(K,K):(j.status="pending",j.then(function(_){j.status==="pending"&&(j.status="fulfilled",j.value=_)},function(_){j.status==="pending"&&(j.status="rejected",j.reason=_)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function C(j,_,J,ee,ue){var O=typeof j;(O==="undefined"||O==="boolean")&&(j=null);var F=!1;if(j===null)F=!0;else switch(O){case"bigint":case"string":case"number":F=!0;break;case"object":switch(j.$$typeof){case i:case o:F=!0;break;case b:return F=j._init,C(F(j._payload),_,J,ee,ue)}}if(F)return ue=ue(j),F=ee===""?"."+oe(j,0):ee,te(ue)?(J="",F!=null&&(J=F.replace(Z,"$&/")+"/"),C(ue,_,J,"",function(Ae){return Ae})):ue!=null&&(we(ue)&&(ue=ke(ue,J+(ue.key==null||j&&j.key===ue.key?"":(""+ue.key).replace(Z,"$&/")+"/")+F)),_.push(ue)),1;F=0;var ae=ee===""?".":ee+":";if(te(j))for(var ce=0;ce<j.length;ce++)ee=j[ce],O=ae+oe(ee,ce),F+=C(ee,_,J,O,ue);else if(ce=M(j),typeof ce=="function")for(j=ce.call(j),ce=0;!(ee=j.next()).done;)ee=ee.value,O=ae+oe(ee,ce++),F+=C(ee,_,J,O,ue);else if(O==="object"){if(typeof j.then=="function")return C(me(j),_,J,ee,ue);throw _=String(j),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return F}function E(j,_,J){if(j==null)return j;var ee=[],ue=0;return C(j,ee,"","",function(O){return _.call(J,O,ue++)}),ee}function $(j){if(j._status===-1){var _=j._result;_=_(),_.then(function(J){(j._status===0||j._status===-1)&&(j._status=1,j._result=J)},function(J){(j._status===0||j._status===-1)&&(j._status=2,j._result=J)}),j._status===-1&&(j._status=0,j._result=_)}if(j._status===1)return j._result.default;throw j._result}var Q=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},re={map:E,forEach:function(j,_,J){E(j,function(){_.apply(this,arguments)},J)},count:function(j){var _=0;return E(j,function(){_++}),_},toArray:function(j){return E(j,function(_){return _})||[]},only:function(j){if(!we(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return xe.Activity=g,xe.Children=re,xe.Component=G,xe.Fragment=c,xe.Profiler=x,xe.PureComponent=le,xe.StrictMode=u,xe.Suspense=y,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,xe.__COMPILER_RUNTIME={__proto__:null,c:function(j){return V.H.useMemoCache(j)}},xe.cache=function(j){return function(){return j.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(j,_,J){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ee=U({},j.props),ue=j.key;if(_!=null)for(O in _.key!==void 0&&(ue=""+_.key),_)!P.call(_,O)||O==="key"||O==="__self"||O==="__source"||O==="ref"&&_.ref===void 0||(ee[O]=_[O]);var O=arguments.length-2;if(O===1)ee.children=J;else if(1<O){for(var F=Array(O),ae=0;ae<O;ae++)F[ae]=arguments[ae+2];ee.children=F}return fe(j.type,ue,ee)},xe.createContext=function(j){return j={$$typeof:p,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:v,_context:j},j},xe.createElement=function(j,_,J){var ee,ue={},O=null;if(_!=null)for(ee in _.key!==void 0&&(O=""+_.key),_)P.call(_,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ue[ee]=_[ee]);var F=arguments.length-2;if(F===1)ue.children=J;else if(1<F){for(var ae=Array(F),ce=0;ce<F;ce++)ae[ce]=arguments[ce+2];ue.children=ae}if(j&&j.defaultProps)for(ee in F=j.defaultProps,F)ue[ee]===void 0&&(ue[ee]=F[ee]);return fe(j,O,ue)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(j){return{$$typeof:S,render:j}},xe.isValidElement=we,xe.lazy=function(j){return{$$typeof:b,_payload:{_status:-1,_result:j},_init:$}},xe.memo=function(j,_){return{$$typeof:f,type:j,compare:_===void 0?null:_}},xe.startTransition=function(j){var _=V.T,J={};V.T=J;try{var ee=j(),ue=V.S;ue!==null&&ue(J,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(K,Q)}catch(O){Q(O)}finally{_!==null&&J.types!==null&&(_.types=J.types),V.T=_}},xe.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},xe.use=function(j){return V.H.use(j)},xe.useActionState=function(j,_,J){return V.H.useActionState(j,_,J)},xe.useCallback=function(j,_){return V.H.useCallback(j,_)},xe.useContext=function(j){return V.H.useContext(j)},xe.useDebugValue=function(){},xe.useDeferredValue=function(j,_){return V.H.useDeferredValue(j,_)},xe.useEffect=function(j,_){return V.H.useEffect(j,_)},xe.useEffectEvent=function(j){return V.H.useEffectEvent(j)},xe.useId=function(){return V.H.useId()},xe.useImperativeHandle=function(j,_,J){return V.H.useImperativeHandle(j,_,J)},xe.useInsertionEffect=function(j,_){return V.H.useInsertionEffect(j,_)},xe.useLayoutEffect=function(j,_){return V.H.useLayoutEffect(j,_)},xe.useMemo=function(j,_){return V.H.useMemo(j,_)},xe.useOptimistic=function(j,_){return V.H.useOptimistic(j,_)},xe.useReducer=function(j,_,J){return V.H.useReducer(j,_,J)},xe.useRef=function(j){return V.H.useRef(j)},xe.useState=function(j){return V.H.useState(j)},xe.useSyncExternalStore=function(j,_,J){return V.H.useSyncExternalStore(j,_,J)},xe.useTransition=function(){return V.H.useTransition()},xe.version="19.2.4",xe}var cx;function ro(){return cx||(cx=1,Hc.exports=dh()),Hc.exports}var h=ro(),qc={exports:{}},ls={},Gc={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 ox;function fh(){return ox||(ox=1,(function(i){function o(C,E){var $=C.length;C.push(E);e:for(;0<$;){var Q=$-1>>>1,re=C[Q];if(0<x(re,E))C[Q]=E,C[$]=re,$=Q;else break e}}function c(C){return C.length===0?null:C[0]}function u(C){if(C.length===0)return null;var E=C[0],$=C.pop();if($!==E){C[0]=$;e:for(var Q=0,re=C.length,j=re>>>1;Q<j;){var _=2*(Q+1)-1,J=C[_],ee=_+1,ue=C[ee];if(0>x(J,$))ee<re&&0>x(ue,J)?(C[Q]=ue,C[ee]=$,Q=ee):(C[Q]=J,C[_]=$,Q=_);else if(ee<re&&0>x(ue,$))C[Q]=ue,C[ee]=$,Q=ee;else break e}}return E}function x(C,E){var $=C.sortIndex-E.sortIndex;return $!==0?$:C.id-E.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;i.unstable_now=function(){return v.now()}}else{var p=Date,S=p.now();i.unstable_now=function(){return p.now()-S}}var y=[],f=[],b=1,g=null,T=3,M=!1,D=!1,U=!1,Y=!1,G=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function X(C){for(var E=c(f);E!==null;){if(E.callback===null)u(f);else if(E.startTime<=C)u(f),E.sortIndex=E.expirationTime,o(y,E);else break;E=c(f)}}function te(C){if(U=!1,X(C),!D)if(c(y)!==null)D=!0,K||(K=!0,ye());else{var E=c(f);E!==null&&me(te,E.startTime-C)}}var K=!1,V=-1,P=5,fe=-1;function ke(){return Y?!0:!(i.unstable_now()-fe<P)}function we(){if(Y=!1,K){var C=i.unstable_now();fe=C;var E=!0;try{e:{D=!1,U&&(U=!1,W(V),V=-1),M=!0;var $=T;try{t:{for(X(C),g=c(y);g!==null&&!(g.expirationTime>C&&ke());){var Q=g.callback;if(typeof Q=="function"){g.callback=null,T=g.priorityLevel;var re=Q(g.expirationTime<=C);if(C=i.unstable_now(),typeof re=="function"){g.callback=re,X(C),E=!0;break t}g===c(y)&&u(y),X(C)}else u(y);g=c(y)}if(g!==null)E=!0;else{var j=c(f);j!==null&&me(te,j.startTime-C),E=!1}}break e}finally{g=null,T=$,M=!1}E=void 0}}finally{E?ye():K=!1}}}var ye;if(typeof le=="function")ye=function(){le(we)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,oe=Z.port2;Z.port1.onmessage=we,ye=function(){oe.postMessage(null)}}else ye=function(){G(we,0)};function me(C,E){V=G(function(){C(i.unstable_now())},E)}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(C){C.callback=null},i.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<C?Math.floor(1e3/C):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(C){switch(T){case 1:case 2:case 3:var E=3;break;default:E=T}var $=T;T=E;try{return C()}finally{T=$}},i.unstable_requestPaint=function(){Y=!0},i.unstable_runWithPriority=function(C,E){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var $=T;T=C;try{return E()}finally{T=$}},i.unstable_scheduleCallback=function(C,E,$){var Q=i.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?Q+$:Q):$=Q,C){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=$+re,C={id:b++,callback:E,priorityLevel:C,startTime:$,expirationTime:re,sortIndex:-1},$>Q?(C.sortIndex=$,o(f,C),c(y)===null&&C===c(f)&&(U?(W(V),V=-1):U=!0,me(te,$-Q))):(C.sortIndex=re,o(y,C),D||M||(D=!0,K||(K=!0,ye()))),C},i.unstable_shouldYield=ke,i.unstable_wrapCallback=function(C){var E=T;return function(){var $=T;T=E;try{return C.apply(this,arguments)}finally{T=$}}}})(Yc)),Yc}var ux;function xh(){return ux||(ux=1,Gc.exports=fh()),Gc.exports}var Vc={exports:{}},pt={};/**
|
|
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 dx;function ph(){if(dx)return pt;dx=1;var i=ro();function o(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)f+="&args[]="+encodeURIComponent(arguments[b])}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 c(){}var u={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},x=Symbol.for("react.portal");function v(y,f,b){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:g==null?null:""+g,children:y,containerInfo:f,implementation:b}}var p=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,pt.createPortal=function(y,f){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(o(299));return v(y,f,null,b)},pt.flushSync=function(y){var f=p.T,b=u.p;try{if(p.T=null,u.p=2,y)return y()}finally{p.T=f,u.p=b,u.d.f()}},pt.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))},pt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},pt.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var b=f.as,g=S(b,f.crossOrigin),T=typeof f.integrity=="string"?f.integrity:void 0,M=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;b==="style"?u.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:T,fetchPriority:M}):b==="script"&&u.d.X(y,{crossOrigin:g,integrity:T,fetchPriority:M,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},pt.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var b=S(f.as,f.crossOrigin);u.d.M(y,{crossOrigin:b,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)},pt.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var b=f.as,g=S(b,f.crossOrigin);u.d.L(y,b,{crossOrigin:g,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})}},pt.preloadModule=function(y,f){if(typeof y=="string")if(f){var b=S(f.as,f.crossOrigin);u.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else u.d.m(y)},pt.requestFormReset=function(y){u.d.r(y)},pt.unstable_batchedUpdates=function(y,f){return y(f)},pt.useFormState=function(y,f,b){return p.H.useFormState(y,f,b)},pt.useFormStatus=function(){return p.H.useHostTransitionStatus()},pt.version="19.2.4",pt}var fx;function mh(){if(fx)return Vc.exports;fx=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(o){console.error(o)}}return i(),Vc.exports=ph(),Vc.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 xx;function hh(){if(xx)return ls;xx=1;var i=xh(),o=ro(),c=mh();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 x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(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 S(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(v(e)!==e)throw Error(u(188))}function f(e){var t=e.alternate;if(!t){if(t=v(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 d=!1,m=s.child;m;){if(m===l){d=!0,l=s,a=r;break}if(m===a){d=!0,a=s,l=r;break}m=m.sibling}if(!d){for(m=r.child;m;){if(m===l){d=!0,l=r,a=s;break}if(m===a){d=!0,a=r,l=s;break}m=m.sibling}if(!d)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 b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,T=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),le=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=we&&e[we]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case G:return"Profiler";case Y:return"StrictMode";case te:return"Suspense";case K:return"SuspenseList";case fe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case D:return"Portal";case le:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var me=Array.isArray,C=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},Q=[],re=-1;function j(e){return{current:e}}function _(e){0>re||(e.current=Q[re],Q[re]=null,re--)}function J(e,t){re++,Q[re]=e.current,e.current=t}var ee=j(null),ue=j(null),O=j(null),F=j(null);function ae(e,t){switch(J(O,t),J(ue,e),J(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wf(t),e=Af(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_(ee),J(ee,e)}function ce(){_(ee),_(ue),_(O)}function Ae(e){e.memoizedState!==null&&J(F,e);var t=ee.current,l=Af(t,e.type);t!==l&&(J(ue,e),J(ee,l))}function Xe(e){ue.current===e&&(_(ee),_(ue)),F.current===e&&(_(F),Fn._currentValue=$)}var Tt,Fe;function Ct(e){if(Tt===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Tt=t&&t[1]||"",Fe=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Tt+e+Fe}var xt=!1;function nl(e,t){if(!e||xt)return"";xt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(L){var z=L}Reflect.construct(e,[],q)}else{try{q.call()}catch(L){z=L}e.call(q.prototype)}}else{try{throw Error()}catch(L){z=L}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(L){if(L&&z&&typeof L.stack=="string")return[L.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(),d=r[0],m=r[1];if(d&&m){var N=d.split(`
|
|
44
|
-
`),R=m.split(`
|
|
45
|
-
`);for(s=a=0;a<N.length&&!N[a].includes("DetermineComponentFrameRoot");)a++;for(;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;if(a===N.length||s===R.length)for(a=N.length-1,s=R.length-1;1<=a&&0<=s&&N[a]!==R[s];)s--;for(;1<=a&&0<=s;a--,s--)if(N[a]!==R[s]){if(a!==1||s!==1)do if(a--,s--,0>s||N[a]!==R[s]){var B=`
|
|
46
|
-
`+N[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=s);break}}}finally{xt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ct(l):""}function cn(e,t){switch(e.tag){case 26:case 27:case 5:return Ct(e.type);case 16:return Ct("Lazy");case 13:return e.child!==t&&t!==null?Ct("Suspense Fallback"):Ct("Suspense");case 19:return Ct("SuspenseList");case 0:case 15:return nl(e.type,!1);case 11:return nl(e.type.render,!1);case 1:return nl(e.type,!0);case 31:return Ct("Activity");default:return""}}function yt(e){try{var t="",l=null;do t+=cn(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var Dt=Object.prototype.hasOwnProperty,Tl=i.unstable_scheduleCallback,sl=i.unstable_cancelCallback,on=i.unstable_shouldYield,rl=i.unstable_requestPaint,it=i.unstable_now,Ne=i.unstable_getCurrentPriorityLevel,I=i.unstable_ImmediatePriority,Ve=i.unstable_UserBlockingPriority,Be=i.unstable_NormalPriority,It=i.unstable_LowPriority,Cl=i.unstable_IdlePriority,mt=i.log,Pt=i.unstable_setDisableYieldValue,Bt=null,Ze=null;function at(e){if(typeof mt=="function"&&Pt(e),Ze&&typeof Ze.setStrictMode=="function")try{Ze.setStrictMode(Bt,e)}catch{}}var Qe=Math.clz32?Math.clz32:wl,Ge=Math.log,il=Math.LN2;function wl(e){return e>>>=0,e===0?32:31-(Ge(e)/il|0)|0}var nt=256,wt=262144,la=4194304;function aa(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 ss(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var m=a&134217727;return m!==0?(a=m&~r,a!==0?s=aa(a):(d&=m,d!==0?s=aa(d):l||(l=m&~e,l!==0&&(s=aa(l))))):(m=a&~r,m!==0?s=aa(m):d!==0?s=aa(d):l||(l=a&~e,l!==0&&(s=aa(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 un(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wx(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 io(){var e=la;return la<<=1,(la&62914560)===0&&(la=4194304),e}function Tr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function dn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fx(e,t,l,a,s,r){var d=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 m=e.entanglements,N=e.expirationTimes,R=e.hiddenUpdates;for(l=d&~l;0<l;){var B=31-Qe(l),q=1<<B;m[B]=0,N[B]=-1;var z=R[B];if(z!==null)for(R[B]=null,B=0;B<z.length;B++){var L=z[B];L!==null&&(L.lane&=-536870913)}l&=~q}a!==0&&co(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function co(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Qe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function oo(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Qe(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function uo(e,t){var l=t&-t;return l=(l&42)!==0?1:Cr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Cr(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 wr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function fo(){var e=E.p;return e!==0?e:(e=window.event,e===void 0?32:If(e.type))}function xo(e,t){var l=E.p;try{return E.p=e,t()}finally{E.p=l}}var Al=Math.random().toString(36).slice(2),ct="__reactFiber$"+Al,gt="__reactProps$"+Al,ja="__reactContainer$"+Al,Ar="__reactEvents$"+Al,Ix="__reactListeners$"+Al,Px="__reactHandles$"+Al,po="__reactResources$"+Al,fn="__reactMarker$"+Al;function Rr(e){delete e[ct],delete e[gt],delete e[Ar],delete e[Ix],delete e[Px]}function Sa(e){var t=e[ct];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ja]||l[ct]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Df(e);e!==null;){if(l=e[ct])return l;e=Df(e)}return t}e=l,l=e.parentNode}return null}function Na(e){if(e=e[ct]||e[ja]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Ea(e){var t=e[po];return t||(t=e[po]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function st(e){e[fn]=!0}var mo=new Set,ho={};function na(e,t){ka(e,t),ka(e+"Capture",t)}function ka(e,t){for(ho[e]=t,e=0;e<t.length;e++)mo.add(t[e])}var ep=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]*$"),vo={},yo={};function tp(e){return Dt.call(yo,e)?!0:Dt.call(vo,e)?!1:ep.test(e)?yo[e]=!0:(vo[e]=!0,!1)}function rs(e,t,l){if(tp(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 is(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 cl(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 Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function go(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lp(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(d){l=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=go(e)?"checked":"value";e._valueTracker=lp(e,t,""+e[t])}}function bo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=go(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function cs(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 ap=/[\n"\\]/g;function Ht(e){return e.replace(ap,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mr(e,t,l,a,s,r,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?zr(e,d,Ut(t)):l!=null?zr(e,d,Ut(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Ut(m):e.removeAttribute("name")}function jo(e,t,l,a,s,r,d,m){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?""+Ut(l):"",t=t!=null?""+Ut(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=m?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),_r(e)}function zr(e,t,l){t==="number"&&cs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ta(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=""+Ut(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 So(e,t,l){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ut(l):""}function No(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(me(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Ut(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),_r(e)}function Ca(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var np=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 Eo(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||np.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function ko(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&&Eo(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&Eo(e,r,t[r])}function Lr(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 sp=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"]]),rp=/^[\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 os(e){return rp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ol(){}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 wa=null,Aa=null;function To(e){var t=Na(e);if(t&&(e=t.stateNode)){var l=e[gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mr(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="'+Ht(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[gt]||null;if(!s)throw Error(u(90));Mr(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&&bo(a)}break e;case"textarea":So(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ta(e,!!l.multiple,t,!1)}}}var Br=!1;function Co(e,t,l){if(Br)return e(t,l);Br=!0;try{var a=e(t);return a}finally{if(Br=!1,(wa!==null||Aa!==null)&&(Ws(),wa&&(t=wa,e=Aa,Aa=wa=null,To(t),e)))for(t=0;t<e.length;t++)To(e[t])}}function pn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[gt]||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 ul=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ur=!1;if(ul)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){Ur=!0}}),window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Ur=!1}var Rl=null,Hr=null,us=null;function wo(){if(us)return us;var e,t=Hr,l=t.length,a,s="value"in Rl?Rl.value:Rl.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var d=l-e;for(a=1;a<=d&&t[l-a]===s[r-a];a++);return us=s.slice(e,1<a?1-a:void 0)}function ds(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 fs(){return!0}function Ao(){return!1}function bt(e){function t(l,a,s,r,d){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(r):r[m]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?fs:Ao,this.isPropagationStopped=Ao,this}return g(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=fs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xs=bt(sa),hn=g({},sa,{view:0,detail:0}),ip=bt(hn),qr,Gr,vn,ps=g({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vr,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!==vn&&(vn&&e.type==="mousemove"?(qr=e.screenX-vn.screenX,Gr=e.screenY-vn.screenY):Gr=qr=0,vn=e),qr)},movementY:function(e){return"movementY"in e?e.movementY:Gr}}),Ro=bt(ps),cp=g({},ps,{dataTransfer:0}),op=bt(cp),up=g({},hn,{relatedTarget:0}),Yr=bt(up),dp=g({},sa,{animationName:0,elapsedTime:0,pseudoElement:0}),fp=bt(dp),xp=g({},sa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pp=bt(xp),mp=g({},sa,{data:0}),_o=bt(mp),hp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vp={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"},yp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yp[e])?!!t[e]:!1}function Vr(){return gp}var bp=g({},hn,{key:function(e){if(e.key){var t=hp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vr,charCode:function(e){return e.type==="keypress"?ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jp=bt(bp),Sp=g({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mo=bt(Sp),Np=g({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vr}),Ep=bt(Np),kp=g({},sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tp=bt(kp),Cp=g({},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}),wp=bt(Cp),Ap=g({},sa,{newState:0,oldState:0}),Rp=bt(Ap),_p=[9,13,27,32],Qr=ul&&"CompositionEvent"in window,yn=null;ul&&"documentMode"in document&&(yn=document.documentMode);var Mp=ul&&"TextEvent"in window&&!yn,zo=ul&&(!Qr||yn&&8<yn&&11>=yn),Lo=" ",Oo=!1;function Do(e,t){switch(e){case"keyup":return _p.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ra=!1;function zp(e,t){switch(e){case"compositionend":return Bo(t);case"keypress":return t.which!==32?null:(Oo=!0,Lo);case"textInput":return e=t.data,e===Lo&&Oo?null:e;default:return null}}function Lp(e,t){if(Ra)return e==="compositionend"||!Qr&&Do(e,t)?(e=wo(),us=Hr=Rl=null,Ra=!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 zo&&t.locale!=="ko"?null:t.data;default:return null}}var Op={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 Uo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Op[e.type]:t==="textarea"}function Ho(e,t,l,a){wa?Aa?Aa.push(a):Aa=[a]:wa=a,t=ar(t,"onChange"),0<t.length&&(l=new xs("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var gn=null,bn=null;function Dp(e){Sf(e,0)}function ms(e){var t=xn(e);if(bo(t))return e}function qo(e,t){if(e==="change")return t}var Go=!1;if(ul){var Xr;if(ul){var Zr="oninput"in document;if(!Zr){var Yo=document.createElement("div");Yo.setAttribute("oninput","return;"),Zr=typeof Yo.oninput=="function"}Xr=Zr}else Xr=!1;Go=Xr&&(!document.documentMode||9<document.documentMode)}function Vo(){gn&&(gn.detachEvent("onpropertychange",Qo),bn=gn=null)}function Qo(e){if(e.propertyName==="value"&&ms(bn)){var t=[];Ho(t,bn,e,Dr(e)),Co(Dp,t)}}function Bp(e,t,l){e==="focusin"?(Vo(),gn=t,bn=l,gn.attachEvent("onpropertychange",Qo)):e==="focusout"&&Vo()}function Up(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ms(bn)}function Hp(e,t){if(e==="click")return ms(t)}function qp(e,t){if(e==="input"||e==="change")return ms(t)}function Gp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:Gp;function jn(e,t){if(At(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(!Dt.call(t,s)||!At(e[s],t[s]))return!1}return!0}function Xo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zo(e,t){var l=Xo(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=Xo(l)}}function Ko(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ko(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $o(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cs(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=cs(e.document)}return t}function Kr(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 Yp=ul&&"documentMode"in document&&11>=document.documentMode,_a=null,$r=null,Sn=null,Jr=!1;function Jo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||_a==null||_a!==cs(a)||(a=_a,"selectionStart"in a&&Kr(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}),Sn&&jn(Sn,a)||(Sn=a,a=ar($r,"onSelect"),0<a.length&&(t=new xs("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=_a)))}function ra(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ma={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionrun:ra("Transition","TransitionRun"),transitionstart:ra("Transition","TransitionStart"),transitioncancel:ra("Transition","TransitionCancel"),transitionend:ra("Transition","TransitionEnd")},Wr={},Wo={};ul&&(Wo=document.createElement("div").style,"AnimationEvent"in window||(delete Ma.animationend.animation,delete Ma.animationiteration.animation,delete Ma.animationstart.animation),"TransitionEvent"in window||delete Ma.transitionend.transition);function ia(e){if(Wr[e])return Wr[e];if(!Ma[e])return e;var t=Ma[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Wo)return Wr[e]=t[l];return e}var Fo=ia("animationend"),Io=ia("animationiteration"),Po=ia("animationstart"),Vp=ia("transitionrun"),Qp=ia("transitionstart"),Xp=ia("transitioncancel"),eu=ia("transitionend"),tu=new Map,Fr="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(" ");Fr.push("scrollEnd");function $t(e,t){tu.set(e,t),na(t,[e])}var hs=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)},qt=[],za=0,Ir=0;function vs(){for(var e=za,t=Ir=za=0;t<e;){var l=qt[t];qt[t++]=null;var a=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var r=qt[t];if(qt[t++]=null,a!==null&&s!==null){var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}r!==0&&lu(l,s,r)}}function ys(e,t,l,a){qt[za++]=e,qt[za++]=t,qt[za++]=l,qt[za++]=a,Ir|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Pr(e,t,l,a){return ys(e,t,l,a),gs(e)}function ca(e,t){return ys(e,null,null,t),gs(e)}function lu(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-Qe(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function gs(e){if(50<Qn)throw Qn=0,cc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var La={};function Zp(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 Rt(e,t,l,a){return new Zp(e,t,l,a)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dl(e,t){var l=e.alternate;return l===null?(l=Rt(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 au(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 bs(e,t,l,a,s,r){var d=0;if(a=e,typeof e=="function")ei(e)&&(d=1);else if(typeof e=="string")d=Fm(e,l,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case fe:return e=Rt(31,l,t,s),e.elementType=fe,e.lanes=r,e;case U:return oa(l.children,s,r,t);case Y:d=8,s|=24;break;case G:return e=Rt(12,l,t,s|2),e.elementType=G,e.lanes=r,e;case te:return e=Rt(13,l,t,s),e.elementType=te,e.lanes=r,e;case K:return e=Rt(19,l,t,s),e.elementType=K,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:d=10;break e;case W:d=9;break e;case X:d=11;break e;case V:d=14;break e;case P:d=16,a=null;break e}d=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Rt(d,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function oa(e,t,l,a){return e=Rt(7,e,a,t),e.lanes=l,e}function ti(e,t,l){return e=Rt(6,e,null,t),e.lanes=l,e}function nu(e){var t=Rt(18,null,null,0);return t.stateNode=e,t}function li(e,t,l){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var su=new WeakMap;function Gt(e,t){if(typeof e=="object"&&e!==null){var l=su.get(e);return l!==void 0?l:(t={value:e,source:t,stack:yt(t)},su.set(e,t),t)}return{value:e,source:t,stack:yt(t)}}var Oa=[],Da=0,js=null,Nn=0,Yt=[],Vt=0,_l=null,el=1,tl="";function fl(e,t){Oa[Da++]=Nn,Oa[Da++]=js,js=e,Nn=t}function ru(e,t,l){Yt[Vt++]=el,Yt[Vt++]=tl,Yt[Vt++]=_l,_l=e;var a=el;e=tl;var s=32-Qe(a)-1;a&=~(1<<s),l+=1;var r=32-Qe(t)+s;if(30<r){var d=s-s%5;r=(a&(1<<d)-1).toString(32),a>>=d,s-=d,el=1<<32-Qe(t)+s|l<<s|a,tl=r+e}else el=1<<r|l<<s|a,tl=e}function ai(e){e.return!==null&&(fl(e,1),ru(e,1,0))}function ni(e){for(;e===js;)js=Oa[--Da],Oa[Da]=null,Nn=Oa[--Da],Oa[Da]=null;for(;e===_l;)_l=Yt[--Vt],Yt[Vt]=null,tl=Yt[--Vt],Yt[Vt]=null,el=Yt[--Vt],Yt[Vt]=null}function iu(e,t){Yt[Vt++]=el,Yt[Vt++]=tl,Yt[Vt++]=_l,el=t.id,tl=t.overflow,_l=e}var ot=null,He=null,Ee=!1,Ml=null,Qt=!1,si=Error(u(519));function zl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw En(Gt(t,e)),si}function cu(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[ct]=e,t[gt]=a,l){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(l=0;l<Zn.length;l++)be(Zn[l],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),jo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),No(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||Tf(t.textContent,l)?(a.popover!=null&&(be("beforetoggle",t),be("toggle",t)),a.onScroll!=null&&be("scroll",t),a.onScrollEnd!=null&&be("scrollend",t),a.onClick!=null&&(t.onclick=ol),t=!0):t=!1,t||zl(e,!0)}function ou(e){for(ot=e.return;ot;)switch(ot.tag){case 5:case 31:case 13:Qt=!1;return;case 27:case 3:Qt=!0;return;default:ot=ot.return}}function Ba(e){if(e!==ot)return!1;if(!Ee)return ou(e),Ee=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Nc(e.type,e.memoizedProps)),l=!l),l&&He&&zl(e),ou(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));He=Of(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));He=Of(e)}else t===27?(t=He,Kl(e.type)?(e=wc,wc=null,He=e):He=t):He=ot?Zt(e.stateNode.nextSibling):null;return!0}function ua(){He=ot=null,Ee=!1}function ri(){var e=Ml;return e!==null&&(Et===null?Et=e:Et.push.apply(Et,e),Ml=null),e}function En(e){Ml===null?Ml=[e]:Ml.push(e)}var ii=j(null),da=null,xl=null;function Ll(e,t,l){J(ii,t._currentValue),t._currentValue=l}function pl(e){e._currentValue=ii.current,_(ii)}function ci(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 oi(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var d=s.child;r=r.firstContext;e:for(;r!==null;){var m=r;r=s;for(var N=0;N<t.length;N++)if(m.context===t[N]){r.lanes|=l,m=r.alternate,m!==null&&(m.lanes|=l),ci(r.return,l,e),a||(d=null);break e}r=m.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=l,r=d.alternate,r!==null&&(r.lanes|=l),ci(d,l,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Ua(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 d=s.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var m=s.type;At(s.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(s===F.current){if(d=s.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Fn):e=[Fn])}s=s.return}e!==null&&oi(t,e,l,a),t.flags|=262144}function Ss(e){for(e=e.firstContext;e!==null;){if(!At(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fa(e){da=e,xl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ut(e){return uu(da,e)}function Ns(e,t){return da===null&&fa(e),uu(e,t)}function uu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},xl===null){if(e===null)throw Error(u(308));xl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xl=xl.next=t;return l}var Kp=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()})}},$p=i.unstable_scheduleCallback,Jp=i.unstable_NormalPriority,Ie={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ui(){return{controller:new Kp,data:new Map,refCount:0}}function kn(e){e.refCount--,e.refCount===0&&$p(Jp,function(){e.controller.abort()})}var Tn=null,di=0,Ha=0,qa=null;function Wp(e,t){if(Tn===null){var l=Tn=[];di=0,Ha=pc(),qa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return di++,t.then(du,du),t}function du(){if(--di===0&&Tn!==null){qa!==null&&(qa.status="fulfilled");var e=Tn;Tn=null,Ha=0,qa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fp(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 fu=C.S;C.S=function(e,t){Jd=it(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Wp(e,t),fu!==null&&fu(e,t)};var xa=j(null);function fi(){var e=xa.current;return e!==null?e:Ue.pooledCache}function Es(e,t){t===null?J(xa,xa.current):J(xa,t.pool)}function xu(){var e=fi();return e===null?null:{parent:Ie._currentValue,pool:e}}var Ga=Error(u(460)),xi=Error(u(474)),ks=Error(u(542)),Ts={then:function(){}};function pu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(ol,ol),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vu(e),e;default:if(typeof t.status=="string")t.then(ol,ol);else{if(e=Ue,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,vu(e),e}throw ma=t,Ga}}function pa(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ma=l,Ga):l}}var ma=null;function hu(){if(ma===null)throw Error(u(459));var e=ma;return ma=null,e}function vu(e){if(e===Ga||e===ks)throw Error(u(483))}var Ya=null,Cn=0;function Cs(e){var t=Cn;return Cn+=1,Ya===null&&(Ya=[]),mu(Ya,e,t)}function wn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===T?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yu(e){function t(w,k){if(e){var A=w.deletions;A===null?(w.deletions=[k],w.flags|=16):A.push(k)}}function l(w,k){if(!e)return null;for(;k!==null;)t(w,k),k=k.sibling;return null}function a(w){for(var k=new Map;w!==null;)w.key!==null?k.set(w.key,w):k.set(w.index,w),w=w.sibling;return k}function s(w,k){return w=dl(w,k),w.index=0,w.sibling=null,w}function r(w,k,A){return w.index=A,e?(A=w.alternate,A!==null?(A=A.index,A<k?(w.flags|=67108866,k):A):(w.flags|=67108866,k)):(w.flags|=1048576,k)}function d(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function m(w,k,A,H){return k===null||k.tag!==6?(k=ti(A,w.mode,H),k.return=w,k):(k=s(k,A),k.return=w,k)}function N(w,k,A,H){var ie=A.type;return ie===U?B(w,k,A.props.children,H,A.key):k!==null&&(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===P&&pa(ie)===k.type)?(k=s(k,A.props),wn(k,A),k.return=w,k):(k=bs(A.type,A.key,A.props,null,w.mode,H),wn(k,A),k.return=w,k)}function R(w,k,A,H){return k===null||k.tag!==4||k.stateNode.containerInfo!==A.containerInfo||k.stateNode.implementation!==A.implementation?(k=li(A,w.mode,H),k.return=w,k):(k=s(k,A.children||[]),k.return=w,k)}function B(w,k,A,H,ie){return k===null||k.tag!==7?(k=oa(A,w.mode,H,ie),k.return=w,k):(k=s(k,A),k.return=w,k)}function q(w,k,A){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ti(""+k,w.mode,A),k.return=w,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case M:return A=bs(k.type,k.key,k.props,null,w.mode,A),wn(A,k),A.return=w,A;case D:return k=li(k,w.mode,A),k.return=w,k;case P:return k=pa(k),q(w,k,A)}if(me(k)||ye(k))return k=oa(k,w.mode,A,null),k.return=w,k;if(typeof k.then=="function")return q(w,Cs(k),A);if(k.$$typeof===le)return q(w,Ns(w,k),A);ws(w,k)}return null}function z(w,k,A,H){var ie=k!==null?k.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ie!==null?null:m(w,k,""+A,H);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case M:return A.key===ie?N(w,k,A,H):null;case D:return A.key===ie?R(w,k,A,H):null;case P:return A=pa(A),z(w,k,A,H)}if(me(A)||ye(A))return ie!==null?null:B(w,k,A,H,null);if(typeof A.then=="function")return z(w,k,Cs(A),H);if(A.$$typeof===le)return z(w,k,Ns(w,A),H);ws(w,A)}return null}function L(w,k,A,H,ie){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return w=w.get(A)||null,m(k,w,""+H,ie);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case M:return w=w.get(H.key===null?A:H.key)||null,N(k,w,H,ie);case D:return w=w.get(H.key===null?A:H.key)||null,R(k,w,H,ie);case P:return H=pa(H),L(w,k,A,H,ie)}if(me(H)||ye(H))return w=w.get(A)||null,B(k,w,H,ie,null);if(typeof H.then=="function")return L(w,k,A,Cs(H),ie);if(H.$$typeof===le)return L(w,k,A,Ns(k,H),ie);ws(k,H)}return null}function ne(w,k,A,H){for(var ie=null,Te=null,se=k,he=k=0,Se=null;se!==null&&he<A.length;he++){se.index>he?(Se=se,se=null):Se=se.sibling;var Ce=z(w,se,A[he],H);if(Ce===null){se===null&&(se=Se);break}e&&se&&Ce.alternate===null&&t(w,se),k=r(Ce,k,he),Te===null?ie=Ce:Te.sibling=Ce,Te=Ce,se=Se}if(he===A.length)return l(w,se),Ee&&fl(w,he),ie;if(se===null){for(;he<A.length;he++)se=q(w,A[he],H),se!==null&&(k=r(se,k,he),Te===null?ie=se:Te.sibling=se,Te=se);return Ee&&fl(w,he),ie}for(se=a(se);he<A.length;he++)Se=L(se,w,he,A[he],H),Se!==null&&(e&&Se.alternate!==null&&se.delete(Se.key===null?he:Se.key),k=r(Se,k,he),Te===null?ie=Se:Te.sibling=Se,Te=Se);return e&&se.forEach(function(Il){return t(w,Il)}),Ee&&fl(w,he),ie}function de(w,k,A,H){if(A==null)throw Error(u(151));for(var ie=null,Te=null,se=k,he=k=0,Se=null,Ce=A.next();se!==null&&!Ce.done;he++,Ce=A.next()){se.index>he?(Se=se,se=null):Se=se.sibling;var Il=z(w,se,Ce.value,H);if(Il===null){se===null&&(se=Se);break}e&&se&&Il.alternate===null&&t(w,se),k=r(Il,k,he),Te===null?ie=Il:Te.sibling=Il,Te=Il,se=Se}if(Ce.done)return l(w,se),Ee&&fl(w,he),ie;if(se===null){for(;!Ce.done;he++,Ce=A.next())Ce=q(w,Ce.value,H),Ce!==null&&(k=r(Ce,k,he),Te===null?ie=Ce:Te.sibling=Ce,Te=Ce);return Ee&&fl(w,he),ie}for(se=a(se);!Ce.done;he++,Ce=A.next())Ce=L(se,w,he,Ce.value,H),Ce!==null&&(e&&Ce.alternate!==null&&se.delete(Ce.key===null?he:Ce.key),k=r(Ce,k,he),Te===null?ie=Ce:Te.sibling=Ce,Te=Ce);return e&&se.forEach(function(ch){return t(w,ch)}),Ee&&fl(w,he),ie}function De(w,k,A,H){if(typeof A=="object"&&A!==null&&A.type===U&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case M:e:{for(var ie=A.key;k!==null;){if(k.key===ie){if(ie=A.type,ie===U){if(k.tag===7){l(w,k.sibling),H=s(k,A.props.children),H.return=w,w=H;break e}}else if(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===P&&pa(ie)===k.type){l(w,k.sibling),H=s(k,A.props),wn(H,A),H.return=w,w=H;break e}l(w,k);break}else t(w,k);k=k.sibling}A.type===U?(H=oa(A.props.children,w.mode,H,A.key),H.return=w,w=H):(H=bs(A.type,A.key,A.props,null,w.mode,H),wn(H,A),H.return=w,w=H)}return d(w);case D:e:{for(ie=A.key;k!==null;){if(k.key===ie)if(k.tag===4&&k.stateNode.containerInfo===A.containerInfo&&k.stateNode.implementation===A.implementation){l(w,k.sibling),H=s(k,A.children||[]),H.return=w,w=H;break e}else{l(w,k);break}else t(w,k);k=k.sibling}H=li(A,w.mode,H),H.return=w,w=H}return d(w);case P:return A=pa(A),De(w,k,A,H)}if(me(A))return ne(w,k,A,H);if(ye(A)){if(ie=ye(A),typeof ie!="function")throw Error(u(150));return A=ie.call(A),de(w,k,A,H)}if(typeof A.then=="function")return De(w,k,Cs(A),H);if(A.$$typeof===le)return De(w,k,Ns(w,A),H);ws(w,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,k!==null&&k.tag===6?(l(w,k.sibling),H=s(k,A),H.return=w,w=H):(l(w,k),H=ti(A,w.mode,H),H.return=w,w=H),d(w)):l(w,k)}return function(w,k,A,H){try{Cn=0;var ie=De(w,k,A,H);return Ya=null,ie}catch(se){if(se===Ga||se===ks)throw se;var Te=Rt(29,se,null,w.mode);return Te.lanes=H,Te.return=w,Te}finally{}}}var ha=yu(!0),gu=yu(!1),Ol=!1;function pi(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 Dl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Bl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Re&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=gs(e),lu(e,null,l),t}return ys(e,a,t,l),gs(e)}function An(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,oo(e,l)}}function hi(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 d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=d:r=r.next=d,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 vi=!1;function Rn(){if(vi){var e=qa;if(e!==null)throw e}}function _n(e,t,l,a){vi=!1;var s=e.updateQueue;Ol=!1;var r=s.firstBaseUpdate,d=s.lastBaseUpdate,m=s.shared.pending;if(m!==null){s.shared.pending=null;var N=m,R=N.next;N.next=null,d===null?r=R:d.next=R,d=N;var B=e.alternate;B!==null&&(B=B.updateQueue,m=B.lastBaseUpdate,m!==d&&(m===null?B.firstBaseUpdate=R:m.next=R,B.lastBaseUpdate=N))}if(r!==null){var q=s.baseState;d=0,B=R=N=null,m=r;do{var z=m.lane&-536870913,L=z!==m.lane;if(L?(je&z)===z:(a&z)===z){z!==0&&z===Ha&&(vi=!0),B!==null&&(B=B.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var ne=e,de=m;z=t;var De=l;switch(de.tag){case 1:if(ne=de.payload,typeof ne=="function"){q=ne.call(De,q,z);break e}q=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=de.payload,z=typeof ne=="function"?ne.call(De,q,z):ne,z==null)break e;q=g({},q,z);break e;case 2:Ol=!0}}z=m.callback,z!==null&&(e.flags|=64,L&&(e.flags|=8192),L=s.callbacks,L===null?s.callbacks=[z]:L.push(z))}else L={lane:z,tag:m.tag,payload:m.payload,callback:m.callback,next:null},B===null?(R=B=L,N=q):B=B.next=L,d|=z;if(m=m.next,m===null){if(m=s.shared.pending,m===null)break;L=m,m=L.next,L.next=null,s.lastBaseUpdate=L,s.shared.pending=null}}while(!0);B===null&&(N=q),s.baseState=N,s.firstBaseUpdate=R,s.lastBaseUpdate=B,r===null&&(s.shared.lanes=0),Yl|=d,e.lanes=d,e.memoizedState=q}}function bu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function ju(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)bu(l[e],t)}var Va=j(null),As=j(0);function Su(e,t){e=Nl,J(As,e),J(Va,t),Nl=e|t.baseLanes}function yi(){J(As,Nl),J(Va,Va.current)}function gi(){Nl=As.current,_(Va),_(As)}var _t=j(null),Xt=null;function Ul(e){var t=e.alternate;J(Je,Je.current&1),J(_t,e),Xt===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(Xt=e)}function bi(e){J(Je,Je.current),J(_t,e),Xt===null&&(Xt=e)}function Nu(e){e.tag===22?(J(Je,Je.current),J(_t,e),Xt===null&&(Xt=e)):Hl()}function Hl(){J(Je,Je.current),J(_t,_t.current)}function Mt(e){_(_t),Xt===e&&(Xt=null),_(Je)}var Je=j(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||Tc(l)||Cc(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 ml=0,pe=null,Le=null,Pe=null,_s=!1,Qa=!1,va=!1,Ms=0,Mn=0,Xa=null,Ip=0;function Ke(){throw Error(u(321))}function ji(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!At(e[l],t[l]))return!1;return!0}function Si(e,t,l,a,s,r){return ml=r,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?rd:Bi,va=!1,r=l(a,s),va=!1,Qa&&(r=ku(t,l,a,s)),Eu(e),r}function Eu(e){C.H=On;var t=Le!==null&&Le.next!==null;if(ml=0,Pe=Le=pe=null,_s=!1,Mn=0,Xa=null,t)throw Error(u(300));e===null||et||(e=e.dependencies,e!==null&&Ss(e)&&(et=!0))}function ku(e,t,l,a){pe=e;var s=0;do{if(Qa&&(Xa=null),Mn=0,Qa=!1,25<=s)throw Error(u(301));if(s+=1,Pe=Le=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}C.H=id,r=t(l,a)}while(Qa);return r}function Pp(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?zn(t):t,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(pe.flags|=1024),t}function Ni(){var e=Ms!==0;return Ms=0,e}function Ei(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ki(e){if(_s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_s=!1}ml=0,Pe=Le=pe=null,Qa=!1,Mn=Ms=0,Xa=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?pe.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function We(){if(Le===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=Pe===null?pe.memoizedState:Pe.next;if(t!==null)Pe=t,Le=e;else{if(e===null)throw pe.alternate===null?Error(u(467)):Error(u(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},Pe===null?pe.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function zs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zn(e){var t=Mn;return Mn+=1,Xa===null&&(Xa=[]),e=mu(Xa,e,t),t=pe,(Pe===null?t.memoizedState:Pe.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?rd:Bi),e}function Ls(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zn(e);if(e.$$typeof===le)return ut(e)}throw Error(u(438,String(e)))}function Ti(e){var t=null,l=pe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=pe.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=zs(),pe.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]=ke;return t.index++,l}function hl(e,t){return typeof t=="function"?t(e):t}function Os(e){var t=We();return Ci(t,Le,e)}function Ci(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 d=s.next;s.next=r.next,r.next=d}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var m=d=null,N=null,R=t,B=!1;do{var q=R.lane&-536870913;if(q!==R.lane?(je&q)===q:(ml&q)===q){var z=R.revertLane;if(z===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),q===Ha&&(B=!0);else if((ml&z)===z){R=R.next,z===Ha&&(B=!0);continue}else q={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(m=N=q,d=r):N=N.next=q,pe.lanes|=z,Yl|=z;q=R.action,va&&l(r,q),r=R.hasEagerState?R.eagerState:l(r,q)}else z={lane:q,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(m=N=z,d=r):N=N.next=z,pe.lanes|=q,Yl|=q;R=R.next}while(R!==null&&R!==t);if(N===null?d=r:N.next=m,!At(r,e.memoizedState)&&(et=!0,B&&(l=qa,l!==null)))throw l;e.memoizedState=r,e.baseState=d,e.baseQueue=N,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function wi(e){var t=We(),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 d=s=s.next;do r=e(r,d.action),d=d.next;while(d!==s);At(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function Tu(e,t,l){var a=pe,s=We(),r=Ee;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var d=!At((Le||s).memoizedState,l);if(d&&(s.memoizedState=l,et=!0),s=s.queue,_i(Au.bind(null,a,s,e),[e]),s.getSnapshot!==t||d||Pe!==null&&Pe.memoizedState.tag&1){if(a.flags|=2048,Za(9,{destroy:void 0},wu.bind(null,a,s,l,t),null),Ue===null)throw Error(u(349));r||(ml&127)!==0||Cu(a,t,l)}return l}function Cu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=pe.updateQueue,t===null?(t=zs(),pe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function wu(e,t,l,a){t.value=l,t.getSnapshot=a,Ru(t)&&_u(e)}function Au(e,t,l){return l(function(){Ru(t)&&_u(e)})}function Ru(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!At(e,l)}catch{return!0}}function _u(e){var t=ca(e,2);t!==null&&kt(t,e,2)}function Ai(e){var t=ht();if(typeof e=="function"){var l=e;if(e=l(),va){at(!0);try{l()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:e},t}function Mu(e,t,l,a){return e.baseState=l,Ci(e,Le,typeof a=="function"?a:hl)}function em(e,t,l,a,s){if(Us(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(d){r.listeners.push(d)}};C.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,zu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function zu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=C.T,d={};C.T=d;try{var m=l(s,a),N=C.S;N!==null&&N(d,m),Lu(e,t,m)}catch(R){Ri(e,t,R)}finally{r!==null&&d.types!==null&&(r.types=d.types),C.T=r}}else try{r=l(s,a),Lu(e,t,r)}catch(R){Ri(e,t,R)}}function Lu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Ou(e,t,a)},function(a){return Ri(e,t,a)}):Ou(e,t,l)}function Ou(e,t,l){t.status="fulfilled",t.value=l,Du(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,zu(e,l)))}function Ri(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Du(t),t=t.next;while(t!==a)}e.action=null}function Du(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bu(e,t){return t}function Uu(e,t){if(Ee){var l=Ue.formState;if(l!==null){e:{var a=pe;if(Ee){if(He){t:{for(var s=He,r=Qt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Zt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){He=Zt(s.nextSibling),a=s.data==="F!";break e}}zl(a)}a=!1}a&&(t=l[0])}}return l=ht(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:t},l.queue=a,l=ad.bind(null,pe,a),a.dispatch=l,a=Ai(!1),r=Di.bind(null,pe,!1,a.queue),a=ht(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=em.bind(null,pe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Hu(e){var t=We();return qu(t,Le,e)}function qu(e,t,l){if(t=Ci(e,t,Bu)[0],e=Os(hl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=zn(t)}catch(d){throw d===Ga?ks:d}else a=t;t=We();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(pe.flags|=2048,Za(9,{destroy:void 0},tm.bind(null,s,l),null)),[a,r,e]}function tm(e,t){e.action=t}function Gu(e){var t=We(),l=Le;if(l!==null)return qu(t,l,e);We(),t=t.memoizedState,l=We();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Za(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=pe.updateQueue,t===null&&(t=zs(),pe.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 Yu(){return We().memoizedState}function Ds(e,t,l,a){var s=ht();pe.flags|=e,s.memoizedState=Za(1|t,{destroy:void 0},l,a===void 0?null:a)}function Bs(e,t,l,a){var s=We();a=a===void 0?null:a;var r=s.memoizedState.inst;Le!==null&&a!==null&&ji(a,Le.memoizedState.deps)?s.memoizedState=Za(t,r,l,a):(pe.flags|=e,s.memoizedState=Za(1|t,r,l,a))}function Vu(e,t){Ds(8390656,8,e,t)}function _i(e,t){Bs(2048,8,e,t)}function lm(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=zs(),pe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Qu(e){var t=We().memoizedState;return lm({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Xu(e,t){return Bs(4,2,e,t)}function Zu(e,t){return Bs(4,4,e,t)}function Ku(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 $u(e,t,l){l=l!=null?l.concat([e]):null,Bs(4,4,Ku.bind(null,t,e),l)}function Mi(){}function Ju(e,t){var l=We();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ji(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Wu(e,t){var l=We();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ji(t,a[1]))return a[0];if(a=e(),va){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a}function zi(e,t,l){return l===void 0||(ml&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Fd(),pe.lanes|=e,Yl|=e,l)}function Fu(e,t,l,a){return At(l,t)?l:Va.current!==null?(e=zi(e,l,a),At(e,t)||(et=!0),e):(ml&42)===0||(ml&1073741824)!==0&&(je&261930)===0?(et=!0,e.memoizedState=l):(e=Fd(),pe.lanes|=e,Yl|=e,t)}function Iu(e,t,l,a,s){var r=E.p;E.p=r!==0&&8>r?r:8;var d=C.T,m={};C.T=m,Di(e,!1,t,l);try{var N=s(),R=C.S;if(R!==null&&R(m,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var B=Fp(N,a);Ln(e,t,B,Ot(e))}else Ln(e,t,a,Ot(e))}catch(q){Ln(e,t,{then:function(){},status:"rejected",reason:q},Ot())}finally{E.p=r,d!==null&&m.types!==null&&(d.types=m.types),C.T=d}}function am(){}function Li(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Pu(e).queue;Iu(e,s,t,$,l===null?am:function(){return ed(e),l(a)})}function Pu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:$},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ed(e){var t=Pu(e);t.next===null&&(t=e.alternate.memoizedState),Ln(e,t.next.queue,{},Ot())}function Oi(){return ut(Fn)}function td(){return We().memoizedState}function ld(){return We().memoizedState}function nm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Ot();e=Dl(l);var a=Bl(t,e,l);a!==null&&(kt(a,t,l),An(a,t,l)),t={cache:ui()},e.payload=t;return}t=t.return}}function sm(e,t,l){var a=Ot();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Us(e)?nd(t,l):(l=Pr(e,t,l,a),l!==null&&(kt(l,e,a),sd(l,t,a)))}function ad(e,t,l){var a=Ot();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(Us(e))nd(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,m=r(d,l);if(s.hasEagerState=!0,s.eagerState=m,At(m,d))return ys(e,t,s,0),Ue===null&&vs(),!1}catch{}finally{}if(l=Pr(e,t,s,a),l!==null)return kt(l,e,a),sd(l,t,a),!0}return!1}function Di(e,t,l,a){if(a={lane:2,revertLane:pc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Us(e)){if(t)throw Error(u(479))}else t=Pr(e,l,a,2),t!==null&&kt(t,e,2)}function Us(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function nd(e,t){Qa=_s=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function sd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,oo(e,l)}}var On={readContext:ut,use:Ls,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke};On.useEffectEvent=Ke;var rd={readContext:ut,use:Ls,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:ut,useEffect:Vu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ds(4194308,4,Ku.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ds(4194308,4,e,t)},useInsertionEffect:function(e,t){Ds(4,2,e,t)},useMemo:function(e,t){var l=ht();t=t===void 0?null:t;var a=e();if(va){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ht();if(l!==void 0){var s=l(t);if(va){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=sm.bind(null,pe,e),[a.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ad.bind(null,pe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Mi,useDeferredValue:function(e,t){var l=ht();return zi(l,e,t)},useTransition:function(){var e=Ai(!1);return e=Iu.bind(null,pe,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=pe,s=ht();if(Ee){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ue===null)throw Error(u(349));(je&127)!==0||Cu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Vu(Au.bind(null,a,r,e),[e]),a.flags|=2048,Za(9,{destroy:void 0},wu.bind(null,a,r,l,t),null),l},useId:function(){var e=ht(),t=Ue.identifierPrefix;if(Ee){var l=tl,a=el;l=(a&~(1<<32-Qe(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ms++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ip++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oi,useFormState:Uu,useActionState:Uu,useOptimistic:function(e){var t=ht();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,pe,!0,l),l.dispatch=t,[e,t]},useMemoCache:Ti,useCacheRefresh:function(){return ht().memoizedState=nm.bind(null,pe)},useEffectEvent:function(e){var t=ht(),l={impl:e};return t.memoizedState=l,function(){if((Re&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Bi={readContext:ut,use:Ls,useCallback:Ju,useContext:ut,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Zu,useMemo:Wu,useReducer:Os,useRef:Yu,useState:function(){return Os(hl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=We();return Fu(l,Le.memoizedState,e,t)},useTransition:function(){var e=Os(hl)[0],t=We().memoizedState;return[typeof e=="boolean"?e:zn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Oi,useFormState:Hu,useActionState:Hu,useOptimistic:function(e,t){var l=We();return Mu(l,Le,e,t)},useMemoCache:Ti,useCacheRefresh:ld};Bi.useEffectEvent=Qu;var id={readContext:ut,use:Ls,useCallback:Ju,useContext:ut,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Zu,useMemo:Wu,useReducer:wi,useRef:Yu,useState:function(){return wi(hl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=We();return Le===null?zi(l,e,t):Fu(l,Le.memoizedState,e,t)},useTransition:function(){var e=wi(hl)[0],t=We().memoizedState;return[typeof e=="boolean"?e:zn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Oi,useFormState:Gu,useActionState:Gu,useOptimistic:function(e,t){var l=We();return Le!==null?Mu(l,Le,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ti,useCacheRefresh:ld};id.useEffectEvent=Qu;function Ui(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Hi={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Ot(),s=Dl(a);s.payload=t,l!=null&&(s.callback=l),t=Bl(e,s,a),t!==null&&(kt(t,e,a),An(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Ot(),s=Dl(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Bl(e,s,a),t!==null&&(kt(t,e,a),An(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Ot(),a=Dl(l);a.tag=2,t!=null&&(a.callback=t),t=Bl(e,a,l),t!==null&&(kt(t,e,l),An(t,e,l))}};function cd(e,t,l,a,s,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,d):t.prototype&&t.prototype.isPureReactComponent?!jn(l,a)||!jn(s,r):!0}function od(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&&Hi.enqueueReplaceState(t,t.state,null)}function ya(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=g({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function ud(e){hs(e)}function dd(e){console.error(e)}function fd(e){hs(e)}function Hs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function xd(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 qi(e,t,l){return l=Dl(l),l.tag=3,l.payload={element:null},l.callback=function(){Hs(e,t)},l}function pd(e){return e=Dl(e),e.tag=3,e}function md(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(){xd(t,l,a)}}var d=l.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){xd(t,l,a),typeof s!="function"&&(Vl===null?Vl=new Set([this]):Vl.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function rm(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Ua(t,l,s,!0),l=_t.current,l!==null){switch(l.tag){case 31:case 13:return Xt===null?Fs():l.alternate===null&&$e===0&&($e=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Ts?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),dc(e,a,s)),!1;case 22:return l.flags|=65536,a===Ts?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)),dc(e,a,s)),!1}throw Error(u(435,l.tag))}return dc(e,a,s),Fs(),!1}if(Ee)return t=_t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==si&&(e=Error(u(422),{cause:a}),En(Gt(e,l)))):(a!==si&&(t=Error(u(423),{cause:a}),En(Gt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Gt(a,l),s=qi(e.stateNode,a,s),hi(e,s),$e!==4&&($e=2)),!1;var r=Error(u(520),{cause:a});if(r=Gt(r,l),Vn===null?Vn=[r]:Vn.push(r),$e!==4&&($e=2),t===null)return!0;a=Gt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=qi(l.stateNode,a,e),hi(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"&&(Vl===null||!Vl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=pd(s),md(s,e,l,a),hi(l,s),!1}l=l.return}while(l!==null);return!1}var Gi=Error(u(461)),et=!1;function dt(e,t,l,a){t.child=e===null?gu(t,null,l,a):ha(t,e.child,l,a)}function hd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var d={};for(var m in a)m!=="ref"&&(d[m]=a[m])}else d=a;return fa(t),a=Si(e,t,l,d,r,s),m=Ni(),e!==null&&!et?(Ei(e,t,s),vl(e,t,s)):(Ee&&m&&ai(t),t.flags|=1,dt(e,t,a,s),t.child)}function vd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!ei(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,yd(e,t,r,a,s)):(e=bs(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 d=r.memoizedProps;if(l=l.compare,l=l!==null?l:jn,l(d,a)&&e.ref===t.ref)return vl(e,t,s)}return t.flags|=1,e=dl(r,a),e.ref=t.ref,e.return=t,t.child=e}function yd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(jn(r,a)&&e.ref===t.ref)if(et=!1,t.pendingProps=a=r,Ji(e,s))(e.flags&131072)!==0&&(et=!0);else return t.lanes=e.lanes,vl(e,t,s)}return Yi(e,t,l,a,s)}function gd(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 bd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Es(t,r!==null?r.cachePool:null),r!==null?Su(t,r):yi(),Nu(t);else return a=t.lanes=536870912,bd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(Es(t,r.cachePool),Su(t,r),Hl(),t.memoizedState=null):(e!==null&&Es(t,null),yi(),Hl());return dt(e,t,s,l),t.child}function Dn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bd(e,t,l,a,s){var r=fi();return r=r===null?null:{parent:Ie._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&Es(t,null),yi(),Nu(t),e!==null&&Ua(e,t,a,!0),t.childLanes=s,null}function qs(e,t){return t=Ys({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jd(e,t,l){return ha(t,e.child,null,l),e=qs(t,t.pendingProps),e.flags|=2,Mt(t),t.memoizedState=null,e}function im(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(a.mode==="hidden")return e=qs(t,a),t.lanes=536870912,Dn(null,e);if(bi(t),(e=He)?(e=Lf(e,Qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_l!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,ot=t,He=null)):e=null,e===null)throw zl(t);return t.lanes=536870912,null}return qs(t,a)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(bi(t),s)if(t.flags&256)t.flags&=-257,t=jd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(et||Ua(e,t,l,!1),s=(l&e.childLanes)!==0,et||s){if(a=Ue,a!==null&&(d=uo(a,l),d!==0&&d!==r.retryLane))throw r.retryLane=d,ca(e,d),kt(a,e,d),Gi;Fs(),t=jd(e,t,l)}else e=r.treeContext,He=Zt(d.nextSibling),ot=t,Ee=!0,Ml=null,Qt=!1,e!==null&&iu(t,e),t=qs(t,a),t.flags|=4096;return t}return e=dl(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 fa(t),l=Si(e,t,l,a,void 0,s),a=Ni(),e!==null&&!et?(Ei(e,t,s),vl(e,t,s)):(Ee&&a&&ai(t),t.flags|=1,dt(e,t,l,s),t.child)}function Sd(e,t,l,a,s,r){return fa(t),t.updateQueue=null,l=ku(t,a,l,s),Eu(e),a=Ni(),e!==null&&!et?(Ei(e,t,r),vl(e,t,r)):(Ee&&a&&ai(t),t.flags|=1,dt(e,t,l,r),t.child)}function Nd(e,t,l,a,s){if(fa(t),t.stateNode===null){var r=La,d=l.contextType;typeof d=="object"&&d!==null&&(r=ut(d)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Hi,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},pi(t),d=l.contextType,r.context=typeof d=="object"&&d!==null?ut(d):La,r.state=t.memoizedState,d=l.getDerivedStateFromProps,typeof d=="function"&&(Ui(t,l,d,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&Hi.enqueueReplaceState(r,r.state,null),_n(t,a,r,s),Rn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var m=t.memoizedProps,N=ya(l,m);r.props=N;var R=r.context,B=l.contextType;d=La,typeof B=="object"&&B!==null&&(d=ut(B));var q=l.getDerivedStateFromProps;B=typeof q=="function"||typeof r.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(m||R!==d)&&od(t,r,a,d),Ol=!1;var z=t.memoizedState;r.state=z,_n(t,a,r,s),Rn(),R=t.memoizedState,m||z!==R||Ol?(typeof q=="function"&&(Ui(t,l,q,a),R=t.memoizedState),(N=Ol||cd(t,l,N,a,z,R,d))?(B||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),r.props=a,r.state=R,r.context=d,a=N):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,mi(e,t),d=t.memoizedProps,B=ya(l,d),r.props=B,q=t.pendingProps,z=r.context,R=l.contextType,N=La,typeof R=="object"&&R!==null&&(N=ut(R)),m=l.getDerivedStateFromProps,(R=typeof m=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==q||z!==N)&&od(t,r,a,N),Ol=!1,z=t.memoizedState,r.state=z,_n(t,a,r,s),Rn();var L=t.memoizedState;d!==q||z!==L||Ol||e!==null&&e.dependencies!==null&&Ss(e.dependencies)?(typeof m=="function"&&(Ui(t,l,m,a),L=t.memoizedState),(B=Ol||cd(t,l,B,a,z,L,N)||e!==null&&e.dependencies!==null&&Ss(e.dependencies))?(R||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,L,N),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,L,N)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=L),r.props=a,r.state=L,r.context=N,a=B):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===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=ha(t,e.child,null,s),t.child=ha(t,null,l,s)):dt(e,t,l,s),t.memoizedState=r.state,e=t.child):e=vl(e,t,s),e}function Ed(e,t,l,a){return ua(),t.flags|=256,dt(e,t,l,a),t.child}var Vi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qi(e){return{baseLanes:e,cachePool:xu()}}function Xi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Lt),e}function kd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(Je.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(s?Ul(t):Hl(),(e=He)?(e=Lf(e,Qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_l!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,ot=t,He=null)):e=null,e===null)throw zl(t);return Cc(e)?t.lanes=32:t.lanes=536870912,null}var m=a.children;return a=a.fallback,s?(Hl(),s=t.mode,m=Ys({mode:"hidden",children:m},s),a=oa(a,s,l,null),m.return=t,a.return=t,m.sibling=a,t.child=m,a=t.child,a.memoizedState=Qi(l),a.childLanes=Xi(e,d,l),t.memoizedState=Vi,Dn(null,a)):(Ul(t),Zi(t,m))}var N=e.memoizedState;if(N!==null&&(m=N.dehydrated,m!==null)){if(r)t.flags&256?(Ul(t),t.flags&=-257,t=Ki(e,t,l)):t.memoizedState!==null?(Hl(),t.child=e.child,t.flags|=128,t=null):(Hl(),m=a.fallback,s=t.mode,a=Ys({mode:"visible",children:a.children},s),m=oa(m,s,l,null),m.flags|=2,a.return=t,m.return=t,a.sibling=m,t.child=a,ha(t,e.child,null,l),a=t.child,a.memoizedState=Qi(l),a.childLanes=Xi(e,d,l),t.memoizedState=Vi,t=Dn(null,a));else if(Ul(t),Cc(m)){if(d=m.nextSibling&&m.nextSibling.dataset,d)var R=d.dgst;d=R,a=Error(u(419)),a.stack="",a.digest=d,En({value:a,source:null,stack:null}),t=Ki(e,t,l)}else if(et||Ua(e,t,l,!1),d=(l&e.childLanes)!==0,et||d){if(d=Ue,d!==null&&(a=uo(d,l),a!==0&&a!==N.retryLane))throw N.retryLane=a,ca(e,a),kt(d,e,a),Gi;Tc(m)||Fs(),t=Ki(e,t,l)}else Tc(m)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,He=Zt(m.nextSibling),ot=t,Ee=!0,Ml=null,Qt=!1,e!==null&&iu(t,e),t=Zi(t,a.children),t.flags|=4096);return t}return s?(Hl(),m=a.fallback,s=t.mode,N=e.child,R=N.sibling,a=dl(N,{mode:"hidden",children:a.children}),a.subtreeFlags=N.subtreeFlags&65011712,R!==null?m=dl(R,m):(m=oa(m,s,l,null),m.flags|=2),m.return=t,a.return=t,a.sibling=m,t.child=a,Dn(null,a),a=t.child,m=e.child.memoizedState,m===null?m=Qi(l):(s=m.cachePool,s!==null?(N=Ie._currentValue,s=s.parent!==N?{parent:N,pool:N}:s):s=xu(),m={baseLanes:m.baseLanes|l,cachePool:s}),a.memoizedState=m,a.childLanes=Xi(e,d,l),t.memoizedState=Vi,Dn(e.child,a)):(Ul(t),l=e.child,e=l.sibling,l=dl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=l,t.memoizedState=null,l)}function Zi(e,t){return t=Ys({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ys(e,t){return e=Rt(22,e,null,t),e.lanes=0,e}function Ki(e,t,l){return ha(t,e.child,null,l),e=Zi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Td(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ci(e.return,t,l)}function $i(e,t,l,a,s,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=l,d.tailMode=s,d.treeForkCount=r)}function Cd(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var d=Je.current,m=(d&2)!==0;if(m?(d=d&1|2,t.flags|=128):d&=1,J(Je,d),dt(e,t,a,l),a=Ee?Nn:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Td(e,l,t);else if(e.tag===19)Td(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),$i(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}$i(t,!0,l,null,r,a);break;case"together":$i(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function vl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ua(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=dl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=dl(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&&Ss(e)))}function cm(e,t,l){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Ll(t,Ie,e.memoizedState.cache),ua();break;case 27:case 5:Ae(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Ll(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ul(t),t.flags|=128,null):(l&t.child.childLanes)!==0?kd(e,t,l):(Ul(t),e=vl(e,t,l),e!==null?e.sibling:null);Ul(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Ua(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Cd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),J(Je,Je.current),a)break;return null;case 22:return t.lanes=0,gd(e,t,l,t.pendingProps);case 24:Ll(t,Ie,e.memoizedState.cache)}return vl(e,t,l)}function wd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return et=!1,cm(e,t,l);et=(e.flags&131072)!==0}else et=!1,Ee&&(t.flags&1048576)!==0&&ru(t,Nn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=pa(t.elementType),t.type=e,typeof e=="function")ei(e)?(a=ya(e,a),t.tag=1,t=Nd(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===X){t.tag=11,t=hd(null,t,e,a,l);break e}else if(s===V){t.tag=14,t=vd(null,t,e,a,l);break e}}throw t=oe(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=ya(a,t.pendingProps),Nd(e,t,a,s,l);case 3:e:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,mi(e,t),_n(t,a,null,l);var d=t.memoizedState;if(a=d.cache,Ll(t,Ie,a),a!==r.cache&&oi(t,[Ie],l,!0),Rn(),a=d.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Ed(e,t,a,l);break e}else if(a!==s){s=Gt(Error(u(424)),t),En(s),t=Ed(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(He=Zt(e.firstChild),ot=t,Ee=!0,Ml=null,Qt=!0,l=gu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(ua(),a===s){t=vl(e,t,l);break e}dt(e,t,a,l)}t=t.child}return t;case 26:return Gs(e,t),e===null?(l=qf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ee||(l=t.type,e=t.pendingProps,a=nr(O.current).createElement(l),a[ct]=t,a[gt]=e,ft(a,l,e),st(a),t.stateNode=a):t.memoizedState=qf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&Ee&&(a=t.stateNode=Bf(t.type,t.pendingProps,O.current),ot=t,Qt=!0,s=He,Kl(t.type)?(wc=s,He=Zt(a.firstChild)):He=s),dt(e,t,t.pendingProps.children,l),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((s=a=He)&&(a=Um(a,t.type,t.pendingProps,Qt),a!==null?(t.stateNode=a,ot=t,He=Zt(a.firstChild),Qt=!1,s=!0):s=!1),s||zl(t)),Ae(t),s=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,a=r.children,Nc(s,r)?a=null:d!==null&&Nc(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Si(e,t,Pp,null,null,l),Fn._currentValue=s),Gs(e,t),dt(e,t,a,l),t.child;case 6:return e===null&&Ee&&((e=l=He)&&(l=Hm(l,t.pendingProps,Qt),l!==null?(t.stateNode=l,ot=t,He=null,e=!0):e=!1),e||zl(t)),null;case 13:return kd(e,t,l);case 4:return ae(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ha(t,null,a,l):dt(e,t,a,l),t.child;case 11:return hd(e,t,t.type,t.pendingProps,l);case 7:return dt(e,t,t.pendingProps,l),t.child;case 8:return dt(e,t,t.pendingProps.children,l),t.child;case 12:return dt(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Ll(t,t.type,a.value),dt(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,fa(t),s=ut(s),a=a(s),t.flags|=1,dt(e,t,a,l),t.child;case 14:return vd(e,t,t.type,t.pendingProps,l);case 15:return yd(e,t,t.type,t.pendingProps,l);case 19:return Cd(e,t,l);case 31:return im(e,t,l);case 22:return gd(e,t,l,t.pendingProps);case 24:return fa(t),a=ut(Ie),e===null?(s=fi(),s===null&&(s=Ue,r=ui(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},pi(t),Ll(t,Ie,s)):((e.lanes&l)!==0&&(mi(e,t),_n(t,null,null,l),Rn()),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),Ll(t,Ie,a)):(a=r.cache,Ll(t,Ie,a),a!==s.cache&&oi(t,[Ie],l,!0))),dt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function yl(e){e.flags|=4}function Wi(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(tf())e.flags|=8192;else throw ma=Ts,xi}else e.flags&=-16777217}function Ad(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(tf())e.flags|=8192;else throw ma=Ts,xi}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?io():536870912,e.lanes|=t,Wa|=t)}function Bn(e,t){if(!Ee)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 qe(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 om(e,t,l){var a=t.pendingProps;switch(ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),pl(Ie),ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ba(t)?yl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ri())),qe(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(yl(t),r!==null?(qe(t),Ad(t,r)):(qe(t),Wi(t,s,null,a,l))):r?r!==e.memoizedState?(yl(t),qe(t),Ad(t,r)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&yl(t),qe(t),Wi(t,s,e,a,l)),null;case 27:if(Xe(t),l=O.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&yl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return qe(t),null}e=ee.current,Ba(t)?cu(t):(e=Bf(s,a,l),t.stateNode=e,yl(t))}return qe(t),null;case 5:if(Xe(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&yl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(r=ee.current,Ba(t))cu(t);else{var d=nr(O.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?d.createElement(s,{is:a.is}):d.createElement(s)}}r[ct]=t,r[gt]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(ft(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&&yl(t)}}return qe(t),Wi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&yl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=O.current,Ba(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=ot,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[ct]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Tf(e.nodeValue,l)),e||zl(t,!0)}else e=nr(e).createTextNode(a),e[ct]=t,t.stateNode=e}return qe(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ba(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[ct]=t}else ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else l=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Mt(t),t):(Mt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return qe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ba(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[ct]=t}else ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),s=!1}else s=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Mt(t),t):(Mt(t),null)}return Mt(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),Vs(t,t.updateQueue),qe(t),null);case 4:return ce(),e===null&&yc(t.stateNode.containerInfo),qe(t),null;case 10:return pl(t.type),qe(t),null;case 19:if(_(Je),a=t.memoizedState,a===null)return qe(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Bn(a,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Rs(e),r!==null){for(t.flags|=128,Bn(a,!1),e=r.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)au(l,e),l=l.sibling;return J(Je,Je.current&1|2),Ee&&fl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&it()>$s&&(t.flags|=128,s=!0,Bn(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,Vs(t,e),Bn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Ee)return qe(t),null}else 2*it()-a.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Bn(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=it(),e.sibling=null,l=Je.current,J(Je,s?l&1|2:l&1),Ee&&fl(t,a.treeForkCount),e):(qe(t),null);case 22:case 23:return Mt(t),gi(),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&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),l=t.updateQueue,l!==null&&Vs(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&&_(xa),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),pl(Ie),qe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function um(e,t){switch(ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pl(Ie),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Xe(t),null;case 31:if(t.memoizedState!==null){if(Mt(t),t.alternate===null)throw Error(u(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _(Je),null;case 4:return ce(),null;case 10:return pl(t.type),null;case 22:case 23:return Mt(t),gi(),e!==null&&_(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pl(Ie),null;case 25:return null;default:return null}}function Rd(e,t){switch(ni(t),t.tag){case 3:pl(Ie),ce();break;case 26:case 27:case 5:Xe(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&Mt(t);break;case 13:Mt(t);break;case 19:_(Je);break;case 10:pl(t.type);break;case 22:case 23:Mt(t),gi(),e!==null&&_(xa);break;case 24:pl(Ie)}}function Un(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,d=l.inst;a=r(),d.destroy=a}l=l.next}while(l!==s)}}catch(m){ze(t,t.return,m)}}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 d=a.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,s=t;var N=l,R=m;try{R()}catch(B){ze(s,N,B)}}}a=a.next}while(a!==r)}}catch(B){ze(t,t.return,B)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ju(t,l)}catch(a){ze(e,e.return,a)}}}function Md(e,t,l){l.props=ya(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ze(e,t,a)}}function Hn(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){ze(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){ze(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){ze(e,t,s)}else l.current=null}function zd(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){ze(e,e.return,s)}}function Fi(e,t,l){try{var a=e.stateNode;Mm(a,e.type,l,t),a[gt]=t}catch(s){ze(e,e.return,s)}}function Ld(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Kl(e.type)||e.tag===4}function Ii(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ld(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&&Kl(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 Pi(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=ol));else if(a!==4&&(a===27&&Kl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Pi(e,t,l),e=e.sibling;e!==null;)Pi(e,t,l),e=e.sibling}function Qs(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&&Kl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Qs(e,t,l),e=e.sibling;e!==null;)Qs(e,t,l),e=e.sibling}function Od(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ft(t,a,l),t[ct]=e,t[gt]=l}catch(r){ze(e,e.return,r)}}var gl=!1,tt=!1,ec=!1,Dd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function dm(e,t){if(e=e.containerInfo,jc=dr,e=$o(e),Kr(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 d=0,m=-1,N=-1,R=0,B=0,q=e,z=null;t:for(;;){for(var L;q!==l||s!==0&&q.nodeType!==3||(m=d+s),q!==r||a!==0&&q.nodeType!==3||(N=d+a),q.nodeType===3&&(d+=q.nodeValue.length),(L=q.firstChild)!==null;)z=q,q=L;for(;;){if(q===e)break t;if(z===l&&++R===s&&(m=d),z===r&&++B===a&&(N=d),(L=q.nextSibling)!==null)break;q=z,z=q.parentNode}q=L}l=m===-1||N===-1?null:{start:m,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(Sc={focusedElem:e,selectionRange:l},dr=!1,rt=t;rt!==null;)if(t=rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rt=e;else for(;rt!==null;){switch(t=rt,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 ne=ya(l.type,s);e=a.getSnapshotBeforeUpdate(ne,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(de){ze(l,l.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)kc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":kc(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,rt=e;break}rt=t.return}}function Bd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:jl(e,l),a&4&&Un(5,l);break;case 1:if(jl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(d){ze(l,l.return,d)}else{var s=ya(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){ze(l,l.return,d)}}a&64&&_d(l),a&512&&Hn(l,l.return);break;case 3:if(jl(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{ju(e,t)}catch(d){ze(l,l.return,d)}}break;case 27:t===null&&a&4&&Od(l);case 26:case 5:jl(e,l),t===null&&a&4&&zd(l),a&512&&Hn(l,l.return);break;case 12:jl(e,l);break;case 31:jl(e,l),a&4&&qd(e,l);break;case 13:jl(e,l),a&4&&Gd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=bm.bind(null,l),qm(e,l))));break;case 22:if(a=l.memoizedState!==null||gl,!a){t=t!==null&&t.memoizedState!==null||tt,s=gl;var r=tt;gl=a,(tt=t)&&!r?Sl(e,l,(l.subtreeFlags&8772)!==0):jl(e,l),gl=s,tt=r}break;case 30:break;default:jl(e,l)}}function Ud(e){var t=e.alternate;t!==null&&(e.alternate=null,Ud(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rr(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,jt=!1;function bl(e,t,l){for(l=l.child;l!==null;)Hd(e,t,l),l=l.sibling}function Hd(e,t,l){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(Bt,l)}catch{}switch(l.tag){case 26:tt||ll(l,t),bl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:tt||ll(l,t);var a=Ye,s=jt;Kl(l.type)&&(Ye=l.stateNode,jt=!1),bl(e,t,l),$n(l.stateNode),Ye=a,jt=s;break;case 5:tt||ll(l,t);case 6:if(a=Ye,s=jt,Ye=null,bl(e,t,l),Ye=a,jt=s,Ye!==null)if(jt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(l.stateNode)}catch(r){ze(l,t,r)}else try{Ye.removeChild(l.stateNode)}catch(r){ze(l,t,r)}break;case 18:Ye!==null&&(jt?(e=Ye,Mf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),nn(e)):Mf(Ye,l.stateNode));break;case 4:a=Ye,s=jt,Ye=l.stateNode.containerInfo,jt=!0,bl(e,t,l),Ye=a,jt=s;break;case 0:case 11:case 14:case 15:ql(2,l,t),tt||ql(4,l,t),bl(e,t,l);break;case 1:tt||(ll(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Md(l,t,a)),bl(e,t,l);break;case 21:bl(e,t,l);break;case 22:tt=(a=tt)||l.memoizedState!==null,bl(e,t,l),tt=a;break;default:bl(e,t,l)}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{nn(e)}catch(l){ze(t,t.return,l)}}}function Gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{nn(e)}catch(l){ze(t,t.return,l)}}function fm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Dd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Dd),t;default:throw Error(u(435,e.tag))}}function Xs(e,t){var l=fm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=jm.bind(null,e,a);a.then(s,s)}})}function St(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,d=t,m=d;e:for(;m!==null;){switch(m.tag){case 27:if(Kl(m.type)){Ye=m.stateNode,jt=!1;break e}break;case 5:Ye=m.stateNode,jt=!1;break e;case 3:case 4:Ye=m.stateNode.containerInfo,jt=!0;break e}m=m.return}if(Ye===null)throw Error(u(160));Hd(r,d,s),Ye=null,jt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var Jt=null;function Yd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:St(t,e),Nt(e),a&4&&(ql(3,e,e.return),Un(3,e),ql(5,e,e.return));break;case 1:St(t,e),Nt(e),a&512&&(tt||l===null||ll(l,l.return)),a&64&&gl&&(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=Jt;if(St(t,e),Nt(e),a&512&&(tt||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[fn]||r[ct]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ft(r,a,l),r[ct]=e,st(r),a=r;break e;case"link":var d=Vf("link","href",s).get(a+(l.href||""));if(d){for(var m=0;m<d.length;m++)if(r=d[m],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)){d.splice(m,1);break t}}r=s.createElement(a),ft(r,a,l),s.head.appendChild(r);break;case"meta":if(d=Vf("meta","content",s).get(a+(l.content||""))){for(m=0;m<d.length;m++)if(r=d[m],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)){d.splice(m,1);break t}}r=s.createElement(a),ft(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[ct]=e,st(r),a=r}e.stateNode=a}else Qf(s,e.type,e.stateNode);else e.stateNode=Yf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Qf(s,e.type,e.stateNode):Yf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Fi(e,e.memoizedProps,l.memoizedProps)}break;case 27:St(t,e),Nt(e),a&512&&(tt||l===null||ll(l,l.return)),l!==null&&a&4&&Fi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(St(t,e),Nt(e),a&512&&(tt||l===null||ll(l,l.return)),e.flags&32){s=e.stateNode;try{Ca(s,"")}catch(ne){ze(e,e.return,ne)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Fi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(ec=!0);break;case 6:if(St(t,e),Nt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ne){ze(e,e.return,ne)}}break;case 3:if(ir=null,s=Jt,Jt=sr(t.containerInfo),St(t,e),Jt=s,Nt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{nn(t.containerInfo)}catch(ne){ze(e,e.return,ne)}ec&&(ec=!1,Vd(e));break;case 4:a=Jt,Jt=sr(e.stateNode.containerInfo),St(t,e),Nt(e),Jt=a;break;case 12:St(t,e),Nt(e);break;case 31:St(t,e),Nt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xs(e,a)));break;case 13:St(t,e),Nt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ks=it()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xs(e,a)));break;case 22:s=e.memoizedState!==null;var N=l!==null&&l.memoizedState!==null,R=gl,B=tt;if(gl=R||s,tt=B||N,St(t,e),tt=B,gl=R,Nt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||N||gl||tt||ga(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){N=l=t;try{if(r=N.stateNode,s)d=r.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{m=N.stateNode;var q=N.memoizedProps.style,z=q!=null&&q.hasOwnProperty("display")?q.display:null;m.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(ne){ze(N,N.return,ne)}}}else if(t.tag===6){if(l===null){N=t;try{N.stateNode.nodeValue=s?"":N.memoizedProps}catch(ne){ze(N,N.return,ne)}}}else if(t.tag===18){if(l===null){N=t;try{var L=N.stateNode;s?zf(L,!0):zf(N.stateNode,!1)}catch(ne){ze(N,N.return,ne)}}}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,Xs(e,l))));break;case 19:St(t,e),Nt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Xs(e,a)));break;case 30:break;case 21:break;default:St(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Ld(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Ii(e);Qs(e,r,s);break;case 5:var d=l.stateNode;l.flags&32&&(Ca(d,""),l.flags&=-33);var m=Ii(e);Qs(e,m,d);break;case 3:case 4:var N=l.stateNode.containerInfo,R=Ii(e);Pi(e,R,N);break;default:throw Error(u(161))}}catch(B){ze(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bd(e,t.alternate,t),t=t.sibling}function ga(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),ga(t);break;case 1:ll(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Md(t,t.return,l),ga(t);break;case 27:$n(t.stateNode);case 26:case 5:ll(t,t.return),ga(t);break;case 22:t.memoizedState===null&&ga(t);break;case 30:ga(t);break;default:ga(t)}e=e.sibling}}function Sl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,d=r.flags;switch(r.tag){case 0:case 11:case 15:Sl(s,r,l),Un(4,r);break;case 1:if(Sl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(R){ze(a,a.return,R)}if(a=r,s=a.updateQueue,s!==null){var m=a.stateNode;try{var N=s.shared.hiddenCallbacks;if(N!==null)for(s.shared.hiddenCallbacks=null,s=0;s<N.length;s++)bu(N[s],m)}catch(R){ze(a,a.return,R)}}l&&d&64&&_d(r),Hn(r,r.return);break;case 27:Od(r);case 26:case 5:Sl(s,r,l),l&&a===null&&d&4&&zd(r),Hn(r,r.return);break;case 12:Sl(s,r,l);break;case 31:Sl(s,r,l),l&&d&4&&qd(s,r);break;case 13:Sl(s,r,l),l&&d&4&&Gd(s,r);break;case 22:r.memoizedState===null&&Sl(s,r,l),Hn(r,r.return);break;case 30:break;default:Sl(s,r,l)}t=t.sibling}}function tc(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&&kn(l))}function lc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&kn(e))}function Wt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qd(e,t,l,a),t=t.sibling}function Qd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Wt(e,t,l,a),s&2048&&Un(9,t);break;case 1:Wt(e,t,l,a);break;case 3:Wt(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&&kn(e)));break;case 12:if(s&2048){Wt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,d=r.id,m=r.onPostCommit;typeof m=="function"&&m(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){ze(t,t.return,N)}}else Wt(e,t,l,a);break;case 31:Wt(e,t,l,a);break;case 13:Wt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,d=t.alternate,t.memoizedState!==null?r._visibility&2?Wt(e,t,l,a):qn(e,t):r._visibility&2?Wt(e,t,l,a):(r._visibility|=2,Ka(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&tc(d,t);break;case 24:Wt(e,t,l,a),s&2048&&lc(t.alternate,t);break;default:Wt(e,t,l,a)}}function Ka(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,m=l,N=a,R=d.flags;switch(d.tag){case 0:case 11:case 15:Ka(r,d,m,N,s),Un(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?Ka(r,d,m,N,s):qn(r,d):(B._visibility|=2,Ka(r,d,m,N,s)),s&&R&2048&&tc(d.alternate,d);break;case 24:Ka(r,d,m,N,s),s&&R&2048&&lc(d.alternate,d);break;default:Ka(r,d,m,N,s)}t=t.sibling}}function qn(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:qn(l,a),s&2048&&tc(a.alternate,a);break;case 24:qn(l,a),s&2048&&lc(a.alternate,a);break;default:qn(l,a)}t=t.sibling}}var Gn=8192;function $a(e,t,l){if(e.subtreeFlags&Gn)for(e=e.child;e!==null;)Xd(e,t,l),e=e.sibling}function Xd(e,t,l){switch(e.tag){case 26:$a(e,t,l),e.flags&Gn&&e.memoizedState!==null&&Im(l,Jt,e.memoizedState,e.memoizedProps);break;case 5:$a(e,t,l);break;case 3:case 4:var a=Jt;Jt=sr(e.stateNode.containerInfo),$a(e,t,l),Jt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Gn,Gn=16777216,$a(e,t,l),Gn=a):$a(e,t,l));break;default:$a(e,t,l)}}function Zd(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 Yn(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];rt=a,$d(a,e)}Zd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kd(e),e=e.sibling}function Kd(e){switch(e.tag){case 0:case 11:case 15:Yn(e),e.flags&2048&&ql(9,e,e.return);break;case 3:Yn(e);break;case 12:Yn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zs(e)):Yn(e);break;default:Yn(e)}}function Zs(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];rt=a,$d(a,e)}Zd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ql(8,t,t.return),Zs(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Zs(t));break;default:Zs(t)}e=e.sibling}}function $d(e,t){for(;rt!==null;){var l=rt;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:kn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,rt=a;else e:for(l=e;rt!==null;){a=rt;var s=a.sibling,r=a.return;if(Ud(a),a===l){rt=null;break e}if(s!==null){s.return=r,rt=s;break e}rt=r}}}var xm={getCacheForType:function(e){var t=ut(Ie),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ut(Ie).controller.signal}},pm=typeof WeakMap=="function"?WeakMap:Map,Re=0,Ue=null,ge=null,je=0,Me=0,zt=null,Gl=!1,Ja=!1,ac=!1,Nl=0,$e=0,Yl=0,ba=0,nc=0,Lt=0,Wa=0,Vn=null,Et=null,sc=!1,Ks=0,Jd=0,$s=1/0,Js=null,Vl=null,lt=0,Ql=null,Fa=null,El=0,rc=0,ic=null,Wd=null,Qn=0,cc=null;function Ot(){return(Re&2)!==0&&je!==0?je&-je:C.T!==null?pc():fo()}function Fd(){if(Lt===0)if((je&536870912)===0||Ee){var e=wt;wt<<=1,(wt&3932160)===0&&(wt=262144),Lt=e}else Lt=536870912;return e=_t.current,e!==null&&(e.flags|=32),Lt}function kt(e,t,l){(e===Ue&&(Me===2||Me===9)||e.cancelPendingCommit!==null)&&(Ia(e,0),Xl(e,je,Lt,!1)),dn(e,l),((Re&2)===0||e!==Ue)&&(e===Ue&&((Re&2)===0&&(ba|=l),$e===4&&Xl(e,je,Lt,!1)),al(e))}function Id(e,t,l){if((Re&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||un(e,t),s=a?vm(e,t):uc(e,t,!0),r=a;do{if(s===0){Ja&&!a&&Xl(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!mm(l)){s=uc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var m=e;s=Vn;var N=m.current.memoizedState.isDehydrated;if(N&&(Ia(m,d).flags|=256),d=uc(m,d,!1),d!==2){if(ac&&!N){m.errorRecoveryDisabledLanes|=r,ba|=r,s=4;break e}r=Et,Et=s,r!==null&&(Et===null?Et=r:Et.push.apply(Et,r))}s=d}if(r=!1,s!==2)continue}}if(s===1){Ia(e,0),Xl(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:Xl(a,t,Lt,!Gl);break e;case 2:Et=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Ks+300-it(),10<s)){if(Xl(a,t,Lt,!Gl),ss(a,0,!0)!==0)break e;El=t,a.timeoutHandle=Rf(Pd.bind(null,a,l,Et,Js,sc,t,Lt,ba,Wa,Gl,r,"Throttled",-0,0),s);break e}Pd(a,l,Et,Js,sc,t,Lt,ba,Wa,Gl,r,null,-0,0)}}break}while(!0);al(e)}function Pd(e,t,l,a,s,r,d,m,N,R,B,q,z,L){if(e.timeoutHandle=-1,q=t.subtreeFlags,q&8192||(q&16785408)===16785408){q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ol},Xd(t,r,q);var ne=(r&62914560)===r?Ks-it():(r&4194048)===r?Jd-it():0;if(ne=Pm(q,ne),ne!==null){El=r,e.cancelPendingCommit=ne(cf.bind(null,e,t,r,l,a,s,d,m,N,B,q,null,z,L)),Xl(e,r,d,!R);return}}cf(e,t,r,l,a,s,d,m,N)}function mm(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(!At(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 Xl(e,t,l,a){t&=~nc,t&=~ba,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Qe(s),d=1<<r;a[r]=-1,s&=~d}l!==0&&co(e,l,t)}function Ws(){return(Re&6)===0?(Xn(0),!1):!0}function oc(){if(ge!==null){if(Me===0)var e=ge.return;else e=ge,xl=da=null,ki(e),Ya=null,Cn=0,e=ge;for(;e!==null;)Rd(e.alternate,e),e=e.return;ge=null}}function Ia(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Om(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),El=0,oc(),Ue=e,ge=l=dl(e.current,null),je=t,Me=0,zt=null,Gl=!1,Ja=un(e,t),ac=!1,Wa=Lt=nc=ba=Yl=$e=0,Et=Vn=null,sc=!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-Qe(a),r=1<<s;t|=e[s],a&=~r}return Nl=t,vs(),l}function ef(e,t){pe=null,C.H=On,t===Ga||t===ks?(t=hu(),Me=3):t===xi?(t=hu(),Me=4):Me=t===Gi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,zt=t,ge===null&&($e=1,Hs(e,Gt(t,e.current)))}function tf(){var e=_t.current;return e===null?!0:(je&4194048)===je?Xt===null:(je&62914560)===je||(je&536870912)!==0?e===Xt:!1}function lf(){var e=C.H;return C.H=On,e===null?On:e}function af(){var e=C.A;return C.A=xm,e}function Fs(){$e=4,Gl||(je&4194048)!==je&&_t.current!==null||(Ja=!0),(Yl&134217727)===0&&(ba&134217727)===0||Ue===null||Xl(Ue,je,Lt,!1)}function uc(e,t,l){var a=Re;Re|=2;var s=lf(),r=af();(Ue!==e||je!==t)&&(Js=null,Ia(e,t)),t=!1;var d=$e;e:do try{if(Me!==0&&ge!==null){var m=ge,N=zt;switch(Me){case 8:oc(),d=6;break e;case 3:case 2:case 9:case 6:_t.current===null&&(t=!0);var R=Me;if(Me=0,zt=null,Pa(e,m,N,R),l&&Ja){d=0;break e}break;default:R=Me,Me=0,zt=null,Pa(e,m,N,R)}}hm(),d=$e;break}catch(B){ef(e,B)}while(!0);return t&&e.shellSuspendCounter++,xl=da=null,Re=a,C.H=s,C.A=r,ge===null&&(Ue=null,je=0,vs()),d}function hm(){for(;ge!==null;)nf(ge)}function vm(e,t){var l=Re;Re|=2;var a=lf(),s=af();Ue!==e||je!==t?(Js=null,$s=it()+500,Ia(e,t)):Ja=un(e,t);e:do try{if(Me!==0&&ge!==null){t=ge;var r=zt;t:switch(Me){case 1:Me=0,zt=null,Pa(e,t,r,1);break;case 2:case 9:if(pu(r)){Me=0,zt=null,sf(t);break}t=function(){Me!==2&&Me!==9||Ue!==e||(Me=7),al(e)},r.then(t,t);break e;case 3:Me=7;break e;case 4:Me=5;break e;case 7:pu(r)?(Me=0,zt=null,sf(t)):(Me=0,zt=null,Pa(e,t,r,7));break;case 5:var d=null;switch(ge.tag){case 26:d=ge.memoizedState;case 5:case 27:var m=ge;if(d?Xf(d):m.stateNode.complete){Me=0,zt=null;var N=m.sibling;if(N!==null)ge=N;else{var R=m.return;R!==null?(ge=R,Is(R)):ge=null}break t}}Me=0,zt=null,Pa(e,t,r,5);break;case 6:Me=0,zt=null,Pa(e,t,r,6);break;case 8:oc(),$e=6;break e;default:throw Error(u(462))}}ym();break}catch(B){ef(e,B)}while(!0);return xl=da=null,C.H=a,C.A=s,Re=l,ge!==null?0:(Ue=null,je=0,vs(),$e)}function ym(){for(;ge!==null&&!on();)nf(ge)}function nf(e){var t=wd(e.alternate,e,Nl);e.memoizedProps=e.pendingProps,t===null?Is(e):ge=t}function sf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Sd(l,t,t.pendingProps,t.type,void 0,je);break;case 11:t=Sd(l,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:ki(t);default:Rd(l,t),t=ge=au(t,Nl),t=wd(l,t,Nl)}e.memoizedProps=e.pendingProps,t===null?Is(e):ge=t}function Pa(e,t,l,a){xl=da=null,ki(t),Ya=null,Cn=0;var s=t.return;try{if(rm(e,s,t,l,je)){$e=1,Hs(e,Gt(l,e.current)),ge=null;return}}catch(r){if(s!==null)throw ge=s,r;$e=1,Hs(e,Gt(l,e.current)),ge=null;return}t.flags&32768?(Ee||a===1?e=!0:Ja||(je&536870912)!==0?e=!1:(Gl=e=!0,(a===2||a===9||a===3||a===6)&&(a=_t.current,a!==null&&a.tag===13&&(a.flags|=16384))),rf(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){rf(t,Gl);return}e=t.return;var l=om(t.alternate,t,Nl);if(l!==null){ge=l;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);$e===0&&($e=5)}function rf(e,t){do{var l=um(e.alternate,e);if(l!==null){l.flags&=32767,ge=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=l}while(e!==null);$e=6,ge=null}function cf(e,t,l,a,s,r,d,m,N){e.cancelPendingCommit=null;do Ps();while(lt!==0);if((Re&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Ir,Fx(e,l,r,d,m,N),e===Ue&&(ge=Ue=null,je=0),Fa=t,Ql=e,El=l,rc=r,ic=s,Wd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sm(Be,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,s=E.p,E.p=2,d=Re,Re|=4;try{dm(e,t,l)}finally{Re=d,E.p=s,C.T=a}}lt=1,of(),uf(),df()}}function of(){if(lt===1){lt=0;var e=Ql,t=Fa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var a=E.p;E.p=2;var s=Re;Re|=4;try{Yd(t,e);var r=Sc,d=$o(e.containerInfo),m=r.focusedElem,N=r.selectionRange;if(d!==m&&m&&m.ownerDocument&&Ko(m.ownerDocument.documentElement,m)){if(N!==null&&Kr(m)){var R=N.start,B=N.end;if(B===void 0&&(B=R),"selectionStart"in m)m.selectionStart=R,m.selectionEnd=Math.min(B,m.value.length);else{var q=m.ownerDocument||document,z=q&&q.defaultView||window;if(z.getSelection){var L=z.getSelection(),ne=m.textContent.length,de=Math.min(N.start,ne),De=N.end===void 0?de:Math.min(N.end,ne);!L.extend&&de>De&&(d=De,De=de,de=d);var w=Zo(m,de),k=Zo(m,De);if(w&&k&&(L.rangeCount!==1||L.anchorNode!==w.node||L.anchorOffset!==w.offset||L.focusNode!==k.node||L.focusOffset!==k.offset)){var A=q.createRange();A.setStart(w.node,w.offset),L.removeAllRanges(),de>De?(L.addRange(A),L.extend(k.node,k.offset)):(A.setEnd(k.node,k.offset),L.addRange(A))}}}}for(q=[],L=m;L=L.parentNode;)L.nodeType===1&&q.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<q.length;m++){var H=q[m];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}dr=!!jc,Sc=jc=null}finally{Re=s,E.p=a,C.T=l}}e.current=t,lt=2}}function uf(){if(lt===2){lt=0;var e=Ql,t=Fa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var a=E.p;E.p=2;var s=Re;Re|=4;try{Bd(e,t.alternate,t)}finally{Re=s,E.p=a,C.T=l}}lt=3}}function df(){if(lt===4||lt===3){lt=0,rl();var e=Ql,t=Fa,l=El,a=Wd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,Fa=Ql=null,ff(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Vl=null),wr(l),t=t.stateNode,Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(Bt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=C.T,s=E.p,E.p=2,C.T=null;try{for(var r=e.onRecoverableError,d=0;d<a.length;d++){var m=a[d];r(m.value,{componentStack:m.stack})}}finally{C.T=t,E.p=s}}(El&3)!==0&&Ps(),al(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===cc?Qn++:(Qn=0,cc=e):Qn=0,Xn(0)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,kn(t)))}function Ps(){return of(),uf(),df(),xf()}function xf(){if(lt!==5)return!1;var e=Ql,t=rc;rc=0;var l=wr(El),a=C.T,s=E.p;try{E.p=32>l?32:l,C.T=null,l=ic,ic=null;var r=Ql,d=El;if(lt=0,Fa=Ql=null,El=0,(Re&6)!==0)throw Error(u(331));var m=Re;if(Re|=4,Kd(r.current),Qd(r,r.current,d,l),Re=m,Xn(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(Bt,r)}catch{}return!0}finally{E.p=s,C.T=a,ff(e,t)}}function pf(e,t,l){t=Gt(l,t),t=qi(e.stateNode,t,2),e=Bl(e,t,2),e!==null&&(dn(e,2),al(e))}function ze(e,t,l){if(e.tag===3)pf(e,e,l);else for(;t!==null;){if(t.tag===3){pf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Vl===null||!Vl.has(a))){e=Gt(l,e),l=pd(2),a=Bl(t,l,2),a!==null&&(md(l,a,t,e),dn(a,2),al(a));break}}t=t.return}}function dc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new pm;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)||(ac=!0,s.add(l),e=gm.bind(null,e,t,l),t.then(e,e))}function gm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ue===e&&(je&l)===l&&($e===4||$e===3&&(je&62914560)===je&&300>it()-Ks?(Re&2)===0&&Ia(e,0):nc|=l,Wa===je&&(Wa=0)),al(e)}function mf(e,t){t===0&&(t=io()),e=ca(e,t),e!==null&&(dn(e,t),al(e))}function bm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),mf(e,l)}function jm(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),mf(e,l)}function Sm(e,t){return Tl(e,t)}var er=null,en=null,fc=!1,tr=!1,xc=!1,Zl=0;function al(e){e!==en&&e.next===null&&(en===null?er=en=e:en=en.next=e),tr=!0,fc||(fc=!0,Em())}function Xn(e,t){if(!xc&&tr){xc=!0;do for(var l=!1,a=er;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var d=a.suspendedLanes,m=a.pingedLanes;r=(1<<31-Qe(42|e)+1)-1,r&=s&~(d&~m),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,gf(a,r))}else r=je,r=ss(a,a===Ue?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||un(a,r)||(l=!0,gf(a,r));a=a.next}while(l);xc=!1}}function Nm(){hf()}function hf(){tr=fc=!1;var e=0;Zl!==0&&Lm()&&(e=Zl);for(var t=it(),l=null,a=er;a!==null;){var s=a.next,r=vf(a,t);r===0?(a.next=null,l===null?er=s:l.next=s,s===null&&(en=l)):(l=a,(e!==0||(r&3)!==0)&&(tr=!0)),a=s}lt!==0&<!==5||Xn(e),Zl!==0&&(Zl=0)}function vf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-Qe(r),m=1<<d,N=s[d];N===-1?((m&l)===0||(m&a)!==0)&&(s[d]=Wx(m,t)):N<=t&&(e.expiredLanes|=m),r&=~m}if(t=Ue,l=je,l=ss(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Me===2||Me===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&sl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||un(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&sl(a),wr(l)){case 2:case 8:l=Ve;break;case 32:l=Be;break;case 268435456:l=Cl;break;default:l=Be}return a=yf.bind(null,e),l=Tl(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&sl(a),e.callbackPriority=2,e.callbackNode=null,2}function yf(e,t){if(lt!==0&<!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Ps()&&e.callbackNode!==l)return null;var a=je;return a=ss(e,e===Ue?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Id(e,a,t),vf(e,it()),e.callbackNode!=null&&e.callbackNode===l?yf.bind(null,e):null)}function gf(e,t){if(Ps())return null;Id(e,t,!0)}function Em(){Dm(function(){(Re&6)!==0?Tl(I,Nm):hf()})}function pc(){if(Zl===0){var e=Ha;e===0&&(e=nt,nt<<=1,(nt&261888)===0&&(nt=256)),Zl=e}return Zl}function bf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:os(""+e)}function jf(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 km(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=bf((s[gt]||null).action),d=a.submitter;d&&(t=(t=d[gt]||null)?bf(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var m=new xs("action","action",null,a,s);e.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Zl!==0){var N=d?jf(s,d):new FormData(s);Li(l,{pending:!0,data:N,method:s.method,action:r},null,N)}}else typeof r=="function"&&(m.preventDefault(),N=d?jf(s,d):new FormData(s),Li(l,{pending:!0,data:N,method:s.method,action:r},r,N))},currentTarget:s}]})}}for(var mc=0;mc<Fr.length;mc++){var hc=Fr[mc],Tm=hc.toLowerCase(),Cm=hc[0].toUpperCase()+hc.slice(1);$t(Tm,"on"+Cm)}$t(Fo,"onAnimationEnd"),$t(Io,"onAnimationIteration"),$t(Po,"onAnimationStart"),$t("dblclick","onDoubleClick"),$t("focusin","onFocus"),$t("focusout","onBlur"),$t(Vp,"onTransitionRun"),$t(Qp,"onTransitionStart"),$t(Xp,"onTransitionCancel"),$t(eu,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),na("onBeforeInput",["compositionend","keypress","textInput","paste"]),na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zn="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(" "),wm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zn));function Sf(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 d=a.length-1;0<=d;d--){var m=a[d],N=m.instance,R=m.currentTarget;if(m=m.listener,N!==r&&s.isPropagationStopped())break e;r=m,s.currentTarget=R;try{r(s)}catch(B){hs(B)}s.currentTarget=null,r=N}else for(d=0;d<a.length;d++){if(m=a[d],N=m.instance,R=m.currentTarget,m=m.listener,N!==r&&s.isPropagationStopped())break e;r=m,s.currentTarget=R;try{r(s)}catch(B){hs(B)}s.currentTarget=null,r=N}}}}function be(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var a=e+"__bubble";l.has(a)||(Nf(t,e,2,!1),l.add(a))}function vc(e,t,l){var a=0;t&&(a|=4),Nf(l,e,a,t)}var lr="_reactListening"+Math.random().toString(36).slice(2);function yc(e){if(!e[lr]){e[lr]=!0,mo.forEach(function(l){l!=="selectionchange"&&(wm.has(l)||vc(l,!1,e),vc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lr]||(t[lr]=!0,vc("selectionchange",!1,t))}}function Nf(e,t,l,a){switch(If(t)){case 2:var s=lh;break;case 8:s=ah;break;default:s=zc}l=s.bind(null,t,l,e),s=void 0,!Ur||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 gc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var d=a.tag;if(d===3||d===4){var m=a.stateNode.containerInfo;if(m===s)break;if(d===4)for(d=a.return;d!==null;){var N=d.tag;if((N===3||N===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;m!==null;){if(d=Sa(m),d===null)return;if(N=d.tag,N===5||N===6||N===26||N===27){a=r=d;continue e}m=m.parentNode}}a=a.return}Co(function(){var R=r,B=Dr(l),q=[];e:{var z=tu.get(e);if(z!==void 0){var L=xs,ne=e;switch(e){case"keypress":if(ds(l)===0)break e;case"keydown":case"keyup":L=jp;break;case"focusin":ne="focus",L=Yr;break;case"focusout":ne="blur",L=Yr;break;case"beforeblur":case"afterblur":L=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":L=Ro;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=op;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Ep;break;case Fo:case Io:case Po:L=fp;break;case eu:L=Tp;break;case"scroll":case"scrollend":L=ip;break;case"wheel":L=wp;break;case"copy":case"cut":case"paste":L=pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Mo;break;case"toggle":case"beforetoggle":L=Rp}var de=(t&4)!==0,De=!de&&(e==="scroll"||e==="scrollend"),w=de?z!==null?z+"Capture":null:z;de=[];for(var k=R,A;k!==null;){var H=k;if(A=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||A===null||w===null||(H=pn(k,w),H!=null&&de.push(Kn(k,H,A))),De)break;k=k.return}0<de.length&&(z=new L(z,ne,null,l,B),q.push({event:z,listeners:de}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",z&&l!==Or&&(ne=l.relatedTarget||l.fromElement)&&(Sa(ne)||ne[ja]))break e;if((L||z)&&(z=B.window===B?B:(z=B.ownerDocument)?z.defaultView||z.parentWindow:window,L?(ne=l.relatedTarget||l.toElement,L=R,ne=ne?Sa(ne):null,ne!==null&&(De=v(ne),de=ne.tag,ne!==De||de!==5&&de!==27&&de!==6)&&(ne=null)):(L=null,ne=R),L!==ne)){if(de=Ro,H="onMouseLeave",w="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(de=Mo,H="onPointerLeave",w="onPointerEnter",k="pointer"),De=L==null?z:xn(L),A=ne==null?z:xn(ne),z=new de(H,k+"leave",L,l,B),z.target=De,z.relatedTarget=A,H=null,Sa(B)===R&&(de=new de(w,k+"enter",ne,l,B),de.target=A,de.relatedTarget=De,H=de),De=H,L&&ne)t:{for(de=Am,w=L,k=ne,A=0,H=w;H;H=de(H))A++;H=0;for(var ie=k;ie;ie=de(ie))H++;for(;0<A-H;)w=de(w),A--;for(;0<H-A;)k=de(k),H--;for(;A--;){if(w===k||k!==null&&w===k.alternate){de=w;break t}w=de(w),k=de(k)}de=null}else de=null;L!==null&&Ef(q,z,L,de,!1),ne!==null&&De!==null&&Ef(q,De,ne,de,!0)}}e:{if(z=R?xn(R):window,L=z.nodeName&&z.nodeName.toLowerCase(),L==="select"||L==="input"&&z.type==="file")var Te=qo;else if(Uo(z))if(Go)Te=qp;else{Te=Up;var se=Bp}else L=z.nodeName,!L||L.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?R&&Lr(R.elementType)&&(Te=qo):Te=Hp;if(Te&&(Te=Te(e,R))){Ho(q,Te,l,B);break e}se&&se(e,z,R),e==="focusout"&&R&&z.type==="number"&&R.memoizedProps.value!=null&&zr(z,"number",z.value)}switch(se=R?xn(R):window,e){case"focusin":(Uo(se)||se.contentEditable==="true")&&(_a=se,$r=R,Sn=null);break;case"focusout":Sn=$r=_a=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Jo(q,l,B);break;case"selectionchange":if(Yp)break;case"keydown":case"keyup":Jo(q,l,B)}var he;if(Qr)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Ra?Do(e,l)&&(Se="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Se="onCompositionStart");Se&&(zo&&l.locale!=="ko"&&(Ra||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Ra&&(he=wo()):(Rl=B,Hr="value"in Rl?Rl.value:Rl.textContent,Ra=!0)),se=ar(R,Se),0<se.length&&(Se=new _o(Se,e,null,l,B),q.push({event:Se,listeners:se}),he?Se.data=he:(he=Bo(l),he!==null&&(Se.data=he)))),(he=Mp?zp(e,l):Lp(e,l))&&(Se=ar(R,"onBeforeInput"),0<Se.length&&(se=new _o("onBeforeInput","beforeinput",null,l,B),q.push({event:se,listeners:Se}),se.data=he)),km(q,e,R,l,B)}Sf(q,t)})}function Kn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function ar(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=pn(e,l),s!=null&&a.unshift(Kn(e,s,r)),s=pn(e,t),s!=null&&a.push(Kn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Am(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ef(e,t,l,a,s){for(var r=t._reactName,d=[];l!==null&&l!==a;){var m=l,N=m.alternate,R=m.stateNode;if(m=m.tag,N!==null&&N===a)break;m!==5&&m!==26&&m!==27||R===null||(N=R,s?(R=pn(l,r),R!=null&&d.unshift(Kn(l,R,N))):s||(R=pn(l,r),R!=null&&d.push(Kn(l,R,N)))),l=l.return}d.length!==0&&e.push({event:t,listeners:d})}var Rm=/\r\n?/g,_m=/\u0000|\uFFFD/g;function kf(e){return(typeof e=="string"?e:""+e).replace(Rm,`
|
|
49
|
-
`).replace(_m,"")}function Tf(e,t){return t=kf(t),kf(e)===t}function Oe(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ca(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ca(e,""+a);break;case"className":is(e,"class",a);break;case"tabIndex":is(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":is(e,l,a);break;case"style":ko(e,a,r);break;case"data":if(t!=="object"){is(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=os(""+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"&&Oe(e,t,"name",s.name,s,null),Oe(e,t,"formEncType",s.formEncType,s,null),Oe(e,t,"formMethod",s.formMethod,s,null),Oe(e,t,"formTarget",s.formTarget,s,null)):(Oe(e,t,"encType",s.encType,s,null),Oe(e,t,"method",s.method,s,null),Oe(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=os(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=ol);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("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=os(""+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":be("beforetoggle",e),be("toggle",e),rs(e,"popover",a);break;case"xlinkActuate":cl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":cl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":cl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":cl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":cl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":cl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":cl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":cl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":cl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":rs(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=sp.get(l)||l,rs(e,l,a))}}function bc(e,t,l,a,s,r){switch(l){case"style":ko(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"?Ca(e,a):(typeof a=="number"||typeof a=="bigint")&&Ca(e,""+a);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"onClick":a!=null&&(e.onclick=ol);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ho.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[gt]||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,""):rs(e,l,a)}}}function ft(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var d=l[r];if(d!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,r,d,l,null)}}s&&Oe(e,t,"srcSet",l.srcSet,l,null),a&&Oe(e,t,"src",l.src,l,null);return;case"input":be("invalid",e);var m=r=d=s=null,N=null,R=null;for(a in l)if(l.hasOwnProperty(a)){var B=l[a];if(B!=null)switch(a){case"name":s=B;break;case"type":d=B;break;case"checked":N=B;break;case"defaultChecked":R=B;break;case"value":r=B;break;case"defaultValue":m=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Oe(e,t,a,B,l,null)}}jo(e,r,m,N,R,d,s,!1);return;case"select":be("invalid",e),a=d=r=null;for(s in l)if(l.hasOwnProperty(s)&&(m=l[s],m!=null))switch(s){case"value":r=m;break;case"defaultValue":d=m;break;case"multiple":a=m;default:Oe(e,t,s,m,l,null)}t=r,l=d,e.multiple=!!a,t!=null?Ta(e,!!a,t,!1):l!=null&&Ta(e,!!a,l,!0);return;case"textarea":be("invalid",e),r=s=a=null;for(d in l)if(l.hasOwnProperty(d)&&(m=l[d],m!=null))switch(d){case"value":a=m;break;case"defaultValue":s=m;break;case"children":r=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Oe(e,t,d,m,l,null)}No(e,a,s,r);return;case"option":for(N in l)if(l.hasOwnProperty(N)&&(a=l[N],a!=null))switch(N){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Oe(e,t,N,a,l,null)}return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(a=0;a<Zn.length;a++)be(Zn[a],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("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(R in l)if(l.hasOwnProperty(R)&&(a=l[R],a!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,R,a,l,null)}return;default:if(Lr(t)){for(B in l)l.hasOwnProperty(B)&&(a=l[B],a!==void 0&&bc(e,t,B,a,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(a=l[m],a!=null&&Oe(e,t,m,a,l,null))}function Mm(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,d=null,m=null,N=null,R=null,B=null;for(L in l){var q=l[L];if(l.hasOwnProperty(L)&&q!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":N=q;default:a.hasOwnProperty(L)||Oe(e,t,L,null,a,q)}}for(var z in a){var L=a[z];if(q=l[z],a.hasOwnProperty(z)&&(L!=null||q!=null))switch(z){case"type":r=L;break;case"name":s=L;break;case"checked":R=L;break;case"defaultChecked":B=L;break;case"value":d=L;break;case"defaultValue":m=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==q&&Oe(e,t,z,L,a,q)}}Mr(e,d,m,N,R,B,r,s);return;case"select":L=d=m=z=null;for(r in l)if(N=l[r],l.hasOwnProperty(r)&&N!=null)switch(r){case"value":break;case"multiple":L=N;default:a.hasOwnProperty(r)||Oe(e,t,r,null,a,N)}for(s in a)if(r=a[s],N=l[s],a.hasOwnProperty(s)&&(r!=null||N!=null))switch(s){case"value":z=r;break;case"defaultValue":m=r;break;case"multiple":d=r;default:r!==N&&Oe(e,t,s,r,a,N)}t=m,l=d,a=L,z!=null?Ta(e,!!l,z,!1):!!a!=!!l&&(t!=null?Ta(e,!!l,t,!0):Ta(e,!!l,l?[]:"",!1));return;case"textarea":L=z=null;for(m in l)if(s=l[m],l.hasOwnProperty(m)&&s!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Oe(e,t,m,null,a,s)}for(d in a)if(s=a[d],r=l[d],a.hasOwnProperty(d)&&(s!=null||r!=null))switch(d){case"value":z=s;break;case"defaultValue":L=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Oe(e,t,d,s,a,r)}So(e,z,L);return;case"option":for(var ne in l)if(z=l[ne],l.hasOwnProperty(ne)&&z!=null&&!a.hasOwnProperty(ne))switch(ne){case"selected":e.selected=!1;break;default:Oe(e,t,ne,null,a,z)}for(N in a)if(z=a[N],L=l[N],a.hasOwnProperty(N)&&z!==L&&(z!=null||L!=null))switch(N){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:Oe(e,t,N,z,a,L)}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 de in l)z=l[de],l.hasOwnProperty(de)&&z!=null&&!a.hasOwnProperty(de)&&Oe(e,t,de,null,a,z);for(R in a)if(z=a[R],L=l[R],a.hasOwnProperty(R)&&z!==L&&(z!=null||L!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(u(137,t));break;default:Oe(e,t,R,z,a,L)}return;default:if(Lr(t)){for(var De in l)z=l[De],l.hasOwnProperty(De)&&z!==void 0&&!a.hasOwnProperty(De)&&bc(e,t,De,void 0,a,z);for(B in a)z=a[B],L=l[B],!a.hasOwnProperty(B)||z===L||z===void 0&&L===void 0||bc(e,t,B,z,a,L);return}}for(var w in l)z=l[w],l.hasOwnProperty(w)&&z!=null&&!a.hasOwnProperty(w)&&Oe(e,t,w,null,a,z);for(q in a)z=a[q],L=l[q],!a.hasOwnProperty(q)||z===L||z==null&&L==null||Oe(e,t,q,z,a,L)}function Cf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zm(){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,d=s.initiatorType,m=s.duration;if(r&&m&&Cf(d)){for(d=0,m=s.responseEnd,a+=1;a<l.length;a++){var N=l[a],R=N.startTime;if(R>m)break;var B=N.transferSize,q=N.initiatorType;B&&Cf(q)&&(N=N.responseEnd,d+=B*(N<m?1:(m-R)/(N-R)))}if(--a,t+=8*(r+d)/(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 jc=null,Sc=null;function nr(e){return e.nodeType===9?e:e.ownerDocument}function wf(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 Af(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 Nc(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 Ec=null;function Lm(){var e=window.event;return e&&e.type==="popstate"?e===Ec?!1:(Ec=e,!0):(Ec=null,!1)}var Rf=typeof setTimeout=="function"?setTimeout:void 0,Om=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,Dm=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(Bm)}:Rf;function Bm(e){setTimeout(function(){throw e})}function Kl(e){return e==="head"}function Mf(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),nn(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")$n(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,$n(l);for(var r=l.firstChild;r;){var d=r.nextSibling,m=r.nodeName;r[fn]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=d}}else l==="body"&&$n(e.ownerDocument.body);l=s}while(l);nn(t)}function zf(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 kc(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":kc(l),Rr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Um(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[fn])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=Zt(e.nextSibling),e===null)break}return null}function Hm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Zt(e.nextSibling),e===null))return null;return e}function Lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zt(e.nextSibling),e===null))return null;return e}function Tc(e){return e.data==="$?"||e.data==="$~"}function Cc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qm(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 Zt(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 wc=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Zt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Df(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 Bf(e,t,l){switch(t=nr(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 $n(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rr(e)}var Kt=new Map,Uf=new Set;function sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kl=E.d;E.d={f:Gm,r:Ym,D:Vm,C:Qm,L:Xm,m:Zm,X:$m,S:Km,M:Jm};function Gm(){var e=kl.f(),t=Ws();return e||t}function Ym(e){var t=Na(e);t!==null&&t.tag===5&&t.type==="form"?ed(t):kl.r(e)}var tn=typeof document>"u"?null:document;function Hf(e,t,l){var a=tn;if(a&&typeof t=="string"&&t){var s=Ht(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Uf.has(s)||(Uf.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ft(t,"link",e),st(t),a.head.appendChild(t)))}}function Vm(e){kl.D(e),Hf("dns-prefetch",e,null)}function Qm(e,t){kl.C(e,t),Hf("preconnect",e,t)}function Xm(e,t,l){kl.L(e,t,l);var a=tn;if(a&&e&&t){var s='link[rel="preload"][as="'+Ht(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ht(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ht(l.imageSizes)+'"]')):s+='[href="'+Ht(e)+'"]';var r=s;switch(t){case"style":r=ln(e);break;case"script":r=an(e)}Kt.has(r)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Kt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Jn(r))||t==="script"&&a.querySelector(Wn(r))||(t=a.createElement("link"),ft(t,"link",e),st(t),a.head.appendChild(t)))}}function Zm(e,t){kl.m(e,t);var l=tn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ht(a)+'"][href="'+Ht(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=an(e)}if(!Kt.has(r)&&(e=g({rel:"modulepreload",href:e},t),Kt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Wn(r)))return}a=l.createElement("link"),ft(a,"link",e),st(a),l.head.appendChild(a)}}}function Km(e,t,l){kl.S(e,t,l);var a=tn;if(a&&e){var s=Ea(a).hoistableStyles,r=ln(e);t=t||"default";var d=s.get(r);if(!d){var m={loading:0,preload:null};if(d=a.querySelector(Jn(r)))m.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Kt.get(r))&&Ac(e,l);var N=d=a.createElement("link");st(N),ft(N,"link",e),N._p=new Promise(function(R,B){N.onload=R,N.onerror=B}),N.addEventListener("load",function(){m.loading|=1}),N.addEventListener("error",function(){m.loading|=2}),m.loading|=4,rr(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:m},s.set(r,d)}}}function $m(e,t){kl.X(e,t);var l=tn;if(l&&e){var a=Ea(l).hoistableScripts,s=an(e),r=a.get(s);r||(r=l.querySelector(Wn(s)),r||(e=g({src:e,async:!0},t),(t=Kt.get(s))&&Rc(e,t),r=l.createElement("script"),st(r),ft(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Jm(e,t){kl.M(e,t);var l=tn;if(l&&e){var a=Ea(l).hoistableScripts,s=an(e),r=a.get(s);r||(r=l.querySelector(Wn(s)),r||(e=g({src:e,async:!0,type:"module"},t),(t=Kt.get(s))&&Rc(e,t),r=l.createElement("script"),st(r),ft(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function qf(e,t,l,a){var s=(s=O.current)?sr(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=ln(l.href),l=Ea(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=ln(l.href);var r=Ea(s).hoistableStyles,d=r.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=s.querySelector(Jn(e)))&&!r._p&&(d.instance=r,d.state.loading=5),Kt.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},Kt.set(e,l),r||Wm(s,e,l,d.state))),t&&a===null)throw Error(u(528,""));return d}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=an(l),l=Ea(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 ln(e){return'href="'+Ht(e)+'"'}function Jn(e){return'link[rel="stylesheet"]['+e+"]"}function Gf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(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}),ft(t,"link",l),st(t),e.head.appendChild(t))}function an(e){return'[src="'+Ht(e)+'"]'}function Wn(e){return"script[async]"+e}function Yf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ht(l.href)+'"]');if(a)return t.instance=a,st(a),a;var s=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),st(a),ft(a,"style",s),rr(a,l.precedence,e),t.instance=a;case"stylesheet":s=ln(l.href);var r=e.querySelector(Jn(s));if(r)return t.state.loading|=4,t.instance=r,st(r),r;a=Gf(l),(s=Kt.get(s))&&Ac(a,s),r=(e.ownerDocument||e).createElement("link"),st(r);var d=r;return d._p=new Promise(function(m,N){d.onload=m,d.onerror=N}),ft(r,"link",a),t.state.loading|=4,rr(r,l.precedence,e),t.instance=r;case"script":return r=an(l.src),(s=e.querySelector(Wn(r)))?(t.instance=s,st(s),s):(a=l,(s=Kt.get(r))&&(a=g({},l),Rc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),st(s),ft(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,rr(a,l.precedence,e));return t.instance}function rr(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,d=0;d<a.length;d++){var m=a[d];if(m.dataset.precedence===t)r=m;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 Rc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ir=null;function Vf(e,t,l){if(ir===null){var a=new Map,s=ir=new Map;s.set(l,a)}else s=ir,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[fn]||r[ct]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var m=a.get(d);m?m.push(r):a.set(d,[r])}}return a}function Qf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Fm(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 Xf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Im(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=ln(a.href),r=t.querySelector(Jn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cr.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,st(r);return}r=t.ownerDocument||t,a=Gf(a),(s=Kt.get(s))&&Ac(a,s),r=r.createElement("link"),st(r);var d=r;d._p=new Promise(function(m,N){d.onload=m,d.onerror=N}),ft(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=cr.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var _c=0;function Pm(e,t){return e.stylesheets&&e.count===0&&ur(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&ur(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*zm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ur(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 cr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ur(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var or=null;function ur(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,or=new Map,t.forEach(eh,e),or=null,cr.call(e))}function eh(e,t){if(!(t.state.loading&4)){var l=or.get(e);if(l)var a=l.get(null);else{l=new Map,or.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var d=s[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(l.set(d.dataset.precedence,d),a=d)}a&&l.set(null,a)}s=t.instance,d=s.getAttribute("data-precedence"),r=l.get(d)||a,r===a&&l.set(null,s),l.set(d,s),this.count++,a=cr.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 Fn={$$typeof:le,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function th(e,t,l,a,s,r,d,m,N){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=Tr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tr(0),this.hiddenUpdates=Tr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Zf(e,t,l,a,s,r,d,m,N,R,B,q){return e=new th(e,t,l,d,N,R,B,q,m),t=1,r===!0&&(t|=24),r=Rt(3,null,null,t),e.current=r,r.stateNode=e,t=ui(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},pi(r),e}function Kf(e){return e?(e=La,e):La}function $f(e,t,l,a,s,r){s=Kf(s),a.context===null?a.context=s:a.pendingContext=s,a=Dl(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Bl(e,a,t),l!==null&&(kt(l,e,t),An(l,e,t))}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Mc(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Wf(e){if(e.tag===13||e.tag===31){var t=ca(e,67108864);t!==null&&kt(t,e,67108864),Mc(e,67108864)}}function Ff(e){if(e.tag===13||e.tag===31){var t=Ot();t=Cr(t);var l=ca(e,t);l!==null&&kt(l,e,t),Mc(e,t)}}var dr=!0;function lh(e,t,l,a){var s=C.T;C.T=null;var r=E.p;try{E.p=2,zc(e,t,l,a)}finally{E.p=r,C.T=s}}function ah(e,t,l,a){var s=C.T;C.T=null;var r=E.p;try{E.p=8,zc(e,t,l,a)}finally{E.p=r,C.T=s}}function zc(e,t,l,a){if(dr){var s=Lc(a);if(s===null)gc(e,t,a,fr,l),Pf(e,a);else if(sh(s,e,t,l,a))a.stopPropagation();else if(Pf(e,a),t&4&&-1<nh.indexOf(e)){for(;s!==null;){var r=Na(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=aa(r.pendingLanes);if(d!==0){var m=r;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var N=1<<31-Qe(d);m.entanglements[1]|=N,d&=~N}al(r),(Re&6)===0&&($s=it()+500,Xn(0))}}break;case 31:case 13:m=ca(r,2),m!==null&&kt(m,r,2),Ws(),Mc(r,2)}if(r=Lc(a),r===null&&gc(e,t,a,fr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else gc(e,t,a,null,l)}}function Lc(e){return e=Dr(e),Oc(e)}var fr=null;function Oc(e){if(fr=null,e=Sa(e),e!==null){var t=v(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=S(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 fr=e,null}function If(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ne()){case I:return 2;case Ve:return 8;case Be:case It:return 32;case Cl:return 268435456;default:return 32}default:return 32}}var Dc=!1,$l=null,Jl=null,Wl=null,In=new Map,Pn=new Map,Fl=[],nh="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 Pf(e,t){switch(e){case"focusin":case"focusout":$l=null;break;case"dragenter":case"dragleave":Jl=null;break;case"mouseover":case"mouseout":Wl=null;break;case"pointerover":case"pointerout":In.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pn.delete(t.pointerId)}}function es(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=Na(t),t!==null&&Wf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function sh(e,t,l,a,s){switch(t){case"focusin":return $l=es($l,e,t,l,a,s),!0;case"dragenter":return Jl=es(Jl,e,t,l,a,s),!0;case"mouseover":return Wl=es(Wl,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return In.set(r,es(In.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Pn.set(r,es(Pn.get(r)||null,e,t,l,a,s)),!0}return!1}function ex(e){var t=Sa(e.target);if(t!==null){var l=v(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,xo(e.priority,function(){Ff(l)});return}}else if(t===31){if(t=S(l),t!==null){e.blockedOn=t,xo(e.priority,function(){Ff(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 xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Lc(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=Na(l),t!==null&&Wf(t),e.blockedOn=l,!1;t.shift()}return!0}function tx(e,t,l){xr(e)&&l.delete(t)}function rh(){Dc=!1,$l!==null&&xr($l)&&($l=null),Jl!==null&&xr(Jl)&&(Jl=null),Wl!==null&&xr(Wl)&&(Wl=null),In.forEach(tx),Pn.forEach(tx)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,rh)))}var mr=null;function lx(e){mr!==e&&(mr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){mr===e&&(mr=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=Na(l);r!==null&&(e.splice(t,3),t-=3,Li(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function nn(e){function t(N){return pr(N,e)}$l!==null&&pr($l,e),Jl!==null&&pr(Jl,e),Wl!==null&&pr(Wl,e),In.forEach(t),Pn.forEach(t);for(var l=0;l<Fl.length;l++){var a=Fl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Fl.length&&(l=Fl[0],l.blockedOn===null);)ex(l),l.blockedOn===null&&Fl.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],d=s[gt]||null;if(typeof r=="function")d||lx(l);else if(d){var m=null;if(r&&r.hasAttribute("formAction")){if(s=r,d=r[gt]||null)m=d.formAction;else if(Oc(s)!==null)continue}else m=d.action;typeof m=="function"?l[a+1]=m:(l.splice(a,3),a-=3),lx(l)}}}function ax(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return s=d})},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 Bc(e){this._internalRoot=e}hr.prototype.render=Bc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=Ot();$f(l,a,e,t,null,null)},hr.prototype.unmount=Bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$f(e.current,2,null,e,null,null),Ws(),t[ja]=null}};function hr(e){this._internalRoot=e}hr.prototype.unstable_scheduleHydration=function(e){if(e){var t=fo();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Fl.length&&t!==0&&t<Fl[l].priority;l++);Fl.splice(l,0,e),l===0&&ex(e)}};var nx=o.version;if(nx!=="19.2.4")throw Error(u(527,nx,"19.2.4"));E.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?b(e):null,e=e===null?null:e.stateNode,e};var ih={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vr.isDisabled&&vr.supportsFiber)try{Bt=vr.inject(ih),Ze=vr}catch{}}return ls.createRoot=function(e,t){if(!x(e))throw Error(u(299));var l=!1,a="",s=ud,r=dd,d=fd;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&&(d=t.onRecoverableError)),t=Zf(e,1,!1,null,null,l,a,null,s,r,d,ax),e[ja]=t.current,yc(e),new Bc(t)},ls.hydrateRoot=function(e,t,l){if(!x(e))throw Error(u(299));var a=!1,s="",r=ud,d=dd,m=fd,N=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&&(d=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.formState!==void 0&&(N=l.formState)),t=Zf(e,1,!0,t,l??null,a,s,N,r,d,m,ax),t.context=Kf(null),l=t.current,a=Ot(),a=Cr(a),s=Dl(a),s.callback=null,Bl(l,s,a),l=a,t.current.lanes=l,dn(t,l),al(t),e[ja]=t.current,yc(e),new hr(t)},ls.version="19.2.4",ls}var px;function vh(){if(px)return qc.exports;px=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(o){console.error(o)}}return i(),qc.exports=hh(),qc.exports}var yh=vh();const eo="";class Ox extends Error{constructor(o,c){super(o),this.name="ApiError",this.status=c}}async function _e(i,o){const c=await fetch(`${eo}${i}`,o);if(!c.ok){const u=await c.json().catch(()=>({error:c.statusText}));throw new Ox(u.error||`HTTP ${c.status}`,c.status)}return c.json()}const ve={getConfig(){return _e("/api/config")},setConfig(i,o){return _e("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return _e("/api/skills")},getSkillDetail(i,o){return _e(`/api/skills/${i}/${o}`)},getEvals(i,o){return _e(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,c){return _e(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},generateEvals(i,o){return _e(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const c=await fetch(`${eo}/api/skills/${i}/${o}/benchmark/latest`);if(c.status===404)return null;if(!c.ok){const u=await c.json().catch(()=>({error:c.statusText}));throw new Ox(u.error||`HTTP ${c.status}`,c.status)}return c.json()},getHistory(i,o,c){const u=new URLSearchParams;c!=null&&c.model&&u.set("model",c.model),c!=null&&c.type&&u.set("type",c.type),c!=null&&c.from&&u.set("from",c.from),c!=null&&c.to&&u.set("to",c.to);const x=u.toString();return _e(`/api/skills/${i}/${o}/history${x?"?"+x:""}`)},getHistoryEntry(i,o,c){return _e(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`)},compareRuns(i,o,c,u){return _e(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(c)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,o,c,u){const x=new URLSearchParams;u&&x.set("model",u);const v=x.toString();return _e(`/api/skills/${i}/${o}/history/case/${c}${v?"?"+v:""}`)},deleteHistoryEntry(i,o,c){return _e(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`,{method:"DELETE"})},deleteSkill(i,o){return _e(`/api/skills/${i}/${o}`,{method:"DELETE"})},improveSkill(i,o,c){return _e(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},instructEdit(i,o,c){return _e(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...c})})},applyImprovement(i,o,c){return _e(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:c})})},getStats(i,o){return _e(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return _e(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return _e("/api/project-layout")},createSkill(i){return _e("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return _e("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return _e("/api/skill-creator-status")},generateSkill(i){return _e("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,o){return _e(`/api/skills/${i}/${o}/files`)},getSkillFile(i,o,c){return _e(`/api/skills/${i}/${o}/file?path=${encodeURIComponent(c)}`)},saveSkillFile(i,o,c,u){return _e(`/api/skills/${i}/${o}/file`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:u})})},getLeaderboard(i,o){return _e(`/api/skills/${i}/${o}/leaderboard`)},getLeaderboardEntry(i,o,c){return _e(`/api/skills/${i}/${o}/leaderboard/${encodeURIComponent(c)}`)},startSweep(i,o,c){const u=`${eo}/api/skills/${i}/${o}/sweep`,x=new EventSource(u);return fetch(u,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(c)}),x},getCredentials(i,o){return _e(`/api/credentials/${i}/${o}`)},searchModels(){return _e("/api/openrouter/models")}};function gh(i){const[o,c]=h.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return h.useEffect(()=>{const u=window.matchMedia(i);c(u.matches);const x=v=>c(v.matches);return u.addEventListener("change",x),()=>u.removeEventListener("change",x)},[i]),o}const bh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function jh(i,o){switch(o.type){case"SELECT_SKILL":return{...i,selectedSkill:o.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:o.mode,selectedSkill:o.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:o.query};case"SET_SKILLS":return{...i,skills:o.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:o.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:o.loading};case"SET_MOBILE":return{...i,isMobile:o.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:o.view};default:return i}}const Dx=h.createContext(null);function ta(){const i=h.useContext(Dx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function Sh({children:i}){const[o,c]=h.useReducer(jh,bh),u=gh("(max-width: 767px)");h.useEffect(()=>{c({type:"SET_MOBILE",isMobile:u})},[u]);const x=h.useCallback(()=>{c({type:"SET_SKILLS_LOADING",loading:!0}),ve.getSkills().then(g=>{c({type:"SET_SKILLS",skills:g});const M=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(M){const[,D,U]=M,Y=g.find(G=>G.plugin===D&&G.skill===U);Y&&c({type:"SELECT_SKILL",skill:{plugin:D,skill:U,origin:Y.origin}})}}).catch(g=>c({type:"SET_SKILLS_ERROR",error:g.message}))},[]);h.useEffect(()=>{x()},[x]);const v=h.useCallback(g=>{c({type:"SELECT_SKILL",skill:g}),window.location.hash=`/skills/${g.plugin}/${g.skill}`},[]),p=h.useCallback(()=>{c({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),S=h.useCallback(g=>{c({type:"SET_MODE",mode:g})},[]),y=h.useCallback(g=>{c({type:"SET_SEARCH",query:g})},[]),f=h.useCallback(g=>{c({type:"SET_MOBILE_VIEW",view:g})},[]),b=h.useMemo(()=>({state:o,selectSkill:v,clearSelection:p,setMode:S,setSearch:y,setMobileView:f,refreshSkills:x}),[o,v,p,S,y,f,x]);return n.jsx(Dx.Provider,{value:b,children:i})}const Nh={config:null,loading:!0};function Eh(i,o){switch(o.type){case"SET_CONFIG":return{config:o.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const Bx=h.createContext(null);function rn(){const i=h.useContext(Bx);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function kh({children:i}){const[o,c]=h.useReducer(Eh,Nh),u=h.useCallback(()=>{ve.getConfig().then(p=>c({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);h.useEffect(()=>{u()},[u]);const x=h.useCallback(async(p,S)=>{const y=await ve.setConfig(p,S);return c({type:"SET_CONFIG",config:y}),y},[]),v=h.useMemo(()=>({config:o.config,loading:o.loading,updateConfig:x,refreshConfig:u}),[o,x,u]);return n.jsx(Bx.Provider,{value:v,children:i})}function Th({left:i,right:o}){const{state:c}=ta();return c.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:c.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:o})}):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:o})]})}function Ch(){const{state:i,setSearch:o}=ta(),[c,u]=h.useState(i.searchQuery),x=h.useRef(null);h.useEffect(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{o(c)},200),()=>{x.current&&clearTimeout(x.current)}),[c,o]),h.useEffect(()=>{i.searchQuery===""&&c!==""&&u("")},[i.searchQuery]);const v=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:c,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)"}}),c&&n.jsx("button",{onClick:()=>{u(""),o("")},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 ",v," plugin",v!==1?"s":""]})]})}const mx={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 hx({skill:i,isSelected:o,onSelect:c}){const u=mx[i.benchmarkStatus]||mx.missing,x=i.origin==="installed";return n.jsxs("button",{onClick:c,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:o?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:o?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:x?.7:1},onMouseEnter:v=>{o||(v.currentTarget.style.background="var(--surface-2)")},onMouseLeave:v=>{o||(v.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:[x&&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 vx(i){var c;const o={};for(const u of i)(o[c=u.plugin]||(o[c]=[])).push(u);return o}function wh(){const{state:i,selectSkill:o}=ta(),{skills:c,searchQuery:u,selectedSkill:x}=i,[v,p]=h.useState(!1),[S,y]=h.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:b}=h.useMemo(()=>{const g=u.toLowerCase(),T=g?c.filter(U=>U.skill.toLowerCase().includes(g)||U.plugin.toLowerCase().includes(g)):c,M=T.filter(U=>U.origin==="source"),D=T.filter(U=>U.origin==="installed");return{sourceGroups:Object.entries(vx(M)),installedGroups:Object.entries(vx(D))}},[c,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(g=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},g))}):f.length===0&&b.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(Ah,{title:"Your Skills",count:f.reduce((g,[,T])=>g+T.length,0)}),f.map(([g,T])=>n.jsxs("div",{children:[n.jsx(yx,{plugin:g,count:T.length}),T.map(M=>{const D=(x==null?void 0:x.plugin)===M.plugin&&(x==null?void 0:x.skill)===M.skill;return n.jsx(hx,{skill:M,isSelected:D,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},g))]}),b.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>p(g=>!g),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:v?"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:v?"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:["(",b.reduce((g,[,T])=>g+T.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"})]})]}),v&&n.jsxs(n.Fragment,{children:[!S&&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"})]})})]}),b.map(([g,T])=>n.jsxs("div",{children:[n.jsx(yx,{plugin:g,count:T.length}),T.map(M=>{const D=(x==null?void 0:x.plugin)===M.plugin&&(x==null?void 0:x.skill)===M.skill;return n.jsx(hx,{skill:M,isSelected:D,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},g))]})]})]})}function Ah({title:i,count:o}){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:["(",o,")"]})]})}function yx({plugin:i,count:o}){const[c,u]=h.useState(!1),x=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[c?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:x,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:["(",o,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Rh({value:i,onChange:o}){const[c,u]=h.useState([]),[x,v]=h.useState(!1),[p,S]=h.useState(null),[y,f]=h.useState(i),[b,g]=h.useState(!1),T=h.useRef(null),M=h.useRef(void 0);h.useEffect(()=>{v(!0),ve.searchModels().then(G=>u(G.models)).catch(G=>S(G instanceof Error?G.message:String(G))).finally(()=>v(!1))},[]);const D=h.useCallback(G=>{f(G),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>g(!0),300)},[]),U=h.useMemo(()=>{if(!y.trim())return c.slice(0,50);const G=y.toLowerCase();return c.filter(W=>W.id.toLowerCase().includes(G)||W.name.toLowerCase().includes(G)).slice(0,50)},[c,y]);h.useEffect(()=>{function G(W){T.current&&!T.current.contains(W.target)&&g(!1)}return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]);function Y(G){var X;const W=(X=G.pricing)==null?void 0:X.prompt;return W==null||W===0?"Free":`$${(W*1e6).toFixed(2)}/1M`}return n.jsxs("div",{ref:T,style:{position:"relative"},children:[n.jsx("input",{type:"text",value:y,onChange:G=>D(G.target.value),onFocus:()=>g(!0),placeholder:x?"Loading models...":"Search OpenRouter models...",className:"input-field w-full",style:{fontSize:12}}),b&&!x&&n.jsxs("div",{style:{position:"absolute",top:"100%",left:0,right:0,maxHeight:280,overflowY:"auto",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:8,marginTop:4,zIndex:20,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[p&&n.jsxs("div",{className:"px-3 py-2 text-[11px]",style:{color:"var(--red)"},children:["Failed to load models: ",p]}),U.length===0&&!p&&n.jsx("div",{className:"px-3 py-3 text-[11px]",style:{color:"var(--text-tertiary)"},children:"No models found"}),U.map(G=>n.jsxs("button",{onClick:()=>{o(G.id),f(G.id),g(!1)},className:"w-full text-left px-3 py-2 flex items-center justify-between transition-colors duration-100",style:{background:G.id===i?"var(--accent-muted)":"transparent",border:"none",cursor:"pointer",borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:W=>{W.currentTarget.style.background="var(--surface-3)"},onMouseLeave:W=>{W.currentTarget.style.background=G.id===i?"var(--accent-muted)":"transparent"},children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:G.name}),n.jsx("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:G.id})]}),n.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:Y(G)})]},G.id))]})]})}function _h(){const{config:i,updateConfig:o,refreshConfig:c}=rn(),[u,x]=h.useState(!1),[v,p]=h.useState(!1),S=h.useRef(null);h.useEffect(()=>{function g(T){S.current&&!S.current.contains(T.target)&&x(!1)}return u&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]);async function y(g,T){p(!0);try{await o(g.id,T.id),x(!1)}catch{c()}finally{p(!1)}}if(!i)return null;const f=zh(i),b=Mh(i);return n.jsxs("div",{ref:S,className:"relative",children:[n.jsxs("button",{onClick:()=>x(!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:g=>{u||(g.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:g=>{u||(g.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:b!=null&&b.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(g=>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:g.available?"var(--green)":"var(--text-tertiary)",opacity:g.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:g.available?1:.5},children:g.label})]}),g.id==="openrouter"&&g.available?n.jsx("div",{className:"px-3 py-1.5",children:n.jsx(Rh,{value:i.provider==="openrouter"?i.model:"",onChange:T=>{v||y(g,{id:T,label:T})}})}):g.models.map(T=>{const M=Ux(i,g.id,T.id),D=!g.available||v;return n.jsxs("button",{onClick:()=>!D&&y(g,T),disabled:D,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:M?"var(--accent-muted)":"transparent",color:D?"var(--text-tertiary)":"var(--text-primary)",opacity:D?.4:1,cursor:D?"not-allowed":"pointer"},onMouseEnter:U=>{!D&&!M&&(U.currentTarget.style.background="var(--surface-3)")},onMouseLeave:U=>{M||(U.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 ${M?"var(--accent)":"var(--border-subtle)"}`},children:M&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:M?600:400},title:T.id,children:T.label})]},`${g.id}-${T.id}`)})]},g.id))})]})]})}function Ux(i,o,c){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${c}`:i.model===c}function Mh(i){return i.providers.find(o=>o.id===i.provider)}function zh(i){for(const o of i.providers)for(const c of o.models)if(Ux(i,o.id,c.id))return c.label;return i.model}function Lh(){const{state:i,setMode:o}=ta(),{config:c}=rn(),[u,x]=h.useState(null),[v,p]=h.useState(!1);return h.useEffect(()=>{ve.getSkillCreatorStatus().then(x).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:(c==null?void 0:c.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(_h,{})})]}),n.jsx(Ch,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("button",{onClick:()=>o("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:S=>{i.mode!=="create"&&(S.currentTarget.style.background="var(--surface-4)",S.currentTarget.style.color="var(--text-primary)")},onMouseLeave:S=>{i.mode!=="create"&&(S.currentTarget.style.background="var(--surface-3)",S.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 S=(c==null?void 0:c.provider)==="claude-cli";return u.installed&&S?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&&!S?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&&S?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:v?"Copied!":u.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(wh,{})})]})}const Oh="modulepreload",Dh=function(i){return"/"+i},gx={},Bh=function(o,c,u){let x=Promise.resolve();if(c&&c.length>0){let p=function(f){return Promise.all(f.map(b=>Promise.resolve(b).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),y=(S==null?void 0:S.nonce)||(S==null?void 0:S.getAttribute("nonce"));x=p(c.map(f=>{if(f=Dh(f),f in gx)return;gx[f]=!0;const b=f.endsWith(".css"),g=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const T=document.createElement("link");if(T.rel=b?"stylesheet":Oh,b||(T.as="script"),T.crossOrigin="",T.href=f,y&&T.setAttribute("nonce",y),document.head.appendChild(T),b)return new Promise((M,D)=>{T.addEventListener("load",M),T.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${f}`)))})}))}function v(p){const S=new Event("vite:preloadError",{cancelable:!0});if(S.payload=p,window.dispatchEvent(S),!S.defaultPrevented)throw p}return x.then(p=>{for(const S of p||[])S.status==="rejected"&&v(S.reason);return o().catch(v)})};function Qc(){const[i,o]=h.useState([]),[c,u]=h.useState(!1),[x,v]=h.useState(!1),[p,S]=h.useState(null),y=h.useRef(null),f=h.useCallback(async(g,T)=>{o([]),u(!0),v(!1),S(null);const M=new AbortController;y.current=M;try{const D=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:T?JSON.stringify(T):void 0,signal:M.signal});if(!D.ok||!D.body){let le=`HTTP ${D.status}`;try{const X=await D.json();X.error&&(le=X.error)}catch{}throw new Error(le)}const U=D.body.getReader(),Y=new TextDecoder;let G="",W="";for(;;){const{done:le,value:X}=await U.read();if(le)break;G+=Y.decode(X,{stream:!0});const te=G.split(`
|
|
50
|
-
`);G=te.pop()||"";for(const K of te)if(K.startsWith("event: "))W=K.slice(7).trim();else if(K.startsWith("data: ")){try{const V=JSON.parse(K.slice(6)),P={event:W,data:V};W==="done"?(v(!0),o(fe=>[...fe,P])):o(fe=>[...fe,P])}catch{}W=""}}}catch(D){D.name!=="AbortError"&&S(D.message)}finally{u(!1),y.current=null}},[]),b=h.useCallback(()=>{var g;(g=y.current)==null||g.abort()},[]);return{events:i,running:c,done:x,error:p,start:f,stop:b}}function Uh(i){const o=h.useRef(i);o.current=i;const[c,u]=h.useState(new Set),x=h.useRef(new Map),v=h.useCallback(async(f,b,g)=>{var M;(M=x.current.get(f))==null||M.abort();const T=new AbortController;x.current.set(f,T),u(D=>{const U=new Set(D);return U.add(f),U});try{const D=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:g?JSON.stringify(g):void 0,signal:T.signal});if(!D.ok||!D.body){let le=`HTTP ${D.status}`;try{const X=await D.json();X.error&&(le=X.error)}catch{}throw new Error(le)}const U=D.body.getReader(),Y=new TextDecoder;let G="",W="";for(;;){const{done:le,value:X}=await U.read();if(le)break;G+=Y.decode(X,{stream:!0});const te=G.split(`
|
|
51
|
-
`);G=te.pop()||"";for(const K of te)if(K.startsWith("event: "))W=K.slice(7).trim();else if(K.startsWith("data: ")){try{const V=JSON.parse(K.slice(6)),P={event:W,data:V};o.current.onEvent(f,P)}catch{}W=""}}o.current.onDone(f)}catch(D){D.name!=="AbortError"&&o.current.onError(f,D.message)}finally{u(D=>{const U=new Set(D);return U.delete(f),U}),x.current.delete(f)}},[]),p=h.useCallback(f=>{var b;(b=x.current.get(f))==null||b.abort()},[]),S=h.useCallback(()=>{for(const f of x.current.values())f.abort()},[]),y=c.size>0;return{runningSet:c,startCase:v,stopCase:p,stopAll:S,isAnyCaseRunning:y}}const Hh={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,activationTotalPrompts:0,activationStartedAt:null,loading:!0,error:null};function qh(i,o){var c,u;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const x=new Map;if(o.benchmark)for(const p of o.benchmark.cases)x.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(S=>({assertion_id:S.id,text:S.text,pass:S.pass,reasoning:S.reasoning}))});const v=((u=(c=o.evals)==null?void 0:c.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,evalsError:o.evalsError??null,latestBenchmark:o.benchmark,inlineResults:x,selectedCaseId:v,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:o.panel};case"SET_CONTENT":return{...i,skillContent:o.content,isDirty:o.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:o.evals};case"SELECT_CASE":return{...i,selectedCaseId:o.caseId};case"CASE_RUN_START":{const x=new Map(i.caseRunStates);return x.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:x,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const x=new Map(i.caseRunStates),v=x.get(o.caseId);x.set(o.caseId,{status:"complete",mode:v==null?void 0:v.mode});const p=new Map(i.inlineResults);return p.set(o.caseId,o.result),{...i,caseRunStates:x,inlineResults:p}}case"CASE_RUN_ERROR":{const x=new Map(i.caseRunStates),v=x.get(o.caseId);x.set(o.caseId,{status:"error",mode:v==null?void 0:v.mode});const p=new Map(i.inlineResults);return p.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:x,inlineResults:p}}case"CASE_RUN_CANCEL":{const x=new Map(i.caseRunStates),v=x.get(o.caseId);return x.set(o.caseId,{status:"cancelled",mode:v==null?void 0:v.mode}),{...i,caseRunStates:x}}case"BULK_RUN_START":{const x=new Map(i.caseRunStates);for(const v of o.caseIds)x.set(v,{status:"queued",mode:o.mode});return{...i,caseRunStates:x,bulkRunActive:!0,runMode:o.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:o.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const x=new Map(i.caseRunStates);for(const[v,p]of x)(p.status==="running"||p.status==="queued")&&x.set(v,{status:"cancelled"});return{...i,caseRunStates:x,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const x=new Map(i.inlineResults);return x.set(o.evalId,o.result),{...i,inlineResults:x}}case"OPEN_IMPROVE":return{...i,improveTarget:o.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,o.entry]};case"AI_EDIT_RESULT":{const x=o.evalChanges??[],v=new Map;for(let p=0;p<x.length;p++)v.set(p,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:x},aiEditEvalChanges:x,aiEditEvalSelections:v}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:o.message,aiEditClassifiedError:o.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,o.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:o.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:o.classified};case"TOGGLE_EVAL_CHANGE":{const x=new Map(i.aiEditEvalSelections);return x.set(o.index,!x.get(o.index)),{...i,aiEditEvalSelections:x}}case"SELECT_ALL_EVAL_CHANGES":{const x=new Map(i.aiEditEvalSelections);for(const v of x.keys())x.set(v,!0);return{...i,aiEditEvalSelections:x}}case"DESELECT_ALL_EVAL_CHANGES":{const x=new Map(i.aiEditEvalSelections);for(const v of x.keys())x.set(v,!1);return{...i,aiEditEvalSelections:x}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:o.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:o.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:o.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null,activationStartedAt:Date.now()};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,o.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:o.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:o.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_TIMEOUT":return{...i,activationRunning:!1,activationError:"Activation test timed out after 120 seconds"};case"ACTIVATION_CANCEL":return{...i,activationRunning:!1};default:return i}}function Gh(i,o){const c=o.data;if(o.event==="output_ready"&&(i.output=c.output,c.durationMs!=null&&(i.durationMs=c.durationMs),c.tokens!=null&&(i.tokens=c.tokens)),o.event==="outputs_ready"&&(i.output=c.skillOutput,c.skillDurationMs!=null&&(i.durationMs=c.skillDurationMs),c.skillTokens!=null&&(i.tokens=c.skillTokens)),o.event==="assertion_result"){const u={assertion_id:c.assertion_id,text:c.text,pass:c.pass,reasoning:c.reasoning};i.assertions.find(x=>x.assertion_id===u.assertion_id)||i.assertions.push(u)}o.event==="case_complete"&&(i.status=c.status,i.passRate=c.pass_rate,i.errorMessage=c.error_message||void 0,i.classifiedError=c.classified_error||void 0)}const Hx=h.createContext(null);function Ft(){const i=h.useContext(Hx);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Yh({plugin:i,skill:o,origin:c,children:u}){const x=c==="installed",[v,p]=h.useReducer(qh,{...Hh,plugin:i,skill:o}),S=h.useRef(new Set),y=h.useRef(new Set),f=h.useRef(new Map),b=h.useCallback((O,F)=>{let ae=f.current.get(O);ae||(ae={assertions:[]},f.current.set(O,ae)),Gh(ae,F),p({type:"UPDATE_INLINE_RESULT",evalId:O,result:{...ae,assertions:[...ae.assertions]}})},[]),g=h.useCallback(O=>{if(y.current.has(O))return;y.current.add(O);const F=f.current.get(O)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:O,result:{...F,assertions:[...F.assertions]}}),S.current.has(O)&&(S.current.delete(O),S.current.size===0&&ve.getLatestBenchmark(i,o).then(ae=>p({type:"BULK_RUN_COMPLETE",benchmark:ae})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),T=h.useCallback((O,F)=>{y.current.has(O)||(y.current.add(O),p({type:"CASE_RUN_ERROR",caseId:O,error:F}),S.current.has(O)&&(S.current.delete(O),S.current.size===0&&ve.getLatestBenchmark(i,o).then(ae=>p({type:"BULK_RUN_COMPLETE",benchmark:ae})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:M,stopCase:D,stopAll:U}=Uh({onEvent:b,onDone:g,onError:T});h.useEffect(()=>()=>{U()},[U]),h.useEffect(()=>{let O=!1;async function F(){try{const[ae,ce,Ae]=await Promise.allSettled([ve.getSkillDetail(i,o),ve.getEvals(i,o),ve.getLatestBenchmark(i,o)]);if(O)return;let Xe=null,Tt=null;if(ce.status==="fulfilled")Xe=ce.value;else{const Fe=ce.reason;(Fe==null?void 0:Fe.status)!==404&&(Tt=(Fe==null?void 0:Fe.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:ae.status==="fulfilled"?ae.value.skillContent:"",evals:Xe,evalsError:Tt,benchmark:Ae.status==="fulfilled"?Ae.value:null})}catch(ae){O||p({type:"SET_ERROR",error:ae.message})}}return F(),()=>{O=!0}},[i,o]);const Y=h.useCallback(async()=>{if(!x)try{await ve.applyImprovement(i,o,v.skillContent),p({type:"CONTENT_SAVED"})}catch(O){p({type:"SET_ERROR",error:O.message})}},[x,i,o,v.skillContent]),G=h.useCallback(async O=>{if(!x)try{const F=await ve.saveEvals(i,o,O);p({type:"SET_EVALS",evals:F})}catch(F){p({type:"SET_ERROR",error:F.message})}},[x,i,o]),W=h.useCallback((O,F="benchmark")=>{if(x)return;const ae=v.caseRunStates.get(O);if((ae==null?void 0:ae.status)!=="running")if(f.current.delete(O),y.current.delete(O),p({type:"CASE_RUN_START",caseId:O,mode:F}),F==="comparison"){const ce=`/api/skills/${i}/${o}/compare`;M(O,ce,{eval_ids:[O]})}else{const ce=`/api/skills/${i}/${o}/benchmark/case/${O}`;M(O,ce,F==="baseline"?{baseline_only:!0}:void 0)}},[x,i,o,v.caseRunStates,M]),le=h.useCallback((O="benchmark")=>{var ce;if(x)return;const F=((ce=v.evals)==null?void 0:ce.evals)??[];if(F.length===0)return;const ae=F.map(Ae=>Ae.id);for(const Ae of ae)f.current.delete(Ae),y.current.delete(Ae);p({type:"BULK_RUN_START",caseIds:ae,mode:O}),S.current=new Set(ae);for(const Ae of ae)if(O==="comparison")M(Ae,`/api/skills/${i}/${o}/compare`,{eval_ids:[Ae]});else{const Xe=`/api/skills/${i}/${o}/benchmark/case/${Ae}`;M(Ae,Xe,O==="baseline"?{baseline_only:!0}:void 0)}},[x,i,o,v.evals,M]),X=h.useCallback(O=>{D(O),p({type:"CASE_RUN_CANCEL",caseId:O}),S.current.delete(O),y.current.add(O)},[D]),te=h.useCallback(()=>{U(),p({type:"CANCEL_ALL"}),S.current.clear()},[U]),K=h.useCallback(async(O,F)=>{p({type:"OPEN_IMPROVE",evalId:O})},[]),V=h.useCallback(async(O,F)=>{try{await ve.applyImprovement(i,o,F),p({type:"SET_CONTENT",content:F}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),W(O,"benchmark")}catch(ae){p({type:"SET_ERROR",error:ae.message})}},[i,o,W]),P=Qc(),fe=h.useRef(null);h.useEffect(()=>{if(P.events.length)for(const O of P.events){const F=O.data;if(O.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:F.phase,message:F.message}}),O.event==="done"){const ae=F.improved,ce=F.reasoning,Ae=F.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:ae,reasoning:ce,evalChanges:Ae})}if(O.event==="error"){const ae=F;p({type:"AI_EDIT_ERROR",message:ae.description||"Unknown error",classified:ae})}}},[P.events]),h.useEffect(()=>{P.error&&p({type:"AI_EDIT_ERROR",message:P.error})},[P.error]),h.useEffect(()=>()=>{P.stop()},[P.stop]);const ke=h.useCallback(async(O,F,ae)=>{x||(p({type:"AI_EDIT_LOADING"}),fe.current=P.stop,P.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:O,content:v.skillContent,evals:v.evals??{skill_name:o,evals:[]},provider:F,model:ae}))},[x,i,o,v.skillContent,v.evals,P]),we=h.useCallback(()=>{P.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[P]),ye=h.useCallback(async()=>{const O=v.aiEditResult;if(O!=null&&O.improved)try{if(await ve.applyImprovement(i,o,O.improved),p({type:"SET_CONTENT",content:O.improved}),p({type:"CONTENT_SAVED"}),v.aiEditEvalChanges.length>0&&Array.from(v.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:ae}=await Bh(async()=>{const{mergeEvalChanges:Xe}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:Xe}},[]),ce=v.evals??{skill_name:o,evals:[]},Ae=ae(ce,v.aiEditEvalChanges,v.aiEditEvalSelections);try{const Xe=await ve.saveEvals(i,o,Ae);p({type:"SET_EVALS",evals:Xe})}catch(Xe){p({type:"SET_EVALS_RETRY",evalsFile:Ae}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${Xe.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(F){p({type:"SET_ERROR",error:F.message})}},[i,o,v.aiEditResult,v.evals,v.aiEditEvalChanges,v.aiEditEvalSelections]),Z=h.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),oe=h.useCallback(O=>{p({type:"TOGGLE_EVAL_CHANGE",index:O})},[]),me=h.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),C=h.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),E=h.useCallback(async()=>{const O=v.aiEditEvalsRetry;if(O)try{const F=await ve.saveEvals(i,o,O);p({type:"SET_EVALS",evals:F}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(F){p({type:"SET_ERROR",error:`Retry failed: ${F.message}`})}},[i,o,v.aiEditEvalsRetry]),$=h.useCallback(async()=>{try{const O=await ve.getSkillDetail(i,o);p({type:"SET_CONTENT",content:O.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[i,o]),Q=Qc();h.useEffect(()=>{if(Q.events.length)for(const O of Q.events){const F=O.data;if(O.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:F.phase,message:F.message}}),O.event==="done"){const ae=F;ve.saveEvals(i,o,ae).then(ce=>p({type:"GENERATE_EVALS_DONE",evals:ce})).catch(ce=>p({type:"SET_ERROR",error:ce.message}))}O.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:F})}},[Q.events,i,o]),h.useEffect(()=>{Q.error&&p({type:"SET_ERROR",error:Q.error})},[Q.error]),h.useEffect(()=>()=>{Q.stop()},[Q.stop]);const re=h.useCallback(async()=>{x||(p({type:"GENERATE_EVALS_START"}),Q.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[x,i,o,Q]),j=Qc();h.useEffect(()=>()=>{j.stop()},[j.stop]),h.useEffect(()=>{if(j.events.length)for(const O of j.events)O.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:O.data}),O.event==="done"&&(_.current&&(clearTimeout(_.current),_.current=null),p({type:"ACTIVATION_DONE",summary:O.data}))},[j.events]),h.useEffect(()=>{j.error&&(_.current&&(clearTimeout(_.current),_.current=null),p({type:"ACTIVATION_ERROR",error:j.error}))},[j.error]);const _=h.useRef(null),J=h.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),j.stop(),p({type:"ACTIVATION_CANCEL",totalPrompts:0})},[j]),ee=h.useCallback(O=>{const ae=O.trim().split(`
|
|
52
|
-
`).filter(Boolean).map(ce=>ce.startsWith("!")?{prompt:ce.slice(1).trim(),expected:"should_not_activate"}:ce.startsWith("+")?{prompt:ce.slice(1).trim(),expected:"should_activate"}:{prompt:ce.trim(),expected:"auto"});p({type:"ACTIVATION_START"}),p({type:"SET_ACTIVATION_PROMPTS",prompts:O}),j.start(`/api/skills/${i}/${o}/activation-test`,{prompts:ae}),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{j.stop(),p({type:"ACTIVATION_TIMEOUT"}),_.current=null},12e4)},[i,o,j]),ue=h.useMemo(()=>({state:v,dispatch:p,isReadOnly:x,saveContent:Y,saveEvals:G,runCase:W,runAll:le,cancelCase:X,cancelAll:te,improveForCase:K,applyImproveAndRerun:V,refreshSkillContent:$,generateEvals:re,runActivationTest:ee,cancelActivation:J,submitAiEdit:ke,cancelAiEdit:we,applyAiEdit:ye,discardAiEdit:Z,toggleEvalChange:oe,selectAllEvalChanges:me,deselectAllEvalChanges:C,retryEvalsSave:E}),[v,x,Y,G,W,le,X,te,K,V,$,re,ee,J,ke,we,ye,Z,oe,me,C,E]);return n.jsx(Hx.Provider,{value:ue,children:u})}function Vh(i){return i==null?"var(--text-tertiary)":i>=.7?"var(--green)":i>=.4?"var(--yellow)":"var(--red)"}function Qh(i){return i==null?"var(--surface-3)":i>=.7?"var(--green-muted)":i>=.4?"var(--yellow-muted)":"var(--red-muted)"}function Xh({state:i,isReadOnly:o,onDelete:c}){const{plugin:u,skill:x,evals:v,latestBenchmark:p,isDirty:S,caseRunStates:y,regressions:f,iterationCount:b}=i,g=Array.from(y.values()).some(G=>G.status==="running"||G.status==="queued"),T=p==null?void 0:p.overall_pass_rate,M=(v==null?void 0:v.evals.reduce((G,W)=>G+W.assertions.length,0))??0,D=(v==null?void 0:v.evals.length)??0,U=Vh(T),Y=Qh(T);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(Zh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:x}),o&&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"]}),S&&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"}),g&&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:[!o&&c&&n.jsx("button",{disabled:g,onClick:()=>{window.confirm(`Delete skill "${x}"? This cannot be undone.`)&&c()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:g?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:g?.4:1,borderRadius:4},onMouseEnter:G=>{g||(G.currentTarget.style.color="var(--red)")},onMouseLeave:G=>{G.currentTarget.style.color="var(--text-tertiary)"},children:n.jsx(Kh,{})}),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":""]}),b>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",b]}),n.jsx("span",{className:"pill",style:{background:Y,color:U},children:T!=null?`${Math.round(T*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[D," case",D!==1?"s":""," / ",M," assert",M!==1?"s":""]})]})]})}function Zh(){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 Kh(){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 $h=[{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:"leaderboard",label:"Leaderboard",shortcut:"6"},{id:"deps",label:"Deps",shortcut:"7"}]}];function Jh({id:i}){const o={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",{...o,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",{...o,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",{...o,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...o,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",{...o,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"leaderboard":return n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]});case"deps":return n.jsxs("svg",{...o,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 Wh({activePanel:i,onPanelChange:o,isDirty:c,isRunning:u,hasRegressions:x,isActivationRunning:v}){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:$h.map((p,S)=>n.jsxs("div",{className:"flex items-center",children:[S>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,b=y.id==="editor"&&c||y.id==="run"&&u||y.id==="activation"&&v||y.id==="history"&&x,g=y.id==="run"||y.id==="activation"?"var(--accent)":y.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>o(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:T=>{f||(T.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:T=>{f||(T.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(Jh,{id:y.id}),y.label,b&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:g}})]},y.id)})]},p.label))})}function Fh(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const c=o[1],u=o[2].trim(),x={},v=c.split(`
|
|
53
|
-
`);let p="",S=!1;for(const y of v){const f=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&S){const T=f[1],M=f[2].trim();let D=x[p];if((typeof D!="object"||Array.isArray(D))&&(D={},x[p]=D),!M)D[T]=[];else{const U=M.match(/^\[(.+)\]$/);U?D[T]=U[1].split(",").map(Y=>Y.trim().replace(/^["']|["']$/g,"")).filter(Boolean):D[T]=M.replace(/^["']|["']$/g,"")}continue}const b=y.match(/^\s+-\s+(.+)$/);if(b&&p){S=!1;const T=x[p];Array.isArray(T)?T.push(b[1].trim().replace(/^["']|["']$/g,"")):x[p]=[b[1].trim().replace(/^["']|["']$/g,"")];continue}const g=y.match(/^([\w-]+):\s*(.*)$/);if(g){p=g[1];const T=g[2].trim();if(S=!1,!T){x[p]={},S=!0;continue}const M=T.match(/^\[(.+)\]$/);if(M){x[p]=M[1].split(",").map(D=>D.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}x[p]=T.replace(/^["']|["']$/g,"")}}return{metadata:x,body:u}}function Nr(i){if(!i)return"";try{let o=i.replace(/^---\n[\s\S]*?\n---\n?/,""),c=Ih(o);return c=c.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>'),c=c.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),c=c.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),c=c.replace(/\*([^*]+)\*/g,"<em>$1</em>"),c=c.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),c=c.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),c=c.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),c=c.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),c=c.replace(/\n/g,"<br/>"),c}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</pre>`}}function Ih(i){const o=i.split(`
|
|
54
|
-
`),c=[];let u=0;for(;u<o.length;)if(o[u].trim().startsWith("|")&&u+1<o.length&&o[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(o[u+1])){const x=bx(o[u]);u+=2;const v=[];for(;u<o.length&&o[u].trim().startsWith("|");)v.push(bx(o[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)"',S='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 x)y+=`<th ${p}>${f}</th>`;y+="</tr></thead><tbody>";for(const f of v){y+="<tr>";for(const b of f)y+=`<td ${S}>${b}</td>`;y+="</tr>"}y+="</tbody></table>",c.push(y)}else c.push(o[u]),u++;return c.join(`
|
|
55
|
-
`)}function bx(i){return i.split("|").map(o=>o.trim()).filter(o=>o.length>0)}function Er(i,o){const c=i.split(`
|
|
56
|
-
`),u=o.split(`
|
|
57
|
-
`);if(c.length>1e3||u.length>1e3)return[...c.map(b=>({type:"unchanged",content:b}))];const x=c.length,v=u.length,p=Array.from({length:x+1},()=>new Array(v+1).fill(0));for(let b=1;b<=x;b++)for(let g=1;g<=v;g++)c[b-1]===u[g-1]?p[b][g]=p[b-1][g-1]+1:p[b][g]=Math.max(p[b-1][g],p[b][g-1]);const S=[];let y=x,f=v;for(;y>0||f>0;)y>0&&f>0&&c[y-1]===u[f-1]?(S.push({type:"unchanged",content:c[y-1]}),y--,f--):f>0&&(y===0||p[y][f-1]>=p[y-1][f])?(S.push({type:"added",content:u[f-1]}),f--):(S.push({type:"removed",content:c[y-1]}),y--);return S.reverse()}function Ph(i,o){if(o&&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 ns({entries:i,isRunning:o}){const[c,u]=h.useState(!1),x=h.useRef(null);return h.useEffect(()=>{x.current&&!c&&(x.current.scrollTop=x.current.scrollHeight)},[i,c]),i.length===0&&!o?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>u(!c),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:v=>{v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--text-tertiary)"},children:[n.jsxs("span",{className:"flex items-center gap-2",children:[o&&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:c?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!c&&n.jsx("div",{ref:x,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((v,p)=>{const S=p===i.length-1&&o,y=p===0?"0s":`+${((v.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:S?1:.7},children:[Ph(v.phase,S),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:y}),n.jsx("span",{style:{color:S?"var(--text-primary)":"var(--text-secondary)"},children:v.message}),v.current!=null&&v.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",v.current,"/",v.total,"]"]})]},p)})})]})}const jx={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:o,onDismiss:c}){const[u,x]=h.useState(null),v=h.useRef(null);h.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?x(Math.ceil(i.retryAfterMs/1e3)):x(null),()=>{v.current&&clearInterval(v.current)}),[i]),h.useEffect(()=>{if(!(u==null||u<=0))return v.current=setInterval(()=>{x(y=>y==null||y<=1?(v.current&&clearInterval(v.current),0):y-1)},1e3),()=>{v.current&&clearInterval(v.current)}},[u!=null&&u>0]);const p=jx[i.category]||jx.unknown,S=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})]}),c&&n.jsx("button",{onClick:c,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}),(o||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:o&&n.jsx("button",{onClick:o,disabled:S,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:S?.5:1},children:S?`Retry in ${u}s`:"Retry"})})]})]})}function ev({plugin:i,skill:o,skillContent:c,onApplied:u}){const[x,v]=h.useState("closed"),{config:p}=rn(),[S,y]=h.useState("claude-cli"),[f,b]=h.useState("opus"),[g,T]=h.useState([]),[M,D]=h.useState(""),[U,Y]=h.useState(""),[G,W]=h.useState(null),[le,X]=h.useState(null),[te,K]=h.useState([]),[V,P]=h.useState(!1),fe=h.useRef(null);h.useEffect(()=>{if(!p)return;p.providers.find(E=>E.id==="claude-cli"&&E.available)&&(y("claude-cli"),b("opus"))},[p]),h.useEffect(()=>()=>{var C;(C=fe.current)==null||C.abort()},[]);function ke(){return p==null?void 0:p.providers.find(C=>C.id===S&&C.available)}const we=h.useCallback(()=>{var C;(C=fe.current)==null||C.abort(),v("open")},[]);async function ye(){v("loading"),W(null),X(null),K([]);const C=new AbortController;fe.current=C;try{const E=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:S,model:f}),signal:C.signal});if(!E.ok||!E.body){let _=`HTTP ${E.status}`;try{const J=await E.json();J.error&&(_=J.error)}catch{}throw new Error(_)}const $=E.body.getReader(),Q=new TextDecoder;let re="",j="";for(;;){const{done:_,value:J}=await $.read();if(_)break;re+=Q.decode(J,{stream:!0});const ee=re.split(`
|
|
58
|
-
`);re=ee.pop()||"";for(const ue of ee)if(ue.startsWith("event: "))j=ue.slice(7).trim();else if(ue.startsWith("data: ")){try{const O=JSON.parse(ue.slice(6));j==="progress"?K(F=>[...F,{phase:O.phase,message:O.message,timestamp:Date.now()}]):j==="done"||j==="complete"?(D(O.improved),Y(O.reasoning||""),T(Er(O.original||c,O.improved)),v("diff_shown")):j==="error"&&(W(O.message||O.description||"Unknown error"),O.category&&X(O),v("open"))}catch{}j=""}}}catch(E){E.name!=="AbortError"&&(W(E.message),v("open"))}finally{fe.current=null}}async function Z(){P(!0);try{await ve.applyImprovement(i,o,M),u(M),v("closed")}catch(C){W(C.message)}finally{P(!1)}}function oe(){v("closed"),T([]),D(""),Y(""),W(null)}if(x==="closed")return n.jsxs("button",{onClick:()=>v("open"),className:"btn btn-secondary mb-5",disabled:!c,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 me=ke();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:oe,className:"w-7 h-7 rounded-lg flex items-center justify-center 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.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:[(x==="open"||x==="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:S,onChange:C=>{y(C.target.value);const E=p==null?void 0:p.providers.find($=>$.id===C.target.value);E!=null&&E.models[0]&&b(E.models[0].id)},disabled:x==="loading",children:p==null?void 0:p.providers.filter(C=>C.available).map(C=>n.jsx("option",{value:C.id,children:C.label},C.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:C=>b(C.target.value),disabled:x==="loading",children:me==null?void 0:me.models.map(C=>n.jsx("option",{value:C.id,children:C.label},C.id))})]}),x==="loading"?n.jsx("button",{onClick:we,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ye,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),x==="loading"&&te.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(ns,{entries:te,isRunning:!0})})]}),G&&n.jsx("div",{className:"mb-4",children:le?n.jsx(kr,{error:le,onRetry:ye,onDismiss:()=>{W(null),X(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:G})}),x==="diff_shown"&&n.jsxs(n.Fragment,{children:[U&&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: "}),U]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:g.map((C,E)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:C.type==="added"?"rgba(34,197,94,0.1)":C.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:C.type==="added"?"var(--green)":C.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:C.type==="added"?"3px solid var(--green)":C.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:C.type==="added"?"+":C.type==="removed"?"-":" "}),C.content]},E))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:Z,disabled:V,className:"btn btn-primary",children:V?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:oe,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const Sx={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"}},tv={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function lv({change:i,index:o,selected:c,onToggle:u,originalEval:x}){var g;const[v,p]=h.useState(!1),S=Sx[i.action]??Sx.add,y=tv[i.action]??"var(--border-subtle)",f=i.action==="remove"?(x==null?void 0:x.name)??`Eval #${i.evalId}`:((g=i.eval)==null?void 0:g.name)??"Unnamed",b=h.useCallback(()=>u(o),[u,o]);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:c?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:c,onChange:b,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:S.bg,color:S.color,padding:"1px 6px"},children:S.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(!v),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:T=>{T.currentTarget.style.background="var(--surface-3)"},onMouseLeave:T=>{T.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:v?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),v&&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(av,{evalCase:i.eval}),i.action==="modify"&&i.eval&&x&&n.jsx(nv,{original:x,proposed:i.eval}),i.action==="remove"&&x&&n.jsx(sv,{evalCase:x})]})]})}function av({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(to,{label:"Prompt",value:i.prompt}),n.jsx(to,{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 (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(c=>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:"+"})," ",c.text]},c.id))})]})]})}function nv({original:i,proposed:o}){const c=[];i.name!==o.name&&c.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&c.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&c.push({label:"Expected",old:i.expected_output,new:o.expected_output});const u=i.assertions??[],x=o.assertions??[],v=new Set(u.map(f=>f.text)),p=new Set(x.map(f=>f.text)),S=x.filter(f=>!v.has(f.text)),y=u.filter(f=>!p.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[c.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:["- ",lo(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",lo(f.new,120)]})]})]},f.label)),(S.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)),S.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),c.length===0&&S.length===0&&y.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function sv({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(to,{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 (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(c=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:c.text},c.id))})]})]})}function to({label:i,value:o}){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:lo(o,300)})]})}function lo(i,o){return i.length>o?i.slice(0,o)+"...":i}const Nx={remove:0,modify:1,add:2};function rv({changes:i,selections:o,currentEvals:c,onToggle:u,onSelectAll:x,onDeselectAll:v}){if(i.length===0)return null;const p=i.map((y,f)=>({change:y,originalIndex:f}));p.sort((y,f)=>(Nx[y.change.action]??2)-(Nx[f.change.action]??2));const S=Array.from(o.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:["(",S,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:x,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:v,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(lv,{change:y,index:f,selected:o.get(f)??!1,onToggle:u,originalEval:y.evalId!=null?c.find(b=>b.id===y.evalId):void 0},f))})]})}function iv(){var C;const{state:i,dispatch:o,submitAiEdit:c,applyAiEdit:u,discardAiEdit:x,cancelAiEdit:v,toggleEvalChange:p,selectAllEvalChanges:S,deselectAllEvalChanges:y,retryEvalsSave:f}=Ft(),{aiEditLoading:b,aiEditResult:g,aiEditError:T,aiEditClassifiedError:M,aiEditProgress:D,aiEditEvalChanges:U,aiEditEvalSelections:Y,aiEditEvalsRetry:G}=i,[W,le]=h.useState(""),{config:X}=rn(),[te,K]=h.useState("claude-cli"),[V,P]=h.useState("opus"),fe=h.useRef(null);h.useEffect(()=>{var E;(E=fe.current)==null||E.focus()},[]),h.useEffect(()=>{if(!X)return;X.providers.find($=>$.id==="claude-cli"&&$.available)&&(K("claude-cli"),P("opus"))},[X]);const ke=X==null?void 0:X.providers.find(E=>E.id===te&&E.available),we=h.useCallback(()=>{const E=W.trim();!E||b||c(E,te,V)},[W,b,c,te,V]),ye=h.useCallback(E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),we()),E.key==="Escape"&&(E.preventDefault(),b?v():x())},[we,b,v,x]),Z=h.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),oe=g?Er(i.skillContent,g.improved):[],me=((C=i.evals)==null?void 0:C.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:x,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:E=>{E.currentTarget.style.background="var(--surface-3)"},onMouseLeave:E=>{E.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:[!g&&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:fe,value:W,onChange:E=>le(E.target.value),onKeyDown:ye,placeholder:"e.g., Add an error handling section...",disabled:b,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:E=>{const $=E.currentTarget;$.style.height="auto",$.style.height=Math.min($.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:te,onChange:E=>{K(E.target.value);const $=X==null?void 0:X.providers.find(Q=>Q.id===E.target.value);$!=null&&$.models[0]&&P($.models[0].id)},disabled:b,style:{width:"100%"},children:X==null?void 0:X.providers.filter(E=>E.available).map(E=>n.jsx("option",{value:E.id,children:E.label},E.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:V,onChange:E=>P(E.target.value),disabled:b,style:{width:"100%"},children:ke==null?void 0:ke.models.map(E=>n.jsx("option",{value:E.id,children:E.label},E.id))})]}),b?n.jsx("button",{onClick:v,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:we,disabled:!W.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),b&&D.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(ns,{entries:D,isRunning:!0})})]}),T&&n.jsx("div",{className:"mt-3",children:M?n.jsx(kr,{error:M,onRetry:Z,onDismiss:x}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),g&&n.jsxs("div",{className:"animate-fade-in",children:[g.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: "}),g.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:oe.map((E,$)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:E.type==="added"?"rgba(34,197,94,0.1)":E.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:E.type==="added"?"var(--green)":E.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:E.type==="added"?"3px solid var(--green)":E.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:E.type==="added"?"+":E.type==="removed"?"-":" "}),E.content]},$))}),n.jsx(rv,{changes:U,selections:Y,currentEvals:me,onToggle:p,onSelectAll:S,onDeselectAll:y}),G&&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:x,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:Z,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function cv(i,o){const[c,u]=h.useState([]),[x,v]=h.useState("SKILL.md"),[p,S]=h.useState(null),[y,f]=h.useState(!1),[b,g]=h.useState(null),T=h.useCallback(async()=>{try{const U=await ve.getSkillFiles(i,o);u(U.files)}catch{u([])}},[i,o]);h.useEffect(()=>{v("SKILL.md"),S(null),g(null),T()},[i,o,T]);const M=h.useCallback(async U=>{if(v(U),U==="SKILL.md"){S(null),g(null);return}f(!0),g(null);try{const Y=await ve.getSkillFile(i,o,U);S(Y)}catch(Y){g(`Unable to open file: ${Y.message}`),S(null)}finally{f(!1)}},[i,o]),D=h.useCallback(()=>{T()},[T]);return{files:c,activeFile:x,secondaryContent:p,loading:y,error:b,selectFile:M,refresh:D,isSkillMd:x==="SKILL.md"}}function ov(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function uv(i){const o=[],c=new Map;for(const u of i){const x=u.path.split("/"),p={name:x[x.length-1],path:u.path,type:u.type,size:u.size,children:[]};c.set(u.path,p)}for(const u of i){const x=u.path.split("/");if(x.length===1){const v=c.get(u.path);v&&o.push(v)}else{const v=x.slice(0,-1).join("/"),p=c.get(v),S=c.get(u.path);p&&S&&p.children.push(S)}}return o}function qx({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 Gx(){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 dv(){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 fv(){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 Yx({node:i,depth:o,activeFile:c,onSelect:u}){const[x,v]=h.useState(!0),p=i.path===c;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>v(!x),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*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(qx,{expanded:x}),n.jsx(Gx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),x&&i.children.map(S=>n.jsx(Yx,{node:S,depth:o+1,activeFile:c,onSelect:u},S.path))]}):n.jsxs("button",{onClick:()=>u(i.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*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(dv,{}),n.jsx("span",{style:{flex:1},children:i.name}),n.jsx("span",{style:{fontSize:9,color:"var(--text-tertiary)",marginRight:4,whiteSpace:"nowrap"},children:ov(i.size)})]})}function xv({files:i,activeFile:o,onSelect:c,onRefresh:u}){const[x,v]=h.useState(!1),p=h.useMemo(()=>uv(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:()=>v(!x),children:[n.jsx(qx,{expanded:x}),n.jsx(Gx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),n.jsx("button",{onClick:S=>{S.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(fv,{})})]}),x&&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(S=>n.jsx(Yx,{node:S,depth:0,activeFile:o,onSelect:c},S.path))})]})}function yr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function pv(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function mv(i){const o=i.toLowerCase();return o.endsWith(".json")?"json":o.endsWith(".md")?"md":"other"}function Ex({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 kx({content:i,fileType:o}){if(o==="json"){const c=pv(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:c})}return o==="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 Tx(i){try{return JSON.stringify(JSON.parse(i),null,2).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"([^"\\]|\\.)*"\s*:/g,c=>`<span style="color:#6383ff">${c}</span>`).replace(/:\s*"([^"\\]|\\.)*"/g,c=>`<span style="color:#22c55e">${c.slice(0,2)}<span style="color:#22c55e">${c.slice(2)}</span></span>`).replace(/:\s*(-?\d+\.?\d*)/g,(c,u)=>`: <span style="color:#fb923c">${u}</span>`).replace(/:\s*(true|false|null)/g,(c,u)=>`: <span style="color:#a855f7">${u}</span>`)}catch{return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}function hv({file:i,loading:o,error:c,viewMode:u,plugin:x,skill:v,onSaved:p,onDirtyChange:S}){const[y,f]=h.useState(u),[b,g]=h.useState(!1),[T,M]=h.useState(""),[D,U]=h.useState(!1),[Y,G]=h.useState(null),W=u!==y?u:y;h.useEffect(()=>{S==null||S(b)},[b,S]);const le=h.useCallback(()=>{(i==null?void 0:i.content)!=null&&(M(i.content),g(!0))},[i]),X=h.useCallback(()=>{g(!1)},[]),te=h.useCallback(async()=>{if(!(!x||!v||!i)){U(!0);try{await ve.saveSkillFile(x,v,i.path,T),G("Saved"),g(!1),p==null||p(),setTimeout(()=>G(null),2e3)}catch(P){G(`Save failed: ${P.message}`),setTimeout(()=>G(null),3e3)}finally{U(!1)}}},[x,v,i,T,p]);if(h.useEffect(()=>{if(!b)return;const P=fe=>{(fe.ctrlKey||fe.metaKey)&&fe.key==="s"&&(fe.preventDefault(),te())};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[b,te]),o)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(c)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:c})]})});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 (",yr(i.size),") — cannot be displayed"]});const K=i.content??"",V=mv(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 ",yr(512*1024)," — ",yr(i.size)," total"]}),n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[(V==="md"||V==="json")&&["raw","split","preview"].map(P=>n.jsx("button",{onClick:()=>f(P),style:{padding:"2px 8px",fontSize:11,background:W===P?"var(--accent-muted)":"none",color:W===P?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:P},P)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center",gap:6},children:[yr(i.size),x&&v&&!i.binary&&!b&&n.jsx("button",{onClick:le,style:{padding:"1px 6px",fontSize:10,background:"var(--accent-muted)",color:"var(--accent)",border:"none",borderRadius:3,cursor:"pointer"},children:"Edit"}),b&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:te,disabled:D,style:{padding:"1px 6px",fontSize:10,background:"var(--accent)",color:"#fff",border:"none",borderRadius:3,cursor:"pointer",opacity:D?.6:1},children:D?"Saving...":"Save"}),n.jsx("button",{onClick:X,style:{padding:"1px 6px",fontSize:10,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer"},children:"Cancel"})]})]})]}),Y&&n.jsx("div",{style:{padding:"4px 12px",background:Y.startsWith("Save failed")?"var(--red-muted)":"var(--green-muted)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:Y.startsWith("Save failed")?"var(--red)":"var(--green)"},children:Y}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:b?n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:[n.jsx("textarea",{value:T,onChange:P=>M(P.target.value),style:{flex:1,width:"100%",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}}),n.jsxs("div",{style:{position:"sticky",bottom:0,display:"flex",alignItems:"center",gap:8,padding:"6px 12px",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("span",{style:{flex:1,fontSize:11,color:"var(--text-tertiary)"},children:"Unsaved changes"}),n.jsx("button",{onClick:te,disabled:D,style:{padding:"3px 12px",fontSize:11,background:"var(--accent)",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",opacity:D?.6:1},children:D?"Saving...":"Save"}),n.jsx("button",{onClick:X,style:{padding:"3px 12px",fontSize:11,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer"},children:"Cancel"})]})]}):W==="split"&&V!=="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(Ex,{content:K})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:V==="json"?n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(K)}}):n.jsx(kx,{content:K,fileType:V})})]}):W==="preview"&&V!=="other"?V==="json"?n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(K)}}):n.jsx(kx,{content:K,fileType:V}):n.jsx(Ex,{content:K})})]})}function vv({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 yv({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 gv({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 bv({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 Xc({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 jv(){const{state:i,dispatch:o,saveContent:c,isReadOnly:u}=Ft(),{plugin:x,skill:v,skillContent:p,isDirty:S,improveTarget:y,aiEditOpen:f}=i,[b,g]=h.useState("split"),[T,M]=h.useState(!1),D=h.useRef(null),[U,Y]=h.useState(!1),[G,W]=h.useState(""),[le,X]=h.useState(!1),[te,K]=h.useState(null),[V,P]=h.useState([]),[fe,ke]=h.useState([]),[we,ye]=h.useState(null),Z=h.useRef(null),{config:oe}=rn(),{files:me,activeFile:C,secondaryContent:E,loading:$,error:Q,selectFile:re,refresh:j,isSkillMd:_}=cv(x??"",v??""),[J,ee]=h.useState(!1),ue=h.useCallback(I=>{J&&!window.confirm("You have unsaved changes. Discard?")||re(I)},[J,re]);h.useEffect(()=>()=>{var I;(I=Z.current)==null||I.abort()},[]);const{metadata:O,body:F}=Fh(p),ae=O["allowed-tools"],ce=Array.isArray(ae)?ae:typeof ae=="string"?[ae]:[],Ae=O.name,Xe=O.description,Tt=O.metadata,Fe=typeof Tt=="object"&&!Array.isArray(Tt)?Tt:null,Ct=O.version||(Fe==null?void 0:Fe.version),xt=O.tags||(Fe==null?void 0:Fe.tags),nl=Array.isArray(xt)?xt:typeof xt=="string"?xt.split(",").map(I=>I.trim()).filter(Boolean):[],cn=new Set(["name","description","metadata","allowed-tools","version","tags"]),yt=Object.entries(O).filter(([I])=>!cn.has(I)),Dt=h.useCallback(async()=>{M(!0),await c(),M(!1)},[c]),Tl=h.useCallback(I=>{(I.ctrlKey||I.metaKey)&&I.key==="s"&&(I.preventDefault(),I.stopPropagation(),S&&Dt()),(I.ctrlKey||I.metaKey)&&I.key==="k"&&(I.preventDefault(),I.stopPropagation(),o({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[S,Dt,f,o]),sl=h.useCallback(async()=>{var Ve,Be;if(!G.trim())return;(Ve=Z.current)==null||Ve.abort();const I=new AbortController;Z.current=I,X(!0),ye(null),ke([]),K(null),P([]);try{const It=(oe==null?void 0:oe.provider)||"claude-cli",Cl=(oe==null?void 0:oe.model)||"sonnet",mt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:G,provider:It,model:Cl}),signal:I.signal});if(!mt.ok||!mt.body){let Qe=`HTTP ${mt.status}`;try{const Ge=await mt.json();Ge.error&&(Qe=Ge.error)}catch{}throw new Error(Qe)}const Pt=mt.body.getReader(),Bt=new TextDecoder;let Ze="",at="";for(;;){const{done:Qe,value:Ge}=await Pt.read();if(Qe)break;Ze+=Bt.decode(Ge,{stream:!0});const il=Ze.split(`
|
|
59
|
-
`);Ze=il.pop()||"";for(const wl of il)if(wl.startsWith("event: "))at=wl.slice(7).trim();else if(wl.startsWith("data: ")){try{const nt=JSON.parse(wl.slice(6));if(at==="progress")ke(wt=>[...wt,{phase:nt.phase,message:nt.message,timestamp:Date.now()}]);else if(at==="done"||at==="complete"){const wt=["---"];nt.name&&wt.push(`name: ${nt.name}`),nt.description&&wt.push(`description: "${nt.description.replace(/"/g,'\\"')}"`),nt.model&&wt.push(`model: ${nt.model}`),(Be=nt.allowedTools)!=null&&Be.trim()&&wt.push(`allowed-tools: ${nt.allowedTools.trim()}`),wt.push("---","",nt.body||"");const la=wt.join(`
|
|
60
|
-
`);K(la),P(Er(p,la)),X(!1)}else at==="error"&&(ye(nt.message||nt.description||"Generation failed"),X(!1))}catch{}at=""}}}catch(It){It.name!=="AbortError"&&ye(It.message)}finally{X(!1),Z.current=null}},[G,oe,p]),on=h.useCallback(()=>{te&&o({type:"SET_CONTENT",content:te}),Y(!1),K(null),P([]),W(""),ke([])},[te,o]),rl=h.useCallback(()=>{Y(!1),K(null),P([]),W(""),ke([]),ye(null)},[]),it=h.useCallback(()=>{var I;U?((I=Z.current)==null||I.abort(),rl()):(f&&o({type:"CLOSE_AI_EDIT"}),Y(!0))},[U,f,o,rl]),Ne=[{mode:"raw",icon:n.jsx(vv,{}),label:"Editor"},{mode:"split",icon:n.jsx(yv,{}),label:"Split"},{mode:"preview",icon:n.jsx(gv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:Tl,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:Ne.map(({mode:I,icon:Ve,label:Be})=>n.jsxs("button",{onClick:()=>g(I),title:Be,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:b===I?"var(--surface-4)":"transparent",color:b===I?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:b===I?600:400,border:"none",cursor:"pointer"},children:[Ve,n.jsx("span",{style:{letterSpacing:"0.01em"},children:Be})]},I))}),_?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?o({type:"CLOSE_AI_EDIT"}):(U&&rl(),o({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(bv,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:it,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:U?600:400,border:"none",cursor:"pointer",color:U?"#a855f7":"var(--text-tertiary)",background:U?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Xc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),S&&n.jsx("button",{onClick:()=>o({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:Dt,disabled:!S||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),x&&v&&n.jsx(xv,{files:me,activeFile:C,onSelect:ue,onRefresh:j}),!_&&n.jsx(hv,{file:E,loading:$,error:Q,viewMode:b,plugin:x??void 0,skill:v??void 0,onSaved:()=>{re(C),j()},onDirtyChange:ee}),_&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:b==="raw"||b==="preview"?"1fr":"1fr 1fr"},children:[b!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:b==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:D,value:p,onChange:I=>{u||o({type:"SET_CONTENT",content:I.target.value})},onKeyDown:Tl,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}})}),b!=="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:[(Ae||Ct||Xe)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[Ae&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:Ae}),Ct&&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",Ct]})]}),Xe&&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:Xe})]}),nl.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:nl.map(I=>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:I},I))}),ce.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"}),ce.map(I=>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:I},I))]})}),yt.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:yt.map(([I,Ve],Be)=>{const It=Array.isArray(Ve)?Ve.join(", "):typeof Ve=="object"?Object.entries(Ve).map(([Cl,mt])=>`${Cl}: ${Array.isArray(mt)?mt.join(", "):mt}`).join(" | "):Ve;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:Be>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:I}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:It})]},I)})}),(Ae||Xe||nl.length>0||ce.length>0||yt.length>0)&&F&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),F&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(F)}})]})})]}),_&&f&&n.jsx(iv,{}),_&&U&&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:[!te&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Xc,{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:G,onChange:I=>W(I.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:le,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:le?.5:1},onKeyDown:I=>{I.key==="Enter"&&(I.ctrlKey||I.metaKey)&&G.trim()&&!le&&(I.preventDefault(),sl())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[le?n.jsx("button",{onClick:()=>{var I;(I=Z.current)==null||I.abort(),X(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:sl,disabled:!G.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:rl,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),le&&fe.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(ns,{entries:fe,isRunning:!0})}),we&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[we,n.jsx("button",{onClick:sl,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),te&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Xc,{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:V.map((I,Ve)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:I.type==="added"?"rgba(34,197,94,0.1)":I.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:I.type==="added"?"var(--green)":I.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:I.type==="added"?"3px solid var(--green)":I.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:I.type==="added"?"+":I.type==="removed"?"-":" "}),I.content]},Ve))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:on,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:rl,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),_&&y!==null&&x&&v&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(ev,{plugin:x,skill:v,skillContent:p,onApplied:I=>{o({type:"SET_CONTENT",content:I}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function sn(i){return i.testType==="integration"?"integration":"unit"}function as(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Vx(i){const o=new Date(i);return o.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+o.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`}const Sv=new Set(["benchmark","comparison","baseline"]);function Cx(i,o,c,u){return i.map(({rate:x,idx:v,total:p})=>{const S=u+v/(p-1)*(o-u*2),y=u+(c-u*2)-x*(c-u*2);return`${S},${y}`})}function Xx({entries:i}){const o=i.filter(g=>Sv.has(g.type)).slice().reverse(),c=o.map((g,T,M)=>({rate:g.pass_rate,idx:T,total:M.length})).filter((g,T)=>{const M=o[T].type;return M==="benchmark"||M==="comparison"}),u=o.flatMap((g,T)=>g.type==="baseline"?[{rate:g.pass_rate,idx:T,total:o.length}]:g.type==="comparison"&&g.baselinePassRate!=null?[{rate:g.baselinePassRate,idx:T,total:o.length}]:[]);if(c.length<2&&u.length<2)return null;const x=80,v=24,p=2,S=c.length>=2?Cx(c,x,v,p):[],y=u.length>=2?Cx(u,x,v,p):[],f=S[S.length-1],b=y[y.length-1];return n.jsxs("svg",{width:x,height:v,style:{display:"block",flexShrink:0},children:[y.length>0&&n.jsx("polyline",{points:y.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),S.length>0&&n.jsx("polyline",{points:S.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),b&&n.jsx("circle",{cx:parseFloat(b.split(",")[0]),cy:parseFloat(b.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&n.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Zx(i,o,c){const u=[],x=[],v=[];if((i==="PASS"||i==="EFFECTIVE")&&o>=.7){const y=u.length>0?` Met criteria: ${u.map(f=>f.criterion).join(", ")}.`:"";return{explanation:`${i} (score ${o.toFixed(2)}): evaluation met expectations.${y}`}}if((i==="FAIL"||i==="DEGRADING")&&o<.4){const y=x.length>0?` Failed criteria: ${x.map(b=>b.criterion).join(", ")}.`:"",f=[...x.map(b=>`Improve "${b.criterion}" (score: ${b.score.toFixed(2)})`),...v.map(b=>`Strengthen "${b.criterion}" (score: ${b.score.toFixed(2)})`)];return f.length===0&&f.push("Review prompt instructions and add more specific guidance"),{explanation:`${i} (score ${o.toFixed(2)}): evaluation did not meet expectations.${y}`,recommendations:f}}if(i==="INEFFECTIVE"&&o<.2){const y=[...x.map(f=>`Rework "${f.criterion}" — currently at ${f.score.toFixed(2)}`),"Consider adding examples to your system prompt","Review the rubric criteria for achievability"];return{explanation:`${i} (score ${o.toFixed(2)}): evaluation is significantly below expectations.`,recommendations:y}}const p=u.length>0?` Passing: ${u.map(y=>y.criterion).join(", ")}.`:"",S=v.length>0?` Needs improvement: ${v.map(y=>y.criterion).join(", ")}.`:"";return{explanation:`${i} (score ${o.toFixed(2)}): mixed results.${p}${S}`}}function Nv(i,o,c){const[u,x]=h.useState(null),[v,p]=h.useState(!1),S=h.useRef("");h.useEffect(()=>{const f=`${i}/${o}/${c}`;S.current!==f&&(S.current=f,p(!0),ve.getCaseHistory(i,o,c).then(b=>x(b)).catch(()=>x([])).finally(()=>p(!1)))},[i,o,c]);const y=h.useCallback(()=>{p(!0),S.current="",ve.getCaseHistory(i,o,c).then(f=>x(f)).catch(()=>x([])).finally(()=>p(!1))},[i,o,c]);return{entries:u,loading:v,refetch:y}}function Ev(i,o,c){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!c||c.length===0)return u;const v=c.slice(0,10).map(y=>y.assertions.find(f=>f.id===i)).filter(Boolean);if(v.length>=2){const f=v.filter(b=>b.pass).length/v.length;f>=.3&&f<=.7&&(u.flaky=!0)}const p=c.find(y=>y.type==="benchmark"),S=c.find(y=>y.type==="baseline");if(p&&S){const y=p.assertions.find(b=>b.id===i),f=S.assertions.find(b=>b.id===i);y!=null&&y.pass&&(f!=null&&f.pass)&&(u.nonDiscriminating=!0)}if(o&&!o.pass&&c.length>=1){const f=c[0].assertions.find(b=>b.id===i);f!=null&&f.pass&&(u.regression=!0)}return u}function kv(){var C;const{state:i,dispatch:o,saveEvals:c,runCase:u,runAll:x,cancelCase:v,cancelAll:p,generateEvals:S,isReadOnly:y}=Ft(),{evals:f,evalsError:b,selectedCaseId:g,inlineResults:T,caseRunStates:M,generateEvalsLoading:D,generateEvalsProgress:U,generateEvalsError:Y}=i,G=h.useMemo(()=>{for(const E of M.values())if(E.status==="running"||E.status==="queued")return!0;return!1},[M]),[W,le]=h.useState(!1),[X,te]=h.useState("all"),K={skill_name:i.skill,evals:[]},V=f??K,P=V.evals,fe=X==="all"?P:P.filter(E=>sn(E)===X),ke=fe.find(E=>E.id===g)??null,[we,ye]=h.useState([]),Z=h.useMemo(()=>P.some(E=>sn(E)==="integration"),[P]);h.useEffect(()=>{Z&&ve.getCredentials(i.plugin,i.skill).then(E=>ye(E.credentials)).catch(()=>ye([]))},[i.plugin,i.skill,Z]);const oe=h.useMemo(()=>new Set(we.filter(E=>E.status==="missing").map(E=>E.name)),[we]),me=h.useCallback(()=>{S()},[S]);return!f||fe.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:b?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:b?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:b?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:b}),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:()=>le(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:me,disabled:D||y,className:"btn btn-secondary text-[12px]",children:D?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),D&&U.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(ns,{entries:U,isRunning:!0})}),Y&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(kr,{error:Y,onRetry:me})}),W&&n.jsx(wx,{evals:V,onSave:E=>{c(E),le(!1)},onCancel:()=>le(!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 (",fe.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:G?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:()=>x("benchmark"),disabled:fe.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>x("comparison"),disabled:fe.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"flex px-3 py-1.5 gap-1",style:{borderBottom:"1px solid var(--border-subtle)"},children:["all","unit","integration"].map(E=>n.jsx("button",{onClick:()=>te(E),style:{padding:"2px 8px",fontSize:10,fontWeight:X===E?600:400,background:X===E?"var(--accent-muted)":"transparent",color:X===E?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer",textTransform:"capitalize"},children:E==="all"?`All (${P.length})`:E==="unit"?`Unit (${P.filter($=>sn($)==="unit").length})`:`Integration (${P.filter($=>sn($)==="integration").length})`},E))}),n.jsx("div",{className:"py-1",children:fe.map(E=>{var j;const $=T.get(E.id),Q=g===E.id,re=sn(E);return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:E.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:Q?"var(--accent-muted)":"transparent",borderLeft:Q?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:_=>{Q||(_.currentTarget.style.background="var(--surface-2)")},onMouseLeave:_=>{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 flex items-center gap-1.5",style:{color:Q?"var(--text-primary)":"var(--text-secondary)"},children:["#",E.id," ",E.name,n.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:9999,background:re==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:re==="unit"?"#6383ff":"#fb923c",whiteSpace:"nowrap"},children:re==="unit"?"U":"I"}),re==="integration"&&((j=E.requiredCredentials)==null?void 0:j.some(_=>oe.has(_)))&&n.jsx("span",{title:"Configure credentials to run",children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",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"})]})})]}),n.jsx(Kx,{result:$})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[E.assertions.length," assertion",E.assertions.length!==1?"s":"",($==null?void 0:$.passRate)!=null&&n.jsx(wv,{passRate:$.passRate})]})]},E.id)})}),n.jsx("div",{className:"px-3 py-2",children:!y&&n.jsx("button",{onClick:()=>le(!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:E=>{E.currentTarget.style.borderColor="var(--accent)",E.currentTarget.style.color="var(--accent)"},onMouseLeave:E=>{E.currentTarget.style.borderColor="var(--border-default)",E.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:ke?n.jsx(Tv,{evalCase:ke,result:T.get(ke.id),evals:f,caseStatus:((C=M.get(ke.id))==null?void 0:C.status)??"idle",onSaveEvals:c,onRun:E=>u(E,"benchmark"),onCompare:E=>u(E,"comparison"),onCancel:E=>v(E),onImprove:E=>o({type:"OPEN_IMPROVE",evalId:E})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),W&&n.jsx(wx,{evals:V,onSave:E=>{c(E),le(!1)},onCancel:()=>le(!1)})]})}function Tv({evalCase:i,result:o,evals:c,caseStatus:u,onSaveEvals:x,onRun:v,onCompare:p,onCancel:S,onImprove:y}){const{state:f,isReadOnly:b}=Ft(),{plugin:g,skill:T}=f,{entries:M,loading:D}=Nv(g,T,i.id),[U,Y]=h.useState(!1),[G,W]=h.useState(i.prompt),[le,X]=h.useState(!1),[te,K]=h.useState(i.expected_output);h.useState(()=>{W(i.prompt),K(i.expected_output)});const V=h.useCallback(Q=>{x({...c,evals:c.evals.map(re=>re.id===Q.id?Q:re)})},[c,x]),P=h.useCallback(()=>{V({...i,prompt:G}),Y(!1)},[i,G,V]),fe=h.useCallback(()=>{V({...i,expected_output:te}),X(!1)},[i,te,V]),ke=h.useCallback(()=>{V({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,V]),we=h.useCallback((Q,re)=>{V({...i,assertions:i.assertions.map(j=>j.id===Q?{...j,text:re}:j)})},[i,V]),ye=h.useCallback(Q=>{V({...i,assertions:i.assertions.filter(re=>re.id!==Q)})},[i,V]),Z=h.useCallback(()=>{confirm("Delete this test case?")&&x({...c,evals:c.evals.filter(Q=>Q.id!==i.id)})},[c,i.id,x]),oe=o&&o.assertions.length>0&&o.assertions.every(Q=>Q.pass),me=o&&o.assertions.some(Q=>!Q.pass),C=sn(i),E=i.requiredCredentials??[],$=C==="integration"&&E.length>0;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("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:9999,background:C==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:C==="unit"?"#6383ff":"#fb923c"},children:C==="unit"?"Unit":"Integration"}),n.jsx(Kx,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>S(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:()=>v(i.id),disabled:b,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>p(i.id),disabled:b,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),me&&!b&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>y(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!b&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:Z,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"})]})})]})]}),b&&C==="integration"&&n.jsxs("div",{"data-testid":"platform-integration-note",className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--accent-muted)",border:"1px solid rgba(99,131,255,0.2)"},children:[n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),n.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),n.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--accent)"},children:"Run locally in vSkill Studio"})]}),oe&&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.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl",style:{background:"rgba(251,146,60,0.1)",border:"1px solid rgba(251,146,60,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",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"})]}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"Required Credentials"})]}),n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:"This integration test requires the following environment variables:"}),n.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:E.map(Q=>n.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono, monospace)",padding:"2px 6px",borderRadius:4,background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:Q},Q))})]}),n.jsx(gr,{title:"Prompt",children:U?n.jsxs("div",{children:[n.jsx("textarea",{value:G,onChange:Q=>W(Q.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:P,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{W(i.prompt),Y(!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:b?"default":"pointer"},onClick:()=>{b||Y(!0)},onMouseEnter:Q=>{b||(Q.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Q=>{Q.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:b?"No prompt":"Click to edit prompt..."})})}),n.jsx(gr,{title:"Expected Output",children:le?n.jsxs("div",{children:[n.jsx("textarea",{value:te,onChange:Q=>K(Q.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:fe,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{K(i.expected_output),X(!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:b?"default":"pointer"},onClick:()=>{b||X(!0)},onMouseEnter:Q=>{b||(Q.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Q=>{Q.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:b?"No expected output":"Click to edit expected output..."})})}),n.jsx(gr,{title:`Assertions (${i.assertions.length})`,action:b?void 0:n.jsx("button",{onClick:ke,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(Q=>{const re=o==null?void 0:o.assertions.find(_=>_.assertion_id===Q.id),j=Ev(Q.id,re,M);return n.jsx(Cv,{assertion:Q,result:re,badges:j,isReadOnly:b,onUpdate:_=>we(Q.id,_),onDelete:()=>ye(Q.id)},Q.id)})})}),(o==null?void 0:o.output)&&n.jsx(Av,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),o&&o.passRate!=null&&o.passRate<.2&&(()=>{const Q=Zx("INEFFECTIVE",o.passRate);return Q.recommendations&&Q.recommendations.length>0?n.jsx(gr,{title:"Recommendations",children:n.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(251,146,60,0.08)",border:"1px solid rgba(251,146,60,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",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.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"This eval is significantly below expectations"})]}),n.jsx("ul",{className:"space-y-1.5 ml-1",children:Q.recommendations.map((re,j)=>n.jsxs("li",{className:"flex items-start gap-2 text-[12px]",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"#fb923c",fontWeight:600,flexShrink:0},children:"•"}),re]},j))})]})}):null})(),n.jsx(Rv,{evalId:i.id,sharedEntries:M,sharedLoading:D})]},i.id)}function Cv({assertion:i,result:o,badges:c,isReadOnly:u,onUpdate:x,onDelete:v}){const[p,S]=h.useState(!1),[y,f]=h.useState(i.text),[b,g]=h.useState(!1),T=()=>{x(y),S(!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:[o?n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.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"}),(c==null?void 0:c.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}),(c==null?void 0:c.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"}),(c==null?void 0:c.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:M=>f(M.target.value),onKeyDown:M=>{M.key==="Enter"&&T(),M.key==="Escape"&&S(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:T,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),S(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>g(!b),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:b?"Hide reasoning":"Show reasoning"}),b&&(o==null?void 0:o.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:o.reasoning})]}),!u&&n.jsx("button",{onClick:v,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:M=>{M.currentTarget.style.color="var(--red)",M.currentTarget.style.opacity="1"},onMouseLeave:M=>{M.currentTarget.style.color="var(--text-tertiary)",M.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 gr({title:i,action:o,children:c}){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}),o]}),c]})}function Kx({result:i}){const[o,c]=h.useState(!1);if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const u=i.status==="pass",x=i.passRate??0,p=Zx(u?"PASS":"FAIL",x);return n.jsxs("span",{className:"pill text-[10px]",style:{background:u?"var(--green-muted)":"var(--red-muted)",color:u?"var(--green)":"var(--red)",position:"relative",cursor:"default"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-describedby":o?"verdict-tooltip":void 0,children:[i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status,o&&n.jsx("div",{id:"verdict-tooltip",role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,padding:"6px 10px",background:"var(--surface-4)",border:"1px solid var(--border-subtle)",borderRadius:6,fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap",zIndex:50,maxWidth:300,width:"max-content",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:p.explanation})]})}function wv({passRate:i}){const o=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:`${o}%`,background:o>=80?"var(--green)":o>=50?"var(--yellow)":"var(--red)"}})})})}function Av({output:i,durationMs:o,tokens:c}){const[u,x]=h.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>x(!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",o!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(o/1e3).toFixed(1),"s)"]}),c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",c," 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 Zc(i){return i==="baseline"?"right":i==="comparison"?"full":"left"}function Kc({entry:i}){return 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:Vx(i.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:i.type==="benchmark"?"rgba(99,131,255,0.15)":i.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:i.type==="benchmark"?"#6383ff":i.type==="comparison"?"var(--purple)":"#fb923c"},children:i.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:as(i.pass_rate)},children:[Math.round(i.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:[i.durationMs!=null&&n.jsx("span",{children:Qx(i.durationMs)}),i.tokens!=null&&n.jsxs("span",{children:[i.tokens>=1e3?`${(i.tokens/1e3).toFixed(1)}k`:i.tokens," tok"]})]}),i.type==="comparison"&&i.baselinePassRate!=null&&(()=>{const o=i.pass_rate-i.baselinePassRate,c=o>.001?"skill":o<-.001?"baseline":"tie",u=o>0?"+":"",x=c==="skill"?"var(--green)":c==="baseline"?"var(--red)":"var(--text-tertiary)";return n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:o>=0?"var(--green)":"var(--red)"},children:[u,(o*100).toFixed(1),"%"]}),n.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:x},children:c})]})})(),n.jsx("div",{className:"space-y-0.5",children:i.assertions.map(o=>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:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.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:o.text})]},o.id))})]})}function Rv({evalId:i,sharedEntries:o,sharedLoading:c}){const{state:u,dispatch:x}=Ft(),{plugin:v,skill:p}=u,[S,y]=h.useState(!0),f=o??null,b=c??!1,g=h.useCallback(()=>{y(U=>!U)},[]),T=f?f.slice(0,10):[],M=T.some(U=>{const Y=Zc(U.type);return Y==="left"||Y==="full"}),D=T.some(U=>{const Y=Zc(U.type);return Y==="right"||Y==="full"});return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:g,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:S?"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":"",")"]})]}),S&&n.jsx("div",{className:"animate-fade-in",children:b?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:[T.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Xx,{entries:T})}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!M&&n.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!D&&n.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((U,Y)=>{const G=Zc(U.type);return G==="full"?n.jsx("div",{style:{gridColumn:"1 / -1"},children:n.jsx(Kc,{entry:U})},Y):G==="left"?n.jsxs(h.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"},children:n.jsx(Kc,{entry:U})}),n.jsx("div",{style:{gridColumn:"2"}})]},Y):n.jsxs(h.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"}}),n.jsx("div",{style:{gridColumn:"2"},children:n.jsx(Kc,{entry:U})})]},Y)})]}),n.jsx("button",{onClick:()=>x({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:U=>{U.currentTarget.style.textDecoration="underline"},onMouseLeave:U=>{U.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function wx({evals:i,onSave:o,onCancel:c}){const[u,x]=h.useState(""),[v,p]=h.useState(""),[S,y]=h.useState(""),[f,b]=h.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),g=Math.max(0,...i.evals.map(M=>M.id))+1,T=()=>{if(!u.trim()||!v.trim())return;const M={id:g,name:u.trim(),prompt:v.trim(),expected_output:S.trim(),files:[],assertions:f.filter(D=>D.text.trim())};o({...i,evals:[...i.evals,M]})};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:M=>x(M.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:v,onChange:M=>p(M.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:S,onChange:M=>y(M.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((M,D)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:M.text,onChange:U=>b(f.map((Y,G)=>G===D?{...Y,text:U.target.value}:Y)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>b(f.filter((U,Y)=>Y!==D)),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"})]})})]},M.id)),n.jsx("button",{onClick:()=>b([...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:c,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:T,disabled:!u.trim()||!v.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function _v(i,o){const c=i+o,u=c*10,x=c*25,v=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${v(u)}–${v(x)}`}function Mv(){const{state:i,runCase:o,runAll:c,cancelCase:u,cancelAll:x,isReadOnly:v}=Ft(),{evals:p,caseRunStates:S,bulkRunActive:y,latestBenchmark:f,inlineResults:b}=i,g=(p==null?void 0:p.evals)??[],T=h.useMemo(()=>{for(const X of S.values())if(X.status==="running"||X.status==="queued")return!0;return!1},[S]),M=g.filter(X=>{const te=S.get(X.id);return te&&(te.status==="complete"||te.status==="error"||te.status==="cancelled")}).length,D=g.filter(X=>{const te=S.get(X.id);return te&&(te.status==="running"||te.status==="queued")}).length,U=h.useRef(null),[Y,G]=h.useState(0);h.useEffect(()=>{if(T&&!U.current&&(U.current=Date.now()),!T){U.current=null,G(0);return}const X=setInterval(()=>{U.current&&G(Math.round((Date.now()-U.current)/1e3))},1e3);return()=>clearInterval(X)},[T]);const W=g.reduce((X,te)=>X+te.assertions.length,0),le=h.useMemo(()=>_v(g.length,W),[g.length,W]);return n.jsxs("div",{className:"p-5",children:[v&&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"}),T&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[D," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T&&n.jsxs("button",{onClick:x,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:()=>c("comparison"),disabled:g.length===0||T||v,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>c("benchmark"),disabled:g.length===0||T||v,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>c("baseline"),disabled:g.length===0||T||v,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&g.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: ",M,"/",g.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(M/g.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:`${M/g.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: ",Y>=60?`${Math.floor(Y/60)}m ${Y%60}s`:`${Y}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",le]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:g.map(X=>{const te=b.get(X.id),K=S.get(X.id),V=(K==null?void 0:K.status)??"idle";return n.jsx(Lv,{name:X.name,evalId:X.id,result:te,caseStatus:V,runMode:(K==null?void 0:K.mode)??null,isReadOnly:v,onRun:P=>o(P,"benchmark"),onBaseline:P=>o(P,"baseline"),onCompare:P=>o(P,"comparison"),onCancel:P=>u(P)},X.id)})}),!T&&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:()=>c("comparison"),disabled:g.length===0||v,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:g.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(Ax,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(Ax,{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 zv={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 Lv({name:i,evalId:o,result:c,caseStatus:u,runMode:x,isReadOnly:v,onRun:p,onBaseline:S,onCompare:y,onCancel:f}){const[b,g]=h.useState(!1),T=u==="running"||u==="queued",M=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:T?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:T?"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:["#",o," ",i]}),x&&(T||M)&&(()=>{const D=zv[x];return D?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:D.bg,color:D.color,padding:"1px 6px"},children:D.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T?n.jsx("button",{onClick:()=>f(o),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(o),disabled:v,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>p(o),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>S(o),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),c&&c.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:c.status==="pass"?"var(--green-muted)":(c.status==="error","var(--red-muted)"),color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.passRate!=null?`${Math.round(c.passRate*100)}%`:c.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),c&&c.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:c.assertions.map(D=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:D.pass?"var(--green)":"var(--red)"},children:D.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:D.text})]},D.assertion_id))}),c.output&&n.jsx("button",{onClick:()=>g(!b),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:b?"Hide output":"Show output"}),b&&c.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:c.output})]}),c&&c.errorMessage&&n.jsx(Ov,{errorMessage:c.errorMessage,classifiedError:c.classifiedError})]})}const $c={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Ov({errorMessage:i,classifiedError:o}){const[c,u]=h.useState(!1),x=(o==null?void 0:o.title)??"Error",v=o==null?void 0:o.hint,p=o?$c[o.category]??$c.unknown:$c.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:x}),n.jsx("button",{onClick:()=>u(!c),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:c?"Hide details":"Details"})]}),v&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:v}),c&&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 Ax({label:i,value:o,color:c}){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:c},children:[Math.round(o*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:`${o*100}%`,background:c}})})]})}const Rx={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)"}},Dv=[{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 Bv(){const{state:i,dispatch:o,runActivationTest:c,cancelActivation:u}=Ft(),{plugin:x,skill:v,activationPrompts:p,activationResults:S,activationSummary:y,activationRunning:f,activationError:b,activationStartedAt:g}=i,[T,M]=h.useState(p),[D,U]=h.useState(null);h.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:T})},[T,o]),h.useEffect(()=>{fetch(`/api/skills/${x}/${v}/description`).then(K=>K.json()).then(K=>U(K.rawContent||K.description||null)).catch(()=>U(null))},[x,v]);function Y(){c(T)}function G(K){const V=T.trim(),P=V?`${V}
|
|
61
|
-
${K.join(`
|
|
62
|
-
`)}`:K.join(`
|
|
63
|
-
`);M(P)}const W=T.trim().split(`
|
|
64
|
-
`).filter(Boolean).length,le=S.filter(K=>K.classification==="TP"||K.classification==="TN"),X=S.filter(K=>K.classification==="FP"||K.classification==="FN"),te=(D==null?void 0:D.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:Dv.map(K=>n.jsxs("button",{onClick:()=>G(K.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:V=>{V.currentTarget.style.color="var(--text-primary)",V.currentTarget.style.background="var(--surface-3)"},onMouseLeave:V=>{V.currentTarget.style.color="var(--text-tertiary)",V.currentTarget.style.background="var(--surface-2)"},children:["+ ",K.label]},K.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:T,onChange:K=>M(K.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:[W," prompt",W!==1?"s":""]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Y,disabled:f||!T.trim(),className:"btn btn-primary",children:f?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"]})}),f&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[S.length," / ",W," prompts tested",g&&n.jsx(Uv,{startedAt:g})]})]})]})]}),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:te?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Nr(te)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),b&&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:b}),f&&S.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..."})]}),S.length>0&&n.jsxs("div",{className:"space-y-5",children:[X.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 (",X.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:X.map((K,V)=>n.jsx(_x,{result:K},`incorrect-${V}`))})]}),le.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 (",le.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:le.map((K,V)=>n.jsx(_x,{result:K},`correct-${V}`))})]})]}),y&&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"}),y.autoClassifiedCount!=null&&y.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[y.autoClassifiedCount," of ",y.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(Jc,{label:"Precision",value:y.precision,description:"Of all activations, how many were correct?",detail:`${y.tp} true / ${y.tp+y.fp} total activations`}),n.jsx(Jc,{label:"Recall",value:y.recall,description:"Of expected activations, how many fired?",detail:`${y.tp} activated / ${y.tp+y.fn} expected`}),n.jsx(Jc,{label:"Reliability",value:y.reliability,description:"Overall correct classification rate",detail:`${y.tp+y.tn} correct / ${y.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:y.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(jr,{label:"False Positive",abbr:"FP",count:y.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(jr,{label:"False Negative",abbr:"FN",count:y.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:y.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 _x({result:i}){const o=Rx[i.classification]||Rx.FN,c=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:o.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, ${o.text} 20%, transparent)`},children:c?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:o.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:o.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:o.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 Jc({label:i,value:o,description:c,detail:u}){const x=Math.round(o*100),v=x>=80?"var(--green)":x>=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:v},children:[x,"%"]}),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:c}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function jr({abbr:i,count:o,bg:c,color:u,description:x}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:c},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:o}),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:x})]})}function Uv({startedAt:i}){const[o,c]=h.useState(0);return h.useEffect(()=>{const u=setInterval(()=>c(Math.floor((Date.now()-i)/1e3)),1e3);return()=>clearInterval(u)},[i]),n.jsxs("span",{className:"ml-2",children:["(",o,"s)"]})}const Wc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},Mx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},ao=600,no=180,vt=40,Fc=ao-vt*2,Pl=no-vt*2,Hv=[25,50,75,100];function zx(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function qv(i){return i==null?"--":`${(i/1e3).toFixed(1)}s`}function Gv({entries:i,onPointClick:o}){const[c,u]=h.useState(null),x=h.useMemo(()=>[...i].reverse(),[i]);if(x.length<2)return null;const v=x.length,p=x.map((f,b)=>{const g=vt+b/(v-1)*Fc,T=f.passRate*100,M=vt+Pl-T/100*Pl;return{x:g,y:M,pct:T,entry:f}}),S=p.map(f=>`${f.x},${f.y}`).join(" "),y=Array.from(new Set(x.map(f=>f.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative",overflowX:v>=20?"auto":void 0},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:y.map(f=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Wc[f]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Mx[f]??f})]},f))}),n.jsxs("svg",{width:ao,height:no,viewBox:`0 0 ${ao} ${no}`,style:{display:"block",overflow:"visible"},children:[Hv.map(f=>{const b=vt+Pl-f/100*Pl;return n.jsxs("g",{children:[n.jsx("line",{x1:vt,y1:b,x2:vt+Fc,y2:b,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:vt-8,y:b+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[f,"%"]})]},f)}),n.jsx("line",{x1:vt,y1:vt+Pl,x2:vt+Fc,y2:vt+Pl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:vt-8,y:vt+Pl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:S,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((f,b)=>n.jsx("circle",{cx:f.x,cy:f.y,r:5,fill:Wc[f.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:g=>{g.currentTarget.setAttribute("r","7"),u({x:f.x,y:f.y,entry:f.entry})},onMouseLeave:g=>{g.currentTarget.setAttribute("r","5"),u(null)},onClick:()=>o==null?void 0:o(f.entry)},b)),Yv(v).map(f=>n.jsx("text",{x:p[f].x,y:vt+Pl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:zx(x[f].timestamp)},f))]}),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:zx(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:Wc[c.entry.type]??"var(--text-tertiary)",color:"#fff"},children:Mx[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),"%"]})]}),n.jsxs("div",{className:"text-[10px] mt-1.5 flex items-center gap-3",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:qv(c.entry.totalDurationMs)}),n.jsx("span",{children:c.entry.totalTokens!=null?`${c.entry.totalTokens} tokens`:"--"})]})]})]})}function Yv(i){if(i<=3)return Array.from({length:i},(u,x)=>x);if(i<=6)return[0,Math.floor(i/2),i-1];if(i<20)return[0,Math.floor(i/3),Math.floor(2*i/3),i-1];const o=Math.ceil(i/10),c=[0];for(let u=o;u<i-1;u+=o)c.push(u);return c.push(i-1),c}function Sr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Vv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function Qv({rate:i,label:o}){const c=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:o}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(i)},children:[c,"%"]})]}),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:`${c}%`,background:Sr(i)}})})]})})}function Xv({points:i}){if(i.length<2)return null;const o=200,c=48,u=4,x=i.length,v=i.map((y,f)=>{const b=u+f/(x-1)*(o-u*2),g=u+(c-u*2)-y.passRate*(c-u*2);return{x:b,y:g}}),p=`M ${v[0].x},${c-u} `+v.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${v[v.length-1].x},${c-u} Z`,S=v.map((y,f)=>`${f===0?"M":"L"} ${y.x},${y.y}`).join(" ");return n.jsxs("svg",{width:o,height:c,style:{display:"block"},children:[n.jsx("path",{d:p,fill:"var(--accent-muted)"}),n.jsx("path",{d:S,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:v[v.length-1].x,cy:v[v.length-1].y,r:3,fill:"var(--accent)"})]})}function Zv({plugin:i,skill:o}){const[c,u]=h.useState(null),[x,v]=h.useState(!0);if(h.useEffect(()=>{v(!0),ve.getStats(i,o).then(u).catch(()=>u(null)).finally(()=>v(!1))},[i,o]),x)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(!c||c.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=c.trendPoints.length>0?c.trendPoints[c.trendPoints.length-1].passRate:0,S=c.trendPoints.length>0?c.trendPoints[0].passRate:0,y=p-S,f=c.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:c.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:c.modelStats.length})]})]}),c.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(Xv,{points:c.trendPoints})]}),c.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:c.modelStats.map(b=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:b.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:b.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:Sr(b.avgPassRate)},children:[Math.round(b.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Vv(b.avgDurationMs)})]},b.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(b=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:g=>{g.currentTarget.style.background="var(--surface-2)"},onMouseLeave:g=>{g.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:["#",b.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:b.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[b.totalRuns," runs"]})]}),n.jsx(Qv,{rate:b.passRate,label:b.text})]},`${b.evalId}:${b.id}`))})]})]})}function Kv({plugin:i,skill:o}){const[c,u]=h.useState(null),[x,v]=h.useState(null),[p,S]=h.useState({}),[y,f]=h.useState({});h.useEffect(()=>{ve.getEvals(i,o).then(u).catch(()=>u(null))},[i,o]);async function b(g){if(x===g){v(null);return}if(v(g),!p[g]){f(T=>({...T,[g]:!0}));try{const T=await ve.getCaseHistory(i,o,g);S(M=>({...M,[g]:T}))}catch{S(T=>({...T,[g]:[]}))}finally{f(T=>({...T,[g]:!1}))}}}return c?n.jsx("div",{className:"space-y-2 stagger-children",children:c.evals.map(g=>{const T=p[g.id]||[],M=x===g.id,D=y[g.id],U=T.length>0?T[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>b(g.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:M?"var(--surface-2)":"transparent"},onMouseEnter:Y=>{M||(Y.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Y=>{M||(Y.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:M?"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:["#",g.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name}),T.length>=2&&n.jsx(Xx,{entries:T}),U!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:as(U)},children:[Math.round(U*100),"%"]}),T.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.length," runs"]})]}),M&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:D?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..."})]}):T.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:T.map((Y,G)=>n.jsxs("div",{className:"p-4",style:{background:G===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:Vx(Y.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Y.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:Y.type==="benchmark"?"rgba(99,131,255,0.15)":Y.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:Y.type==="benchmark"?"#6383ff":Y.type==="comparison"?"var(--purple)":"#fb923c"},children:Y.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:as(Y.pass_rate)},children:[Math.round(Y.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:[Y.durationMs!=null&&n.jsx("span",{children:Qx(Y.durationMs)}),Y.tokens!=null&&n.jsxs("span",{children:[Y.tokens>=1e3?`${(Y.tokens/1e3).toFixed(1)}k`:Y.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:Y.assertions.map(W=>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:W.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:W.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:W.text}),W.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:W.reasoning})]})]},W.id))})]},G))})})]},g.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 $v(){const{state:i,dispatch:o}=Ft(),{plugin:c,skill:u}=i,[x,v]=h.useState("timeline"),[p,S]=h.useState([]),[y,f]=h.useState(!0),[b,g]=h.useState(""),[T,M]=h.useState(""),[D,U]=h.useState(!1),[Y,G]=h.useState([]),[W,le]=h.useState(null),[X,te]=h.useState(!1),[K,V]=h.useState(null),[P,fe]=h.useState(!1);h.useEffect(()=>{f(!0),ve.getHistory(c,u,{model:b||void 0,type:T||void 0}).then(Z=>{S(Z),Z.length>=2&&ve.compareRuns(c,u,Z[0].timestamp,Z[1].timestamp).then(oe=>{const me=oe.regressions.filter(C=>C.change==="regression");o({type:"SET_REGRESSIONS",regressions:me})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[c,u,b,T]);const ke=h.useCallback(async Z=>{if(D){G(oe=>oe.includes(Z)?oe.filter(me=>me!==Z):oe.length>=2?[oe[1],Z]:[...oe,Z]);return}fe(!0);try{const oe=await ve.getHistoryEntry(c,u,Z);V(oe)}catch{}finally{fe(!1)}},[c,u,D]),we=h.useCallback(async()=>{if(Y.length===2){te(!0);try{const Z=await ve.compareRuns(c,u,Y[0],Y[1]);le(Z)}catch{}finally{te(!1)}}},[c,u,Y]),ye=[...new Set(p.map(Z=>Z.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(Z=>n.jsx("button",{onClick:()=>v(Z),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:x===Z?"var(--accent-muted)":"transparent",color:x===Z?"var(--accent)":"var(--text-tertiary)"},children:Z==="timeline"?"Timeline":Z==="per-eval"?"Per Eval":"Statistics"},Z))}),x==="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(Gv,{entries:p,onPointClick:Z=>ke(Z.timestamp)})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:b,onChange:Z=>g(Z.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ye.map(Z=>n.jsx("option",{value:Z,children:Z},Z))]}),n.jsxs("select",{value:T,onChange:Z=>M(Z.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:()=>{U(!D),G([]),le(null)},className:`btn text-[12px] ${D?"btn-primary":"btn-secondary"}`,children:D?"Exit Compare":"Compare Runs"}),D&&Y.length===2&&n.jsx("button",{onClick:we,disabled:X,className:"btn btn-primary text-[12px]",children:X?"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(Z=>{const oe=Y.includes(Z.timestamp);return n.jsx("button",{onClick:()=>ke(Z.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:oe?"var(--accent-muted)":"var(--surface-1)",border:oe?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:me=>{oe||(me.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:me=>{oe||(me.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:[D&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:oe?"var(--accent)":"var(--border-default)",background:oe?"var(--accent)":"transparent"},children:oe&&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(Z.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:Z.type==="comparison"?"var(--purple-muted)":Z.type==="baseline"?"var(--surface-3)":Z.type==="model-compare"?"rgba(56,189,248,0.15)":Z.type==="improve"||Z.type==="instruct"?"rgba(168,85,247,0.15)":Z.type==="ai-generate"?"rgba(34,197,94,0.15)":Z.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:Z.type==="comparison"?"var(--purple)":Z.type==="baseline"?"var(--text-tertiary)":Z.type==="model-compare"?"#38bdf8":Z.type==="improve"||Z.type==="instruct"?"#a855f7":Z.type==="ai-generate"?"#22c55e":Z.type==="eval-generate"?"#fb923c":"var(--accent)"},children:Z.type==="model-compare"?"model compare":Z.type==="improve"?"ai improve":Z.type==="instruct"?"ai edit":Z.type==="ai-generate"?"ai generate":Z.type==="eval-generate"?"eval generate":Z.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Z.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:Z.passRate>=.8?"var(--green)":Z.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(Z.passRate*100),"%"]})]})]})},Z.timestamp)})}),W&&n.jsx(Jv,{result:W}),K&&!D&&n.jsx(Wv,{run:K,onClose:()=>V(null)})]}),x==="per-eval"&&n.jsx(Kv,{plugin:c,skill:u}),x==="statistics"&&n.jsx(Zv,{plugin:c,skill:u})]})}function Jv({result:i}){const o=i.regressions.filter(u=>u.change==="regression"),c=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()]}),o.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 (",o.length,")"]}),o.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}`))]}),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(--green)"},children:["Improvements (",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(--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 Wv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Fv,{run:i,onClose:o}):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:o,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(c=>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:["#",c.eval_id," ",c.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.pass_rate!=null?`${Math.round(c.pass_rate*100)}%`:c.status})]})},c.eval_id))})]})}function Fv({run:i,onClose:o}){var v;const c=h.useMemo(()=>i.improve?Er(i.improve.original,i.improve.improved):[],[i.improve]),u=h.useMemo(()=>{const p=c.filter(y=>y.type==="added").length,S=c.filter(y=>y.type==="removed").length;return{added:p,removed:S}},[c]),x=h.useMemo(()=>{let p=0,S=0;return c.map(y=>y.type==="removed"?(p++,{...y,origNum:p,newNum:null}):y.type==="added"?(S++,{...y,origNum:null,newNum:S}):(p++,S++,{...y,origNum:p,newNum:S}))},[c]);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:o,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"})]})})]})]}),((v=i.improve)==null?void 0:v.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:x.map((p,S)=>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||""})]},S))})})})]})}function Iv({plugin:i,skill:o}){const[c,u]=h.useState([]),[x,v]=h.useState([]),[p,S]=h.useState(!0),[y,f]=h.useState(null);h.useEffect(()=>{ve.getDependencies(i,o).then(g=>{u(g.mcpDependencies),v(g.skillDependencies)}).catch(()=>{}).finally(()=>S(!1))},[i,o]);async function b(g,T){try{await navigator.clipboard.writeText(T),f(g),setTimeout(()=>f(null),2e3)}catch{}}return p?null:c.length===0&&x.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:c.length+x.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[c.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"}),c.map(g=>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:g.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.transport})]}),n.jsx("button",{onClick:()=>b(g.server,g.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:y===g.server?"var(--green)":"var(--accent)"},children:y===g.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:g.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.matchedTools.map(T=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:T},T))})]},g.server))]}),x.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:x.map(g=>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:g.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.source==="frontmatter"?"frontmatter":"referenced"})]},g.name))})]})]})]})}function Pv(){const{state:i}=Ft(),{plugin:o,skill:c}=i,[u,x]=h.useState(null),[v,p]=h.useState(!0);return h.useEffect(()=>{ve.getDependencies(o,c).then(x).catch(()=>{}).finally(()=>p(!1))},[o,c]),v?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(Iv,{plugin:o,skill:c})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}function ey({data:i}){if(i.length<2)return n.jsx("span",{style:{color:"var(--text-tertiary)",fontSize:10},children:"--"});const o=i.slice(-10),c=80,u=24,x=2,v=c-x*2,p=u-x*2,S=o.length,y=Math.min(...o),b=Math.max(...o)-y||1,g=o.map((D,U)=>{const Y=x+U/(S-1)*v,G=x+p-(D-y)/b*p;return`${Y.toFixed(1)},${G.toFixed(1)}`}),T=o[o.length-1],M=as(T);return n.jsxs("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,style:{display:"block"},children:[n.jsx("polyline",{points:g.join(" "),fill:"none",stroke:M,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),(()=>{const[D,U]=g[g.length-1].split(",");return n.jsx("circle",{cx:D,cy:U,r:2.5,fill:M})})()]})}function ty(){return n.jsxs("span",{className:"pill",style:{background:"rgba(251,191,36,0.15)",color:"#fbbf24",fontSize:9,fontWeight:700,gap:3},children:[n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"#fbbf24",stroke:"none",children:n.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),"Best Model"]})}function ly(i){var u,x;if(i.length===0)return[];const o=new Map;for(const v of i)for(const p of v.models){if(p.status==="error")continue;const S=`${p.provider}/${p.model}`;o.has(S)||o.set(S,{provider:p.provider,passRates:[],lastRubric:null,lastDuration:0,lastCost:null});const y=o.get(S);y.passRates.push(p.passRate.mean),y.lastRubric=((u=p.rubricScore)==null?void 0:u.mean)??null,y.lastDuration=p.duration.mean,y.lastCost=((x=p.cost)==null?void 0:x.total)??null}const c=[];for(const[v,p]of o){const[S,...y]=v.split("/");c.push({rank:0,model:y.join("/"),provider:S,passRate:p.passRates[p.passRates.length-1],rubricScore:p.lastRubric,duration:p.lastDuration,cost:p.lastCost,sparklineData:p.passRates,isBest:!1})}return c.sort((v,p)=>p.passRate-v.passRate),c.forEach((v,p)=>{v.rank=p+1}),c.length>0&&(c[0].isBest=!0),c}function ay(){const{state:i}=Ft(),{plugin:o,skill:c}=i,[u,x]=h.useState([]),[v,p]=h.useState(!0),[S,y]=h.useState(null);h.useEffect(()=>{p(!0),y(null),ve.getLeaderboard(o,c).then(b=>x(b.entries)).catch(b=>y(b instanceof Error?b.message:String(b))).finally(()=>p(!1))},[o,c]);const f=h.useMemo(()=>ly(u),[u]);return v?n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx("div",{className:"spinner spinner-lg"})}):S?n.jsx("div",{className:"flex items-center justify-center h-full px-8",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--red)"},children:"Failed to load leaderboard"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:S})]})}):f.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:"var(--accent-muted)"},children: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:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No sweep results yet"}),n.jsx("div",{className:"text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:"Run your first model sweep to compare performance across models:"}),n.jsx("div",{className:"text-[11px] font-mono px-4 py-3 rounded-lg text-left",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:'vskill eval sweep --models "anthropic/claude-sonnet-4,openrouter/meta-llama/llama-3.1-70b" --judge "anthropic/claude-sonnet-4"'})]})]}):n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("div",{className:"text-[15px] font-semibold",style:{color:"var(--text-primary)"},children:"Model Leaderboard"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[u.length," sweep",u.length!==1?"s":""," · ",f.length," model",f.length!==1?"s":""]})]}),n.jsx("div",{className:"glass-card",style:{overflow:"hidden"},children:n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[n.jsx("thead",{children:n.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["#","Model","Pass Rate","Rubric","Duration","Cost","Trend"].map(b=>n.jsx("th",{style:{padding:"10px 12px",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary)",textAlign:b==="#"?"center":"left",whiteSpace:"nowrap"},children:b},b))})}),n.jsx("tbody",{children:f.map(b=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:g=>{g.currentTarget.style.background="var(--surface-2)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[n.jsx("td",{style:{padding:"10px 12px",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--text-tertiary)",width:40},children:b.rank}),n.jsx("td",{style:{padding:"10px 12px"},children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.model}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:b.provider}),b.isBest&&n.jsx(ty,{})]})}),n.jsx("td",{style:{padding:"10px 12px"},children:n.jsxs("span",{className:"pill",style:{background:b.passRate>=.7?"var(--green-muted)":b.passRate>=.4?"var(--yellow-muted)":"var(--red-muted)",color:as(b.passRate),fontSize:11,fontWeight:600},children:[Math.round(b.passRate*100),"%"]})}),n.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:b.rubricScore!=null?b.rubricScore.toFixed(1):"--"}),n.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:b.duration<1e3?`${Math.round(b.duration)}ms`:`${(b.duration/1e3).toFixed(1)}s`}),n.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:b.cost!=null?`$${b.cost.toFixed(4)}`:"N/A"}),n.jsx("td",{style:{padding:"10px 12px"},children:n.jsx(ey,{data:b.sparklineData})})]},`${b.provider}/${b.model}`))})]})})]})}const ny=["editor","tests","run","activation","history","leaderboard","deps"];function sy(i){return i!=null&&ny.includes(i)}function ry(){const{state:i,dispatch:o,saveContent:c,isReadOnly:u}=Ft(),{refreshSkills:x,clearSelection:v}=ta(),p=h.useCallback(async()=>{try{await ve.deleteSkill(i.plugin,i.skill),x(),v()}catch(f){const b=f instanceof Error?f.message:String(f);o({type:"SET_ERROR",error:`Failed to delete skill: ${b}`})}},[i.plugin,i.skill,x,v,o]);h.useEffect(()=>{const b=new URLSearchParams(window.location.search).get("panel");sy(b)&&b!==i.activePanel&&o({type:"SET_PANEL",panel:b})},[]),h.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const b=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",b)},[i.activePanel]);const S=h.useCallback(f=>{const b=f.ctrlKey||f.metaKey;if(b&&f.key>="1"&&f.key<="7"){f.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","leaderboard","deps"][parseInt(f.key)-1]});return}if(b&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&c();return}},[i.isDirty,c,o]);if(h.useEffect(()=>(window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)),[S]),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(Xh,{state:i,isReadOnly:u,onDelete:u?void 0:p}),i.error&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"flex-1",children:i.error}),n.jsx("button",{onClick:()=>o({type:"SET_ERROR",error:null}),style:{background:"none",border:"none",cursor:"pointer",color:"var(--red)",padding:2},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("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx(Wh,{activePanel:i.activePanel,onPanelChange:f=>o({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(jv,{}),i.activePanel==="tests"&&n.jsx(kv,{}),i.activePanel==="run"&&n.jsx(Mv,{}),i.activePanel==="activation"&&n.jsx(Bv,{}),i.activePanel==="history"&&n.jsx($v,{}),i.activePanel==="leaderboard"&&n.jsx(ay,{}),i.activePanel==="deps"&&n.jsx(Pv,{})]},i.activePanel)})]})}function so(i,o=!0){let c=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(c=c.replace(/^-+|-+$/g,"")),c}function iy(i,o,c,u){const v=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${v}/${c}/skills/${u}/SKILL.md`;case 2:return`${v}/plugins/${c}/skills/${u}/SKILL.md`;case 3:return`${v}/skills/${u}/SKILL.md`}}function cy({onCreated:i,resolveAiConfigOverride:o}){const[c,u]=h.useState("ai"),[x,v]=h.useState(null),[p,S]=h.useState(!0),{config:y}=rn(),[f,b]=h.useState(""),[g,T]=h.useState(3),[M,D]=h.useState(""),[U,Y]=h.useState(""),[G,W]=h.useState(""),[le,X]=h.useState(""),[te,K]=h.useState(""),[V,P]=h.useState(""),[fe,ke]=h.useState("write"),[we,ye]=h.useState(!1),[Z,oe]=h.useState(null),[me,C]=h.useState(""),[E,$]=h.useState(!1),[Q,re]=h.useState(!1),[j,_]=h.useState(null),[J,ee]=h.useState(null),[ue,O]=h.useState([]),F=h.useRef(null),ae=h.useRef(null),ce=h.useRef(null),[Ae,Xe]=h.useState(!1),[Tt,Fe]=h.useState(!1);h.useEffect(()=>{ve.getProjectLayout().then(Ne=>{v(Ne),T(Ne.suggestedLayout);const I=Ne.detectedLayouts.find(Ve=>Ve.layout===Ne.suggestedLayout);I!=null&&I.existingPlugins.length&&D(I.existingPlugins[0])}).catch(()=>{}).finally(()=>S(!1))},[]),h.useEffect(()=>{var Ne;c==="ai"&&((Ne=F.current)==null||Ne.focus())},[c]),h.useEffect(()=>()=>{var Ne;(Ne=ae.current)==null||Ne.abort()},[]);const Ct=h.useMemo(()=>{var Ne;return x?((Ne=x.detectedLayouts.find(I=>I.layout===g))==null?void 0:Ne.existingPlugins)||[]:[]},[x,g]),xt=M==="__new__"?U:M,nl=x?iy(x.root,g,xt||"{plugin}",f||"{skill}"):"",cn=h.useMemo(()=>x?x.detectedLayouts.filter(Ne=>Ne.layout!==4):[],[x]),yt=h.useMemo(()=>{if(!x)return null;const Ne=x.detectedLayouts.find(Be=>Be.layout===2&&Be.existingPlugins.length>0),I=x.detectedLayouts.find(Be=>Be.layout===1&&Be.existingPlugins.length>0),Ve=Ne||I;return Ve?{layout:Ve.layout,plugins:Ve.existingPlugins}:null},[x]),Dt=h.useCallback(()=>{if(o)return o();if(!y)return{provider:"claude-cli",model:"sonnet"};const Ne=y.provider||"claude-cli";let I=y.model||"sonnet";return Ne==="claude-cli"&&I.startsWith("claude-")&&(I=I.replace("claude-","")),{provider:Ne,model:I}},[y,o]),Tl=h.useCallback(()=>{var Ne;(Ne=ae.current)==null||Ne.abort(),$(!1)},[]),sl=h.useCallback(()=>{_(null),ee(null)},[]),on=h.useCallback(async()=>{if(_(null),ee(null),O([]),ce.current=null,!me.trim()){_("Describe what your skill should do");return}$(!0);const Ne=new AbortController;ae.current=Ne;const{provider:I,model:Ve}=Dt();try{const Be=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:me.trim(),provider:I,model:Ve}),signal:Ne.signal});if(!Be.ok||!Be.body){let Bt=`HTTP ${Be.status}`;try{const Ze=await Be.json();Ze.error&&(Bt=Ze.error)}catch{}throw new Error(Bt)}const It=Be.body.getReader(),Cl=new TextDecoder;let mt="",Pt="";for(;;){const{done:Bt,value:Ze}=await It.read();if(Bt)break;mt+=Cl.decode(Ze,{stream:!0});const at=mt.split(`
|
|
69
|
-
`);mt=at.pop()||"";for(const Qe of at)if(Qe.startsWith("event: "))Pt=Qe.slice(7).trim();else if(Qe.startsWith("data: ")){try{const Ge=JSON.parse(Qe.slice(6));if(Pt==="progress")O(il=>[...il,{phase:Ge.phase,message:Ge.message,timestamp:Date.now()}]);else if(Pt==="done"||Pt==="complete"){const il={prompt:me.trim(),provider:Dt().provider,model:Dt().model,reasoning:Ge.reasoning||""};b(Ge.name),W(Ge.description),X(Ge.model||""),K(Ge.allowedTools||""),P(Ge.body),re(!0),ce.current=il,u("manual"),g===3&&yt&&Fe(!0);const wl={name:Ge.name,plugin:xt||"",layout:g,description:Ge.description,model:Ge.model||void 0,allowedTools:Ge.allowedTools||void 0,body:Ge.body,aiMeta:il};ve.saveDraft(wl).then(()=>{Xe(!0)}).catch(()=>{})}else Pt==="error"&&(_(Ge.message||Ge.description||"Unknown error"),Ge.category&&ee(Ge))}catch{}Pt=""}}}catch(Be){Be.name!=="AbortError"&&_(Be.message)}finally{$(!1),ae.current=null}},[me,Dt,g,yt,xt]),rl=h.useCallback(async()=>{if(oe(null),!f.trim()){oe("Skill name is required");return}if(!G.trim()){oe("Description is required");return}if(g!==3&&!xt.trim()){oe("Plugin name is required");return}ye(!0);try{const Ne=await ve.createSkill({name:so(f),plugin:xt||"",layout:g,description:G,model:le||void 0,allowedTools:te||void 0,body:V,aiMeta:ce.current||void 0});i(Ne.plugin,Ne.skill)}catch(Ne){oe(Ne.message)}finally{ye(!1)}},[f,G,g,xt,le,te,V,i]),it=h.useCallback(()=>{yt&&(T(yt.layout),D(yt.plugins[0]),Fe(!1))},[yt]);return{mode:c,setMode:u,layout:x,layoutLoading:p,selectedLayout:g,setSelectedLayout:T,creatableLayouts:cn,availablePlugins:Ct,pathPreview:nl,plugin:M,setPlugin:D,newPlugin:U,setNewPlugin:Y,effectivePlugin:xt,name:f,setName:b,description:G,setDescription:W,model:le,setModel:X,allowedTools:te,setAllowedTools:K,body:V,setBody:P,bodyViewMode:fe,setBodyViewMode:ke,aiPrompt:me,setAiPrompt:C,generating:E,aiGenerated:Q,aiError:j,aiClassifiedError:J,aiProgress:ue,promptRef:F,handleGenerate:on,handleCancelGenerate:Tl,clearAiError:sl,draftSaved:Ae,showPluginRecommendation:Tt,setShowPluginRecommendation:Fe,pluginLayoutInfo:yt,applyPluginRecommendation:it,creating:we,error:Z,handleCreate:rl}}function $x(){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 oy(){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 Jx({node:i,depth:o=0}){var c;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${o*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($x,{}):n.jsx(oy,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(c=i.children)==null?void 0:c.map(u=>n.jsx(Jx,{node:u,depth:o+1},u.name))]})}function uy(i,o,c){const u=[];o&&u.push({name:"evals.json",type:"file"}),u.push({name:"history",type:"dir"});const x=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:u}];return c&&x.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:x}}function dy({skillName:i,hasEvals:o,isDraft:c}){const u=uy(i,o,c);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($x,{})}),"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(Jx,{node:u})})]})}const ea={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Ic({size:i=14,color:o="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,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 fy({onCreated:i,onCancel:o}){const c=cy({onCreated:i});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:()=>c.setMode("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="ai"?"rgba(168,85,247,0.15)":"transparent",color:c.mode==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:c.mode==="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(Ic,{size:12}),"AI-Assisted"]})}),n.jsx("button",{onClick:()=>c.setMode("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:c.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:c.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"})]})})]}),c.layoutLoading&&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"})]}),!c.layoutLoading&&c.layout&&c.mode==="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(Ic,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:c.promptRef,value:c.aiPrompt,onChange:u=>c.setAiPrompt(u.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:c.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...ea,minHeight:"120px"},onKeyDown:u=>{u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),c.handleGenerate())}}),n.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),c.generating&&c.aiProgress.length>0&&n.jsx(ns,{entries:c.aiProgress,isRunning:!0}),c.aiError&&n.jsx("div",{children:c.aiClassifiedError?n.jsx(kr,{error:c.aiClassifiedError,onRetry:c.handleGenerate,onDismiss:c.clearAiError}):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:c.aiError}),n.jsx("button",{onClick:c.handleGenerate,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:[c.generating?n.jsx("button",{onClick:c.handleCancelGenerate,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:c.handleGenerate,disabled:!c.aiPrompt.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:c.aiPrompt.trim()?"#a855f7":"var(--surface-3)",color:c.aiPrompt.trim()?"#fff":"var(--text-tertiary)",cursor:c.aiPrompt.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Ic,{size:14}),"Generate"]}),n.jsx("button",{onClick:o,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"}),!c.generating&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>c.setMode("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!c.layoutLoading&&c.layout&&c.mode==="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"}),c.creatableLayouts.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:c.creatableLayouts.map(u=>n.jsx("button",{onClick:()=>{c.setSelectedLayout(u.layout),c.setPlugin(u.existingPlugins[0]||""),c.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:c.selectedLayout===u.layout?"var(--accent)":"var(--surface-3)",color:c.selectedLayout===u.layout?"#fff":"var(--text-secondary)",border:`1px solid ${c.selectedLayout===u.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:u.label},u.layout))})]}),c.selectedLayout!==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:c.plugin,onChange:u=>{c.setPlugin(u.target.value),c.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:ea,children:[c.availablePlugins.map(u=>n.jsx("option",{value:u,children:u},u)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),c.plugin==="__new__"&&n.jsx("input",{type:"text",value:c.newPlugin,onChange:u=>c.setNewPlugin(so(u.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:ea})]}),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:c.pathPreview})]}),c.showPluginRecommendation&&c.pluginLayoutInfo&&c.selectedLayout===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:c.pluginLayoutInfo.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.applyPluginRecommendation,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:()=>c.setShowPluginRecommendation(!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:c.name,onChange:u=>c.setName(so(u.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:ea})]}),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:c.description,onChange:u=>c.setDescription(u.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...ea,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:c.model,onChange:u=>c.setModel(u.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:ea,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:c.allowedTools,onChange:u=>c.setAllowedTools(u.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:ea})]})]})]}),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(u=>n.jsxs("button",{onClick:()=>c.setBodyViewMode(u),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:c.bodyViewMode===u?"var(--surface-4)":"transparent",color:c.bodyViewMode===u?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:c.bodyViewMode===u?600:400,border:"none",cursor:"pointer"},children:[u==="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:u==="write"?"Write":"Preview"})]},u))})]}),c.bodyViewMode==="write"?n.jsx("textarea",{value:c.body,onChange:u=>c.setBody(u.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:{...ea,minHeight:"150px"}}):c.body.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(c.body)}}):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(dy,{skillName:c.name||"{skill}",hasEvals:!1,isDraft:c.draftSaved}),c.error&&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:c.error}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:c.handleCreate,disabled:c.creating||!c.name||!c.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:c.creating||!c.name||!c.description?"var(--surface-3)":"var(--accent)",color:c.creating||!c.name||!c.description?"var(--text-tertiary)":"#fff",cursor:c.creating||!c.name||!c.description?"not-allowed":"pointer",border:"none"},children:c.creating?"Creating...":"Create Skill"}),n.jsx("button",{onClick:o,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 xy(){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 Pc({variant:i,message:o,onRetry:c}){const{setMode:u,setSearch:x}=ta(),[v,p]=h.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:v?n.jsx(xy,{}):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:S=>{S.currentTarget.style.opacity="0.9"},onMouseLeave:S=>{S.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:o||"Failed to load skill data"}),c&&n.jsx("button",{onClick:c,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:()=>x(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function Lx(){const{state:i,setMobileView:o}=ta();return i.isMobile?n.jsxs("button",{onClick:()=>o("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 py(){const{state:i,selectSkill:o,setMode:c,refreshSkills:u}=ta();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(Lx,{}),n.jsx(fy,{onCreated:(S,y)=>{c("browse"),u(),o({plugin:S,skill:y,origin:"source"})},onCancel:()=>c("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Pc,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Pc,{variant:"no-skills"}):n.jsx(Pc,{variant:"no-selection"});const{plugin:x,skill:v,origin:p}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(Lx,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Yh,{plugin:x,skill:v,origin:p,children:n.jsx(ry,{})},`${x}/${v}`)})]})}function my(){return n.jsx(kh,{children:n.jsx(Sh,{children:n.jsx(Th,{left:n.jsx(Lh,{}),right:n.jsx(py,{})})})})}yh.createRoot(document.getElementById("root")).render(n.jsx(h.StrictMode,{children:n.jsx(my,{})}));
|