vskill 0.3.0 → 0.4.0
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/find.test.js +48 -0
- package/dist/commands/find.test.js.map +1 -1
- package/dist/eval/__tests__/comparator.test.js +63 -0
- package/dist/eval/__tests__/comparator.test.js.map +1 -1
- package/dist/eval/comparator.d.ts +3 -2
- package/dist/eval/comparator.js +6 -3
- package/dist/eval/comparator.js.map +1 -1
- package/dist/eval-server/__tests__/sse-helpers.test.d.ts +1 -0
- package/dist/eval-server/__tests__/sse-helpers.test.js +128 -0
- package/dist/eval-server/__tests__/sse-helpers.test.js.map +1 -0
- package/dist/eval-server/api-routes.js +5 -7
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/sse-helpers.d.ts +10 -0
- package/dist/eval-server/sse-helpers.js +42 -0
- package/dist/eval-server/sse-helpers.js.map +1 -1
- package/dist/eval-ui/assets/index-CU39Pi0h.js +75 -0
- package/dist/eval-ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-BDZxYaAi.js +0 -73
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))o(m);new MutationObserver(m=>{for(const v of m)if(v.type==="childList")for(const h of v.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function d(m){const v={};return m.integrity&&(v.integrity=m.integrity),m.referrerPolicy&&(v.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?v.credentials="include":m.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function o(m){if(m.ep)return;m.ep=!0;const v=d(m);fetch(m.href,v)}})();var _c={exports:{}},Vn={};/**
|
|
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 Kf;function qp(){if(Kf)return Vn;Kf=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function d(o,m,v){var h=null;if(v!==void 0&&(h=""+v),m.key!==void 0&&(h=""+m.key),"key"in m){v={};for(var S in m)S!=="key"&&(v[S]=m[S])}else v=m;return m=v.ref,{$$typeof:r,type:o,key:h,ref:m!==void 0?m:null,props:v}}return Vn.Fragment=u,Vn.jsx=d,Vn.jsxs=d,Vn}var Jf;function Yp(){return Jf||(Jf=1,_c.exports=qp()),_c.exports}var n=Yp(),kc={exports:{}},oe={};/**
|
|
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 $f;function Gp(){if($f)return oe;$f=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),h=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),R=Symbol.iterator;function U(N){return N===null||typeof N!="object"?null:(N=R&&N[R]||N["@@iterator"],typeof N=="function"?N:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,X={};function ne(N,T,O){this.props=N,this.context=T,this.refs=X,this.updater=O||Y}ne.prototype.isReactComponent={},ne.prototype.setState=function(N,T){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,T,"setState")},ne.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function se(){}se.prototype=ne.prototype;function F(N,T,O){this.props=N,this.context=T,this.refs=X,this.updater=O||Y}var G=F.prototype=new se;G.constructor=F,Z(G,ne.prototype),G.isPureReactComponent=!0;var ee=Array.isArray;function J(){}var I={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function me(N,T,O){var q=O.ref;return{$$typeof:r,type:N,key:T,ref:q!==void 0?q:null,props:O}}function xe(N,T){return me(N.type,T,N.props)}function Ne(N){return typeof N=="object"&&N!==null&&N.$$typeof===r}function ye(N){var T={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(O){return T[O]})}var K=/\/+/g;function $(N,T){return typeof N=="object"&&N!==null&&N.key!=null?ye(""+N.key):T.toString(36)}function W(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(J,J):(N.status="pending",N.then(function(T){N.status==="pending"&&(N.status="fulfilled",N.value=T)},function(T){N.status==="pending"&&(N.status="rejected",N.reason=T)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function k(N,T,O,q,V){var te=typeof N;(te==="undefined"||te==="boolean")&&(N=null);var ce=!1;if(N===null)ce=!0;else switch(te){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(N.$$typeof){case r:case u:ce=!0;break;case j:return ce=N._init,k(ce(N._payload),T,O,q,V)}}if(ce)return V=V(N),ce=q===""?"."+$(N,0):q,ee(V)?(O="",ce!=null&&(O=ce.replace(K,"$&/")+"/"),k(V,T,O,"",function(Bl){return Bl})):V!=null&&(Ne(V)&&(V=xe(V,O+(V.key==null||N&&N.key===V.key?"":(""+V.key).replace(K,"$&/")+"/")+ce)),T.push(V)),1;ce=0;var Ye=q===""?".":q+":";if(ee(N))for(var ze=0;ze<N.length;ze++)q=N[ze],te=Ye+$(q,ze),ce+=k(q,T,O,te,V);else if(ze=U(N),typeof ze=="function")for(N=ze.call(N),ze=0;!(q=N.next()).done;)q=q.value,te=Ye+$(q,ze++),ce+=k(q,T,O,te,V);else if(te==="object"){if(typeof N.then=="function")return k(W(N),T,O,q,V);throw T=String(N),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return ce}function w(N,T,O){if(N==null)return N;var q=[],V=0;return k(N,q,"","",function(te){return T.call(O,te,V++)}),q}function D(N){if(N._status===-1){var T=N._result;T=T(),T.then(function(O){(N._status===0||N._status===-1)&&(N._status=1,N._result=O)},function(O){(N._status===0||N._status===-1)&&(N._status=2,N._result=O)}),N._status===-1&&(N._status=0,N._result=T)}if(N._status===1)return N._result.default;throw N._result}var le=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},pe={map:w,forEach:function(N,T,O){w(N,function(){T.apply(this,arguments)},O)},count:function(N){var T=0;return w(N,function(){T++}),T},toArray:function(N){return w(N,function(T){return T})||[]},only:function(N){if(!Ne(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return oe.Activity=b,oe.Children=pe,oe.Component=ne,oe.Fragment=d,oe.Profiler=m,oe.PureComponent=F,oe.StrictMode=o,oe.Suspense=p,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,oe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return I.H.useMemoCache(N)}},oe.cache=function(N){return function(){return N.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(N,T,O){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var q=Z({},N.props),V=N.key;if(T!=null)for(te in T.key!==void 0&&(V=""+T.key),T)!P.call(T,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&T.ref===void 0||(q[te]=T[te]);var te=arguments.length-2;if(te===1)q.children=O;else if(1<te){for(var ce=Array(te),Ye=0;Ye<te;Ye++)ce[Ye]=arguments[Ye+2];q.children=ce}return me(N.type,V,q)},oe.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:v,_context:N},N},oe.createElement=function(N,T,O){var q,V={},te=null;if(T!=null)for(q in T.key!==void 0&&(te=""+T.key),T)P.call(T,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(V[q]=T[q]);var ce=arguments.length-2;if(ce===1)V.children=O;else if(1<ce){for(var Ye=Array(ce),ze=0;ze<ce;ze++)Ye[ze]=arguments[ze+2];V.children=Ye}if(N&&N.defaultProps)for(q in ce=N.defaultProps,ce)V[q]===void 0&&(V[q]=ce[q]);return me(N,te,V)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(N){return{$$typeof:S,render:N}},oe.isValidElement=Ne,oe.lazy=function(N){return{$$typeof:j,_payload:{_status:-1,_result:N},_init:D}},oe.memo=function(N,T){return{$$typeof:x,type:N,compare:T===void 0?null:T}},oe.startTransition=function(N){var T=I.T,O={};I.T=O;try{var q=N(),V=I.S;V!==null&&V(O,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(J,le)}catch(te){le(te)}finally{T!==null&&O.types!==null&&(T.types=O.types),I.T=T}},oe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},oe.use=function(N){return I.H.use(N)},oe.useActionState=function(N,T,O){return I.H.useActionState(N,T,O)},oe.useCallback=function(N,T){return I.H.useCallback(N,T)},oe.useContext=function(N){return I.H.useContext(N)},oe.useDebugValue=function(){},oe.useDeferredValue=function(N,T){return I.H.useDeferredValue(N,T)},oe.useEffect=function(N,T){return I.H.useEffect(N,T)},oe.useEffectEvent=function(N){return I.H.useEffectEvent(N)},oe.useId=function(){return I.H.useId()},oe.useImperativeHandle=function(N,T,O){return I.H.useImperativeHandle(N,T,O)},oe.useInsertionEffect=function(N,T){return I.H.useInsertionEffect(N,T)},oe.useLayoutEffect=function(N,T){return I.H.useLayoutEffect(N,T)},oe.useMemo=function(N,T){return I.H.useMemo(N,T)},oe.useOptimistic=function(N,T){return I.H.useOptimistic(N,T)},oe.useReducer=function(N,T,O){return I.H.useReducer(N,T,O)},oe.useRef=function(N){return I.H.useRef(N)},oe.useState=function(N){return I.H.useState(N)},oe.useSyncExternalStore=function(N,T,O){return I.H.useSyncExternalStore(N,T,O)},oe.useTransition=function(){return I.H.useTransition()},oe.version="19.2.4",oe}var Wf;function Kc(){return Wf||(Wf=1,kc.exports=Gp()),kc.exports}var y=Kc(),Rc={exports:{}},Qn={},Mc={exports:{}},wc={};/**
|
|
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 Ff;function Vp(){return Ff||(Ff=1,(function(r){function u(k,w){var D=k.length;k.push(w);e:for(;0<D;){var le=D-1>>>1,pe=k[le];if(0<m(pe,w))k[le]=w,k[D]=pe,D=le;else break e}}function d(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var w=k[0],D=k.pop();if(D!==w){k[0]=D;e:for(var le=0,pe=k.length,N=pe>>>1;le<N;){var T=2*(le+1)-1,O=k[T],q=T+1,V=k[q];if(0>m(O,D))q<pe&&0>m(V,O)?(k[le]=V,k[q]=D,le=q):(k[le]=O,k[T]=D,le=T);else if(q<pe&&0>m(V,D))k[le]=V,k[q]=D,le=q;else break e}}return w}function m(k,w){var D=k.sortIndex-w.sortIndex;return D!==0?D:k.id-w.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;r.unstable_now=function(){return v.now()}}else{var h=Date,S=h.now();r.unstable_now=function(){return h.now()-S}}var p=[],x=[],j=1,b=null,R=3,U=!1,Y=!1,Z=!1,X=!1,ne=typeof setTimeout=="function"?setTimeout:null,se=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function G(k){for(var w=d(x);w!==null;){if(w.callback===null)o(x);else if(w.startTime<=k)o(x),w.sortIndex=w.expirationTime,u(p,w);else break;w=d(x)}}function ee(k){if(Z=!1,G(k),!Y)if(d(p)!==null)Y=!0,J||(J=!0,ye());else{var w=d(x);w!==null&&W(ee,w.startTime-k)}}var J=!1,I=-1,P=5,me=-1;function xe(){return X?!0:!(r.unstable_now()-me<P)}function Ne(){if(X=!1,J){var k=r.unstable_now();me=k;var w=!0;try{e:{Y=!1,Z&&(Z=!1,se(I),I=-1),U=!0;var D=R;try{t:{for(G(k),b=d(p);b!==null&&!(b.expirationTime>k&&xe());){var le=b.callback;if(typeof le=="function"){b.callback=null,R=b.priorityLevel;var pe=le(b.expirationTime<=k);if(k=r.unstable_now(),typeof pe=="function"){b.callback=pe,G(k),w=!0;break t}b===d(p)&&o(p),G(k)}else o(p);b=d(p)}if(b!==null)w=!0;else{var N=d(x);N!==null&&W(ee,N.startTime-k),w=!1}}break e}finally{b=null,R=D,U=!1}w=void 0}}finally{w?ye():J=!1}}}var ye;if(typeof F=="function")ye=function(){F(Ne)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,$=K.port2;K.port1.onmessage=Ne,ye=function(){$.postMessage(null)}}else ye=function(){ne(Ne,0)};function W(k,w){I=ne(function(){k(r.unstable_now())},w)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return R},r.unstable_next=function(k){switch(R){case 1:case 2:case 3:var w=3;break;default:w=R}var D=R;R=w;try{return k()}finally{R=D}},r.unstable_requestPaint=function(){X=!0},r.unstable_runWithPriority=function(k,w){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var D=R;R=k;try{return w()}finally{R=D}},r.unstable_scheduleCallback=function(k,w,D){var le=r.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?le+D:le):D=le,k){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=D+pe,k={id:j++,callback:w,priorityLevel:k,startTime:D,expirationTime:pe,sortIndex:-1},D>le?(k.sortIndex=D,u(x,k),d(p)===null&&k===d(x)&&(Z?(se(I),I=-1):Z=!0,W(ee,D-le))):(k.sortIndex=pe,u(p,k),Y||U||(Y=!0,J||(J=!0,ye()))),k},r.unstable_shouldYield=xe,r.unstable_wrapCallback=function(k){var w=R;return function(){var D=R;R=w;try{return k.apply(this,arguments)}finally{R=D}}}})(wc)),wc}var If;function Qp(){return If||(If=1,Mc.exports=Vp()),Mc.exports}var zc={exports:{}},at={};/**
|
|
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 Pf;function Xp(){if(Pf)return at;Pf=1;var r=Kc();function u(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)x+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var o={d:{f:d,r:function(){throw Error(u(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},m=Symbol.for("react.portal");function v(p,x,j){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:b==null?null:""+b,children:p,containerInfo:x,implementation:j}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,at.createPortal=function(p,x){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(u(299));return v(p,x,null,j)},at.flushSync=function(p){var x=h.T,j=o.p;try{if(h.T=null,o.p=2,p)return p()}finally{h.T=x,o.p=j,o.d.f()}},at.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(p,x))},at.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},at.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var j=x.as,b=S(j,x.crossOrigin),R=typeof x.integrity=="string"?x.integrity:void 0,U=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;j==="style"?o.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:b,integrity:R,fetchPriority:U}):j==="script"&&o.d.X(p,{crossOrigin:b,integrity:R,fetchPriority:U,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},at.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var j=S(x.as,x.crossOrigin);o.d.M(p,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(p)},at.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var j=x.as,b=S(j,x.crossOrigin);o.d.L(p,j,{crossOrigin:b,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},at.preloadModule=function(p,x){if(typeof p=="string")if(x){var j=S(x.as,x.crossOrigin);o.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(p)},at.requestFormReset=function(p){o.d.r(p)},at.unstable_batchedUpdates=function(p,x){return p(x)},at.useFormState=function(p,x,j){return h.H.useFormState(p,x,j)},at.useFormStatus=function(){return h.H.useHostTransitionStatus()},at.version="19.2.4",at}var em;function Zp(){if(em)return zc.exports;em=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(u){console.error(u)}}return r(),zc.exports=Xp(),zc.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 tm;function Kp(){if(tm)return Qn;tm=1;var r=Qp(),u=Kc(),d=Zp();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function 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 h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function 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 p(e){if(v(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var i=s.alternate;if(i===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===l)return p(s),e;if(i===a)return p(s),t;i=i.sibling}throw Error(o(188))}if(l.return!==a.return)l=s,a=i;else{for(var c=!1,f=s.child;f;){if(f===l){c=!0,l=s,a=i;break}if(f===a){c=!0,a=s,l=i;break}f=f.sibling}if(!c){for(f=i.child;f;){if(f===l){c=!0,l=i,a=s;break}if(f===a){c=!0,a=i,l=s;break}f=f.sibling}if(!c)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,R=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),Y=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),F=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),Ne=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=Ne&&e[Ne]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case ne:return"Profiler";case X:return"StrictMode";case ee:return"Suspense";case J:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Y:return"Portal";case F:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var W=Array.isArray,k=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},le=[],pe=-1;function N(e){return{current:e}}function T(e){0>pe||(e.current=le[pe],le[pe]=null,pe--)}function O(e,t){pe++,le[pe]=e.current,e.current=t}var q=N(null),V=N(null),te=N(null),ce=N(null);function Ye(e,t){switch(O(te,t),O(V,e),O(q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?hf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=hf(t),e=vf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}T(q),O(q,e)}function ze(){T(q),T(V),T(te)}function Bl(e){e.memoizedState!==null&&O(ce,e);var t=q.current,l=vf(t,e.type);t!==l&&(O(V,e),O(q,l))}function cl(e){V.current===e&&(T(q),T(V)),ce.current===e&&(T(ce),Hn._currentValue=D)}var Za,Ka;function Lt(e){if(Za===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Za=t&&t[1]||"",Ka=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Za+e+Ka}var Ja=!1;function $a(e,t){if(!e||Ja)return"";Ja=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(z){var M=z}Reflect.construct(e,[],H)}else{try{H.call()}catch(z){M=z}e.call(H.prototype)}}else{try{throw Error()}catch(z){M=z}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(z){if(z&&M&&typeof z.stack=="string")return[z.stack,M.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 i=a.DetermineComponentFrameRoot(),c=i[0],f=i[1];if(c&&f){var g=c.split(`
|
|
44
|
-
`),_=f.split(`
|
|
45
|
-
`);for(s=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(a===g.length||s===_.length)for(a=g.length-1,s=_.length-1;1<=a&&0<=s&&g[a]!==_[s];)s--;for(;1<=a&&0<=s;a--,s--)if(g[a]!==_[s]){if(a!==1||s!==1)do if(a--,s--,0>s||g[a]!==_[s]){var L=`
|
|
46
|
-
`+g[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=s);break}}}finally{Ja=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Lt(l):""}function na(e,t){switch(e.tag){case 26:case 27:case 5:return Lt(e.type);case 16:return Lt("Lazy");case 13:return e.child!==t&&t!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return $a(e.type,!1);case 11:return $a(e.type.render,!1);case 1:return $a(e.type,!0);case 31:return Lt("Activity");default:return""}}function Zn(e){try{var t="",l=null;do t+=na(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var Q=Object.prototype.hasOwnProperty,Oe=r.unstable_scheduleCallback,ul=r.unstable_cancelCallback,Kn=r.unstable_shouldYield,Gt=r.unstable_requestPaint,nt=r.unstable_now,xi=r.unstable_getCurrentPriorityLevel,sa=r.unstable_ImmediatePriority,Vt=r.unstable_UserBlockingPriority,ia=r.unstable_NormalPriority,pi=r.unstable_LowPriority,Wa=r.unstable_IdlePriority,ra=r.log,lt=r.unstable_setDisableYieldValue,Ul=null,xt=null;function ol(e){if(typeof ra=="function"&<(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(Ul,e)}catch{}}var pt=Math.clz32?Math.clz32:Cm,Em=Math.log,Tm=Math.LN2;function Cm(e){return e>>>=0,e===0?32:31-(Em(e)/Tm|0)|0}var Jn=256,$n=262144,Wn=4194304;function Hl(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 Fn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~i,a!==0?s=Hl(a):(c&=f,c!==0?s=Hl(c):l||(l=f&~e,l!==0&&(s=Hl(l))))):(f=a&~i,f!==0?s=Hl(f):c!==0?s=Hl(c):l||(l=a&~e,l!==0&&(s=Hl(l)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:s}function Fa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Am(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 $c(){var e=Wn;return Wn<<=1,(Wn&62914560)===0&&(Wn=4194304),e}function hi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ia(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _m(e,t,l,a,s,i){var c=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 f=e.entanglements,g=e.expirationTimes,_=e.hiddenUpdates;for(l=c&~l;0<l;){var L=31-pt(l),H=1<<L;f[L]=0,g[L]=-1;var M=_[L];if(M!==null)for(_[L]=null,L=0;L<M.length;L++){var z=M[L];z!==null&&(z.lane&=-536870913)}l&=~H}a!==0&&Wc(e,a,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(c&~t))}function Wc(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-pt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Fc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-pt(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function Ic(e,t){var l=t&-t;return l=(l&42)!==0?1:vi(l),(l&(e.suspendedLanes|t))!==0?0:l}function vi(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 yi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Pc(){var e=w.p;return e!==0?e:(e=window.event,e===void 0?32:qf(e.type))}function eu(e,t){var l=w.p;try{return w.p=e,t()}finally{w.p=l}}var dl=Math.random().toString(36).slice(2),Fe="__reactFiber$"+dl,rt="__reactProps$"+dl,ca="__reactContainer$"+dl,gi="__reactEvents$"+dl,km="__reactListeners$"+dl,Rm="__reactHandles$"+dl,tu="__reactResources$"+dl,Pa="__reactMarker$"+dl;function bi(e){delete e[Fe],delete e[rt],delete e[gi],delete e[km],delete e[Rm]}function ua(e){var t=e[Fe];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ca]||l[Fe]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Ef(e);e!==null;){if(l=e[Fe])return l;e=Ef(e)}return t}e=l,l=e.parentNode}return null}function oa(e){if(e=e[Fe]||e[ca]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function en(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function da(e){var t=e[tu];return t||(t=e[tu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[Pa]=!0}var lu=new Set,au={};function ql(e,t){fa(e,t),fa(e+"Capture",t)}function fa(e,t){for(au[e]=t,e=0;e<t.length;e++)lu.add(t[e])}var Mm=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]*$"),nu={},su={};function wm(e){return Q.call(su,e)?!0:Q.call(nu,e)?!1:Mm.test(e)?su[e]=!0:(nu[e]=!0,!1)}function In(e,t,l){if(wm(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 Pn(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 Qt(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 Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function iu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zm(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,i=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(c){l=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ji(e){if(!e._valueTracker){var t=iu(e)?"checked":"value";e._valueTracker=zm(e,t,""+e[t])}}function ru(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=iu(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function es(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 Om=/[\n"\\]/g;function Et(e){return e.replace(Om,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Si(e,t,l,a,s,i,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Ni(e,c,Nt(t)):l!=null?Ni(e,c,Nt(l)):a!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+Nt(f):e.removeAttribute("name")}function cu(e,t,l,a,s,i,c,f){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){ji(e);return}l=l!=null?""+Nt(l):"",t=t!=null?""+Nt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),ji(e)}function Ni(e,t,l){t==="number"&&es(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ma(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=""+Nt(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 uu(e,t,l){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Nt(l):""}function ou(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(W(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Nt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),ji(e)}function xa(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Dm=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 du(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||Dm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function fu(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(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&&du(e,s,a)}else for(var i in t)t.hasOwnProperty(i)&&du(e,i,t[i])}function Ei(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 Lm=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"]]),Bm=/^[\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 ts(e){return Bm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xt(){}var Ti=null;function Ci(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pa=null,ha=null;function mu(e){var t=oa(e);if(t&&(e=t.stateNode)){var l=e[rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Si(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="'+Et(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[rt]||null;if(!s)throw Error(o(90));Si(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&&ru(a)}break e;case"textarea":uu(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&ma(e,!!l.multiple,t,!1)}}}var Ai=!1;function xu(e,t,l){if(Ai)return e(t,l);Ai=!0;try{var a=e(t);return a}finally{if(Ai=!1,(pa!==null||ha!==null)&&(Gs(),pa&&(t=pa,e=ha,ha=pa=null,mu(t),e)))for(t=0;t<e.length;t++)mu(e[t])}}function tn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[rt]||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(o(231,t,typeof l));return l}var Zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_i=!1;if(Zt)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){_i=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{_i=!1}var fl=null,ki=null,ls=null;function pu(){if(ls)return ls;var e,t=ki,l=t.length,a,s="value"in fl?fl.value:fl.textContent,i=s.length;for(e=0;e<l&&t[e]===s[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===s[i-a];a++);return ls=s.slice(e,1<a?1-a:void 0)}function as(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 ns(){return!0}function hu(){return!1}function ct(e){function t(l,a,s,i,c){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(i):i[f]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ns:hu,this.isPropagationStopped=hu,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ns)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ns)},persist:function(){},isPersistent:ns}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ss=ct(Yl),an=b({},Yl,{view:0,detail:0}),Um=ct(an),Ri,Mi,nn,is=b({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zi,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!==nn&&(nn&&e.type==="mousemove"?(Ri=e.screenX-nn.screenX,Mi=e.screenY-nn.screenY):Mi=Ri=0,nn=e),Ri)},movementY:function(e){return"movementY"in e?e.movementY:Mi}}),vu=ct(is),Hm=b({},is,{dataTransfer:0}),qm=ct(Hm),Ym=b({},an,{relatedTarget:0}),wi=ct(Ym),Gm=b({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),Vm=ct(Gm),Qm=b({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Xm=ct(Qm),Zm=b({},Yl,{data:0}),yu=ct(Zm),Km={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jm={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"},$m={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$m[e])?!!t[e]:!1}function zi(){return Wm}var Fm=b({},an,{key:function(e){if(e.key){var t=Km[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=as(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zi,charCode:function(e){return e.type==="keypress"?as(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?as(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Im=ct(Fm),Pm=b({},is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gu=ct(Pm),ex=b({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zi}),tx=ct(ex),lx=b({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),ax=ct(lx),nx=b({},is,{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}),sx=ct(nx),ix=b({},Yl,{newState:0,oldState:0}),rx=ct(ix),cx=[9,13,27,32],Oi=Zt&&"CompositionEvent"in window,sn=null;Zt&&"documentMode"in document&&(sn=document.documentMode);var ux=Zt&&"TextEvent"in window&&!sn,bu=Zt&&(!Oi||sn&&8<sn&&11>=sn),ju=" ",Su=!1;function Nu(e,t){switch(e){case"keyup":return cx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function ox(e,t){switch(e){case"compositionend":return Eu(t);case"keypress":return t.which!==32?null:(Su=!0,ju);case"textInput":return e=t.data,e===ju&&Su?null:e;default:return null}}function dx(e,t){if(va)return e==="compositionend"||!Oi&&Nu(e,t)?(e=pu(),ls=ki=fl=null,va=!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 bu&&t.locale!=="ko"?null:t.data;default:return null}}var fx={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 Tu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fx[e.type]:t==="textarea"}function Cu(e,t,l,a){pa?ha?ha.push(a):ha=[a]:pa=a,t=$s(t,"onChange"),0<t.length&&(l=new ss("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var rn=null,cn=null;function mx(e){of(e,0)}function rs(e){var t=en(e);if(ru(t))return e}function Au(e,t){if(e==="change")return t}var _u=!1;if(Zt){var Di;if(Zt){var Li="oninput"in document;if(!Li){var ku=document.createElement("div");ku.setAttribute("oninput","return;"),Li=typeof ku.oninput=="function"}Di=Li}else Di=!1;_u=Di&&(!document.documentMode||9<document.documentMode)}function Ru(){rn&&(rn.detachEvent("onpropertychange",Mu),cn=rn=null)}function Mu(e){if(e.propertyName==="value"&&rs(cn)){var t=[];Cu(t,cn,e,Ci(e)),xu(mx,t)}}function xx(e,t,l){e==="focusin"?(Ru(),rn=t,cn=l,rn.attachEvent("onpropertychange",Mu)):e==="focusout"&&Ru()}function px(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rs(cn)}function hx(e,t){if(e==="click")return rs(t)}function vx(e,t){if(e==="input"||e==="change")return rs(t)}function yx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ht=typeof Object.is=="function"?Object.is:yx;function un(e,t){if(ht(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(!Q.call(t,s)||!ht(e[s],t[s]))return!1}return!0}function wu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zu(e,t){var l=wu(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=wu(l)}}function Ou(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ou(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Du(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=es(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=es(e.document)}return t}function Bi(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 gx=Zt&&"documentMode"in document&&11>=document.documentMode,ya=null,Ui=null,on=null,Hi=!1;function Lu(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hi||ya==null||ya!==es(a)||(a=ya,"selectionStart"in a&&Bi(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}),on&&un(on,a)||(on=a,a=$s(Ui,"onSelect"),0<a.length&&(t=new ss("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ya)))}function Gl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ga={animationend:Gl("Animation","AnimationEnd"),animationiteration:Gl("Animation","AnimationIteration"),animationstart:Gl("Animation","AnimationStart"),transitionrun:Gl("Transition","TransitionRun"),transitionstart:Gl("Transition","TransitionStart"),transitioncancel:Gl("Transition","TransitionCancel"),transitionend:Gl("Transition","TransitionEnd")},qi={},Bu={};Zt&&(Bu=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function Vl(e){if(qi[e])return qi[e];if(!ga[e])return e;var t=ga[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Bu)return qi[e]=t[l];return e}var Uu=Vl("animationend"),Hu=Vl("animationiteration"),qu=Vl("animationstart"),bx=Vl("transitionrun"),jx=Vl("transitionstart"),Sx=Vl("transitioncancel"),Yu=Vl("transitionend"),Gu=new Map,Yi="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(" ");Yi.push("scrollEnd");function zt(e,t){Gu.set(e,t),ql(t,[e])}var cs=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)},Tt=[],ba=0,Gi=0;function us(){for(var e=ba,t=Gi=ba=0;t<e;){var l=Tt[t];Tt[t++]=null;var a=Tt[t];Tt[t++]=null;var s=Tt[t];Tt[t++]=null;var i=Tt[t];if(Tt[t++]=null,a!==null&&s!==null){var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}i!==0&&Vu(l,s,i)}}function os(e,t,l,a){Tt[ba++]=e,Tt[ba++]=t,Tt[ba++]=l,Tt[ba++]=a,Gi|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Vi(e,t,l,a){return os(e,t,l,a),ds(e)}function Ql(e,t){return os(e,null,null,t),ds(e)}function Vu(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,i=e.return;i!==null;)i.childLanes|=l,a=i.alternate,a!==null&&(a.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-pt(l),e=i.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),i):null}function ds(e){if(50<wn)throw wn=0,Ir=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ja={};function Nx(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 vt(e,t,l,a){return new Nx(e,t,l,a)}function Qi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kt(e,t){var l=e.alternate;return l===null?(l=vt(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 Qu(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 fs(e,t,l,a,s,i){var c=0;if(a=e,typeof e=="function")Qi(e)&&(c=1);else if(typeof e=="string")c=_p(e,l,q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=vt(31,l,t,s),e.elementType=me,e.lanes=i,e;case Z:return Xl(l.children,s,i,t);case X:c=8,s|=24;break;case ne:return e=vt(12,l,t,s|2),e.elementType=ne,e.lanes=i,e;case ee:return e=vt(13,l,t,s),e.elementType=ee,e.lanes=i,e;case J:return e=vt(19,l,t,s),e.elementType=J,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case F:c=10;break e;case se:c=9;break e;case G:c=11;break e;case I:c=14;break e;case P:c=16,a=null;break e}c=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=vt(c,l,t,s),t.elementType=e,t.type=a,t.lanes=i,t}function Xl(e,t,l,a){return e=vt(7,e,a,t),e.lanes=l,e}function Xi(e,t,l){return e=vt(6,e,null,t),e.lanes=l,e}function Xu(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Zi(e,t,l){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zu=new WeakMap;function Ct(e,t){if(typeof e=="object"&&e!==null){var l=Zu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Zn(t)},Zu.set(e,t),t)}return{value:e,source:t,stack:Zn(t)}}var Sa=[],Na=0,ms=null,dn=0,At=[],_t=0,ml=null,Bt=1,Ut="";function Jt(e,t){Sa[Na++]=dn,Sa[Na++]=ms,ms=e,dn=t}function Ku(e,t,l){At[_t++]=Bt,At[_t++]=Ut,At[_t++]=ml,ml=e;var a=Bt;e=Ut;var s=32-pt(a)-1;a&=~(1<<s),l+=1;var i=32-pt(t)+s;if(30<i){var c=s-s%5;i=(a&(1<<c)-1).toString(32),a>>=c,s-=c,Bt=1<<32-pt(t)+s|l<<s|a,Ut=i+e}else Bt=1<<i|l<<s|a,Ut=e}function Ki(e){e.return!==null&&(Jt(e,1),Ku(e,1,0))}function Ji(e){for(;e===ms;)ms=Sa[--Na],Sa[Na]=null,dn=Sa[--Na],Sa[Na]=null;for(;e===ml;)ml=At[--_t],At[_t]=null,Ut=At[--_t],At[_t]=null,Bt=At[--_t],At[_t]=null}function Ju(e,t){At[_t++]=Bt,At[_t++]=Ut,At[_t++]=ml,Bt=t.id,Ut=t.overflow,ml=e}var Ie=null,De=null,je=!1,xl=null,kt=!1,$i=Error(o(519));function pl(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fn(Ct(t,e)),$i}function $u(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[Fe]=e,t[rt]=a,l){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(l=0;l<On.length;l++)ve(On[l],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),cu(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),ou(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||xf(t.textContent,l)?(a.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),a.onScroll!=null&&ve("scroll",t),a.onScrollEnd!=null&&ve("scrollend",t),a.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||pl(e,!0)}function Wu(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:kt=!1;return;case 27:case 3:kt=!0;return;default:Ie=Ie.return}}function Ea(e){if(e!==Ie)return!1;if(!je)return Wu(e),je=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||mc(e.type,e.memoizedProps)),l=!l),l&&De&&pl(e),Wu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=Nf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));De=Nf(e)}else t===27?(t=De,kl(e.type)?(e=yc,yc=null,De=e):De=t):De=Ie?Mt(e.stateNode.nextSibling):null;return!0}function Zl(){De=Ie=null,je=!1}function Wi(){var e=xl;return e!==null&&(ft===null?ft=e:ft.push.apply(ft,e),xl=null),e}function fn(e){xl===null?xl=[e]:xl.push(e)}var Fi=N(null),Kl=null,$t=null;function hl(e,t,l){O(Fi,t._currentValue),t._currentValue=l}function Wt(e){e._currentValue=Fi.current,T(Fi)}function Ii(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Pi(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var c=s.child;i=i.firstContext;e:for(;i!==null;){var f=i;i=s;for(var g=0;g<t.length;g++)if(f.context===t[g]){i.lanes|=l,f=i.alternate,f!==null&&(f.lanes|=l),Ii(i.return,l,e),a||(c=null);break e}i=f.next}}else if(s.tag===18){if(c=s.return,c===null)throw Error(o(341));c.lanes|=l,i=c.alternate,i!==null&&(i.lanes|=l),Ii(c,l,e),c=null}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===e){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}}function Ta(e,t,l,a){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var c=s.alternate;if(c===null)throw Error(o(387));if(c=c.memoizedProps,c!==null){var f=s.type;ht(s.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(s===ce.current){if(c=s.alternate,c===null)throw Error(o(387));c.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Hn):e=[Hn])}s=s.return}e!==null&&Pi(t,e,l,a),t.flags|=262144}function xs(e){for(e=e.firstContext;e!==null;){if(!ht(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jl(e){Kl=e,$t=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return Fu(Kl,e)}function ps(e,t){return Kl===null&&Jl(e),Fu(e,t)}function Fu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},$t===null){if(e===null)throw Error(o(308));$t=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else $t=$t.next=t;return l}var Ex=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()})}},Tx=r.unstable_scheduleCallback,Cx=r.unstable_NormalPriority,Qe={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function er(){return{controller:new Ex,data:new Map,refCount:0}}function mn(e){e.refCount--,e.refCount===0&&Tx(Cx,function(){e.controller.abort()})}var xn=null,tr=0,Ca=0,Aa=null;function Ax(e,t){if(xn===null){var l=xn=[];tr=0,Ca=nc(),Aa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return tr++,t.then(Iu,Iu),t}function Iu(){if(--tr===0&&xn!==null){Aa!==null&&(Aa.status="fulfilled");var e=xn;xn=null,Ca=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _x(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 Pu=k.S;k.S=function(e,t){Bd=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ax(e,t),Pu!==null&&Pu(e,t)};var $l=N(null);function lr(){var e=$l.current;return e!==null?e:we.pooledCache}function hs(e,t){t===null?O($l,$l.current):O($l,t.pool)}function eo(){var e=lr();return e===null?null:{parent:Qe._currentValue,pool:e}}var _a=Error(o(460)),ar=Error(o(474)),vs=Error(o(542)),ys={then:function(){}};function to(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lo(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Xt,Xt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,no(e),e;default:if(typeof t.status=="string")t.then(Xt,Xt);else{if(e=we,e!==null&&100<e.shellSuspendCounter)throw Error(o(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,no(e),e}throw Fl=t,_a}}function Wl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Fl=l,_a):l}}var Fl=null;function ao(){if(Fl===null)throw Error(o(459));var e=Fl;return Fl=null,e}function no(e){if(e===_a||e===vs)throw Error(o(483))}var ka=null,pn=0;function gs(e){var t=pn;return pn+=1,ka===null&&(ka=[]),lo(ka,e,t)}function hn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function bs(e,t){throw t.$$typeof===R?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function so(e){function t(C,E){if(e){var A=C.deletions;A===null?(C.deletions=[E],C.flags|=16):A.push(E)}}function l(C,E){if(!e)return null;for(;E!==null;)t(C,E),E=E.sibling;return null}function a(C){for(var E=new Map;C!==null;)C.key!==null?E.set(C.key,C):E.set(C.index,C),C=C.sibling;return E}function s(C,E){return C=Kt(C,E),C.index=0,C.sibling=null,C}function i(C,E,A){return C.index=A,e?(A=C.alternate,A!==null?(A=A.index,A<E?(C.flags|=67108866,E):A):(C.flags|=67108866,E)):(C.flags|=1048576,E)}function c(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function f(C,E,A,B){return E===null||E.tag!==6?(E=Xi(A,C.mode,B),E.return=C,E):(E=s(E,A),E.return=C,E)}function g(C,E,A,B){var re=A.type;return re===Z?L(C,E,A.props.children,B,A.key):E!==null&&(E.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===P&&Wl(re)===E.type)?(E=s(E,A.props),hn(E,A),E.return=C,E):(E=fs(A.type,A.key,A.props,null,C.mode,B),hn(E,A),E.return=C,E)}function _(C,E,A,B){return E===null||E.tag!==4||E.stateNode.containerInfo!==A.containerInfo||E.stateNode.implementation!==A.implementation?(E=Zi(A,C.mode,B),E.return=C,E):(E=s(E,A.children||[]),E.return=C,E)}function L(C,E,A,B,re){return E===null||E.tag!==7?(E=Xl(A,C.mode,B,re),E.return=C,E):(E=s(E,A),E.return=C,E)}function H(C,E,A){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Xi(""+E,C.mode,A),E.return=C,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case U:return A=fs(E.type,E.key,E.props,null,C.mode,A),hn(A,E),A.return=C,A;case Y:return E=Zi(E,C.mode,A),E.return=C,E;case P:return E=Wl(E),H(C,E,A)}if(W(E)||ye(E))return E=Xl(E,C.mode,A,null),E.return=C,E;if(typeof E.then=="function")return H(C,gs(E),A);if(E.$$typeof===F)return H(C,ps(C,E),A);bs(C,E)}return null}function M(C,E,A,B){var re=E!==null?E.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return re!==null?null:f(C,E,""+A,B);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case U:return A.key===re?g(C,E,A,B):null;case Y:return A.key===re?_(C,E,A,B):null;case P:return A=Wl(A),M(C,E,A,B)}if(W(A)||ye(A))return re!==null?null:L(C,E,A,B,null);if(typeof A.then=="function")return M(C,E,gs(A),B);if(A.$$typeof===F)return M(C,E,ps(C,A),B);bs(C,A)}return null}function z(C,E,A,B,re){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return C=C.get(A)||null,f(E,C,""+B,re);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case U:return C=C.get(B.key===null?A:B.key)||null,g(E,C,B,re);case Y:return C=C.get(B.key===null?A:B.key)||null,_(E,C,B,re);case P:return B=Wl(B),z(C,E,A,B,re)}if(W(B)||ye(B))return C=C.get(A)||null,L(E,C,B,re,null);if(typeof B.then=="function")return z(C,E,A,gs(B),re);if(B.$$typeof===F)return z(C,E,A,ps(E,B),re);bs(E,B)}return null}function ae(C,E,A,B){for(var re=null,Ee=null,ie=E,fe=E=0,be=null;ie!==null&&fe<A.length;fe++){ie.index>fe?(be=ie,ie=null):be=ie.sibling;var Te=M(C,ie,A[fe],B);if(Te===null){ie===null&&(ie=be);break}e&&ie&&Te.alternate===null&&t(C,ie),E=i(Te,E,fe),Ee===null?re=Te:Ee.sibling=Te,Ee=Te,ie=be}if(fe===A.length)return l(C,ie),je&&Jt(C,fe),re;if(ie===null){for(;fe<A.length;fe++)ie=H(C,A[fe],B),ie!==null&&(E=i(ie,E,fe),Ee===null?re=ie:Ee.sibling=ie,Ee=ie);return je&&Jt(C,fe),re}for(ie=a(ie);fe<A.length;fe++)be=z(ie,C,fe,A[fe],B),be!==null&&(e&&be.alternate!==null&&ie.delete(be.key===null?fe:be.key),E=i(be,E,fe),Ee===null?re=be:Ee.sibling=be,Ee=be);return e&&ie.forEach(function(Ol){return t(C,Ol)}),je&&Jt(C,fe),re}function ue(C,E,A,B){if(A==null)throw Error(o(151));for(var re=null,Ee=null,ie=E,fe=E=0,be=null,Te=A.next();ie!==null&&!Te.done;fe++,Te=A.next()){ie.index>fe?(be=ie,ie=null):be=ie.sibling;var Ol=M(C,ie,Te.value,B);if(Ol===null){ie===null&&(ie=be);break}e&&ie&&Ol.alternate===null&&t(C,ie),E=i(Ol,E,fe),Ee===null?re=Ol:Ee.sibling=Ol,Ee=Ol,ie=be}if(Te.done)return l(C,ie),je&&Jt(C,fe),re;if(ie===null){for(;!Te.done;fe++,Te=A.next())Te=H(C,Te.value,B),Te!==null&&(E=i(Te,E,fe),Ee===null?re=Te:Ee.sibling=Te,Ee=Te);return je&&Jt(C,fe),re}for(ie=a(ie);!Te.done;fe++,Te=A.next())Te=z(ie,C,fe,Te.value,B),Te!==null&&(e&&Te.alternate!==null&&ie.delete(Te.key===null?fe:Te.key),E=i(Te,E,fe),Ee===null?re=Te:Ee.sibling=Te,Ee=Te);return e&&ie.forEach(function(Hp){return t(C,Hp)}),je&&Jt(C,fe),re}function Me(C,E,A,B){if(typeof A=="object"&&A!==null&&A.type===Z&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case U:e:{for(var re=A.key;E!==null;){if(E.key===re){if(re=A.type,re===Z){if(E.tag===7){l(C,E.sibling),B=s(E,A.props.children),B.return=C,C=B;break e}}else if(E.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===P&&Wl(re)===E.type){l(C,E.sibling),B=s(E,A.props),hn(B,A),B.return=C,C=B;break e}l(C,E);break}else t(C,E);E=E.sibling}A.type===Z?(B=Xl(A.props.children,C.mode,B,A.key),B.return=C,C=B):(B=fs(A.type,A.key,A.props,null,C.mode,B),hn(B,A),B.return=C,C=B)}return c(C);case Y:e:{for(re=A.key;E!==null;){if(E.key===re)if(E.tag===4&&E.stateNode.containerInfo===A.containerInfo&&E.stateNode.implementation===A.implementation){l(C,E.sibling),B=s(E,A.children||[]),B.return=C,C=B;break e}else{l(C,E);break}else t(C,E);E=E.sibling}B=Zi(A,C.mode,B),B.return=C,C=B}return c(C);case P:return A=Wl(A),Me(C,E,A,B)}if(W(A))return ae(C,E,A,B);if(ye(A)){if(re=ye(A),typeof re!="function")throw Error(o(150));return A=re.call(A),ue(C,E,A,B)}if(typeof A.then=="function")return Me(C,E,gs(A),B);if(A.$$typeof===F)return Me(C,E,ps(C,A),B);bs(C,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,E!==null&&E.tag===6?(l(C,E.sibling),B=s(E,A),B.return=C,C=B):(l(C,E),B=Xi(A,C.mode,B),B.return=C,C=B),c(C)):l(C,E)}return function(C,E,A,B){try{pn=0;var re=Me(C,E,A,B);return ka=null,re}catch(ie){if(ie===_a||ie===vs)throw ie;var Ee=vt(29,ie,null,C.mode);return Ee.lanes=B,Ee.return=C,Ee}finally{}}}var Il=so(!0),io=so(!1),vl=!1;function nr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sr(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 yl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ce&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=ds(e),Vu(e,null,l),t}return os(e,a,t,l),ds(e)}function vn(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,Fc(e,l)}}function ir(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?s=i=c:i=i.next=c,l=l.next}while(l!==null);i===null?s=i=t:i=i.next=t}else s=i=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 rr=!1;function yn(){if(rr){var e=Aa;if(e!==null)throw e}}function gn(e,t,l,a){rr=!1;var s=e.updateQueue;vl=!1;var i=s.firstBaseUpdate,c=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var g=f,_=g.next;g.next=null,c===null?i=_:c.next=_,c=g;var L=e.alternate;L!==null&&(L=L.updateQueue,f=L.lastBaseUpdate,f!==c&&(f===null?L.firstBaseUpdate=_:f.next=_,L.lastBaseUpdate=g))}if(i!==null){var H=s.baseState;c=0,L=_=g=null,f=i;do{var M=f.lane&-536870913,z=M!==f.lane;if(z?(ge&M)===M:(a&M)===M){M!==0&&M===Ca&&(rr=!0),L!==null&&(L=L.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var ae=e,ue=f;M=t;var Me=l;switch(ue.tag){case 1:if(ae=ue.payload,typeof ae=="function"){H=ae.call(Me,H,M);break e}H=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ue.payload,M=typeof ae=="function"?ae.call(Me,H,M):ae,M==null)break e;H=b({},H,M);break e;case 2:vl=!0}}M=f.callback,M!==null&&(e.flags|=64,z&&(e.flags|=8192),z=s.callbacks,z===null?s.callbacks=[M]:z.push(M))}else z={lane:M,tag:f.tag,payload:f.payload,callback:f.callback,next:null},L===null?(_=L=z,g=H):L=L.next=z,c|=M;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;z=f,f=z.next,z.next=null,s.lastBaseUpdate=z,s.shared.pending=null}}while(!0);L===null&&(g=H),s.baseState=g,s.firstBaseUpdate=_,s.lastBaseUpdate=L,i===null&&(s.shared.lanes=0),El|=c,e.lanes=c,e.memoizedState=H}}function ro(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function co(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)ro(l[e],t)}var Ra=N(null),js=N(0);function uo(e,t){e=sl,O(js,e),O(Ra,t),sl=e|t.baseLanes}function cr(){O(js,sl),O(Ra,Ra.current)}function ur(){sl=js.current,T(Ra),T(js)}var yt=N(null),Rt=null;function bl(e){var t=e.alternate;O(Ge,Ge.current&1),O(yt,e),Rt===null&&(t===null||Ra.current!==null||t.memoizedState!==null)&&(Rt=e)}function or(e){O(Ge,Ge.current),O(yt,e),Rt===null&&(Rt=e)}function oo(e){e.tag===22?(O(Ge,Ge.current),O(yt,e),Rt===null&&(Rt=e)):jl()}function jl(){O(Ge,Ge.current),O(yt,yt.current)}function gt(e){T(yt),Rt===e&&(Rt=null),T(Ge)}var Ge=N(0);function Ss(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||hc(l)||vc(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 Ft=0,de=null,ke=null,Xe=null,Ns=!1,Ma=!1,Pl=!1,Es=0,bn=0,wa=null,kx=0;function Ue(){throw Error(o(321))}function dr(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!ht(e[l],t[l]))return!1;return!0}function fr(e,t,l,a,s,i){return Ft=i,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Jo:Ar,Pl=!1,i=l(a,s),Pl=!1,Ma&&(i=mo(t,l,a,s)),fo(e),i}function fo(e){k.H=Nn;var t=ke!==null&&ke.next!==null;if(Ft=0,Xe=ke=de=null,Ns=!1,bn=0,wa=null,t)throw Error(o(300));e===null||Ze||(e=e.dependencies,e!==null&&xs(e)&&(Ze=!0))}function mo(e,t,l,a){de=e;var s=0;do{if(Ma&&(wa=null),bn=0,Ma=!1,25<=s)throw Error(o(301));if(s+=1,Xe=ke=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}k.H=$o,i=t(l,a)}while(Ma);return i}function Rx(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?jn(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(de.flags|=1024),t}function mr(){var e=Es!==0;return Es=0,e}function xr(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function pr(e){if(Ns){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ns=!1}Ft=0,Xe=ke=de=null,Ma=!1,bn=Es=0,wa=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ve(){if(ke===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Xe===null?de.memoizedState:Xe.next;if(t!==null)Xe=t,ke=e;else{if(e===null)throw de.alternate===null?Error(o(467)):Error(o(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jn(e){var t=bn;return bn+=1,wa===null&&(wa=[]),e=lo(wa,e,t),t=de,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Jo:Ar),e}function Cs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jn(e);if(e.$$typeof===F)return Pe(e)}throw Error(o(438,String(e)))}function hr(e){var t=null,l=de.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=de.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=Ts(),de.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]=xe;return t.index++,l}function It(e,t){return typeof t=="function"?t(e):t}function As(e){var t=Ve();return vr(t,ke,e)}function vr(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var s=e.baseQueue,i=a.pending;if(i!==null){if(s!==null){var c=s.next;s.next=i.next,i.next=c}t.baseQueue=s=i,a.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var f=c=null,g=null,_=t,L=!1;do{var H=_.lane&-536870913;if(H!==_.lane?(ge&H)===H:(Ft&H)===H){var M=_.revertLane;if(M===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),H===Ca&&(L=!0);else if((Ft&M)===M){_=_.next,M===Ca&&(L=!0);continue}else H={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=H,c=i):g=g.next=H,de.lanes|=M,El|=M;H=_.action,Pl&&l(i,H),i=_.hasEagerState?_.eagerState:l(i,H)}else M={lane:H,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=M,c=i):g=g.next=M,de.lanes|=H,El|=H;_=_.next}while(_!==null&&_!==t);if(g===null?c=i:g.next=f,!ht(i,e.memoizedState)&&(Ze=!0,L&&(l=Aa,l!==null)))throw l;e.memoizedState=i,e.baseState=c,e.baseQueue=g,a.lastRenderedState=i}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function yr(e){var t=Ve(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,i=t.memoizedState;if(s!==null){l.pending=null;var c=s=s.next;do i=e(i,c.action),c=c.next;while(c!==s);ht(i,t.memoizedState)||(Ze=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,a]}function xo(e,t,l){var a=de,s=Ve(),i=je;if(i){if(l===void 0)throw Error(o(407));l=l()}else l=t();var c=!ht((ke||s).memoizedState,l);if(c&&(s.memoizedState=l,Ze=!0),s=s.queue,jr(vo.bind(null,a,s,e),[e]),s.getSnapshot!==t||c||Xe!==null&&Xe.memoizedState.tag&1){if(a.flags|=2048,za(9,{destroy:void 0},ho.bind(null,a,s,l,t),null),we===null)throw Error(o(349));i||(Ft&127)!==0||po(a,t,l)}return l}function po(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=de.updateQueue,t===null?(t=Ts(),de.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function ho(e,t,l,a){t.value=l,t.getSnapshot=a,yo(t)&&go(e)}function vo(e,t,l){return l(function(){yo(t)&&go(e)})}function yo(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!ht(e,l)}catch{return!0}}function go(e){var t=Ql(e,2);t!==null&&mt(t,e,2)}function gr(e){var t=st();if(typeof e=="function"){var l=e;if(e=l(),Pl){ol(!0);try{l()}finally{ol(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:e},t}function bo(e,t,l,a){return e.baseState=l,vr(e,ke,typeof a=="function"?a:It)}function Mx(e,t,l,a,s){if(Rs(e))throw Error(o(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){i.listeners.push(c)}};k.T!==null?l(!0):i.isTransition=!1,a(i),l=t.pending,l===null?(i.next=t.pending=i,jo(t,i)):(i.next=l.next,t.pending=l.next=i)}}function jo(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var i=k.T,c={};k.T=c;try{var f=l(s,a),g=k.S;g!==null&&g(c,f),So(e,t,f)}catch(_){br(e,t,_)}finally{i!==null&&c.types!==null&&(i.types=c.types),k.T=i}}else try{i=l(s,a),So(e,t,i)}catch(_){br(e,t,_)}}function So(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){No(e,t,a)},function(a){return br(e,t,a)}):No(e,t,l)}function No(e,t,l){t.status="fulfilled",t.value=l,Eo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,jo(e,l)))}function br(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Eo(t),t=t.next;while(t!==a)}e.action=null}function Eo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function To(e,t){return t}function Co(e,t){if(je){var l=we.formState;if(l!==null){e:{var a=de;if(je){if(De){t:{for(var s=De,i=kt;s.nodeType!==8;){if(!i){s=null;break t}if(s=Mt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){De=Mt(s.nextSibling),a=s.data==="F!";break e}}pl(a)}a=!1}a&&(t=l[0])}}return l=st(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:t},l.queue=a,l=Xo.bind(null,de,a),a.dispatch=l,a=gr(!1),i=Cr.bind(null,de,!1,a.queue),a=st(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Mx.bind(null,de,s,i,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Ao(e){var t=Ve();return _o(t,ke,e)}function _o(e,t,l){if(t=vr(e,t,To)[0],e=As(It)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=jn(t)}catch(c){throw c===_a?vs:c}else a=t;t=Ve();var s=t.queue,i=s.dispatch;return l!==t.memoizedState&&(de.flags|=2048,za(9,{destroy:void 0},wx.bind(null,s,l),null)),[a,i,e]}function wx(e,t){e.action=t}function ko(e){var t=Ve(),l=ke;if(l!==null)return _o(t,l,e);Ve(),t=t.memoizedState,l=Ve();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=de.updateQueue,t===null&&(t=Ts(),de.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 Ro(){return Ve().memoizedState}function _s(e,t,l,a){var s=st();de.flags|=e,s.memoizedState=za(1|t,{destroy:void 0},l,a===void 0?null:a)}function ks(e,t,l,a){var s=Ve();a=a===void 0?null:a;var i=s.memoizedState.inst;ke!==null&&a!==null&&dr(a,ke.memoizedState.deps)?s.memoizedState=za(t,i,l,a):(de.flags|=e,s.memoizedState=za(1|t,i,l,a))}function Mo(e,t){_s(8390656,8,e,t)}function jr(e,t){ks(2048,8,e,t)}function zx(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=Ts(),de.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function wo(e){var t=Ve().memoizedState;return zx({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function zo(e,t){return ks(4,2,e,t)}function Oo(e,t){return ks(4,4,e,t)}function Do(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 Lo(e,t,l){l=l!=null?l.concat([e]):null,ks(4,4,Do.bind(null,t,e),l)}function Sr(){}function Bo(e,t){var l=Ve();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&dr(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Uo(e,t){var l=Ve();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&dr(t,a[1]))return a[0];if(a=e(),Pl){ol(!0);try{e()}finally{ol(!1)}}return l.memoizedState=[a,t],a}function Nr(e,t,l){return l===void 0||(Ft&1073741824)!==0&&(ge&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Hd(),de.lanes|=e,El|=e,l)}function Ho(e,t,l,a){return ht(l,t)?l:Ra.current!==null?(e=Nr(e,l,a),ht(e,t)||(Ze=!0),e):(Ft&42)===0||(Ft&1073741824)!==0&&(ge&261930)===0?(Ze=!0,e.memoizedState=l):(e=Hd(),de.lanes|=e,El|=e,t)}function qo(e,t,l,a,s){var i=w.p;w.p=i!==0&&8>i?i:8;var c=k.T,f={};k.T=f,Cr(e,!1,t,l);try{var g=s(),_=k.S;if(_!==null&&_(f,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var L=_x(g,a);Sn(e,t,L,St(e))}else Sn(e,t,a,St(e))}catch(H){Sn(e,t,{then:function(){},status:"rejected",reason:H},St())}finally{w.p=i,c!==null&&f.types!==null&&(c.types=f.types),k.T=c}}function Ox(){}function Er(e,t,l,a){if(e.tag!==5)throw Error(o(476));var s=Yo(e).queue;qo(e,s,t,D,l===null?Ox:function(){return Go(e),l(a)})}function Yo(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:D},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Go(e){var t=Yo(e);t.next===null&&(t=e.alternate.memoizedState),Sn(e,t.next.queue,{},St())}function Tr(){return Pe(Hn)}function Vo(){return Ve().memoizedState}function Qo(){return Ve().memoizedState}function Dx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=St();e=yl(l);var a=gl(t,e,l);a!==null&&(mt(a,t,l),vn(a,t,l)),t={cache:er()},e.payload=t;return}t=t.return}}function Lx(e,t,l){var a=St();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Rs(e)?Zo(t,l):(l=Vi(e,t,l,a),l!==null&&(mt(l,e,a),Ko(l,t,a)))}function Xo(e,t,l){var a=St();Sn(e,t,l,a)}function Sn(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))Zo(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,f=i(c,l);if(s.hasEagerState=!0,s.eagerState=f,ht(f,c))return os(e,t,s,0),we===null&&us(),!1}catch{}finally{}if(l=Vi(e,t,s,a),l!==null)return mt(l,e,a),Ko(l,t,a),!0}return!1}function Cr(e,t,l,a){if(a={lane:2,revertLane:nc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(o(479))}else t=Vi(e,l,a,2),t!==null&&mt(t,e,2)}function Rs(e){var t=e.alternate;return e===de||t!==null&&t===de}function Zo(e,t){Ma=Ns=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Ko(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Fc(e,l)}}var Nn={readContext:Pe,use:Cs,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};Nn.useEffectEvent=Ue;var Jo={readContext:Pe,use:Cs,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:Mo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,_s(4194308,4,Do.bind(null,t,e),l)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var l=st();t=t===void 0?null:t;var a=e();if(Pl){ol(!0);try{e()}finally{ol(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=st();if(l!==void 0){var s=l(t);if(Pl){ol(!0);try{l(t)}finally{ol(!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=Lx.bind(null,de,e),[a.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=gr(e);var t=e.queue,l=Xo.bind(null,de,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Sr,useDeferredValue:function(e,t){var l=st();return Nr(l,e,t)},useTransition:function(){var e=gr(!1);return e=qo.bind(null,de,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=de,s=st();if(je){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),we===null)throw Error(o(349));(ge&127)!==0||po(a,t,l)}s.memoizedState=l;var i={value:l,getSnapshot:t};return s.queue=i,Mo(vo.bind(null,a,i,e),[e]),a.flags|=2048,za(9,{destroy:void 0},ho.bind(null,a,i,l,t),null),l},useId:function(){var e=st(),t=we.identifierPrefix;if(je){var l=Ut,a=Bt;l=(a&~(1<<32-pt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Es++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=kx++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Tr,useFormState:Co,useActionState:Co,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Cr.bind(null,de,!0,l),l.dispatch=t,[e,t]},useMemoCache:hr,useCacheRefresh:function(){return st().memoizedState=Dx.bind(null,de)},useEffectEvent:function(e){var t=st(),l={impl:e};return t.memoizedState=l,function(){if((Ce&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},Ar={readContext:Pe,use:Cs,useCallback:Bo,useContext:Pe,useEffect:jr,useImperativeHandle:Lo,useInsertionEffect:zo,useLayoutEffect:Oo,useMemo:Uo,useReducer:As,useRef:Ro,useState:function(){return As(It)},useDebugValue:Sr,useDeferredValue:function(e,t){var l=Ve();return Ho(l,ke.memoizedState,e,t)},useTransition:function(){var e=As(It)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:jn(e),t]},useSyncExternalStore:xo,useId:Vo,useHostTransitionStatus:Tr,useFormState:Ao,useActionState:Ao,useOptimistic:function(e,t){var l=Ve();return bo(l,ke,e,t)},useMemoCache:hr,useCacheRefresh:Qo};Ar.useEffectEvent=wo;var $o={readContext:Pe,use:Cs,useCallback:Bo,useContext:Pe,useEffect:jr,useImperativeHandle:Lo,useInsertionEffect:zo,useLayoutEffect:Oo,useMemo:Uo,useReducer:yr,useRef:Ro,useState:function(){return yr(It)},useDebugValue:Sr,useDeferredValue:function(e,t){var l=Ve();return ke===null?Nr(l,e,t):Ho(l,ke.memoizedState,e,t)},useTransition:function(){var e=yr(It)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:jn(e),t]},useSyncExternalStore:xo,useId:Vo,useHostTransitionStatus:Tr,useFormState:ko,useActionState:ko,useOptimistic:function(e,t){var l=Ve();return ke!==null?bo(l,ke,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:hr,useCacheRefresh:Qo};$o.useEffectEvent=wo;function _r(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var kr={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=St(),s=yl(a);s.payload=t,l!=null&&(s.callback=l),t=gl(e,s,a),t!==null&&(mt(t,e,a),vn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=St(),s=yl(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=gl(e,s,a),t!==null&&(mt(t,e,a),vn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=St(),a=yl(l);a.tag=2,t!=null&&(a.callback=t),t=gl(e,a,l),t!==null&&(mt(t,e,l),vn(t,e,l))}};function Wo(e,t,l,a,s,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,i,c):t.prototype&&t.prototype.isPureReactComponent?!un(l,a)||!un(s,i):!0}function Fo(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&&kr.enqueueReplaceState(t,t.state,null)}function ea(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function Io(e){cs(e)}function Po(e){console.error(e)}function ed(e){cs(e)}function Ms(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function td(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 Rr(e,t,l){return l=yl(l),l.tag=3,l.payload={element:null},l.callback=function(){Ms(e,t)},l}function ld(e){return e=yl(e),e.tag=3,e}function ad(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var i=a.value;e.payload=function(){return s(i)},e.callback=function(){td(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){td(t,l,a),typeof s!="function"&&(Tl===null?Tl=new Set([this]):Tl.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function Bx(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Ta(t,l,s,!0),l=yt.current,l!==null){switch(l.tag){case 31:case 13:return Rt===null?Vs():l.alternate===null&&He===0&&(He=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===ys?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),tc(e,a,s)),!1;case 22:return l.flags|=65536,a===ys?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)),tc(e,a,s)),!1}throw Error(o(435,l.tag))}return tc(e,a,s),Vs(),!1}if(je)return t=yt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==$i&&(e=Error(o(422),{cause:a}),fn(Ct(e,l)))):(a!==$i&&(t=Error(o(423),{cause:a}),fn(Ct(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Ct(a,l),s=Rr(e.stateNode,a,s),ir(e,s),He!==4&&(He=2)),!1;var i=Error(o(520),{cause:a});if(i=Ct(i,l),Mn===null?Mn=[i]:Mn.push(i),He!==4&&(He=2),t===null)return!0;a=Ct(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Rr(l.stateNode,a,e),ir(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Tl===null||!Tl.has(i))))return l.flags|=65536,s&=-s,l.lanes|=s,s=ld(s),ad(s,e,l,a),ir(l,s),!1}l=l.return}while(l!==null);return!1}var Mr=Error(o(461)),Ze=!1;function et(e,t,l,a){t.child=e===null?io(t,null,l,a):Il(t,e.child,l,a)}function nd(e,t,l,a,s){l=l.render;var i=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return Jl(t),a=fr(e,t,l,c,i,s),f=mr(),e!==null&&!Ze?(xr(e,t,s),Pt(e,t,s)):(je&&f&&Ki(t),t.flags|=1,et(e,t,a,s),t.child)}function sd(e,t,l,a,s){if(e===null){var i=l.type;return typeof i=="function"&&!Qi(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,id(e,t,i,a,s)):(e=fs(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Hr(e,s)){var c=i.memoizedProps;if(l=l.compare,l=l!==null?l:un,l(c,a)&&e.ref===t.ref)return Pt(e,t,s)}return t.flags|=1,e=Kt(i,a),e.ref=t.ref,e.return=t,t.child=e}function id(e,t,l,a,s){if(e!==null){var i=e.memoizedProps;if(un(i,a)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=a=i,Hr(e,s))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,Pt(e,t,s)}return wr(e,t,l,a,s)}function rd(e,t,l,a){var s=a.children,i=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(i=i!==null?i.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&~i}else a=0,t.child=null;return cd(e,t,i,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hs(t,i!==null?i.cachePool:null),i!==null?uo(t,i):cr(),oo(t);else return a=t.lanes=536870912,cd(e,t,i!==null?i.baseLanes|l:l,l,a)}else i!==null?(hs(t,i.cachePool),uo(t,i),jl(),t.memoizedState=null):(e!==null&&hs(t,null),cr(),jl());return et(e,t,s,l),t.child}function En(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cd(e,t,l,a,s){var i=lr();return i=i===null?null:{parent:Qe._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&hs(t,null),cr(),oo(t),e!==null&&Ta(e,t,a,!0),t.childLanes=s,null}function ws(e,t){return t=Os({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ud(e,t,l){return Il(t,e.child,null,l),e=ws(t,t.pendingProps),e.flags|=2,gt(t),t.memoizedState=null,e}function Ux(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(je){if(a.mode==="hidden")return e=ws(t,a),t.lanes=536870912,En(null,e);if(or(t),(e=De)?(e=Sf(e,kt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ml!==null?{id:Bt,overflow:Ut}:null,retryLane:536870912,hydrationErrors:null},l=Xu(e),l.return=t,t.child=l,Ie=t,De=null)):e=null,e===null)throw pl(t);return t.lanes=536870912,null}return ws(t,a)}var i=e.memoizedState;if(i!==null){var c=i.dehydrated;if(or(t),s)if(t.flags&256)t.flags&=-257,t=ud(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ze||Ta(e,t,l,!1),s=(l&e.childLanes)!==0,Ze||s){if(a=we,a!==null&&(c=Ic(a,l),c!==0&&c!==i.retryLane))throw i.retryLane=c,Ql(e,c),mt(a,e,c),Mr;Vs(),t=ud(e,t,l)}else e=i.treeContext,De=Mt(c.nextSibling),Ie=t,je=!0,xl=null,kt=!1,e!==null&&Ju(t,e),t=ws(t,a),t.flags|=4096;return t}return e=Kt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zs(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(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function wr(e,t,l,a,s){return Jl(t),l=fr(e,t,l,a,void 0,s),a=mr(),e!==null&&!Ze?(xr(e,t,s),Pt(e,t,s)):(je&&a&&Ki(t),t.flags|=1,et(e,t,l,s),t.child)}function od(e,t,l,a,s,i){return Jl(t),t.updateQueue=null,l=mo(t,a,l,s),fo(e),a=mr(),e!==null&&!Ze?(xr(e,t,i),Pt(e,t,i)):(je&&a&&Ki(t),t.flags|=1,et(e,t,l,i),t.child)}function dd(e,t,l,a,s){if(Jl(t),t.stateNode===null){var i=ja,c=l.contextType;typeof c=="object"&&c!==null&&(i=Pe(c)),i=new l(a,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=kr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=a,i.state=t.memoizedState,i.refs={},nr(t),c=l.contextType,i.context=typeof c=="object"&&c!==null?Pe(c):ja,i.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(_r(t,l,c,a),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(c=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),c!==i.state&&kr.enqueueReplaceState(i,i.state,null),gn(t,a,i,s),yn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){i=t.stateNode;var f=t.memoizedProps,g=ea(l,f);i.props=g;var _=i.context,L=l.contextType;c=ja,typeof L=="object"&&L!==null&&(c=Pe(L));var H=l.getDerivedStateFromProps;L=typeof H=="function"||typeof i.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,L||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f||_!==c)&&Fo(t,i,a,c),vl=!1;var M=t.memoizedState;i.state=M,gn(t,a,i,s),yn(),_=t.memoizedState,f||M!==_||vl?(typeof H=="function"&&(_r(t,l,H,a),_=t.memoizedState),(g=vl||Wo(t,l,g,a,M,_,c))?(L||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),i.props=a,i.state=_,i.context=c,a=g):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,sr(e,t),c=t.memoizedProps,L=ea(l,c),i.props=L,H=t.pendingProps,M=i.context,_=l.contextType,g=ja,typeof _=="object"&&_!==null&&(g=Pe(_)),f=l.getDerivedStateFromProps,(_=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(c!==H||M!==g)&&Fo(t,i,a,g),vl=!1,M=t.memoizedState,i.state=M,gn(t,a,i,s),yn();var z=t.memoizedState;c!==H||M!==z||vl||e!==null&&e.dependencies!==null&&xs(e.dependencies)?(typeof f=="function"&&(_r(t,l,f,a),z=t.memoizedState),(L=vl||Wo(t,l,L,a,M,z,g)||e!==null&&e.dependencies!==null&&xs(e.dependencies))?(_||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(a,z,g),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(a,z,g)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=z),i.props=a,i.state=z,i.context=g,a=L):(typeof i.componentDidUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return i=a,zs(e,t),a=(t.flags&128)!==0,i||a?(i=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&a?(t.child=Il(t,e.child,null,s),t.child=Il(t,null,l,s)):et(e,t,l,s),t.memoizedState=i.state,e=t.child):e=Pt(e,t,s),e}function fd(e,t,l,a){return Zl(),t.flags|=256,et(e,t,l,a),t.child}var zr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Or(e){return{baseLanes:e,cachePool:eo()}}function Dr(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=jt),e}function md(e,t,l){var a=t.pendingProps,s=!1,i=(t.flags&128)!==0,c;if((c=i)||(c=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),c&&(s=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(je){if(s?bl(t):jl(),(e=De)?(e=Sf(e,kt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ml!==null?{id:Bt,overflow:Ut}:null,retryLane:536870912,hydrationErrors:null},l=Xu(e),l.return=t,t.child=l,Ie=t,De=null)):e=null,e===null)throw pl(t);return vc(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,s?(jl(),s=t.mode,f=Os({mode:"hidden",children:f},s),a=Xl(a,s,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=Or(l),a.childLanes=Dr(e,c,l),t.memoizedState=zr,En(null,a)):(bl(t),Lr(t,f))}var g=e.memoizedState;if(g!==null&&(f=g.dehydrated,f!==null)){if(i)t.flags&256?(bl(t),t.flags&=-257,t=Br(e,t,l)):t.memoizedState!==null?(jl(),t.child=e.child,t.flags|=128,t=null):(jl(),f=a.fallback,s=t.mode,a=Os({mode:"visible",children:a.children},s),f=Xl(f,s,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,Il(t,e.child,null,l),a=t.child,a.memoizedState=Or(l),a.childLanes=Dr(e,c,l),t.memoizedState=zr,t=En(null,a));else if(bl(t),vc(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var _=c.dgst;c=_,a=Error(o(419)),a.stack="",a.digest=c,fn({value:a,source:null,stack:null}),t=Br(e,t,l)}else if(Ze||Ta(e,t,l,!1),c=(l&e.childLanes)!==0,Ze||c){if(c=we,c!==null&&(a=Ic(c,l),a!==0&&a!==g.retryLane))throw g.retryLane=a,Ql(e,a),mt(c,e,a),Mr;hc(f)||Vs(),t=Br(e,t,l)}else hc(f)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,De=Mt(f.nextSibling),Ie=t,je=!0,xl=null,kt=!1,e!==null&&Ju(t,e),t=Lr(t,a.children),t.flags|=4096);return t}return s?(jl(),f=a.fallback,s=t.mode,g=e.child,_=g.sibling,a=Kt(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,_!==null?f=Kt(_,f):(f=Xl(f,s,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,En(null,a),a=t.child,f=e.child.memoizedState,f===null?f=Or(l):(s=f.cachePool,s!==null?(g=Qe._currentValue,s=s.parent!==g?{parent:g,pool:g}:s):s=eo(),f={baseLanes:f.baseLanes|l,cachePool:s}),a.memoizedState=f,a.childLanes=Dr(e,c,l),t.memoizedState=zr,En(e.child,a)):(bl(t),l=e.child,e=l.sibling,l=Kt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Lr(e,t){return t=Os({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Os(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Br(e,t,l){return Il(t,e.child,null,l),e=Lr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ii(e.return,t,l)}function Ur(e,t,l,a,s,i){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:i}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=s,c.treeForkCount=i)}function pd(e,t,l){var a=t.pendingProps,s=a.revealOrder,i=a.tail;a=a.children;var c=Ge.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,O(Ge,c),et(e,t,a,l),a=je?dn:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xd(e,l,t);else if(e.tag===19)xd(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&&Ss(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Ur(t,!1,s,l,i,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&&Ss(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Ur(t,!0,l,null,i,a);break;case"together":Ur(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Pt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),El|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ta(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Kt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Kt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Hr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&xs(e)))}function Hx(e,t,l){switch(t.tag){case 3:Ye(t,t.stateNode.containerInfo),hl(t,Qe,e.memoizedState.cache),Zl();break;case 27:case 5:Bl(t);break;case 4:Ye(t,t.stateNode.containerInfo);break;case 10:hl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,or(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(bl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?md(e,t,l):(bl(t),e=Pt(e,t,l),e!==null?e.sibling:null);bl(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Ta(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return pd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),O(Ge,Ge.current),a)break;return null;case 22:return t.lanes=0,rd(e,t,l,t.pendingProps);case 24:hl(t,Qe,e.memoizedState.cache)}return Pt(e,t,l)}function hd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!Hr(e,l)&&(t.flags&128)===0)return Ze=!1,Hx(e,t,l);Ze=(e.flags&131072)!==0}else Ze=!1,je&&(t.flags&1048576)!==0&&Ku(t,dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Wl(t.elementType),t.type=e,typeof e=="function")Qi(e)?(a=ea(e,a),t.tag=1,t=dd(null,t,e,a,l)):(t.tag=0,t=wr(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===G){t.tag=11,t=nd(null,t,e,a,l);break e}else if(s===I){t.tag=14,t=sd(null,t,e,a,l);break e}}throw t=$(e)||e,Error(o(306,t,""))}}return t;case 0:return wr(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=ea(a,t.pendingProps),dd(e,t,a,s,l);case 3:e:{if(Ye(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var i=t.memoizedState;s=i.element,sr(e,t),gn(t,a,null,l);var c=t.memoizedState;if(a=c.cache,hl(t,Qe,a),a!==i.cache&&Pi(t,[Qe],l,!0),yn(),a=c.element,i.isDehydrated)if(i={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=fd(e,t,a,l);break e}else if(a!==s){s=Ct(Error(o(424)),t),fn(s),t=fd(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(De=Mt(e.firstChild),Ie=t,je=!0,xl=null,kt=!0,l=io(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Zl(),a===s){t=Pt(e,t,l);break e}et(e,t,a,l)}t=t.child}return t;case 26:return zs(e,t),e===null?(l=_f(t.type,null,t.pendingProps,null))?t.memoizedState=l:je||(l=t.type,e=t.pendingProps,a=Ws(te.current).createElement(l),a[Fe]=t,a[rt]=e,tt(a,l,e),$e(a),t.stateNode=a):t.memoizedState=_f(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bl(t),e===null&&je&&(a=t.stateNode=Tf(t.type,t.pendingProps,te.current),Ie=t,kt=!0,s=De,kl(t.type)?(yc=s,De=Mt(a.firstChild)):De=s),et(e,t,t.pendingProps.children,l),zs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&je&&((s=a=De)&&(a=pp(a,t.type,t.pendingProps,kt),a!==null?(t.stateNode=a,Ie=t,De=Mt(a.firstChild),kt=!1,s=!0):s=!1),s||pl(t)),Bl(t),s=t.type,i=t.pendingProps,c=e!==null?e.memoizedProps:null,a=i.children,mc(s,i)?a=null:c!==null&&mc(s,c)&&(t.flags|=32),t.memoizedState!==null&&(s=fr(e,t,Rx,null,null,l),Hn._currentValue=s),zs(e,t),et(e,t,a,l),t.child;case 6:return e===null&&je&&((e=l=De)&&(l=hp(l,t.pendingProps,kt),l!==null?(t.stateNode=l,Ie=t,De=null,e=!0):e=!1),e||pl(t)),null;case 13:return md(e,t,l);case 4:return Ye(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Il(t,null,a,l):et(e,t,a,l),t.child;case 11:return nd(e,t,t.type,t.pendingProps,l);case 7:return et(e,t,t.pendingProps,l),t.child;case 8:return et(e,t,t.pendingProps.children,l),t.child;case 12:return et(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,hl(t,t.type,a.value),et(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,Jl(t),s=Pe(s),a=a(s),t.flags|=1,et(e,t,a,l),t.child;case 14:return sd(e,t,t.type,t.pendingProps,l);case 15:return id(e,t,t.type,t.pendingProps,l);case 19:return pd(e,t,l);case 31:return Ux(e,t,l);case 22:return rd(e,t,l,t.pendingProps);case 24:return Jl(t),a=Pe(Qe),e===null?(s=lr(),s===null&&(s=we,i=er(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=l),s=i),t.memoizedState={parent:a,cache:s},nr(t),hl(t,Qe,s)):((e.lanes&l)!==0&&(sr(e,t),gn(t,null,null,l),yn()),s=e.memoizedState,i=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),hl(t,Qe,a)):(a=i.cache,hl(t,Qe,a),a!==s.cache&&Pi(t,[Qe],l,!0))),et(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function el(e){e.flags|=4}function qr(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(Vd())e.flags|=8192;else throw Fl=ys,ar}else e.flags&=-16777217}function vd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zf(t))if(Vd())e.flags|=8192;else throw Fl=ys,ar}function Ds(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$c():536870912,e.lanes|=t,Ba|=t)}function Tn(e,t){if(!je)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 Le(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 qx(e,t,l){var a=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return Le(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wt(Qe),ze(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ea(t)?el(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wi())),Le(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(el(t),i!==null?(Le(t),vd(t,i)):(Le(t),qr(t,s,null,a,l))):i?i!==e.memoizedState?(el(t),Le(t),vd(t,i)):(Le(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&el(t),Le(t),qr(t,s,e,a,l)),null;case 27:if(cl(t),l=te.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Le(t),null}e=q.current,Ea(t)?$u(t):(e=Tf(s,a,l),t.stateNode=e,el(t))}return Le(t),null;case 5:if(cl(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Le(t),null}if(i=q.current,Ea(t))$u(t);else{var c=Ws(te.current);switch(i){case 1:i=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=c.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?c.createElement(s,{is:a.is}):c.createElement(s)}}i[Fe]=t,i[rt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(tt(i,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&&el(t)}}return Le(t),qr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=te.current,Ea(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=Ie,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[Fe]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||xf(e.nodeValue,l)),e||pl(t,!0)}else e=Ws(e).createTextNode(a),e[Fe]=t,t.stateNode=e}return Le(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ea(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Fe]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),e=!1}else l=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(gt(t),t):(gt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Le(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ea(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[Fe]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),s=!1}else s=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(gt(t),t):(gt(t),null)}return gt(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),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ds(t,t.updateQueue),Le(t),null);case 4:return ze(),e===null&&cc(t.stateNode.containerInfo),Le(t),null;case 10:return Wt(t.type),Le(t),null;case 19:if(T(Ge),a=t.memoizedState,a===null)return Le(t),null;if(s=(t.flags&128)!==0,i=a.rendering,i===null)if(s)Tn(a,!1);else{if(He!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ss(e),i!==null){for(t.flags|=128,Tn(a,!1),e=i.updateQueue,t.updateQueue=e,Ds(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Qu(l,e),l=l.sibling;return O(Ge,Ge.current&1|2),je&&Jt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&nt()>qs&&(t.flags|=128,s=!0,Tn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Ss(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ds(t,e),Tn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!je)return Le(t),null}else 2*nt()-a.renderingStartTime>qs&&l!==536870912&&(t.flags|=128,s=!0,Tn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=nt(),e.sibling=null,l=Ge.current,O(Ge,s?l&1|2:l&1),je&&Jt(t,a.treeForkCount),e):(Le(t),null);case 22:case 23:return gt(t),ur(),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&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),l=t.updateQueue,l!==null&&Ds(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&&T($l),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Wt(Qe),Le(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Yx(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wt(Qe),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return cl(t),null;case 31:if(t.memoizedState!==null){if(gt(t),t.alternate===null)throw Error(o(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(gt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return T(Ge),null;case 4:return ze(),null;case 10:return Wt(t.type),null;case 22:case 23:return gt(t),ur(),e!==null&&T($l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wt(Qe),null;case 25:return null;default:return null}}function yd(e,t){switch(Ji(t),t.tag){case 3:Wt(Qe),ze();break;case 26:case 27:case 5:cl(t);break;case 4:ze();break;case 31:t.memoizedState!==null&>(t);break;case 13:gt(t);break;case 19:T(Ge);break;case 10:Wt(t.type);break;case 22:case 23:gt(t),ur(),e!==null&&T($l);break;case 24:Wt(Qe)}}function Cn(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 i=l.create,c=l.inst;a=i(),c.destroy=a}l=l.next}while(l!==s)}}catch(f){_e(t,t.return,f)}}function Sl(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var i=s.next;a=i;do{if((a.tag&e)===e){var c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,s=t;var g=l,_=f;try{_()}catch(L){_e(s,g,L)}}}a=a.next}while(a!==i)}}catch(L){_e(t,t.return,L)}}function gd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{co(t,l)}catch(a){_e(e,e.return,a)}}}function bd(e,t,l){l.props=ea(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){_e(e,t,a)}}function An(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){_e(e,t,s)}}function Ht(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){_e(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){_e(e,t,s)}else l.current=null}function jd(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){_e(e,e.return,s)}}function Yr(e,t,l){try{var a=e.stateNode;up(a,e.type,l,t),a[rt]=t}catch(s){_e(e,e.return,s)}}function Sd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kl(e.type)||e.tag===4}function Gr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sd(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 Vr(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=Xt));else if(a!==4&&(a===27&&kl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Vr(e,t,l),e=e.sibling;e!==null;)Vr(e,t,l),e=e.sibling}function Ls(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(Ls(e,t,l),e=e.sibling;e!==null;)Ls(e,t,l),e=e.sibling}function Nd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);tt(t,a,l),t[Fe]=e,t[rt]=l}catch(i){_e(e,e.return,i)}}var tl=!1,Ke=!1,Qr=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,We=null;function Gx(e,t){if(e=e.containerInfo,dc=ai,e=Du(e),Bi(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,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var c=0,f=-1,g=-1,_=0,L=0,H=e,M=null;t:for(;;){for(var z;H!==l||s!==0&&H.nodeType!==3||(f=c+s),H!==i||a!==0&&H.nodeType!==3||(g=c+a),H.nodeType===3&&(c+=H.nodeValue.length),(z=H.firstChild)!==null;)M=H,H=z;for(;;){if(H===e)break t;if(M===l&&++_===s&&(f=c),M===i&&++L===a&&(g=c),(z=H.nextSibling)!==null)break;H=M,M=H.parentNode}H=z}l=f===-1||g===-1?null:{start:f,end:g}}else l=null}l=l||{start:0,end:0}}else l=null;for(fc={focusedElem:e,selectionRange:l},ai=!1,We=t;We!==null;)if(t=We,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,We=e;else for(;We!==null;){switch(t=We,i=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&&i!==null){e=void 0,l=t,s=i.memoizedProps,i=i.memoizedState,a=l.stateNode;try{var ae=ea(l.type,s);e=a.getSnapshotBeforeUpdate(ae,i),a.__reactInternalSnapshotBeforeUpdate=e}catch(ue){_e(l,l.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)pc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pc(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,We=e;break}We=t.return}}function Td(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:al(e,l),a&4&&Cn(5,l);break;case 1:if(al(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){_e(l,l.return,c)}else{var s=ea(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){_e(l,l.return,c)}}a&64&&gd(l),a&512&&An(l,l.return);break;case 3:if(al(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{co(e,t)}catch(c){_e(l,l.return,c)}}break;case 27:t===null&&a&4&&Nd(l);case 26:case 5:al(e,l),t===null&&a&4&&jd(l),a&512&&An(l,l.return);break;case 12:al(e,l);break;case 31:al(e,l),a&4&&_d(e,l);break;case 13:al(e,l),a&4&&kd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Fx.bind(null,l),vp(e,l))));break;case 22:if(a=l.memoizedState!==null||tl,!a){t=t!==null&&t.memoizedState!==null||Ke,s=tl;var i=Ke;tl=a,(Ke=t)&&!i?nl(e,l,(l.subtreeFlags&8772)!==0):al(e,l),tl=s,Ke=i}break;case 30:break;default:al(e,l)}}function Cd(e){var t=e.alternate;t!==null&&(e.alternate=null,Cd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bi(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 Be=null,ut=!1;function ll(e,t,l){for(l=l.child;l!==null;)Ad(e,t,l),l=l.sibling}function Ad(e,t,l){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(Ul,l)}catch{}switch(l.tag){case 26:Ke||Ht(l,t),ll(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ke||Ht(l,t);var a=Be,s=ut;kl(l.type)&&(Be=l.stateNode,ut=!1),ll(e,t,l),Ln(l.stateNode),Be=a,ut=s;break;case 5:Ke||Ht(l,t);case 6:if(a=Be,s=ut,Be=null,ll(e,t,l),Be=a,ut=s,Be!==null)if(ut)try{(Be.nodeType===9?Be.body:Be.nodeName==="HTML"?Be.ownerDocument.body:Be).removeChild(l.stateNode)}catch(i){_e(l,t,i)}else try{Be.removeChild(l.stateNode)}catch(i){_e(l,t,i)}break;case 18:Be!==null&&(ut?(e=Be,bf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Xa(e)):bf(Be,l.stateNode));break;case 4:a=Be,s=ut,Be=l.stateNode.containerInfo,ut=!0,ll(e,t,l),Be=a,ut=s;break;case 0:case 11:case 14:case 15:Sl(2,l,t),Ke||Sl(4,l,t),ll(e,t,l);break;case 1:Ke||(Ht(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&bd(l,t,a)),ll(e,t,l);break;case 21:ll(e,t,l);break;case 22:Ke=(a=Ke)||l.memoizedState!==null,ll(e,t,l),Ke=a;break;default:ll(e,t,l)}}function _d(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xa(e)}catch(l){_e(t,t.return,l)}}}function kd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xa(e)}catch(l){_e(t,t.return,l)}}function Vx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ed),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ed),t;default:throw Error(o(435,e.tag))}}function Bs(e,t){var l=Vx(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=Ix.bind(null,e,a);a.then(s,s)}})}function ot(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],i=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(kl(f.type)){Be=f.stateNode,ut=!1;break e}break;case 5:Be=f.stateNode,ut=!1;break e;case 3:case 4:Be=f.stateNode.containerInfo,ut=!0;break e}f=f.return}if(Be===null)throw Error(o(160));Ad(i,c,s),Be=null,ut=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rd(t,e),t=t.sibling}var Ot=null;function Rd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ot(t,e),dt(e),a&4&&(Sl(3,e,e.return),Cn(3,e),Sl(5,e,e.return));break;case 1:ot(t,e),dt(e),a&512&&(Ke||l===null||Ht(l,l.return)),a&64&&tl&&(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=Ot;if(ot(t,e),dt(e),a&512&&(Ke||l===null||Ht(l,l.return)),a&4){var i=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":i=s.getElementsByTagName("title")[0],(!i||i[Pa]||i[Fe]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(a),s.head.insertBefore(i,s.querySelector("head > title"))),tt(i,a,l),i[Fe]=e,$e(i),a=i;break e;case"link":var c=Mf("link","href",s).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(i=c[f],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(f,1);break t}}i=s.createElement(a),tt(i,a,l),s.head.appendChild(i);break;case"meta":if(c=Mf("meta","content",s).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(i=c[f],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(f,1);break t}}i=s.createElement(a),tt(i,a,l),s.head.appendChild(i);break;default:throw Error(o(468,a))}i[Fe]=e,$e(i),a=i}e.stateNode=a}else wf(s,e.type,e.stateNode);else e.stateNode=Rf(s,a,e.memoizedProps);else i!==a?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,a===null?wf(s,e.type,e.stateNode):Rf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Yr(e,e.memoizedProps,l.memoizedProps)}break;case 27:ot(t,e),dt(e),a&512&&(Ke||l===null||Ht(l,l.return)),l!==null&&a&4&&Yr(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ot(t,e),dt(e),a&512&&(Ke||l===null||Ht(l,l.return)),e.flags&32){s=e.stateNode;try{xa(s,"")}catch(ae){_e(e,e.return,ae)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Yr(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Qr=!0);break;case 6:if(ot(t,e),dt(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ae){_e(e,e.return,ae)}}break;case 3:if(Ps=null,s=Ot,Ot=Fs(t.containerInfo),ot(t,e),Ot=s,dt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{Xa(t.containerInfo)}catch(ae){_e(e,e.return,ae)}Qr&&(Qr=!1,Md(e));break;case 4:a=Ot,Ot=Fs(e.stateNode.containerInfo),ot(t,e),dt(e),Ot=a;break;case 12:ot(t,e),dt(e);break;case 31:ot(t,e),dt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Bs(e,a)));break;case 13:ot(t,e),dt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Hs=nt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Bs(e,a)));break;case 22:s=e.memoizedState!==null;var g=l!==null&&l.memoizedState!==null,_=tl,L=Ke;if(tl=_||s,Ke=L||g,ot(t,e),Ke=L,tl=_,dt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||g||tl||Ke||ta(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){g=l=t;try{if(i=g.stateNode,s)c=i.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=g.stateNode;var H=g.memoizedProps.style,M=H!=null&&H.hasOwnProperty("display")?H.display:null;f.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ae){_e(g,g.return,ae)}}}else if(t.tag===6){if(l===null){g=t;try{g.stateNode.nodeValue=s?"":g.memoizedProps}catch(ae){_e(g,g.return,ae)}}}else if(t.tag===18){if(l===null){g=t;try{var z=g.stateNode;s?jf(z,!0):jf(g.stateNode,!1)}catch(ae){_e(g,g.return,ae)}}}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,Bs(e,l))));break;case 19:ot(t,e),dt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Bs(e,a)));break;case 30:break;case 21:break;default:ot(t,e),dt(e)}}function dt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Sd(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var s=l.stateNode,i=Gr(e);Ls(e,i,s);break;case 5:var c=l.stateNode;l.flags&32&&(xa(c,""),l.flags&=-33);var f=Gr(e);Ls(e,f,c);break;case 3:case 4:var g=l.stateNode.containerInfo,_=Gr(e);Vr(e,_,g);break;default:throw Error(o(161))}}catch(L){_e(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Md(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Md(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function al(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Td(e,t.alternate,t),t=t.sibling}function ta(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Sl(4,t,t.return),ta(t);break;case 1:Ht(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&bd(t,t.return,l),ta(t);break;case 27:Ln(t.stateNode);case 26:case 5:Ht(t,t.return),ta(t);break;case 22:t.memoizedState===null&&ta(t);break;case 30:ta(t);break;default:ta(t)}e=e.sibling}}function nl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,i=t,c=i.flags;switch(i.tag){case 0:case 11:case 15:nl(s,i,l),Cn(4,i);break;case 1:if(nl(s,i,l),a=i,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){_e(a,a.return,_)}if(a=i,s=a.updateQueue,s!==null){var f=a.stateNode;try{var g=s.shared.hiddenCallbacks;if(g!==null)for(s.shared.hiddenCallbacks=null,s=0;s<g.length;s++)ro(g[s],f)}catch(_){_e(a,a.return,_)}}l&&c&64&&gd(i),An(i,i.return);break;case 27:Nd(i);case 26:case 5:nl(s,i,l),l&&a===null&&c&4&&jd(i),An(i,i.return);break;case 12:nl(s,i,l);break;case 31:nl(s,i,l),l&&c&4&&_d(s,i);break;case 13:nl(s,i,l),l&&c&4&&kd(s,i);break;case 22:i.memoizedState===null&&nl(s,i,l),An(i,i.return);break;case 30:break;default:nl(s,i,l)}t=t.sibling}}function Xr(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&&mn(l))}function Zr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mn(e))}function Dt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wd(e,t,l,a),t=t.sibling}function wd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Dt(e,t,l,a),s&2048&&Cn(9,t);break;case 1:Dt(e,t,l,a);break;case 3:Dt(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&&mn(e)));break;case 12:if(s&2048){Dt(e,t,l,a),e=t.stateNode;try{var i=t.memoizedProps,c=i.id,f=i.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){_e(t,t.return,g)}}else Dt(e,t,l,a);break;case 31:Dt(e,t,l,a);break;case 13:Dt(e,t,l,a);break;case 23:break;case 22:i=t.stateNode,c=t.alternate,t.memoizedState!==null?i._visibility&2?Dt(e,t,l,a):_n(e,t):i._visibility&2?Dt(e,t,l,a):(i._visibility|=2,Oa(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Xr(c,t);break;case 24:Dt(e,t,l,a),s&2048&&Zr(t.alternate,t);break;default:Dt(e,t,l,a)}}function Oa(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,c=t,f=l,g=a,_=c.flags;switch(c.tag){case 0:case 11:case 15:Oa(i,c,f,g,s),Cn(8,c);break;case 23:break;case 22:var L=c.stateNode;c.memoizedState!==null?L._visibility&2?Oa(i,c,f,g,s):_n(i,c):(L._visibility|=2,Oa(i,c,f,g,s)),s&&_&2048&&Xr(c.alternate,c);break;case 24:Oa(i,c,f,g,s),s&&_&2048&&Zr(c.alternate,c);break;default:Oa(i,c,f,g,s)}t=t.sibling}}function _n(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:_n(l,a),s&2048&&Xr(a.alternate,a);break;case 24:_n(l,a),s&2048&&Zr(a.alternate,a);break;default:_n(l,a)}t=t.sibling}}var kn=8192;function Da(e,t,l){if(e.subtreeFlags&kn)for(e=e.child;e!==null;)zd(e,t,l),e=e.sibling}function zd(e,t,l){switch(e.tag){case 26:Da(e,t,l),e.flags&kn&&e.memoizedState!==null&&kp(l,Ot,e.memoizedState,e.memoizedProps);break;case 5:Da(e,t,l);break;case 3:case 4:var a=Ot;Ot=Fs(e.stateNode.containerInfo),Da(e,t,l),Ot=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=kn,kn=16777216,Da(e,t,l),kn=a):Da(e,t,l));break;default:Da(e,t,l)}}function Od(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 Rn(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];We=a,Ld(a,e)}Od(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dd(e),e=e.sibling}function Dd(e){switch(e.tag){case 0:case 11:case 15:Rn(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:Rn(e);break;case 12:Rn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Us(e)):Rn(e);break;default:Rn(e)}}function Us(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];We=a,Ld(a,e)}Od(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Us(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Us(t));break;default:Us(t)}e=e.sibling}}function Ld(e,t){for(;We!==null;){var l=We;switch(l.tag){case 0:case 11:case 15:Sl(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:mn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,We=a;else e:for(l=e;We!==null;){a=We;var s=a.sibling,i=a.return;if(Cd(a),a===l){We=null;break e}if(s!==null){s.return=i,We=s;break e}We=i}}}var Qx={getCacheForType:function(e){var t=Pe(Qe),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Pe(Qe).controller.signal}},Xx=typeof WeakMap=="function"?WeakMap:Map,Ce=0,we=null,he=null,ge=0,Ae=0,bt=null,Nl=!1,La=!1,Kr=!1,sl=0,He=0,El=0,la=0,Jr=0,jt=0,Ba=0,Mn=null,ft=null,$r=!1,Hs=0,Bd=0,qs=1/0,Ys=null,Tl=null,Je=0,Cl=null,Ua=null,il=0,Wr=0,Fr=null,Ud=null,wn=0,Ir=null;function St(){return(Ce&2)!==0&&ge!==0?ge&-ge:k.T!==null?nc():Pc()}function Hd(){if(jt===0)if((ge&536870912)===0||je){var e=$n;$n<<=1,($n&3932160)===0&&($n=262144),jt=e}else jt=536870912;return e=yt.current,e!==null&&(e.flags|=32),jt}function mt(e,t,l){(e===we&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(Ha(e,0),Al(e,ge,jt,!1)),Ia(e,l),((Ce&2)===0||e!==we)&&(e===we&&((Ce&2)===0&&(la|=l),He===4&&Al(e,ge,jt,!1)),qt(e))}function qd(e,t,l){if((Ce&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Fa(e,t),s=a?Jx(e,t):ec(e,t,!0),i=a;do{if(s===0){La&&!a&&Al(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!Zx(l)){s=ec(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;s=Mn;var g=f.current.memoizedState.isDehydrated;if(g&&(Ha(f,c).flags|=256),c=ec(f,c,!1),c!==2){if(Kr&&!g){f.errorRecoveryDisabledLanes|=i,la|=i,s=4;break e}i=ft,ft=s,i!==null&&(ft===null?ft=i:ft.push.apply(ft,i))}s=c}if(i=!1,s!==2)continue}}if(s===1){Ha(e,0),Al(e,t,0,!0);break}e:{switch(a=e,i=s,i){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Al(a,t,jt,!Nl);break e;case 2:ft=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=Hs+300-nt(),10<s)){if(Al(a,t,jt,!Nl),Fn(a,0,!0)!==0)break e;il=t,a.timeoutHandle=yf(Yd.bind(null,a,l,ft,Ys,$r,t,jt,la,Ba,Nl,i,"Throttled",-0,0),s);break e}Yd(a,l,ft,Ys,$r,t,jt,la,Ba,Nl,i,null,-0,0)}}break}while(!0);qt(e)}function Yd(e,t,l,a,s,i,c,f,g,_,L,H,M,z){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},zd(t,i,H);var ae=(i&62914560)===i?Hs-nt():(i&4194048)===i?Bd-nt():0;if(ae=Rp(H,ae),ae!==null){il=i,e.cancelPendingCommit=ae($d.bind(null,e,t,i,l,a,s,c,f,g,L,H,null,M,z)),Al(e,i,c,!_);return}}$d(e,t,i,l,a,s,c,f,g)}function Zx(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],i=s.getSnapshot;s=s.value;try{if(!ht(i(),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 Al(e,t,l,a){t&=~Jr,t&=~la,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var i=31-pt(s),c=1<<i;a[i]=-1,s&=~c}l!==0&&Wc(e,l,t)}function Gs(){return(Ce&6)===0?(zn(0),!1):!0}function Pr(){if(he!==null){if(Ae===0)var e=he.return;else e=he,$t=Kl=null,pr(e),ka=null,pn=0,e=he;for(;e!==null;)yd(e.alternate,e),e=e.return;he=null}}function Ha(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,fp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),il=0,Pr(),we=e,he=l=Kt(e.current,null),ge=t,Ae=0,bt=null,Nl=!1,La=Fa(e,t),Kr=!1,Ba=jt=Jr=la=El=He=0,ft=Mn=null,$r=!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-pt(a),i=1<<s;t|=e[s],a&=~i}return sl=t,us(),l}function Gd(e,t){de=null,k.H=Nn,t===_a||t===vs?(t=ao(),Ae=3):t===ar?(t=ao(),Ae=4):Ae=t===Mr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,bt=t,he===null&&(He=1,Ms(e,Ct(t,e.current)))}function Vd(){var e=yt.current;return e===null?!0:(ge&4194048)===ge?Rt===null:(ge&62914560)===ge||(ge&536870912)!==0?e===Rt:!1}function Qd(){var e=k.H;return k.H=Nn,e===null?Nn:e}function Xd(){var e=k.A;return k.A=Qx,e}function Vs(){He=4,Nl||(ge&4194048)!==ge&&yt.current!==null||(La=!0),(El&134217727)===0&&(la&134217727)===0||we===null||Al(we,ge,jt,!1)}function ec(e,t,l){var a=Ce;Ce|=2;var s=Qd(),i=Xd();(we!==e||ge!==t)&&(Ys=null,Ha(e,t)),t=!1;var c=He;e:do try{if(Ae!==0&&he!==null){var f=he,g=bt;switch(Ae){case 8:Pr(),c=6;break e;case 3:case 2:case 9:case 6:yt.current===null&&(t=!0);var _=Ae;if(Ae=0,bt=null,qa(e,f,g,_),l&&La){c=0;break e}break;default:_=Ae,Ae=0,bt=null,qa(e,f,g,_)}}Kx(),c=He;break}catch(L){Gd(e,L)}while(!0);return t&&e.shellSuspendCounter++,$t=Kl=null,Ce=a,k.H=s,k.A=i,he===null&&(we=null,ge=0,us()),c}function Kx(){for(;he!==null;)Zd(he)}function Jx(e,t){var l=Ce;Ce|=2;var a=Qd(),s=Xd();we!==e||ge!==t?(Ys=null,qs=nt()+500,Ha(e,t)):La=Fa(e,t);e:do try{if(Ae!==0&&he!==null){t=he;var i=bt;t:switch(Ae){case 1:Ae=0,bt=null,qa(e,t,i,1);break;case 2:case 9:if(to(i)){Ae=0,bt=null,Kd(t);break}t=function(){Ae!==2&&Ae!==9||we!==e||(Ae=7),qt(e)},i.then(t,t);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:to(i)?(Ae=0,bt=null,Kd(t)):(Ae=0,bt=null,qa(e,t,i,7));break;case 5:var c=null;switch(he.tag){case 26:c=he.memoizedState;case 5:case 27:var f=he;if(c?zf(c):f.stateNode.complete){Ae=0,bt=null;var g=f.sibling;if(g!==null)he=g;else{var _=f.return;_!==null?(he=_,Qs(_)):he=null}break t}}Ae=0,bt=null,qa(e,t,i,5);break;case 6:Ae=0,bt=null,qa(e,t,i,6);break;case 8:Pr(),He=6;break e;default:throw Error(o(462))}}$x();break}catch(L){Gd(e,L)}while(!0);return $t=Kl=null,k.H=a,k.A=s,Ce=l,he!==null?0:(we=null,ge=0,us(),He)}function $x(){for(;he!==null&&!Kn();)Zd(he)}function Zd(e){var t=hd(e.alternate,e,sl);e.memoizedProps=e.pendingProps,t===null?Qs(e):he=t}function Kd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=od(l,t,t.pendingProps,t.type,void 0,ge);break;case 11:t=od(l,t,t.pendingProps,t.type.render,t.ref,ge);break;case 5:pr(t);default:yd(l,t),t=he=Qu(t,sl),t=hd(l,t,sl)}e.memoizedProps=e.pendingProps,t===null?Qs(e):he=t}function qa(e,t,l,a){$t=Kl=null,pr(t),ka=null,pn=0;var s=t.return;try{if(Bx(e,s,t,l,ge)){He=1,Ms(e,Ct(l,e.current)),he=null;return}}catch(i){if(s!==null)throw he=s,i;He=1,Ms(e,Ct(l,e.current)),he=null;return}t.flags&32768?(je||a===1?e=!0:La||(ge&536870912)!==0?e=!1:(Nl=e=!0,(a===2||a===9||a===3||a===6)&&(a=yt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Jd(t,e)):Qs(t)}function Qs(e){var t=e;do{if((t.flags&32768)!==0){Jd(t,Nl);return}e=t.return;var l=qx(t.alternate,t,sl);if(l!==null){he=l;return}if(t=t.sibling,t!==null){he=t;return}he=t=e}while(t!==null);He===0&&(He=5)}function Jd(e,t){do{var l=Yx(e.alternate,e);if(l!==null){l.flags&=32767,he=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){he=e;return}he=e=l}while(e!==null);He=6,he=null}function $d(e,t,l,a,s,i,c,f,g){e.cancelPendingCommit=null;do Xs();while(Je!==0);if((Ce&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(i=t.lanes|t.childLanes,i|=Gi,_m(e,l,i,c,f,g),e===we&&(he=we=null,ge=0),Ua=t,Cl=e,il=l,Wr=i,Fr=s,Ud=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Px(ia,function(){return ef(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null,s=w.p,w.p=2,c=Ce,Ce|=4;try{Gx(e,t,l)}finally{Ce=c,w.p=s,k.T=a}}Je=1,Wd(),Fd(),Id()}}function Wd(){if(Je===1){Je=0;var e=Cl,t=Ua,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null;var a=w.p;w.p=2;var s=Ce;Ce|=4;try{Rd(t,e);var i=fc,c=Du(e.containerInfo),f=i.focusedElem,g=i.selectionRange;if(c!==f&&f&&f.ownerDocument&&Ou(f.ownerDocument.documentElement,f)){if(g!==null&&Bi(f)){var _=g.start,L=g.end;if(L===void 0&&(L=_),"selectionStart"in f)f.selectionStart=_,f.selectionEnd=Math.min(L,f.value.length);else{var H=f.ownerDocument||document,M=H&&H.defaultView||window;if(M.getSelection){var z=M.getSelection(),ae=f.textContent.length,ue=Math.min(g.start,ae),Me=g.end===void 0?ue:Math.min(g.end,ae);!z.extend&&ue>Me&&(c=Me,Me=ue,ue=c);var C=zu(f,ue),E=zu(f,Me);if(C&&E&&(z.rangeCount!==1||z.anchorNode!==C.node||z.anchorOffset!==C.offset||z.focusNode!==E.node||z.focusOffset!==E.offset)){var A=H.createRange();A.setStart(C.node,C.offset),z.removeAllRanges(),ue>Me?(z.addRange(A),z.extend(E.node,E.offset)):(A.setEnd(E.node,E.offset),z.addRange(A))}}}}for(H=[],z=f;z=z.parentNode;)z.nodeType===1&&H.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<H.length;f++){var B=H[f];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}ai=!!dc,fc=dc=null}finally{Ce=s,w.p=a,k.T=l}}e.current=t,Je=2}}function Fd(){if(Je===2){Je=0;var e=Cl,t=Ua,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=k.T,k.T=null;var a=w.p;w.p=2;var s=Ce;Ce|=4;try{Td(e,t.alternate,t)}finally{Ce=s,w.p=a,k.T=l}}Je=3}}function Id(){if(Je===4||Je===3){Je=0,Gt();var e=Cl,t=Ua,l=il,a=Ud;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Ua=Cl=null,Pd(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Tl=null),yi(l),t=t.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(Ul,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=k.T,s=w.p,w.p=2,k.T=null;try{for(var i=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];i(f.value,{componentStack:f.stack})}}finally{k.T=t,w.p=s}}(il&3)!==0&&Xs(),qt(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Ir?wn++:(wn=0,Ir=e):wn=0,zn(0)}}function Pd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mn(t)))}function Xs(){return Wd(),Fd(),Id(),ef()}function ef(){if(Je!==5)return!1;var e=Cl,t=Wr;Wr=0;var l=yi(il),a=k.T,s=w.p;try{w.p=32>l?32:l,k.T=null,l=Fr,Fr=null;var i=Cl,c=il;if(Je=0,Ua=Cl=null,il=0,(Ce&6)!==0)throw Error(o(331));var f=Ce;if(Ce|=4,Dd(i.current),wd(i,i.current,c,l),Ce=f,zn(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(Ul,i)}catch{}return!0}finally{w.p=s,k.T=a,Pd(e,t)}}function tf(e,t,l){t=Ct(l,t),t=Rr(e.stateNode,t,2),e=gl(e,t,2),e!==null&&(Ia(e,2),qt(e))}function _e(e,t,l){if(e.tag===3)tf(e,e,l);else for(;t!==null;){if(t.tag===3){tf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Tl===null||!Tl.has(a))){e=Ct(l,e),l=ld(2),a=gl(t,l,2),a!==null&&(ad(l,a,t,e),Ia(a,2),qt(a));break}}t=t.return}}function tc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Xx;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)||(Kr=!0,s.add(l),e=Wx.bind(null,e,t,l),t.then(e,e))}function Wx(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,we===e&&(ge&l)===l&&(He===4||He===3&&(ge&62914560)===ge&&300>nt()-Hs?(Ce&2)===0&&Ha(e,0):Jr|=l,Ba===ge&&(Ba=0)),qt(e)}function lf(e,t){t===0&&(t=$c()),e=Ql(e,t),e!==null&&(Ia(e,t),qt(e))}function Fx(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),lf(e,l)}function Ix(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(o(314))}a!==null&&a.delete(t),lf(e,l)}function Px(e,t){return Oe(e,t)}var Zs=null,Ya=null,lc=!1,Ks=!1,ac=!1,_l=0;function qt(e){e!==Ya&&e.next===null&&(Ya===null?Zs=Ya=e:Ya=Ya.next=e),Ks=!0,lc||(lc=!0,tp())}function zn(e,t){if(!ac&&Ks){ac=!0;do for(var l=!1,a=Zs;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var i=0;else{var c=a.suspendedLanes,f=a.pingedLanes;i=(1<<31-pt(42|e)+1)-1,i&=s&~(c&~f),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,rf(a,i))}else i=ge,i=Fn(a,a===we?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Fa(a,i)||(l=!0,rf(a,i));a=a.next}while(l);ac=!1}}function ep(){af()}function af(){Ks=lc=!1;var e=0;_l!==0&&dp()&&(e=_l);for(var t=nt(),l=null,a=Zs;a!==null;){var s=a.next,i=nf(a,t);i===0?(a.next=null,l===null?Zs=s:l.next=s,s===null&&(Ya=l)):(l=a,(e!==0||(i&3)!==0)&&(Ks=!0)),a=s}Je!==0&&Je!==5||zn(e),_l!==0&&(_l=0)}function nf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var c=31-pt(i),f=1<<c,g=s[c];g===-1?((f&l)===0||(f&a)!==0)&&(s[c]=Am(f,t)):g<=t&&(e.expiredLanes|=f),i&=~f}if(t=we,l=ge,l=Fn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&ul(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Fa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&ul(a),yi(l)){case 2:case 8:l=Vt;break;case 32:l=ia;break;case 268435456:l=Wa;break;default:l=ia}return a=sf.bind(null,e),l=Oe(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&ul(a),e.callbackPriority=2,e.callbackNode=null,2}function sf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Xs()&&e.callbackNode!==l)return null;var a=ge;return a=Fn(e,e===we?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(qd(e,a,t),nf(e,nt()),e.callbackNode!=null&&e.callbackNode===l?sf.bind(null,e):null)}function rf(e,t){if(Xs())return null;qd(e,t,!0)}function tp(){mp(function(){(Ce&6)!==0?Oe(sa,ep):af()})}function nc(){if(_l===0){var e=Ca;e===0&&(e=Jn,Jn<<=1,(Jn&261888)===0&&(Jn=256)),_l=e}return _l}function cf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ts(""+e)}function uf(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 lp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var i=cf((s[rt]||null).action),c=a.submitter;c&&(t=(t=c[rt]||null)?cf(t.formAction):c.getAttribute("formAction"),t!==null&&(i=t,c=null));var f=new ss("action","action",null,a,s);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(_l!==0){var g=c?uf(s,c):new FormData(s);Er(l,{pending:!0,data:g,method:s.method,action:i},null,g)}}else typeof i=="function"&&(f.preventDefault(),g=c?uf(s,c):new FormData(s),Er(l,{pending:!0,data:g,method:s.method,action:i},i,g))},currentTarget:s}]})}}for(var sc=0;sc<Yi.length;sc++){var ic=Yi[sc],ap=ic.toLowerCase(),np=ic[0].toUpperCase()+ic.slice(1);zt(ap,"on"+np)}zt(Uu,"onAnimationEnd"),zt(Hu,"onAnimationIteration"),zt(qu,"onAnimationStart"),zt("dblclick","onDoubleClick"),zt("focusin","onFocus"),zt("focusout","onBlur"),zt(bx,"onTransitionRun"),zt(jx,"onTransitionStart"),zt(Sx,"onTransitionCancel"),zt(Yu,"onTransitionEnd"),fa("onMouseEnter",["mouseout","mouseover"]),fa("onMouseLeave",["mouseout","mouseover"]),fa("onPointerEnter",["pointerout","pointerover"]),fa("onPointerLeave",["pointerout","pointerover"]),ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var On="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(On));function of(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 i=void 0;if(t)for(var c=a.length-1;0<=c;c--){var f=a[c],g=f.instance,_=f.currentTarget;if(f=f.listener,g!==i&&s.isPropagationStopped())break e;i=f,s.currentTarget=_;try{i(s)}catch(L){cs(L)}s.currentTarget=null,i=g}else for(c=0;c<a.length;c++){if(f=a[c],g=f.instance,_=f.currentTarget,f=f.listener,g!==i&&s.isPropagationStopped())break e;i=f,s.currentTarget=_;try{i(s)}catch(L){cs(L)}s.currentTarget=null,i=g}}}}function ve(e,t){var l=t[gi];l===void 0&&(l=t[gi]=new Set);var a=e+"__bubble";l.has(a)||(df(t,e,2,!1),l.add(a))}function rc(e,t,l){var a=0;t&&(a|=4),df(l,e,a,t)}var Js="_reactListening"+Math.random().toString(36).slice(2);function cc(e){if(!e[Js]){e[Js]=!0,lu.forEach(function(l){l!=="selectionchange"&&(sp.has(l)||rc(l,!1,e),rc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Js]||(t[Js]=!0,rc("selectionchange",!1,t))}}function df(e,t,l,a){switch(qf(t)){case 2:var s=zp;break;case 8:s=Op;break;default:s=Nc}l=s.bind(null,t,l,e),s=void 0,!_i||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 uc(e,t,l,a,s){var i=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===s)break;if(c===4)for(c=a.return;c!==null;){var g=c.tag;if((g===3||g===4)&&c.stateNode.containerInfo===s)return;c=c.return}for(;f!==null;){if(c=ua(f),c===null)return;if(g=c.tag,g===5||g===6||g===26||g===27){a=i=c;continue e}f=f.parentNode}}a=a.return}xu(function(){var _=i,L=Ci(l),H=[];e:{var M=Gu.get(e);if(M!==void 0){var z=ss,ae=e;switch(e){case"keypress":if(as(l)===0)break e;case"keydown":case"keyup":z=Im;break;case"focusin":ae="focus",z=wi;break;case"focusout":ae="blur",z=wi;break;case"beforeblur":case"afterblur":z=wi;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":z=vu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=qm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=tx;break;case Uu:case Hu:case qu:z=Vm;break;case Yu:z=ax;break;case"scroll":case"scrollend":z=Um;break;case"wheel":z=sx;break;case"copy":case"cut":case"paste":z=Xm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=gu;break;case"toggle":case"beforetoggle":z=rx}var ue=(t&4)!==0,Me=!ue&&(e==="scroll"||e==="scrollend"),C=ue?M!==null?M+"Capture":null:M;ue=[];for(var E=_,A;E!==null;){var B=E;if(A=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||A===null||C===null||(B=tn(E,C),B!=null&&ue.push(Dn(E,B,A))),Me)break;E=E.return}0<ue.length&&(M=new z(M,ae,null,l,L),H.push({event:M,listeners:ue}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",M&&l!==Ti&&(ae=l.relatedTarget||l.fromElement)&&(ua(ae)||ae[ca]))break e;if((z||M)&&(M=L.window===L?L:(M=L.ownerDocument)?M.defaultView||M.parentWindow:window,z?(ae=l.relatedTarget||l.toElement,z=_,ae=ae?ua(ae):null,ae!==null&&(Me=v(ae),ue=ae.tag,ae!==Me||ue!==5&&ue!==27&&ue!==6)&&(ae=null)):(z=null,ae=_),z!==ae)){if(ue=vu,B="onMouseLeave",C="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ue=gu,B="onPointerLeave",C="onPointerEnter",E="pointer"),Me=z==null?M:en(z),A=ae==null?M:en(ae),M=new ue(B,E+"leave",z,l,L),M.target=Me,M.relatedTarget=A,B=null,ua(L)===_&&(ue=new ue(C,E+"enter",ae,l,L),ue.target=A,ue.relatedTarget=Me,B=ue),Me=B,z&&ae)t:{for(ue=ip,C=z,E=ae,A=0,B=C;B;B=ue(B))A++;B=0;for(var re=E;re;re=ue(re))B++;for(;0<A-B;)C=ue(C),A--;for(;0<B-A;)E=ue(E),B--;for(;A--;){if(C===E||E!==null&&C===E.alternate){ue=C;break t}C=ue(C),E=ue(E)}ue=null}else ue=null;z!==null&&ff(H,M,z,ue,!1),ae!==null&&Me!==null&&ff(H,Me,ae,ue,!0)}}e:{if(M=_?en(_):window,z=M.nodeName&&M.nodeName.toLowerCase(),z==="select"||z==="input"&&M.type==="file")var Ee=Au;else if(Tu(M))if(_u)Ee=vx;else{Ee=px;var ie=xx}else z=M.nodeName,!z||z.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?_&&Ei(_.elementType)&&(Ee=Au):Ee=hx;if(Ee&&(Ee=Ee(e,_))){Cu(H,Ee,l,L);break e}ie&&ie(e,M,_),e==="focusout"&&_&&M.type==="number"&&_.memoizedProps.value!=null&&Ni(M,"number",M.value)}switch(ie=_?en(_):window,e){case"focusin":(Tu(ie)||ie.contentEditable==="true")&&(ya=ie,Ui=_,on=null);break;case"focusout":on=Ui=ya=null;break;case"mousedown":Hi=!0;break;case"contextmenu":case"mouseup":case"dragend":Hi=!1,Lu(H,l,L);break;case"selectionchange":if(gx)break;case"keydown":case"keyup":Lu(H,l,L)}var fe;if(Oi)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else va?Nu(e,l)&&(be="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(be="onCompositionStart");be&&(bu&&l.locale!=="ko"&&(va||be!=="onCompositionStart"?be==="onCompositionEnd"&&va&&(fe=pu()):(fl=L,ki="value"in fl?fl.value:fl.textContent,va=!0)),ie=$s(_,be),0<ie.length&&(be=new yu(be,e,null,l,L),H.push({event:be,listeners:ie}),fe?be.data=fe:(fe=Eu(l),fe!==null&&(be.data=fe)))),(fe=ux?ox(e,l):dx(e,l))&&(be=$s(_,"onBeforeInput"),0<be.length&&(ie=new yu("onBeforeInput","beforeinput",null,l,L),H.push({event:ie,listeners:be}),ie.data=fe)),lp(H,e,_,l,L)}of(H,t)})}function Dn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function $s(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=tn(e,l),s!=null&&a.unshift(Dn(e,s,i)),s=tn(e,t),s!=null&&a.push(Dn(e,s,i))),e.tag===3)return a;e=e.return}return[]}function ip(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ff(e,t,l,a,s){for(var i=t._reactName,c=[];l!==null&&l!==a;){var f=l,g=f.alternate,_=f.stateNode;if(f=f.tag,g!==null&&g===a)break;f!==5&&f!==26&&f!==27||_===null||(g=_,s?(_=tn(l,i),_!=null&&c.unshift(Dn(l,_,g))):s||(_=tn(l,i),_!=null&&c.push(Dn(l,_,g)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var rp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function mf(e){return(typeof e=="string"?e:""+e).replace(rp,`
|
|
49
|
-
`).replace(cp,"")}function xf(e,t){return t=mf(t),mf(e)===t}function Re(e,t,l,a,s,i){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||xa(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&xa(e,""+a);break;case"className":Pn(e,"class",a);break;case"tabIndex":Pn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Pn(e,l,a);break;case"style":fu(e,a,i);break;case"data":if(t!=="object"){Pn(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=ts(""+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 i=="function"&&(l==="formAction"?(t!=="input"&&Re(e,t,"name",s.name,s,null),Re(e,t,"formEncType",s.formEncType,s,null),Re(e,t,"formMethod",s.formMethod,s,null),Re(e,t,"formTarget",s.formTarget,s,null)):(Re(e,t,"encType",s.encType,s,null),Re(e,t,"method",s.method,s,null),Re(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ts(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Xt);break;case"onScroll":a!=null&&ve("scroll",e);break;case"onScrollEnd":a!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(o(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=ts(""+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":ve("beforetoggle",e),ve("toggle",e),In(e,"popover",a);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":In(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=Lm.get(l)||l,In(e,l,a))}}function oc(e,t,l,a,s,i){switch(l){case"style":fu(e,a,i);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?xa(e,a):(typeof a=="number"||typeof a=="bigint")&&xa(e,""+a);break;case"onScroll":a!=null&&ve("scroll",e);break;case"onScrollEnd":a!=null&&ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!au.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),i=e[rt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof a=="function")){typeof i!="function"&&i!==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,""):In(e,l,a)}}}function tt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var a=!1,s=!1,i;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];if(c!=null)switch(i){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Re(e,t,i,c,l,null)}}s&&Re(e,t,"srcSet",l.srcSet,l,null),a&&Re(e,t,"src",l.src,l,null);return;case"input":ve("invalid",e);var f=i=c=s=null,g=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":s=L;break;case"type":c=L;break;case"checked":g=L;break;case"defaultChecked":_=L;break;case"value":i=L;break;case"defaultValue":f=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,t));break;default:Re(e,t,a,L,l,null)}}cu(e,i,f,g,_,c,s,!1);return;case"select":ve("invalid",e),a=c=i=null;for(s in l)if(l.hasOwnProperty(s)&&(f=l[s],f!=null))switch(s){case"value":i=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Re(e,t,s,f,l,null)}t=i,l=c,e.multiple=!!a,t!=null?ma(e,!!a,t,!1):l!=null&&ma(e,!!a,l,!0);return;case"textarea":ve("invalid",e),i=s=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":s=f;break;case"children":i=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Re(e,t,c,f,l,null)}ou(e,a,s,i);return;case"option":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Re(e,t,g,a,l,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(a=0;a<On.length;a++)ve(On[a],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in l)if(l.hasOwnProperty(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Re(e,t,_,a,l,null)}return;default:if(Ei(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&oc(e,t,L,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Re(e,t,f,a,l,null))}function up(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,i=null,c=null,f=null,g=null,_=null,L=null;for(z in l){var H=l[z];if(l.hasOwnProperty(z)&&H!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":g=H;default:a.hasOwnProperty(z)||Re(e,t,z,null,a,H)}}for(var M in a){var z=a[M];if(H=l[M],a.hasOwnProperty(M)&&(z!=null||H!=null))switch(M){case"type":i=z;break;case"name":s=z;break;case"checked":_=z;break;case"defaultChecked":L=z;break;case"value":c=z;break;case"defaultValue":f=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(137,t));break;default:z!==H&&Re(e,t,M,z,a,H)}}Si(e,c,f,g,_,L,i,s);return;case"select":z=c=f=M=null;for(i in l)if(g=l[i],l.hasOwnProperty(i)&&g!=null)switch(i){case"value":break;case"multiple":z=g;default:a.hasOwnProperty(i)||Re(e,t,i,null,a,g)}for(s in a)if(i=a[s],g=l[s],a.hasOwnProperty(s)&&(i!=null||g!=null))switch(s){case"value":M=i;break;case"defaultValue":f=i;break;case"multiple":c=i;default:i!==g&&Re(e,t,s,i,a,g)}t=f,l=c,a=z,M!=null?ma(e,!!l,M,!1):!!a!=!!l&&(t!=null?ma(e,!!l,t,!0):ma(e,!!l,l?[]:"",!1));return;case"textarea":z=M=null;for(f in l)if(s=l[f],l.hasOwnProperty(f)&&s!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Re(e,t,f,null,a,s)}for(c in a)if(s=a[c],i=l[c],a.hasOwnProperty(c)&&(s!=null||i!=null))switch(c){case"value":M=s;break;case"defaultValue":z=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==i&&Re(e,t,c,s,a,i)}uu(e,M,z);return;case"option":for(var ae in l)if(M=l[ae],l.hasOwnProperty(ae)&&M!=null&&!a.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Re(e,t,ae,null,a,M)}for(g in a)if(M=a[g],z=l[g],a.hasOwnProperty(g)&&M!==z&&(M!=null||z!=null))switch(g){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Re(e,t,g,M,a,z)}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 ue in l)M=l[ue],l.hasOwnProperty(ue)&&M!=null&&!a.hasOwnProperty(ue)&&Re(e,t,ue,null,a,M);for(_ in a)if(M=a[_],z=l[_],a.hasOwnProperty(_)&&M!==z&&(M!=null||z!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:Re(e,t,_,M,a,z)}return;default:if(Ei(t)){for(var Me in l)M=l[Me],l.hasOwnProperty(Me)&&M!==void 0&&!a.hasOwnProperty(Me)&&oc(e,t,Me,void 0,a,M);for(L in a)M=a[L],z=l[L],!a.hasOwnProperty(L)||M===z||M===void 0&&z===void 0||oc(e,t,L,M,a,z);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!a.hasOwnProperty(C)&&Re(e,t,C,null,a,M);for(H in a)M=a[H],z=l[H],!a.hasOwnProperty(H)||M===z||M==null&&z==null||Re(e,t,H,M,a,z)}function pf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function op(){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],i=s.transferSize,c=s.initiatorType,f=s.duration;if(i&&f&&pf(c)){for(c=0,f=s.responseEnd,a+=1;a<l.length;a++){var g=l[a],_=g.startTime;if(_>f)break;var L=g.transferSize,H=g.initiatorType;L&&pf(H)&&(g=g.responseEnd,c+=L*(g<f?1:(f-_)/(g-_)))}if(--a,t+=8*(i+c)/(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 dc=null,fc=null;function Ws(e){return e.nodeType===9?e:e.ownerDocument}function hf(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 vf(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 mc(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 xc=null;function dp(){var e=window.event;return e&&e.type==="popstate"?e===xc?!1:(xc=e,!0):(xc=null,!1)}var yf=typeof setTimeout=="function"?setTimeout:void 0,fp=typeof clearTimeout=="function"?clearTimeout:void 0,gf=typeof Promise=="function"?Promise:void 0,mp=typeof queueMicrotask=="function"?queueMicrotask:typeof gf<"u"?function(e){return gf.resolve(null).then(e).catch(xp)}:yf;function xp(e){setTimeout(function(){throw e})}function kl(e){return e==="head"}function bf(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),Xa(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Ln(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ln(l);for(var i=l.firstChild;i;){var c=i.nextSibling,f=i.nodeName;i[Pa]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=c}}else l==="body"&&Ln(e.ownerDocument.body);l=s}while(l);Xa(t)}function jf(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 pc(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":pc(l),bi(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function pp(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[Pa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==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(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Mt(e.nextSibling),e===null)break}return null}function hp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Mt(e.nextSibling),e===null))return null;return e}function Sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Mt(e.nextSibling),e===null))return null;return e}function hc(e){return e.data==="$?"||e.data==="$~"}function vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vp(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 Mt(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 yc=null;function Nf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Mt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Ef(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 Tf(e,t,l){switch(t=Ws(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ln(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bi(e)}var wt=new Map,Cf=new Set;function Fs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rl=w.d;w.d={f:yp,r:gp,D:bp,C:jp,L:Sp,m:Np,X:Tp,S:Ep,M:Cp};function yp(){var e=rl.f(),t=Gs();return e||t}function gp(e){var t=oa(e);t!==null&&t.tag===5&&t.type==="form"?Go(t):rl.r(e)}var Ga=typeof document>"u"?null:document;function Af(e,t,l){var a=Ga;if(a&&typeof t=="string"&&t){var s=Et(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Cf.has(s)||(Cf.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),tt(t,"link",e),$e(t),a.head.appendChild(t)))}}function bp(e){rl.D(e),Af("dns-prefetch",e,null)}function jp(e,t){rl.C(e,t),Af("preconnect",e,t)}function Sp(e,t,l){rl.L(e,t,l);var a=Ga;if(a&&e&&t){var s='link[rel="preload"][as="'+Et(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Et(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Et(l.imageSizes)+'"]')):s+='[href="'+Et(e)+'"]';var i=s;switch(t){case"style":i=Va(e);break;case"script":i=Qa(e)}wt.has(i)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),wt.set(i,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Bn(i))||t==="script"&&a.querySelector(Un(i))||(t=a.createElement("link"),tt(t,"link",e),$e(t),a.head.appendChild(t)))}}function Np(e,t){rl.m(e,t);var l=Ga;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Et(a)+'"][href="'+Et(e)+'"]',i=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Qa(e)}if(!wt.has(i)&&(e=b({rel:"modulepreload",href:e},t),wt.set(i,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Un(i)))return}a=l.createElement("link"),tt(a,"link",e),$e(a),l.head.appendChild(a)}}}function Ep(e,t,l){rl.S(e,t,l);var a=Ga;if(a&&e){var s=da(a).hoistableStyles,i=Va(e);t=t||"default";var c=s.get(i);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(Bn(i)))f.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=wt.get(i))&&gc(e,l);var g=c=a.createElement("link");$e(g),tt(g,"link",e),g._p=new Promise(function(_,L){g.onload=_,g.onerror=L}),g.addEventListener("load",function(){f.loading|=1}),g.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Is(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},s.set(i,c)}}}function Tp(e,t){rl.X(e,t);var l=Ga;if(l&&e){var a=da(l).hoistableScripts,s=Qa(e),i=a.get(s);i||(i=l.querySelector(Un(s)),i||(e=b({src:e,async:!0},t),(t=wt.get(s))&&bc(e,t),i=l.createElement("script"),$e(i),tt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(s,i))}}function Cp(e,t){rl.M(e,t);var l=Ga;if(l&&e){var a=da(l).hoistableScripts,s=Qa(e),i=a.get(s);i||(i=l.querySelector(Un(s)),i||(e=b({src:e,async:!0,type:"module"},t),(t=wt.get(s))&&bc(e,t),i=l.createElement("script"),$e(i),tt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(s,i))}}function _f(e,t,l,a){var s=(s=te.current)?Fs(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Va(l.href),l=da(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=Va(l.href);var i=da(s).hoistableStyles,c=i.get(e);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=s.querySelector(Bn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),wt.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},wt.set(e,l),i||Ap(s,e,l,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qa(l),l=da(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(o(444,e))}}function Va(e){return'href="'+Et(e)+'"'}function Bn(e){return'link[rel="stylesheet"]['+e+"]"}function kf(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Ap(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}),tt(t,"link",l),$e(t),e.head.appendChild(t))}function Qa(e){return'[src="'+Et(e)+'"]'}function Un(e){return"script[async]"+e}function Rf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Et(l.href)+'"]');if(a)return t.instance=a,$e(a),a;var s=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),$e(a),tt(a,"style",s),Is(a,l.precedence,e),t.instance=a;case"stylesheet":s=Va(l.href);var i=e.querySelector(Bn(s));if(i)return t.state.loading|=4,t.instance=i,$e(i),i;a=kf(l),(s=wt.get(s))&&gc(a,s),i=(e.ownerDocument||e).createElement("link"),$e(i);var c=i;return c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),tt(i,"link",a),t.state.loading|=4,Is(i,l.precedence,e),t.instance=i;case"script":return i=Qa(l.src),(s=e.querySelector(Un(i)))?(t.instance=s,$e(s),s):(a=l,(s=wt.get(i))&&(a=b({},l),bc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),$e(s),tt(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Is(a,l.precedence,e));return t.instance}function Is(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,i=s,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)i=f;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ps=null;function Mf(e,t,l){if(Ps===null){var a=new Map,s=Ps=new Map;s.set(l,a)}else s=Ps,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 i=l[s];if(!(i[Pa]||i[Fe]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var c=i.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(i):a.set(c,[i])}}return a}function wf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function _p(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 zf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kp(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=Va(a.href),i=t.querySelector(Bn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ei.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,$e(i);return}i=t.ownerDocument||t,a=kf(a),(s=wt.get(s))&&gc(a,s),i=i.createElement("link"),$e(i);var c=i;c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),tt(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ei.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var jc=0;function Rp(e,t){return e.stylesheets&&e.count===0&&li(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&li(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&jc===0&&(jc=62500*op());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&li(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>jc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function ei(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)li(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ti=null;function li(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ti=new Map,t.forEach(Mp,e),ti=null,ei.call(e))}function Mp(e,t){if(!(t.state.loading&4)){var l=ti.get(e);if(l)var a=l.get(null);else{l=new Map,ti.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var c=s[i];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}s=t.instance,c=s.getAttribute("data-precedence"),i=l.get(c)||a,i===a&&l.set(null,s),l.set(c,s),this.count++,a=ei.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Hn={$$typeof:F,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function wp(e,t,l,a,s,i,c,f,g){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=hi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hi(0),this.hiddenUpdates=hi(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Of(e,t,l,a,s,i,c,f,g,_,L,H){return e=new wp(e,t,l,c,g,_,L,H,f),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=er(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:a,isDehydrated:l,cache:t},nr(i),e}function Df(e){return e?(e=ja,e):ja}function Lf(e,t,l,a,s,i){s=Df(s),a.context===null?a.context=s:a.pendingContext=s,a=yl(t),a.payload={element:l},i=i===void 0?null:i,i!==null&&(a.callback=i),l=gl(e,a,t),l!==null&&(mt(l,e,t),vn(l,e,t))}function Bf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Sc(e,t){Bf(e,t),(e=e.alternate)&&Bf(e,t)}function Uf(e){if(e.tag===13||e.tag===31){var t=Ql(e,67108864);t!==null&&mt(t,e,67108864),Sc(e,67108864)}}function Hf(e){if(e.tag===13||e.tag===31){var t=St();t=vi(t);var l=Ql(e,t);l!==null&&mt(l,e,t),Sc(e,t)}}var ai=!0;function zp(e,t,l,a){var s=k.T;k.T=null;var i=w.p;try{w.p=2,Nc(e,t,l,a)}finally{w.p=i,k.T=s}}function Op(e,t,l,a){var s=k.T;k.T=null;var i=w.p;try{w.p=8,Nc(e,t,l,a)}finally{w.p=i,k.T=s}}function Nc(e,t,l,a){if(ai){var s=Ec(a);if(s===null)uc(e,t,a,ni,l),Yf(e,a);else if(Lp(s,e,t,l,a))a.stopPropagation();else if(Yf(e,a),t&4&&-1<Dp.indexOf(e)){for(;s!==null;){var i=oa(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var c=Hl(i.pendingLanes);if(c!==0){var f=i;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var g=1<<31-pt(c);f.entanglements[1]|=g,c&=~g}qt(i),(Ce&6)===0&&(qs=nt()+500,zn(0))}}break;case 31:case 13:f=Ql(i,2),f!==null&&mt(f,i,2),Gs(),Sc(i,2)}if(i=Ec(a),i===null&&uc(e,t,a,ni,l),i===s)break;s=i}s!==null&&a.stopPropagation()}else uc(e,t,a,null,l)}}function Ec(e){return e=Ci(e),Tc(e)}var ni=null;function Tc(e){if(ni=null,e=ua(e),e!==null){var t=v(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(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 ni=e,null}function qf(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(xi()){case sa:return 2;case Vt:return 8;case ia:case pi:return 32;case Wa:return 268435456;default:return 32}default:return 32}}var Cc=!1,Rl=null,Ml=null,wl=null,qn=new Map,Yn=new Map,zl=[],Dp="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 Yf(e,t){switch(e){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":wl=null;break;case"pointerover":case"pointerout":qn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yn.delete(t.pointerId)}}function Gn(e,t,l,a,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:i,targetContainers:[s]},t!==null&&(t=oa(t),t!==null&&Uf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Lp(e,t,l,a,s){switch(t){case"focusin":return Rl=Gn(Rl,e,t,l,a,s),!0;case"dragenter":return Ml=Gn(Ml,e,t,l,a,s),!0;case"mouseover":return wl=Gn(wl,e,t,l,a,s),!0;case"pointerover":var i=s.pointerId;return qn.set(i,Gn(qn.get(i)||null,e,t,l,a,s)),!0;case"gotpointercapture":return i=s.pointerId,Yn.set(i,Gn(Yn.get(i)||null,e,t,l,a,s)),!0}return!1}function Gf(e){var t=ua(e.target);if(t!==null){var l=v(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,eu(e.priority,function(){Hf(l)});return}}else if(t===31){if(t=S(l),t!==null){e.blockedOn=t,eu(e.priority,function(){Hf(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 si(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Ec(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Ti=a,l.target.dispatchEvent(a),Ti=null}else return t=oa(l),t!==null&&Uf(t),e.blockedOn=l,!1;t.shift()}return!0}function Vf(e,t,l){si(e)&&l.delete(t)}function Bp(){Cc=!1,Rl!==null&&si(Rl)&&(Rl=null),Ml!==null&&si(Ml)&&(Ml=null),wl!==null&&si(wl)&&(wl=null),qn.forEach(Vf),Yn.forEach(Vf)}function ii(e,t){e.blockedOn===t&&(e.blockedOn=null,Cc||(Cc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Bp)))}var ri=null;function Qf(e){ri!==e&&(ri=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){ri===e&&(ri=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(Tc(a||l)===null)continue;break}var i=oa(l);i!==null&&(e.splice(t,3),t-=3,Er(i,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function Xa(e){function t(g){return ii(g,e)}Rl!==null&&ii(Rl,e),Ml!==null&&ii(Ml,e),wl!==null&&ii(wl,e),qn.forEach(t),Yn.forEach(t);for(var l=0;l<zl.length;l++){var a=zl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<zl.length&&(l=zl[0],l.blockedOn===null);)Gf(l),l.blockedOn===null&&zl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],i=l[a+1],c=s[rt]||null;if(typeof i=="function")c||Qf(l);else if(c){var f=null;if(i&&i.hasAttribute("formAction")){if(s=i,c=i[rt]||null)f=c.formAction;else if(Tc(s)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),Qf(l)}}}function Xf(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(c){return s=c})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.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 Ac(e){this._internalRoot=e}ci.prototype.render=Ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=St();Lf(l,a,e,t,null,null)},ci.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lf(e.current,2,null,e,null,null),Gs(),t[ca]=null}};function ci(e){this._internalRoot=e}ci.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pc();e={blockedOn:null,target:e,priority:t};for(var l=0;l<zl.length&&t!==0&&t<zl[l].priority;l++);zl.splice(l,0,e),l===0&&Gf(e)}};var Zf=u.version;if(Zf!=="19.2.4")throw Error(o(527,Zf,"19.2.4"));w.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ui=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ui.isDisabled&&ui.supportsFiber)try{Ul=ui.inject(Up),xt=ui}catch{}}return Qn.createRoot=function(e,t){if(!m(e))throw Error(o(299));var l=!1,a="",s=Io,i=Po,c=ed;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&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=Of(e,1,!1,null,null,l,a,null,s,i,c,Xf),e[ca]=t.current,cc(e),new Ac(t)},Qn.hydrateRoot=function(e,t,l){if(!m(e))throw Error(o(299));var a=!1,s="",i=Io,c=Po,f=ed,g=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(g=l.formState)),t=Of(e,1,!0,t,l??null,a,s,g,i,c,f,Xf),t.context=Df(null),l=t.current,a=St(),a=vi(a),s=yl(a),s.callback=null,gl(l,s,a),l=a,t.current.lanes=l,Ia(t,l),qt(t),e[ca]=t.current,cc(e),new ci(t)},Qn.version="19.2.4",Qn}var lm;function Jp(){if(lm)return Rc.exports;lm=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(u){console.error(u)}}return r(),Rc.exports=Kp(),Rc.exports}var $p=Jp();const Wp="";class Fp extends Error{constructor(u,d){super(u),this.name="ApiError",this.status=d}}async function qe(r,u){const d=await fetch(`${Wp}${r}`,u);if(!d.ok){const o=await d.json().catch(()=>({error:d.statusText}));throw new Fp(o.error||`HTTP ${d.status}`,d.status)}return d.json()}const Se={getConfig(){return qe("/api/config")},setConfig(r,u){return qe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:u})})},getSkills(){return qe("/api/skills")},getSkillDetail(r,u){return qe(`/api/skills/${r}/${u}`)},getEvals(r,u){return qe(`/api/skills/${r}/${u}/evals`)},saveEvals(r,u,d){return qe(`/api/skills/${r}/${u}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},generateEvals(r,u){return qe(`/api/skills/${r}/${u}/generate-evals`,{method:"POST"})},getLatestBenchmark(r,u){return qe(`/api/skills/${r}/${u}/benchmark/latest`)},getHistory(r,u,d){const o=new URLSearchParams;d!=null&&d.model&&o.set("model",d.model),d!=null&&d.type&&o.set("type",d.type),d!=null&&d.from&&o.set("from",d.from),d!=null&&d.to&&o.set("to",d.to);const m=o.toString();return qe(`/api/skills/${r}/${u}/history${m?"?"+m:""}`)},getHistoryEntry(r,u,d){return qe(`/api/skills/${r}/${u}/history/${encodeURIComponent(d)}`)},compareRuns(r,u,d,o){return qe(`/api/skills/${r}/${u}/history-compare?a=${encodeURIComponent(d)}&b=${encodeURIComponent(o)}`)},getCaseHistory(r,u,d,o){const m=new URLSearchParams;o&&m.set("model",o);const v=m.toString();return qe(`/api/skills/${r}/${u}/history/case/${d}${v?"?"+v:""}`)},deleteHistoryEntry(r,u,d){return qe(`/api/skills/${r}/${u}/history/${encodeURIComponent(d)}`,{method:"DELETE"})},improveSkill(r,u,d){return qe(`/api/skills/${r}/${u}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},instructEdit(r,u,d){return qe(`/api/skills/${r}/${u}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...d})})},applyImprovement(r,u,d){return qe(`/api/skills/${r}/${u}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:d})})},getStats(r,u){return qe(`/api/skills/${r}/${u}/stats`)},getDependencies(r,u){return qe(`/api/skills/${r}/${u}/dependencies`)},getProjectLayout(){return qe("/api/project-layout")},createSkill(r){return qe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},getSkillCreatorStatus(){return qe("/api/skill-creator-status")},generateSkill(r){return qe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}};function Ip(r){const[u,d]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(r).matches);return y.useEffect(()=>{const o=window.matchMedia(r);d(o.matches);const m=v=>d(v.matches);return o.addEventListener("change",m),()=>o.removeEventListener("change",m)},[r]),u}const Pp={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function eh(r,u){switch(u.type){case"SELECT_SKILL":return{...r,selectedSkill:u.skill,mode:"browse",mobileView:r.isMobile?"detail":r.mobileView};case"CLEAR_SELECTION":return{...r,selectedSkill:null};case"SET_MODE":return{...r,mode:u.mode,selectedSkill:u.mode==="create"?null:r.selectedSkill};case"SET_SEARCH":return{...r,searchQuery:u.query};case"SET_SKILLS":return{...r,skills:u.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...r,skillsError:u.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...r,skillsLoading:u.loading};case"SET_MOBILE":return{...r,isMobile:u.isMobile};case"SET_MOBILE_VIEW":return{...r,mobileView:u.view};default:return r}}const hm=y.createContext(null);function aa(){const r=y.useContext(hm);if(!r)throw new Error("useStudio must be used within StudioProvider");return r}function th({children:r}){const[u,d]=y.useReducer(eh,Pp),o=Ip("(max-width: 767px)");y.useEffect(()=>{d({type:"SET_MOBILE",isMobile:o})},[o]);const m=y.useCallback(()=>{d({type:"SET_SKILLS_LOADING",loading:!0}),Se.getSkills().then(b=>d({type:"SET_SKILLS",skills:b})).catch(b=>d({type:"SET_SKILLS_ERROR",error:b.message}))},[]);y.useEffect(()=>{m()},[m]);const v=y.useCallback(b=>{d({type:"SELECT_SKILL",skill:b})},[]),h=y.useCallback(()=>{d({type:"CLEAR_SELECTION"})},[]),S=y.useCallback(b=>{d({type:"SET_MODE",mode:b})},[]),p=y.useCallback(b=>{d({type:"SET_SEARCH",query:b})},[]),x=y.useCallback(b=>{d({type:"SET_MOBILE_VIEW",view:b})},[]),j=y.useMemo(()=>({state:u,selectSkill:v,clearSelection:h,setMode:S,setSearch:p,setMobileView:x,refreshSkills:m}),[u,v,h,S,p,x,m]);return n.jsx(hm.Provider,{value:j,children:r})}function lh({left:r,right:u}){const{state:d}=aa();return d.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:d.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:r}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:u})}):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:r}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:u})]})}function ah(){const{state:r,setSearch:u}=aa(),[d,o]=y.useState(r.searchQuery),m=y.useRef(null);y.useEffect(()=>(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{u(d)},200),()=>{m.current&&clearTimeout(m.current)}),[d,u]),y.useEffect(()=>{r.searchQuery===""&&d!==""&&o("")},[r.searchQuery]);const v=new Set(r.skills.map(h=>h.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:d,onChange:h=>o(h.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:h=>{h.currentTarget.style.borderColor="var(--accent)"},onBlur:h=>{h.currentTarget.style.borderColor="var(--border-subtle)"}}),d&&n.jsx("button",{onClick:()=>{o(""),u("")},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"})]})})]}),!r.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[r.skills.length," skill",r.skills.length!==1?"s":""," across ",v," plugin",v!==1?"s":""]})]})}const am={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 nh({skill:r,isSelected:u,onSelect:d}){const o=am[r.benchmarkStatus]||am.missing;return n.jsxs("button",{onClick:d,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:u?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:u?"2px solid var(--accent)":"2px solid transparent",display:"block"},onMouseEnter:m=>{u||(m.currentTarget.style.background="var(--surface-2)")},onMouseLeave:m=>{u||(m.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:r.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:o.bg,color:o.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:o.dot}}),o.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[r.evalCount," eval",r.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[r.assertionCount," assert",r.assertionCount!==1?"s":""]}),r.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(r.lastBenchmark).toLocaleDateString()})]})]})]})}function sh(){const{state:r,selectSkill:u}=aa(),{skills:d,searchQuery:o,selectedSkill:m}=r,v=y.useMemo(()=>{var j;const S=o.toLowerCase(),p=S?d.filter(b=>b.skill.toLowerCase().includes(S)||b.plugin.toLowerCase().includes(S)):d,x={};for(const b of p)(x[j=b.plugin]||(x[j]=[])).push(b);return x},[d,o]),h=Object.entries(v);return r.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(S=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},S))}):h.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.jsx("div",{className:"flex-1",children:h.map(([S,p])=>n.jsxs("div",{children:[n.jsx(ih,{plugin:S,count:p.length}),p.map(x=>{const j=(m==null?void 0:m.plugin)===x.plugin&&(m==null?void 0:m.skill)===x.skill;return n.jsx(nh,{skill:x,isSelected:j,onSelect:()=>u({plugin:x.plugin,skill:x.skill})},`${x.plugin}/${x.skill}`)})]},S))})}function ih({plugin:r,count:u}){const[d,o]=y.useState(!1),m=`/images/icons/${r}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[d?n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):n.jsx("img",{src:m,width:16,height:16,alt:"",onError:()=>o(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:r}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",u,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function rh(){const[r,u]=y.useState(null),[d,o]=y.useState(!1),[m,v]=y.useState(!1),h=y.useRef(null);y.useEffect(()=>{Se.getConfig().then(u).catch(()=>{})},[]),y.useEffect(()=>{function j(b){h.current&&!h.current.contains(b.target)&&o(!1)}return d&&document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[d]);async function S(j,b){v(!0);try{const R=await Se.setConfig(j.id,b.id);u(R),o(!1)}catch{const R=await Se.getConfig();u(R)}finally{v(!1)}}if(!r)return null;const p=uh(r),x=ch(r);return n.jsxs("div",{ref:h,className:"relative",children:[n.jsxs("button",{onClick:()=>o(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:j=>{d||(j.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:j=>{d||(j.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:x!=null&&x.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:p}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&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:r.providers.map(j=>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:j.available?"var(--green)":"var(--text-tertiary)",opacity:j.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:j.available?1:.5},children:j.label})]}),j.models.map(b=>{const R=vm(r,j.id,b.id),U=!j.available||m;return n.jsxs("button",{onClick:()=>!U&&S(j,b),disabled:U,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:R?"var(--accent-muted)":"transparent",color:U?"var(--text-tertiary)":"var(--text-primary)",opacity:U?.4:1,cursor:U?"not-allowed":"pointer"},onMouseEnter:Y=>{!U&&!R&&(Y.currentTarget.style.background="var(--surface-3)")},onMouseLeave:Y=>{R||(Y.currentTarget.style.background="transparent")},children:[n.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${R?"var(--accent)":"var(--border-subtle)"}`},children:R&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:R?600:400},title:b.id,children:b.label})]},`${j.id}-${b.id}`)})]},j.id))})]})]})}function vm(r,u,d){return r.provider!==u?!1:u==="claude-cli"?r.model===`claude-${d}`:r.model===d}function ch(r){return r.providers.find(u=>u.id===r.provider)}function uh(r){for(const u of r.providers)for(const d of u.models)if(vm(r,u.id,d.id))return d.label;return r.model}function oh(){const{state:r,setMode:u}=aa(),[d,o]=y.useState(null);return y.useEffect(()=>{Se.getConfig().then(m=>o(m.projectName)).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:d||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(rh,{})})]}),n.jsx(ah,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("button",{onClick:()=>u("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:r.mode==="create"?"var(--accent)":"var(--surface-3)",color:r.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:m=>{r.mode!=="create"&&(m.currentTarget.style.background="var(--surface-4)",m.currentTarget.style.color="var(--text-primary)")},onMouseLeave:m=>{r.mode!=="create"&&(m.currentTarget.style.background="var(--surface-3)",m.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"]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(sh,{})})]})}const dh="modulepreload",fh=function(r){return"/"+r},nm={},mh=function(u,d,o){let m=Promise.resolve();if(d&&d.length>0){let h=function(x){return Promise.all(x.map(j=>Promise.resolve(j).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),p=(S==null?void 0:S.nonce)||(S==null?void 0:S.getAttribute("nonce"));m=h(d.map(x=>{if(x=fh(x),x in nm)return;nm[x]=!0;const j=x.endsWith(".css"),b=j?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${b}`))return;const R=document.createElement("link");if(R.rel=j?"stylesheet":dh,j||(R.as="script"),R.crossOrigin="",R.href=x,p&&R.setAttribute("nonce",p),document.head.appendChild(R),j)return new Promise((U,Y)=>{R.addEventListener("load",U),R.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${x}`)))})}))}function v(h){const S=new Event("vite:preloadError",{cancelable:!0});if(S.payload=h,window.dispatchEvent(S),!S.defaultPrevented)throw h}return m.then(h=>{for(const S of h||[])S.status==="rejected"&&v(S.reason);return u().catch(v)})};function Oc(){const[r,u]=y.useState([]),[d,o]=y.useState(!1),[m,v]=y.useState(!1),[h,S]=y.useState(null),p=y.useRef(null),x=y.useCallback(async(b,R)=>{u([]),o(!0),v(!1),S(null);const U=new AbortController;p.current=U;try{const Y=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:R?JSON.stringify(R):void 0,signal:U.signal});if(!Y.ok||!Y.body)throw new Error(`HTTP ${Y.status}`);const Z=Y.body.getReader(),X=new TextDecoder;let ne="",se="";for(;;){const{done:F,value:G}=await Z.read();if(F)break;ne+=X.decode(G,{stream:!0});const ee=ne.split(`
|
|
50
|
-
`);ne=ee.pop()||"";for(const J of ee)if(J.startsWith("event: "))se=J.slice(7).trim();else if(J.startsWith("data: ")){try{const I=JSON.parse(J.slice(6)),P={event:se,data:I};se==="done"?(v(!0),u(me=>[...me,P])):u(me=>[...me,P])}catch{}se=""}}}catch(Y){Y.name!=="AbortError"&&S(Y.message)}finally{o(!1),p.current=null}},[]),j=y.useCallback(()=>{var b;(b=p.current)==null||b.abort()},[]);return{events:r,running:d,done:m,error:h,start:x,stop:j}}function xh(r){const u=y.useRef(r);u.current=r;const[d,o]=y.useState(new Set),m=y.useRef(new Map),v=y.useCallback(async(x,j,b)=>{var U;(U=m.current.get(x))==null||U.abort();const R=new AbortController;m.current.set(x,R),o(Y=>{const Z=new Set(Y);return Z.add(x),Z});try{const Y=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json"},body:b?JSON.stringify(b):void 0,signal:R.signal});if(!Y.ok||!Y.body)throw new Error(`HTTP ${Y.status}`);const Z=Y.body.getReader(),X=new TextDecoder;let ne="",se="";for(;;){const{done:F,value:G}=await Z.read();if(F)break;ne+=X.decode(G,{stream:!0});const ee=ne.split(`
|
|
51
|
-
`);ne=ee.pop()||"";for(const J of ee)if(J.startsWith("event: "))se=J.slice(7).trim();else if(J.startsWith("data: ")){try{const I=JSON.parse(J.slice(6)),P={event:se,data:I};u.current.onEvent(x,P)}catch{}se=""}}u.current.onDone(x)}catch(Y){Y.name!=="AbortError"&&u.current.onError(x,Y.message)}finally{o(Y=>{const Z=new Set(Y);return Z.delete(x),Z}),m.current.delete(x)}},[]),h=y.useCallback(x=>{var j;(j=m.current.get(x))==null||j.abort()},[]),S=y.useCallback(()=>{for(const x of m.current.values())x.abort()},[]),p=d.size>0;return{runningSet:d,startCase:v,stopCase:h,stopAll:S,isAnyCaseRunning:p}}const ph={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,loading:!0,error:null};function hh(r,u){var d,o;switch(u.type){case"SET_LOADING":return{...r,loading:u.loading};case"SET_ERROR":return{...r,error:u.error};case"INIT_DATA":{const m=new Map;if(u.benchmark)for(const h of u.benchmark.cases)m.set(h.eval_id,{status:h.status,passRate:h.pass_rate,errorMessage:h.error_message||void 0,durationMs:h.durationMs,tokens:h.tokens,output:h.output,assertions:h.assertions.map(S=>({assertion_id:S.id,text:S.text,pass:S.pass,reasoning:S.reasoning}))});const v=((o=(d=u.evals)==null?void 0:d.evals[0])==null?void 0:o.id)??null;return{...r,skillContent:u.skillContent,savedContent:u.skillContent,isDirty:!1,evals:u.evals,latestBenchmark:u.benchmark,inlineResults:m,selectedCaseId:v,loading:!1,error:null}}case"SET_PANEL":return{...r,activePanel:u.panel};case"SET_CONTENT":return{...r,skillContent:u.content,isDirty:u.content!==r.savedContent};case"CONTENT_SAVED":return{...r,savedContent:r.skillContent,isDirty:!1};case"SET_EVALS":return{...r,evals:u.evals};case"SELECT_CASE":return{...r,selectedCaseId:u.caseId};case"CASE_RUN_START":{const m=new Map(r.caseRunStates);return m.set(u.caseId,{status:"running",startedAt:Date.now(),mode:u.mode}),{...r,caseRunStates:m,runMode:u.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const m=new Map(r.caseRunStates),v=m.get(u.caseId);m.set(u.caseId,{status:"complete",mode:v==null?void 0:v.mode});const h=new Map(r.inlineResults);return h.set(u.caseId,u.result),{...r,caseRunStates:m,inlineResults:h}}case"CASE_RUN_ERROR":{const m=new Map(r.caseRunStates),v=m.get(u.caseId);m.set(u.caseId,{status:"error",mode:v==null?void 0:v.mode});const h=new Map(r.inlineResults);return h.set(u.caseId,{status:"error",errorMessage:u.error,assertions:[]}),{...r,caseRunStates:m,inlineResults:h}}case"CASE_RUN_CANCEL":{const m=new Map(r.caseRunStates),v=m.get(u.caseId);return m.set(u.caseId,{status:"cancelled",mode:v==null?void 0:v.mode}),{...r,caseRunStates:m}}case"BULK_RUN_START":{const m=new Map(r.caseRunStates);for(const v of u.caseIds)m.set(v,{status:"queued",mode:u.mode});return{...r,caseRunStates:m,bulkRunActive:!0,runMode:u.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...r,bulkRunActive:!1,latestBenchmark:u.benchmark??r.latestBenchmark,iterationCount:r.iterationCount+1};case"CANCEL_ALL":{const m=new Map(r.caseRunStates);for(const[v,h]of m)(h.status==="running"||h.status==="queued")&&m.set(v,{status:"cancelled"});return{...r,caseRunStates:m,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const m=new Map(r.inlineResults);return m.set(u.evalId,u.result),{...r,inlineResults:m}}case"OPEN_IMPROVE":return{...r,improveTarget:u.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...r,improveTarget:null};case"OPEN_AI_EDIT":return{...r,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...r,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...r,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...r,aiEditProgress:[...r.aiEditProgress,u.entry]};case"AI_EDIT_RESULT":{const m=u.evalChanges??[],v=new Map;for(let h=0;h<m.length;h++)v.set(h,!0);return{...r,aiEditLoading:!1,aiEditResult:{improved:u.improved,reasoning:u.reasoning,evalChanges:m},aiEditEvalChanges:m,aiEditEvalSelections:v}}case"AI_EDIT_ERROR":return{...r,aiEditLoading:!1,aiEditError:u.message,aiEditClassifiedError:u.classified??null};case"GENERATE_EVALS_START":return{...r,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...r,generateEvalsProgress:[...r.generateEvalsProgress,u.entry]};case"GENERATE_EVALS_DONE":return{...r,generateEvalsLoading:!1,evals:u.evals};case"GENERATE_EVALS_ERROR":return{...r,generateEvalsLoading:!1,generateEvalsError:u.classified};case"TOGGLE_EVAL_CHANGE":{const m=new Map(r.aiEditEvalSelections);return m.set(u.index,!m.get(u.index)),{...r,aiEditEvalSelections:m}}case"SELECT_ALL_EVAL_CHANGES":{const m=new Map(r.aiEditEvalSelections);for(const v of m.keys())m.set(v,!0);return{...r,aiEditEvalSelections:m}}case"DESELECT_ALL_EVAL_CHANGES":{const m=new Map(r.aiEditEvalSelections);for(const v of m.keys())m.set(v,!1);return{...r,aiEditEvalSelections:m}}case"SET_EVALS_RETRY":return{...r,aiEditEvalsRetry:u.evalsFile};case"SET_REGRESSIONS":return{...r,regressions:u.regressions};case"INCREMENT_ITERATION":return{...r,iterationCount:r.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...r,activationPrompts:u.prompts};case"ACTIVATION_START":return{...r,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_RESULT":return{...r,activationResults:[...r.activationResults,u.result]};case"ACTIVATION_DONE":return{...r,activationRunning:!1,activationSummary:u.summary};case"ACTIVATION_ERROR":return{...r,activationRunning:!1,activationError:u.error};case"ACTIVATION_RESET":return{...r,activationResults:[],activationSummary:null,activationError:null};default:return r}}const ym=y.createContext(null);function Yt(){const r=y.useContext(ym);if(!r)throw new Error("useWorkspace must be used within WorkspaceProvider");return r}function vh({plugin:r,skill:u,children:d}){const[o,m]=y.useReducer(hh,{...ph,plugin:r,skill:u}),v=y.useRef(new Set),h=y.useRef(new Set),S=y.useRef(new Map),p=y.useCallback((T,O)=>{const q=O.data;let V=S.current.get(T);if(V||(V={assertions:[]},S.current.set(T,V)),O.event==="output_ready"&&(V.output=q.output,q.durationMs!=null&&(V.durationMs=q.durationMs),q.tokens!=null&&(V.tokens=q.tokens)),O.event==="assertion_result"){const te={assertion_id:q.assertion_id,text:q.text,pass:q.pass,reasoning:q.reasoning};V.assertions.find(ce=>ce.assertion_id===te.assertion_id)||V.assertions.push(te)}O.event==="case_complete"&&(V.status=q.status,V.passRate=q.pass_rate,V.errorMessage=q.error_message||void 0,V.classifiedError=q.classified_error||void 0),m({type:"UPDATE_INLINE_RESULT",evalId:T,result:{...V,assertions:[...V.assertions]}})},[]),x=y.useCallback(T=>{if(h.current.has(T))return;h.current.add(T);const O=S.current.get(T)??{assertions:[]};m({type:"CASE_RUN_COMPLETE",caseId:T,result:{...O,assertions:[...O.assertions]}}),v.current.has(T)&&(v.current.delete(T),v.current.size===0&&Se.getLatestBenchmark(r,u).then(q=>m({type:"BULK_RUN_COMPLETE",benchmark:q})).catch(()=>m({type:"BULK_RUN_COMPLETE",benchmark:null})))},[r,u]),j=y.useCallback((T,O)=>{h.current.has(T)||(h.current.add(T),m({type:"CASE_RUN_ERROR",caseId:T,error:O}),v.current.has(T)&&(v.current.delete(T),v.current.size===0&&Se.getLatestBenchmark(r,u).then(q=>m({type:"BULK_RUN_COMPLETE",benchmark:q})).catch(()=>m({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[r,u]),{startCase:b,stopCase:R,stopAll:U}=xh({onEvent:p,onDone:x,onError:j});y.useEffect(()=>()=>{U()},[U]),y.useEffect(()=>{let T=!1;async function O(){try{const[q,V,te]=await Promise.allSettled([Se.getSkillDetail(r,u),Se.getEvals(r,u),Se.getLatestBenchmark(r,u)]);if(T)return;m({type:"INIT_DATA",skillContent:q.status==="fulfilled"?q.value.skillContent:"",evals:V.status==="fulfilled"?V.value:null,benchmark:te.status==="fulfilled"?te.value:null})}catch(q){T||m({type:"SET_ERROR",error:q.message})}}return O(),()=>{T=!0}},[r,u]);const Y=y.useCallback(async()=>{try{await Se.applyImprovement(r,u,o.skillContent),m({type:"CONTENT_SAVED"})}catch(T){m({type:"SET_ERROR",error:T.message})}},[r,u,o.skillContent]),Z=y.useCallback(async T=>{try{const O=await Se.saveEvals(r,u,T);m({type:"SET_EVALS",evals:O})}catch(O){m({type:"SET_ERROR",error:O.message})}},[r,u]),X=y.useCallback((T,O="benchmark")=>{const q=o.caseRunStates.get(T);if((q==null?void 0:q.status)!=="running")if(S.current.delete(T),h.current.delete(T),m({type:"CASE_RUN_START",caseId:T,mode:O}),O==="comparison"){const V=`/api/skills/${r}/${u}/compare`;b(T,V,{eval_ids:[T]})}else{const V=`/api/skills/${r}/${u}/benchmark/case/${T}`;b(T,V,O==="baseline"?{baseline_only:!0}:void 0)}},[r,u,o.caseRunStates,b]),ne=y.useCallback((T="benchmark")=>{var V;const O=((V=o.evals)==null?void 0:V.evals)??[];if(O.length===0)return;const q=O.map(te=>te.id);for(const te of q)S.current.delete(te),h.current.delete(te);m({type:"BULK_RUN_START",caseIds:q,mode:T}),v.current=new Set(q);for(const te of q)if(T==="comparison")b(te,`/api/skills/${r}/${u}/compare`,{eval_ids:[te]});else{const ce=`/api/skills/${r}/${u}/benchmark/case/${te}`;b(te,ce,T==="baseline"?{baseline_only:!0}:void 0)}},[r,u,o.evals,b]),se=y.useCallback(T=>{R(T),m({type:"CASE_RUN_CANCEL",caseId:T}),v.current.delete(T),h.current.add(T)},[R]),F=y.useCallback(()=>{U(),m({type:"CANCEL_ALL"}),v.current.clear()},[U]),G=y.useCallback(async(T,O)=>{m({type:"OPEN_IMPROVE",evalId:T})},[]),ee=y.useCallback(async(T,O)=>{try{await Se.applyImprovement(r,u,O),m({type:"SET_CONTENT",content:O}),m({type:"CONTENT_SAVED"}),m({type:"CLOSE_IMPROVE"}),X(T,"benchmark")}catch(q){m({type:"SET_ERROR",error:q.message})}},[r,u,X]),J=Oc(),I=y.useRef(null);y.useEffect(()=>{if(J.events.length)for(const T of J.events){const O=T.data;if(T.event==="progress"&&m({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:O.phase,message:O.message}}),T.event==="done"){const q=O.improved,V=O.reasoning,te=O.evalChanges??[];m({type:"AI_EDIT_RESULT",improved:q,reasoning:V,evalChanges:te})}if(T.event==="error"){const q=O;m({type:"AI_EDIT_ERROR",message:q.description||"Unknown error",classified:q})}}},[J.events]),y.useEffect(()=>{J.error&&m({type:"AI_EDIT_ERROR",message:J.error})},[J.error]),y.useEffect(()=>()=>{J.stop()},[J.stop]);const P=y.useCallback(async(T,O,q)=>{m({type:"AI_EDIT_LOADING"}),I.current=J.stop,J.start(`/api/skills/${r}/${u}/improve?sse`,{mode:"instruct",instruction:T,content:o.skillContent,evals:o.evals??{skill_name:u,evals:[]},provider:O,model:q})},[r,u,o.skillContent,o.evals,J]),me=y.useCallback(()=>{J.stop(),m({type:"AI_EDIT_ERROR",message:"Cancelled"})},[J]),xe=y.useCallback(async()=>{const T=o.aiEditResult;if(T!=null&&T.improved)try{if(await Se.applyImprovement(r,u,T.improved),m({type:"SET_CONTENT",content:T.improved}),m({type:"CONTENT_SAVED"}),o.aiEditEvalChanges.length>0&&Array.from(o.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:q}=await mh(async()=>{const{mergeEvalChanges:ce}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ce}},[]),V=o.evals??{skill_name:u,evals:[]},te=q(V,o.aiEditEvalChanges,o.aiEditEvalSelections);try{const ce=await Se.saveEvals(r,u,te);m({type:"SET_EVALS",evals:ce})}catch(ce){m({type:"SET_EVALS_RETRY",evalsFile:te}),m({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ce.message}. You can retry from the AI Edit panel.`});return}}m({type:"CLOSE_AI_EDIT"})}catch(O){m({type:"SET_ERROR",error:O.message})}},[r,u,o.aiEditResult,o.evals,o.aiEditEvalChanges,o.aiEditEvalSelections]),Ne=y.useCallback(()=>{m({type:"CLOSE_AI_EDIT"})},[]),ye=y.useCallback(T=>{m({type:"TOGGLE_EVAL_CHANGE",index:T})},[]),K=y.useCallback(()=>{m({type:"SELECT_ALL_EVAL_CHANGES"})},[]),$=y.useCallback(()=>{m({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),W=y.useCallback(async()=>{const T=o.aiEditEvalsRetry;if(T)try{const O=await Se.saveEvals(r,u,T);m({type:"SET_EVALS",evals:O}),m({type:"SET_ERROR",error:null}),m({type:"CLOSE_AI_EDIT"})}catch(O){m({type:"SET_ERROR",error:`Retry failed: ${O.message}`})}},[r,u,o.aiEditEvalsRetry]),k=y.useCallback(async()=>{try{const T=await Se.getSkillDetail(r,u);m({type:"SET_CONTENT",content:T.skillContent}),m({type:"CONTENT_SAVED"})}catch{}},[r,u]),w=Oc();y.useEffect(()=>{if(w.events.length)for(const T of w.events){const O=T.data;if(T.event==="progress"&&m({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:O.phase,message:O.message}}),T.event==="done"){const q=O;Se.saveEvals(r,u,q).then(V=>m({type:"GENERATE_EVALS_DONE",evals:V})).catch(V=>m({type:"SET_ERROR",error:V.message}))}T.event==="error"&&m({type:"GENERATE_EVALS_ERROR",classified:O})}},[w.events,r,u]),y.useEffect(()=>{w.error&&m({type:"SET_ERROR",error:w.error})},[w.error]),y.useEffect(()=>()=>{w.stop()},[w.stop]);const D=y.useCallback(async()=>{m({type:"GENERATE_EVALS_START"}),w.start(`/api/skills/${r}/${u}/generate-evals?sse`)},[r,u,w]),le=Oc();y.useEffect(()=>()=>{le.stop()},[le.stop]),y.useEffect(()=>{if(le.events.length)for(const T of le.events)T.event==="prompt_result"&&m({type:"ACTIVATION_RESULT",result:T.data}),T.event==="done"&&m({type:"ACTIVATION_DONE",summary:T.data})},[le.events]),y.useEffect(()=>{le.error&&m({type:"ACTIVATION_ERROR",error:le.error})},[le.error]);const pe=y.useCallback(T=>{const q=T.trim().split(`
|
|
52
|
-
`).filter(Boolean).map(V=>V.startsWith("!")?{prompt:V.slice(1).trim(),expected:"should_not_activate"}:V.startsWith("+")?{prompt:V.slice(1).trim(),expected:"should_activate"}:{prompt:V.trim(),expected:"auto"});m({type:"ACTIVATION_START"}),le.start(`/api/skills/${r}/${u}/activation-test`,{prompts:q})},[r,u,le]),N=y.useMemo(()=>({state:o,dispatch:m,saveContent:Y,saveEvals:Z,runCase:X,runAll:ne,cancelCase:se,cancelAll:F,improveForCase:G,applyImproveAndRerun:ee,refreshSkillContent:k,generateEvals:D,runActivationTest:pe,submitAiEdit:P,cancelAiEdit:me,applyAiEdit:xe,discardAiEdit:Ne,toggleEvalChange:ye,selectAllEvalChanges:K,deselectAllEvalChanges:$,retryEvalsSave:W}),[o,Y,Z,X,ne,se,F,G,ee,k,D,pe,P,me,xe,Ne,ye,K,$,W]);return n.jsx(ym.Provider,{value:N,children:d})}function yh({state:r}){const{plugin:u,skill:d,evals:o,latestBenchmark:m,isDirty:v,caseRunStates:h,regressions:S,iterationCount:p}=r,x=Array.from(h.values()).some(Z=>Z.status==="running"||Z.status==="queued"),j=m==null?void 0:m.overall_pass_rate,b=(o==null?void 0:o.evals.reduce((Z,X)=>Z+X.assertions.length,0))??0,R=(o==null?void 0:o.evals.length)??0,U=j!=null?j>=80?"var(--green)":j>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",Y=j!=null?j>=80?"var(--green-muted)":j>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:u}),n.jsx(gh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:d}),v&&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"}),x&&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:[S.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"})]}),S.length," regression",S.length>1?"s":""]}),p>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",p]}),n.jsx("span",{className:"pill",style:{background:Y,color:U},children:j!=null?`${Math.round(j*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[R," case",R!==1?"s":""," / ",b," assert",b!==1?"s":""]})]})]})}function gh(){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"})})}const bh=[{label:"Build",tabs:[{id:"editor",label:"Editor",shortcut:"1"},{id:"tests",label:"Tests",shortcut:"2"}]},{label:"Evaluate",tabs:[{id:"run",label:"Run",shortcut:"3"},{id:"activation",label:"Activation",shortcut:"4"}]},{label:"Insights",tabs:[{id:"history",label:"History",shortcut:"5"},{id:"deps",label:"Deps",shortcut:"6"}]}];function jh({id:r}){const u={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(r){case"editor":return n.jsxs("svg",{...u,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",{...u,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",{...u,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...u,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",{...u,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"deps":return n.jsxs("svg",{...u,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 Sh({activePanel:r,onPanelChange:u,isDirty:d,isRunning:o,hasRegressions:m,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:bh.map((h,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}}),h.tabs.map(p=>{const x=r===p.id,j=p.id==="editor"&&d||p.id==="run"&&o||p.id==="activation"&&v||p.id==="history"&&m,b=p.id==="run"||p.id==="activation"?"var(--accent)":p.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>u(p.id),title:`${p.label} (Ctrl+${p.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:x?"var(--text-primary)":"var(--text-tertiary)",borderBottom:x?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:x?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:R=>{x||(R.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:R=>{x||(R.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(jh,{id:p.id}),p.label,j&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:b}})]},p.id)})]},h.label))})}function Nh(r){const u=r.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!u)return{metadata:{},body:r};const d=u[1],o=u[2].trim(),m={},v=d.split(`
|
|
53
|
-
`);let h="",S=!1;for(const p of v){const x=p.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(x&&h&&S){const R=x[1],U=x[2].trim();let Y=m[h];if((typeof Y!="object"||Array.isArray(Y))&&(Y={},m[h]=Y),!U)Y[R]=[];else{const Z=U.match(/^\[(.+)\]$/);Z?Y[R]=Z[1].split(",").map(X=>X.trim().replace(/^["']|["']$/g,"")).filter(Boolean):Y[R]=U.replace(/^["']|["']$/g,"")}continue}const j=p.match(/^\s+-\s+(.+)$/);if(j&&h){S=!1;const R=m[h];Array.isArray(R)?R.push(j[1].trim().replace(/^["']|["']$/g,"")):m[h]=[j[1].trim().replace(/^["']|["']$/g,"")];continue}const b=p.match(/^([\w-]+):\s*(.*)$/);if(b){h=b[1];const R=b[2].trim();if(S=!1,!R){m[h]={},S=!0;continue}const U=R.match(/^\[(.+)\]$/);if(U){m[h]=U[1].split(",").map(Y=>Y.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}m[h]=R.replace(/^["']|["']$/g,"")}}return{metadata:m,body:o}}function gm(r){if(!r)return"";let u=Eh(r);return u=u.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>'),u=u.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),u=u.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),u=u.replace(/\*([^*]+)\*/g,"<em>$1</em>"),u=u.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),u=u.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),u=u.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),u=u.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),u=u.replace(/\n/g,"<br/>"),u}function Eh(r){const u=r.split(`
|
|
54
|
-
`),d=[];let o=0;for(;o<u.length;)if(u[o].trim().startsWith("|")&&o+1<u.length&&u[o+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(u[o+1])){const m=sm(u[o]);o+=2;const v=[];for(;o<u.length&&u[o].trim().startsWith("|");)v.push(sm(u[o])),o++;const h='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 p='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';p+="<thead><tr>";for(const x of m)p+=`<th ${h}>${x}</th>`;p+="</tr></thead><tbody>";for(const x of v){p+="<tr>";for(const j of x)p+=`<td ${S}>${j}</td>`;p+="</tr>"}p+="</tbody></table>",d.push(p)}else d.push(u[o]),o++;return d.join(`
|
|
55
|
-
`)}function sm(r){return r.split("|").map(u=>u.trim()).filter(u=>u.length>0)}function Jc(r,u){const d=r.split(`
|
|
56
|
-
`),o=u.split(`
|
|
57
|
-
`);if(d.length>1e3||o.length>1e3)return[...d.map(j=>({type:"unchanged",content:j}))];const m=d.length,v=o.length,h=Array.from({length:m+1},()=>new Array(v+1).fill(0));for(let j=1;j<=m;j++)for(let b=1;b<=v;b++)d[j-1]===o[b-1]?h[j][b]=h[j-1][b-1]+1:h[j][b]=Math.max(h[j-1][b],h[j][b-1]);const S=[];let p=m,x=v;for(;p>0||x>0;)p>0&&x>0&&d[p-1]===o[x-1]?(S.push({type:"unchanged",content:d[p-1]}),p--,x--):x>0&&(p===0||h[p][x-1]>=h[p-1][x])?(S.push({type:"added",content:o[x-1]}),x--):(S.push({type:"removed",content:d[p-1]}),p--);return S.reverse()}function Th(r,u){if(u&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing"]).has(r))return n.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const o=new Set(["generating","comparing","preparing"]);return n.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:o.has(r)?"var(--accent)":"var(--green)"}})}function fi({entries:r,isRunning:u}){const[d,o]=y.useState(!1),m=y.useRef(null);return y.useEffect(()=>{m.current&&!d&&(m.current.scrollTop=m.current.scrollHeight)},[r,d]),r.length===0&&!u?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>o(!d),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter: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:[u&&n.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",r.length,")"]}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:d?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!d&&n.jsx("div",{ref:m,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:r.map((v,h)=>{const S=h===r.length-1&&u,p=h===0?"0s":`+${((v.timestamp-r[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:[Th(v.phase,S),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:p}),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,"]"]})]},h)})})]})}const im={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 mi({error:r,onRetry:u,onDismiss:d}){const[o,m]=y.useState(null),v=y.useRef(null);y.useEffect(()=>(r.category==="rate_limit"&&r.retryAfterMs?m(Math.ceil(r.retryAfterMs/1e3)):m(null),()=>{v.current&&clearInterval(v.current)}),[r]),y.useEffect(()=>{if(!(o==null||o<=0))return v.current=setInterval(()=>{m(p=>p==null||p<=1?(v.current&&clearInterval(v.current),0):p-1)},1e3),()=>{v.current&&clearInterval(v.current)}},[o!=null&&o>0]);const h=im[r.category]||im.unknown,S=o!=null&&o>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${h.color} 30%, transparent)`,background:`color-mix(in srgb, ${h.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:h.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:h.color},children:r.title})]}),d&&n.jsx("button",{onClick:d,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:r.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.hint}),(u||o!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:u&&n.jsx("button",{onClick:u,disabled:S,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:S?.5:1},children:S?`Retry in ${o}s`:"Retry"})})]})]})}function Ch({plugin:r,skill:u,skillContent:d,onApplied:o}){const[m,v]=y.useState("closed"),[h,S]=y.useState(null),[p,x]=y.useState("claude-cli"),[j,b]=y.useState("opus"),[R,U]=y.useState([]),[Y,Z]=y.useState(""),[X,ne]=y.useState(""),[se,F]=y.useState(null),[G,ee]=y.useState(null),[J,I]=y.useState([]),[P,me]=y.useState(!1),xe=y.useRef(null);y.useEffect(()=>{Se.getConfig().then(w=>{S(w),w.providers.find(le=>le.id==="claude-cli"&&le.available)&&(x("claude-cli"),b("opus"))}).catch(()=>{})},[]),y.useEffect(()=>()=>{var w;(w=xe.current)==null||w.abort()},[]);function Ne(){return h==null?void 0:h.providers.find(w=>w.id===p&&w.available)}const ye=y.useCallback(()=>{var w;(w=xe.current)==null||w.abort(),v("open")},[]);async function K(){v("loading"),F(null),ee(null),I([]);const w=new AbortController;xe.current=w;try{const D=await fetch(`/api/skills/${encodeURIComponent(r)}/${encodeURIComponent(u)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:p,model:j}),signal:w.signal});if(!D.ok||!D.body)throw new Error(`HTTP ${D.status}`);const le=D.body.getReader(),pe=new TextDecoder;let N="",T="";for(;;){const{done:O,value:q}=await le.read();if(O)break;N+=pe.decode(q,{stream:!0});const V=N.split(`
|
|
58
|
-
`);N=V.pop()||"";for(const te of V)if(te.startsWith("event: "))T=te.slice(7).trim();else if(te.startsWith("data: ")){try{const ce=JSON.parse(te.slice(6));T==="progress"?I(Ye=>[...Ye,{phase:ce.phase,message:ce.message,timestamp:Date.now()}]):T==="done"||T==="complete"?(Z(ce.improved),ne(ce.reasoning||""),U(Jc(ce.original||d,ce.improved)),v("diff_shown")):T==="error"&&(F(ce.message||ce.description||"Unknown error"),ce.category&&ee(ce),v("open"))}catch{}T=""}}}catch(D){D.name!=="AbortError"&&(F(D.message),v("open"))}finally{xe.current=null}}async function $(){me(!0);try{await Se.applyImprovement(r,u,Y),o(Y),v("closed")}catch(w){F(w.message)}finally{me(!1)}}function W(){v("closed"),U([]),Z(""),ne(""),F(null)}if(m==="closed")return n.jsxs("button",{onClick:()=>v("open"),className:"btn btn-secondary mb-5",disabled:!d,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const k=Ne();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:W,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:w=>{w.currentTarget.style.background="var(--surface-3)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(m==="open"||m==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:p,onChange:w=>{x(w.target.value);const D=h==null?void 0:h.providers.find(le=>le.id===w.target.value);D!=null&&D.models[0]&&b(D.models[0].id)},disabled:m==="loading",children:h==null?void 0:h.providers.filter(w=>w.available).map(w=>n.jsx("option",{value:w.id,children:w.label},w.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:j,onChange:w=>b(w.target.value),disabled:m==="loading",children:k==null?void 0:k.models.map(w=>n.jsx("option",{value:w.id,children:w.label},w.id))})]}),m==="loading"?n.jsx("button",{onClick:ye,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:K,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),m==="loading"&&J.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(fi,{entries:J,isRunning:!0})})]}),se&&n.jsx("div",{className:"mb-4",children:G?n.jsx(mi,{error:G,onRetry:K,onDismiss:()=>{F(null),ee(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:se})}),m==="diff_shown"&&n.jsxs(n.Fragment,{children:[X&&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: "}),X]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:R.map((w,D)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:w.type==="added"?"rgba(34,197,94,0.1)":w.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:w.type==="added"?"var(--green)":w.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:w.type==="added"?"3px solid var(--green)":w.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:w.type==="added"?"+":w.type==="removed"?"-":" "}),w.content]},D))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:$,disabled:P,className:"btn btn-primary",children:P?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:W,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const rm={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"}},Ah={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function _h({change:r,index:u,selected:d,onToggle:o,originalEval:m}){var b;const[v,h]=y.useState(!1),S=rm[r.action]??rm.add,p=Ah[r.action]??"var(--border-subtle)",x=r.action==="remove"?(m==null?void 0:m.name)??`Eval #${r.evalId}`:((b=r.eval)==null?void 0:b.name)??"Unnamed",j=y.useCallback(()=>o(u),[o,u]);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 ${p}`,opacity:d?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:d,onChange:j,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:x}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:r.reason}),n.jsx("button",{onClick:()=>h(!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:R=>{R.currentTarget.style.background="var(--surface-3)"},onMouseLeave:R=>{R.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:[r.action==="add"&&r.eval&&n.jsx(kh,{evalCase:r.eval}),r.action==="modify"&&r.eval&&m&&n.jsx(Rh,{original:m,proposed:r.eval}),r.action==="remove"&&m&&n.jsx(Mh,{evalCase:m})]})]})}function kh({evalCase:r}){var u;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Gc,{label:"Prompt",value:r.prompt}),n.jsx(Gc,{label:"Expected",value:r.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((u=r.assertions)==null?void 0:u.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(r.assertions??[]).map(d=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",d.text]},d.id))})]})]})}function Rh({original:r,proposed:u}){const d=[];r.name!==u.name&&d.push({label:"Name",old:r.name,new:u.name}),r.prompt!==u.prompt&&d.push({label:"Prompt",old:r.prompt,new:u.prompt}),r.expected_output!==u.expected_output&&d.push({label:"Expected",old:r.expected_output,new:u.expected_output});const o=r.assertions??[],m=u.assertions??[],v=new Set(o.map(x=>x.text)),h=new Set(m.map(x=>x.text)),S=m.filter(x=>!v.has(x.text)),p=o.filter(x=>!h.has(x.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[d.map(x=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:x.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:["- ",Vc(x.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",Vc(x.new,120)]})]})]},x.label)),(S.length>0||p.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:[p.map(x=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",x.text]},x.id)),S.map(x=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",x.text]},x.id))]})]}),d.length===0&&S.length===0&&p.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Mh({evalCase:r}){var u;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Gc,{label:"Prompt",value:r.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((u=r.assertions)==null?void 0:u.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(r.assertions??[]).map(d=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:d.text},d.id))})]})]})}function Gc({label:r,value:u}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),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:Vc(u,300)})]})}function Vc(r,u){return r.length>u?r.slice(0,u)+"...":r}const cm={remove:0,modify:1,add:2};function wh({changes:r,selections:u,currentEvals:d,onToggle:o,onSelectAll:m,onDeselectAll:v}){if(r.length===0)return null;const h=r.map((p,x)=>({change:p,originalIndex:x}));h.sort((p,x)=>(cm[p.change.action]??2)-(cm[x.change.action]??2));const S=Array.from(u.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,"/",r.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:m,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:p=>{p.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:p=>{p.currentTarget.style.background="var(--surface-3)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:h.map(({change:p,originalIndex:x})=>n.jsx(_h,{change:p,index:x,selected:u.get(x)??!1,onToggle:o,originalEval:p.evalId!=null?d.find(j=>j.id===p.evalId):void 0},x))})]})}function zh(){var w;const{state:r,dispatch:u,submitAiEdit:d,applyAiEdit:o,discardAiEdit:m,cancelAiEdit:v,toggleEvalChange:h,selectAllEvalChanges:S,deselectAllEvalChanges:p,retryEvalsSave:x}=Yt(),{aiEditLoading:j,aiEditResult:b,aiEditError:R,aiEditClassifiedError:U,aiEditProgress:Y,aiEditEvalChanges:Z,aiEditEvalSelections:X,aiEditEvalsRetry:ne}=r,[se,F]=y.useState(""),[G,ee]=y.useState(null),[J,I]=y.useState("claude-cli"),[P,me]=y.useState("opus"),xe=y.useRef(null);y.useEffect(()=>{var D;(D=xe.current)==null||D.focus()},[]),y.useEffect(()=>{Se.getConfig().then(D=>{ee(D),D.providers.find(pe=>pe.id==="claude-cli"&&pe.available)&&(I("claude-cli"),me("opus"))}).catch(()=>{})},[]);const Ne=G==null?void 0:G.providers.find(D=>D.id===J&&D.available),ye=y.useCallback(()=>{const D=se.trim();!D||j||d(D,J,P)},[se,j,d,J,P]),K=y.useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),ye()),D.key==="Escape"&&(D.preventDefault(),j?v():m())},[ye,j,v,m]),$=y.useCallback(()=>{u({type:"CLOSE_AI_EDIT"}),u({type:"OPEN_AI_EDIT"})},[u]),W=b?Jc(r.skillContent,b.improved):[],k=((w=r.evals)==null?void 0:w.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:m,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:D=>{D.currentTarget.style.background="var(--surface-3)"},onMouseLeave:D=>{D.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:xe,value:se,onChange:D=>F(D.target.value),onKeyDown:K,placeholder:"e.g., Add an error handling section...",disabled:j,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:D=>{const le=D.currentTarget;le.style.height="auto",le.style.height=Math.min(le.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:J,onChange:D=>{I(D.target.value);const le=G==null?void 0:G.providers.find(pe=>pe.id===D.target.value);le!=null&&le.models[0]&&me(le.models[0].id)},disabled:j,style:{width:"100%"},children:G==null?void 0:G.providers.filter(D=>D.available).map(D=>n.jsx("option",{value:D.id,children:D.label},D.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:P,onChange:D=>me(D.target.value),disabled:j,style:{width:"100%"},children:Ne==null?void 0:Ne.models.map(D=>n.jsx("option",{value:D.id,children:D.label},D.id))})]}),j?n.jsx("button",{onClick:v,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:ye,disabled:!se.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),j&&Y.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(fi,{entries:Y,isRunning:!0})})]}),R&&n.jsx("div",{className:"mt-3",children:U?n.jsx(mi,{error:U,onRetry:$,onDismiss:m}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:R})}),b&&n.jsxs("div",{className:"animate-fade-in",children:[b.reasoning&&n.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),b.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:W.map((D,le)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:D.type==="added"?"rgba(34,197,94,0.1)":D.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:D.type==="added"?"var(--green)":D.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:D.type==="added"?"3px solid var(--green)":D.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:D.type==="added"?"+":D.type==="removed"?"-":" "}),D.content]},le))}),n.jsx(wh,{changes:Z,selections:X,currentEvals:k,onToggle:h,onSelectAll:S,onDeselectAll:p}),ne&&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:x,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:o,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:m,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:$,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function Oh({size:r=15}){return n.jsxs("svg",{width:r,height:r,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 Dh({size:r=15}){return n.jsxs("svg",{width:r,height:r,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 Lh({size:r=15}){return n.jsxs("svg",{width:r,height:r,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 Bh({size:r=15}){return n.jsxs("svg",{width:r,height:r,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 Uh(){const{state:r,dispatch:u,saveContent:d}=Yt(),{plugin:o,skill:m,skillContent:v,isDirty:h,improveTarget:S,aiEditOpen:p}=r,[x,j]=y.useState("split"),[b,R]=y.useState(!1),U=y.useRef(null),{metadata:Y,body:Z}=Nh(v),X=Y["allowed-tools"],ne=Array.isArray(X)?X:typeof X=="string"?[X]:[],se=Y.name,F=Y.description,G=Y.metadata,ee=typeof G=="object"&&!Array.isArray(G)?G:null,J=Y.version||(ee==null?void 0:ee.version),I=Y.tags||(ee==null?void 0:ee.tags),P=Array.isArray(I)?I:typeof I=="string"?I.split(",").map($=>$.trim()).filter(Boolean):[],me=new Set(["name","description","metadata","allowed-tools","version","tags"]),xe=Object.entries(Y).filter(([$])=>!me.has($)),Ne=y.useCallback(async()=>{R(!0),await d(),R(!1)},[d]),ye=y.useCallback($=>{($.ctrlKey||$.metaKey)&&$.key==="s"&&($.preventDefault(),$.stopPropagation(),h&&Ne()),($.ctrlKey||$.metaKey)&&$.key==="k"&&($.preventDefault(),$.stopPropagation(),u({type:p?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[h,Ne,p,u]),K=[{mode:"raw",icon:n.jsx(Oh,{}),label:"Editor"},{mode:"split",icon:n.jsx(Dh,{}),label:"Split"},{mode:"preview",icon:n.jsx(Lh,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:ye,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:K.map(({mode:$,icon:W,label:k})=>n.jsxs("button",{onClick:()=>j($),title:k,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:x===$?"var(--surface-4)":"transparent",color:x===$?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:x===$?600:400,border:"none",cursor:"pointer"},children:[W,n.jsx("span",{style:{letterSpacing:"0.01em"},children:k})]},$))}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>u({type:p?"CLOSE_AI_EDIT":"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:p?600:400,border:"none",cursor:"pointer",color:p?"#a855f7":"var(--text-tertiary)",background:p?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Bh,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),h&&n.jsx("button",{onClick:()=>u({type:"SET_CONTENT",content:r.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:Ne,disabled:!h||b,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:b?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]})]}),n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:x==="raw"||x==="preview"?"1fr":"1fr 1fr"},children:[x!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:x==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:U,value:v,onChange:$=>u({type:"SET_CONTENT",content:$.target.value}),onKeyDown:ye,spellCheck:!1,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"}})}),x!=="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:[(se||J||F)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[se&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:se}),J&&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",J]})]}),F&&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:F})]}),P.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:P.map($=>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:$},$))}),ne.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"}),ne.map($=>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:$},$))]})}),xe.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:xe.map(([$,W],k)=>{const w=Array.isArray(W)?W.join(", "):typeof W=="object"?Object.entries(W).map(([D,le])=>`${D}: ${Array.isArray(le)?le.join(", "):le}`).join(" | "):W;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:k>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:$}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:w})]},$)})}),(se||F||P.length>0||ne.length>0||xe.length>0)&&Z&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),Z&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:gm(Z)}})]})})]}),p&&n.jsx(zh,{}),S!==null&&o&&m&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Ch,{plugin:o,skill:m,skillContent:v,onApplied:$=>{u({type:"SET_CONTENT",content:$}),u({type:"CONTENT_SAVED"}),u({type:"CLOSE_IMPROVE"})}})})]})}function Qc(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function bm(r){const u=new Date(r);return u.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+u.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function jm(r){return r==null?"--":r>=1e3?`${(r/1e3).toFixed(1)}s`:`${r}ms`}function Sm({entries:r}){if(r.length<2)return null;const u=80,d=24,o=2,m=r.slice().reverse(),v=m.length,h=m.map((S,p)=>{const x=o+p/(v-1)*(u-o*2),j=o+(d-o*2)-S.pass_rate*(d-o*2);return`${x},${j}`});return n.jsxs("svg",{width:u,height:d,style:{display:"block",flexShrink:0},children:[n.jsx("polyline",{points:h.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),h.length>0&&n.jsx("circle",{cx:parseFloat(h[h.length-1].split(",")[0]),cy:parseFloat(h[h.length-1].split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Hh(r,u,d){const[o,m]=y.useState(null),[v,h]=y.useState(!1),S=y.useRef("");y.useEffect(()=>{const x=`${r}/${u}/${d}`;S.current!==x&&(S.current=x,h(!0),Se.getCaseHistory(r,u,d).then(j=>m(j)).catch(()=>m([])).finally(()=>h(!1)))},[r,u,d]);const p=y.useCallback(()=>{h(!0),S.current="",Se.getCaseHistory(r,u,d).then(x=>m(x)).catch(()=>m([])).finally(()=>h(!1))},[r,u,d]);return{entries:o,loading:v,refetch:p}}function qh(r,u,d){const o={flaky:!1,nonDiscriminating:!1,regression:!1};if(!d||d.length===0)return o;const v=d.slice(0,10).map(p=>p.assertions.find(x=>x.id===r)).filter(Boolean);if(v.length>=2){const x=v.filter(j=>j.pass).length/v.length;x>=.3&&x<=.7&&(o.flaky=!0)}const h=d.find(p=>p.type==="benchmark"),S=d.find(p=>p.type==="baseline");if(h&&S){const p=h.assertions.find(j=>j.id===r),x=S.assertions.find(j=>j.id===r);p!=null&&p.pass&&(x!=null&&x.pass)&&(o.nonDiscriminating=!0)}if(u&&!u.pass&&d.length>=1){const x=d[0].assertions.find(j=>j.id===r);x!=null&&x.pass&&(o.regression=!0)}return o}function Yh(){var I;const{state:r,dispatch:u,saveEvals:d,runCase:o,runAll:m,cancelCase:v,cancelAll:h,generateEvals:S}=Yt(),{evals:p,selectedCaseId:x,inlineResults:j,caseRunStates:b,generateEvalsLoading:R,generateEvalsProgress:U,generateEvalsError:Y}=r,Z=y.useMemo(()=>{for(const P of b.values())if(P.status==="running"||P.status==="queued")return!0;return!1},[b]),[X,ne]=y.useState(!1),se={skill_name:r.skill,evals:[]},F=p??se,G=F.evals,ee=G.find(P=>P.id===x)??null,J=y.useCallback(()=>{S()},[S]);return!p||G.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:"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.jsxs("div",{className:"text-center",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:()=>ne(!0),className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:J,disabled:R,className:"btn btn-secondary text-[12px]",children:R?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),R&&U.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(fi,{entries:U,isRunning:!0})}),Y&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(mi,{error:Y,onRetry:J})}),X&&n.jsx(um,{evals:F,onSave:P=>{d(P),ne(!1)},onCancel:()=>ne(!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 (",G.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:Z?n.jsx("button",{onClick:h,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m("benchmark"),disabled:G.length===0,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>m("comparison"),disabled:G.length===0,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:G.map(P=>{const me=j.get(P.id),xe=x===P.id;return n.jsxs("button",{onClick:()=>u({type:"SELECT_CASE",caseId:P.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:xe?"var(--accent-muted)":"transparent",borderLeft:xe?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:Ne=>{xe||(Ne.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Ne=>{xe||(Ne.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:xe?"var(--text-primary)":"var(--text-secondary)"},children:["#",P.id," ",P.name]}),n.jsx(Nm,{result:me})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[P.assertions.length," assertion",P.assertions.length!==1?"s":"",(me==null?void 0:me.passRate)!=null&&n.jsx(Qh,{passRate:me.passRate})]})]},P.id)})}),n.jsx("div",{className:"px-3 py-2",children:n.jsx("button",{onClick:()=>ne(!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:P=>{P.currentTarget.style.borderColor="var(--accent)",P.currentTarget.style.color="var(--accent)"},onMouseLeave:P=>{P.currentTarget.style.borderColor="var(--border-default)",P.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:ee?n.jsx(Gh,{evalCase:ee,result:j.get(ee.id),evals:p,caseStatus:((I=b.get(ee.id))==null?void 0:I.status)??"idle",onSaveEvals:d,onRun:P=>o(P,"benchmark"),onCompare:P=>o(P,"comparison"),onCancel:P=>v(P),onImprove:P=>u({type:"OPEN_IMPROVE",evalId:P})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),X&&n.jsx(um,{evals:F,onSave:P=>{d(P),ne(!1)},onCancel:()=>ne(!1)})]})}function Gh({evalCase:r,result:u,evals:d,caseStatus:o,onSaveEvals:m,onRun:v,onCompare:h,onCancel:S,onImprove:p}){const{state:x}=Yt(),{plugin:j,skill:b}=x,{entries:R,loading:U}=Hh(j,b,r.id),[Y,Z]=y.useState(!1),[X,ne]=y.useState(r.prompt),[se,F]=y.useState(!1),[G,ee]=y.useState(r.expected_output);y.useState(()=>{ne(r.prompt),ee(r.expected_output)});const J=y.useCallback(W=>{m({...d,evals:d.evals.map(k=>k.id===W.id?W:k)})},[d,m]),I=y.useCallback(()=>{J({...r,prompt:X}),Z(!1)},[r,X,J]),P=y.useCallback(()=>{J({...r,expected_output:G}),F(!1)},[r,G,J]),me=y.useCallback(()=>{J({...r,assertions:[...r.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[r,J]),xe=y.useCallback((W,k)=>{J({...r,assertions:r.assertions.map(w=>w.id===W?{...w,text:k}:w)})},[r,J]),Ne=y.useCallback(W=>{J({...r,assertions:r.assertions.filter(k=>k.id!==W)})},[r,J]),ye=y.useCallback(()=>{confirm("Delete this test case?")&&m({...d,evals:d.evals.filter(W=>W.id!==r.id)})},[d,r.id,m]),K=u&&u.assertions.length>0&&u.assertions.every(W=>W.pass),$=u&&u.assertions.some(W=>!W.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",r.id," ",r.name]}),n.jsx(Nm,{result:u})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[o==="running"||o==="queued"?n.jsxs("button",{onClick:()=>S(r.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(r.id),className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>h(r.id),className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),$&&o!=="running"&&o!=="queued"&&n.jsx("button",{onClick:()=>p(r.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),o!=="running"&&o!=="queued"&&n.jsx("button",{onClick:ye,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"})]})})]})]}),K&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Dc,{title:"Prompt",children:Y?n.jsxs("div",{children:[n.jsx("textarea",{value:X,onChange:W=>ne(W.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:I,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ne(r.prompt),Z(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] cursor-pointer 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"},onClick:()=>Z(!0),onMouseEnter:W=>{W.currentTarget.style.borderColor="var(--border-hover)"},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-subtle)"},children:r.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:"Click to edit prompt..."})})}),n.jsx(Dc,{title:"Expected Output",children:se?n.jsxs("div",{children:[n.jsx("textarea",{value:G,onChange:W=>ee(W.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:P,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ee(r.expected_output),F(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] cursor-pointer 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"},onClick:()=>F(!0),onMouseEnter:W=>{W.currentTarget.style.borderColor="var(--border-hover)"},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-subtle)"},children:r.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:"Click to edit expected output..."})})}),n.jsx(Dc,{title:`Assertions (${r.assertions.length})`,action:n.jsx("button",{onClick:me,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:r.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:r.assertions.map(W=>{const k=u==null?void 0:u.assertions.find(D=>D.assertion_id===W.id),w=qh(W.id,k,R);return n.jsx(Vh,{assertion:W,result:k,badges:w,onUpdate:D=>xe(W.id,D),onDelete:()=>Ne(W.id)},W.id)})})}),(u==null?void 0:u.output)&&n.jsx(Xh,{output:u.output,durationMs:u.durationMs,tokens:u.tokens}),n.jsx(Zh,{evalId:r.id,sharedEntries:R,sharedLoading:U})]},r.id)}function Vh({assertion:r,result:u,badges:d,onUpdate:o,onDelete:m}){const[v,h]=y.useState(!1),[S,p]=y.useState(r.text),[x,j]=y.useState(!1),b=()=>{o(S),h(!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:[u?n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:u.pass?"var(--green-muted)":"var(--red-muted)"},children:u.pass?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,border:"1.5px dashed var(--text-tertiary)",background:"transparent"},title:"Not run yet"}),(d==null?void 0:d.regression)&&n.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:r.id}),(d==null?void 0:d.flaky)&&n.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(d==null?void 0:d.nonDiscriminating)&&n.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),v?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:S,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&b(),R.key==="Escape"&&h(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:b,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px] cursor-pointer",style:{color:"var(--text-secondary)"},onClick:()=>{p(r.text),h(!0)},children:r.text}),(u==null?void 0:u.reasoning)&&n.jsx("button",{onClick:()=>j(!x),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:x?"Hide reasoning":"Show reasoning"}),x&&(u==null?void 0:u.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:u.reasoning})]}),n.jsx("button",{onClick:m,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:R=>{R.currentTarget.style.color="var(--red)",R.currentTarget.style.opacity="1"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-tertiary)",R.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Dc({title:r,action:u,children:d}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),u]}),d]})}function Nm({result:r}){if(!r||r.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const u=r.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:u?"var(--green-muted)":"var(--red-muted)",color:u?"var(--green)":"var(--red)"},children:r.passRate!=null?`${Math.round(r.passRate*100)}%`:r.status})}function Qh({passRate:r}){const u=Math.round(r*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:`${u}%`,background:u>=80?"var(--green)":u>=50?"var(--yellow)":"var(--red)"}})})})}function Xh({output:r,durationMs:u,tokens:d}){const[o,m]=y.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>m(!o),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:o?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",u!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(u/1e3).toFixed(1),"s)"]}),d!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",d," tokens)"]})]}),o&&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:r})]})}function Zh({evalId:r,sharedEntries:u,sharedLoading:d}){const{state:o,dispatch:m}=Yt(),{plugin:v,skill:h}=o,[S,p]=y.useState(!0),x=u??null,j=d??!1,b=y.useCallback(()=>{p(!S)},[S]),R=x?x.slice(0,10):[];return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:b,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:S?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",x&&x.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",x.length," run",x.length!==1?"s":"",")"]})]}),S&&n.jsx("div",{className:"animate-fade-in",children:j?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..."})]}):!x||x.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:[R.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Sm,{entries:R})}),n.jsx("div",{className:"space-y-2",children:R.map((U,Y)=>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:bm(U.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:U.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:U.type==="benchmark"?"rgba(99,131,255,0.15)":U.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:U.type==="benchmark"?"#6383ff":U.type==="comparison"?"var(--purple)":"#fb923c"},children:U.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Qc(U.pass_rate)},children:[Math.round(U.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:[U.durationMs!=null&&n.jsx("span",{children:jm(U.durationMs)}),U.tokens!=null&&n.jsxs("span",{children:[U.tokens>=1e3?`${(U.tokens/1e3).toFixed(1)}k`:U.tokens," tok"]})]}),n.jsx("div",{className:"space-y-0.5",children:U.assertions.map(Z=>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:Z.pass?"var(--green-muted)":"var(--red-muted)"},children:Z.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:Z.text})]},Z.id))})]},Y))}),n.jsx("button",{onClick:()=>m({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:U=>{U.currentTarget.style.textDecoration="underline"},onMouseLeave:U=>{U.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function um({evals:r,onSave:u,onCancel:d}){const[o,m]=y.useState(""),[v,h]=y.useState(""),[S,p]=y.useState(""),[x,j]=y.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),b=Math.max(0,...r.evals.map(U=>U.id))+1,R=()=>{if(!o.trim()||!v.trim())return;const U={id:b,name:o.trim(),prompt:v.trim(),expected_output:S.trim(),files:[],assertions:x.filter(Y=>Y.text.trim())};u({...r,evals:[...r.evals,U]})};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:o,onChange:U=>m(U.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:U=>h(U.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:U=>p(U.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"}),x.map((U,Y)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:U.text,onChange:Z=>j(x.map((X,ne)=>ne===Y?{...X,text:Z.target.value}:X)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),x.length>1&&n.jsx("button",{onClick:()=>j(x.filter((Z,X)=>X!==Y)),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"})]})})]},U.id)),n.jsx("button",{onClick:()=>j([...x,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:d,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:R,disabled:!o.trim()||!v.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Kh(r,u){const d=r+u,o=d*10,m=d*25,v=h=>h>=60?`${Math.round(h/60)}m`:`${h}s`;return`${v(o)}–${v(m)}`}function Jh(){const{state:r,runCase:u,runAll:d,cancelCase:o,cancelAll:m}=Yt(),{evals:v,caseRunStates:h,bulkRunActive:S,latestBenchmark:p,inlineResults:x}=r,j=(v==null?void 0:v.evals)??[],b=y.useMemo(()=>{for(const F of h.values())if(F.status==="running"||F.status==="queued")return!0;return!1},[h]),R=j.filter(F=>{const G=h.get(F.id);return G&&(G.status==="complete"||G.status==="error"||G.status==="cancelled")}).length,U=j.filter(F=>{const G=h.get(F.id);return G&&(G.status==="running"||G.status==="queued")}).length,Y=y.useRef(null),[Z,X]=y.useState(0);y.useEffect(()=>{if(b&&!Y.current&&(Y.current=Date.now()),!b){Y.current=null,X(0);return}const F=setInterval(()=>{Y.current&&X(Math.round((Date.now()-Y.current)/1e3))},1e3);return()=>clearInterval(F)},[b]);const ne=j.reduce((F,G)=>F+G.assertions.length,0),se=y.useMemo(()=>Kh(j.length,ne),[j.length,ne]);return n.jsxs("div",{className:"p-5",children:[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"}),b&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[U," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[b&&n.jsxs("button",{onClick:m,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>d("comparison"),disabled:j.length===0||b,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>d("benchmark"),disabled:j.length===0||b,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>d("baseline"),disabled:j.length===0||b,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),b&&j.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",R,"/",j.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(R/j.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${R/j.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",Z>=60?`${Math.floor(Z/60)}m ${Z%60}s`:`${Z}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",se]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:j.map(F=>{const G=x.get(F.id),ee=h.get(F.id),J=(ee==null?void 0:ee.status)??"idle";return n.jsx(Wh,{name:F.name,evalId:F.id,result:G,caseStatus:J,runMode:(ee==null?void 0:ee.mode)??null,onRun:I=>u(I,"benchmark"),onBaseline:I=>u(I,"baseline"),onCompare:I=>u(I,"comparison"),onCancel:I=>o(I)},F.id)})}),!b&&p&&p.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:(p.overall_pass_rate??0)>=.8?"var(--green)":(p.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:p.overall_pass_rate!=null?`${Math.round(p.overall_pass_rate*100)}%`:"--"})]}),p.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(p.totalDurationMs/1e3).toFixed(1),"s",p.model&&` | Model: ${p.model}`]}),p.overall_pass_rate===1&&!p.comparison&&n.jsx("button",{onClick:()=>d("comparison"),disabled:j.length===0,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:j.length===0?.5:1},children:"Run Final A/B Comparison"})]}),p.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(om,{label:"Skill",value:p.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(om,{label:"Baseline",value:p.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:p.comparison.delta>0?"var(--green)":p.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",p.comparison.delta>0?"+":"",(p.comparison.delta*100).toFixed(1),"%",p.verdict&&` | ${p.verdict}`]})]})]})]})}const $h={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 Wh({name:r,evalId:u,result:d,caseStatus:o,runMode:m,onRun:v,onBaseline:h,onCompare:S,onCancel:p}){const[x,j]=y.useState(!1),b=o==="running"||o==="queued",R=o==="complete"||o==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:b?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:b?"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:[o==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),o==="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:["#",u," ",r]}),m&&(b||R)&&(()=>{const U=$h[m];return U?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:U.bg,color:U.color,padding:"1px 6px"},children:U.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[b?n.jsx("button",{onClick:()=>p(u),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:()=>S(u),className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>v(u),className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>h(u),className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),d&&d.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:d.status==="pass"?"var(--green-muted)":(d.status==="error","var(--red-muted)"),color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.passRate!=null?`${Math.round(d.passRate*100)}%`:d.status}),o==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),d&&d.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:d.assertions.map(U=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:U.pass?"var(--green)":"var(--red)"},children:U.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:U.text})]},U.assertion_id))}),d.output&&n.jsx("button",{onClick:()=>j(!x),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:x?"Hide output":"Show output"}),x&&d.output&&n.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:d.output})]}),d&&d.errorMessage&&n.jsx(Fh,{errorMessage:d.errorMessage,classifiedError:d.classifiedError})]})}const Lc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Fh({errorMessage:r,classifiedError:u}){const[d,o]=y.useState(!1),m=(u==null?void 0:u.title)??"Error",v=u==null?void 0:u.hint,h=u?Lc[u.category]??Lc.unknown:Lc.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:h}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:m}),n.jsx("button",{onClick:()=>o(!d),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:d?"Hide details":"Details"})]}),v&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:v}),d&&n.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:r})]})})}function om({label:r,value:u,color:d}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:r}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:d},children:[Math.round(u*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:`${u*100}%`,background:d}})})]})}const dm={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)"}},Ih=[{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 Ph(){const{state:r,dispatch:u,runActivationTest:d}=Yt(),{plugin:o,skill:m,activationPrompts:v,activationResults:h,activationSummary:S,activationRunning:p,activationError:x}=r,[j,b]=y.useState(v),[R,U]=y.useState(null),[Y,Z]=y.useState(!1);y.useEffect(()=>{u({type:"SET_ACTIVATION_PROMPTS",prompts:j})},[j,u]),y.useEffect(()=>{fetch(`/api/skills/${o}/${m}/description`).then(G=>G.json()).then(G=>U(G.rawContent||G.description||null)).catch(()=>U(null))},[o,m]);function X(){d(j)}function ne(G){const ee=j.trim(),J=ee?`${ee}
|
|
59
|
-
${G.join(`
|
|
60
|
-
`)}`:G.join(`
|
|
61
|
-
`);b(J)}const se=h.filter(G=>G.classification==="TP"||G.classification==="TN"),F=h.filter(G=>G.classification==="FP"||G.classification==="FN");return n.jsxs("div",{className:"p-5",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-1",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-5 gap-4 mb-5",children:[n.jsxs("div",{className:"col-span-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("label",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:Ih.map(G=>n.jsxs("button",{onClick:()=>ne(G.prompts),className:"text-[10px] px-2 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},onMouseEnter:ee=>{ee.currentTarget.style.color="var(--text-primary)",ee.currentTarget.style.background="var(--surface-3)"},onMouseLeave:ee=>{ee.currentTarget.style.color="var(--text-tertiary)",ee.currentTarget.style.background="var(--surface-2)"},children:["+ ",G.label]},G.label))})]}),n.jsx("textarea",{className:"input-field h-32 resize-y font-mono text-[12px]",value:j,onChange:G=>b(G.target.value),placeholder:`How do I write a unit test?
|
|
62
|
-
What edge cases should I test?
|
|
63
|
-
+Deploy this to production
|
|
64
|
-
!What's the weather like today?
|
|
65
|
-
!Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center gap-4 mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx("span",{children:"No prefix = auto-classify"}),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.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.jsxs("span",{children:[j.trim().split(`
|
|
66
|
-
`).filter(Boolean).length," prompt",j.trim().split(`
|
|
67
|
-
`).filter(Boolean).length!==1?"s":""]})]})]}),n.jsx("div",{className:"col-span-2 flex flex-col",children:n.jsxs("div",{className:`glass-card flex flex-col ${Y?"flex-1":""}`,children:[n.jsxs("button",{onClick:()=>Z(!Y),className:"w-full p-3 flex items-center justify-between text-left flex-shrink-0",style:{borderBottom:Y?"1px solid var(--border-subtle)":void 0},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:Y?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),Y&&R&&n.jsx("div",{className:"p-3 flex-1 overflow-auto animate-fade-in",style:{maxHeight:320},children:n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:gm(R)}})}),!Y&&R&&n.jsx("div",{className:"px-3 pb-3 pt-1",children:n.jsx("div",{className:"text-[11px] line-clamp-2 leading-relaxed",style:{color:"var(--text-tertiary)"},children:R.replace(/^---[\s\S]*?---\s*/,"").trim().slice(0,150)})})]})})]}),n.jsx("button",{onClick:X,disabled:p||!j.trim(),className:"btn btn-primary mb-5",children:p?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"]})}),x&&n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:x}),h.length>0&&n.jsxs("div",{className:"space-y-5 mb-5",children:[F.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 (",F.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:F.map((G,ee)=>n.jsx(fm,{result:G},`incorrect-${ee}`))})]}),se.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 (",se.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:se.map((G,ee)=>n.jsx(fm,{result:G},`correct-${ee}`))})]})]}),S&&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"}),S.autoClassifiedCount!=null&&S.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[S.autoClassifiedCount," of ",S.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(Bc,{label:"Precision",value:S.precision,description:"Of all activations, how many were correct?",detail:`${S.tp} true / ${S.tp+S.fp} total activations`}),n.jsx(Bc,{label:"Recall",value:S.recall,description:"Of expected activations, how many fired?",detail:`${S.tp} activated / ${S.tp+S.fn} expected`}),n.jsx(Bc,{label:"Reliability",value:S.reliability,description:"Overall correct classification rate",detail:`${S.tp+S.tn} correct / ${S.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(oi,{label:"True Positive",abbr:"TP",count:S.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(oi,{label:"False Positive",abbr:"FP",count:S.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(oi,{label:"False Negative",abbr:"FN",count:S.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(oi,{label:"True Negative",abbr:"TN",count:S.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),p&&h.length===0&&n.jsxs("div",{className:"text-center py-16 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..."})]})]})}function fm({result:r}){const u=dm[r.classification]||dm.FN,d=r.classification==="TP"||r.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:u.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, ${u.text} 20%, transparent)`},children:d?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:u.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:u.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:r.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:u.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:r.classification}),n.jsx("span",{style:{color:r.activate?"var(--green)":"var(--text-tertiary)"},children:r.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",r.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[r.confidence," confidence"]}),r.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"})]}),r.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:r.reasoning})]})]})}function Bc({label:r,value:u,description:d,detail:o}){const m=Math.round(u*100),v=m>=80?"var(--green)":m>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:v},children:[m,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:r}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:d}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:o})]})}function oi({abbr:r,count:u,bg:d,color:o,description:m}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:d},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:o},children:u}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:o},children:r}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:m})]})}const Uc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},mm={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},Xc=600,Zc=180,it=40,Hc=Xc-it*2,Dl=Zc-it*2,ev=[25,50,75,100];function xm(r){return new Date(r).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function tv({entries:r}){const[u,d]=y.useState(null);if(r.length<2)return null;const o=r.length,m=r.map((S,p)=>{const x=it+p/(o-1)*Hc,j=S.passRate*100,b=it+Dl-j/100*Dl;return{x,y:b,pct:j,entry:S}}),v=m.map(S=>`${S.x},${S.y}`).join(" "),h=Array.from(new Set(r.map(S=>S.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:h.map(S=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Uc[S]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:mm[S]??S})]},S))}),n.jsxs("svg",{width:Xc,height:Zc,viewBox:`0 0 ${Xc} ${Zc}`,style:{display:"block",overflow:"visible"},children:[ev.map(S=>{const p=it+Dl-S/100*Dl;return n.jsxs("g",{children:[n.jsx("line",{x1:it,y1:p,x2:it+Hc,y2:p,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:it-8,y:p+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[S,"%"]})]},S)}),n.jsx("line",{x1:it,y1:it+Dl,x2:it+Hc,y2:it+Dl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:it-8,y:it+Dl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:v,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),m.map((S,p)=>n.jsx("circle",{cx:S.x,cy:S.y,r:5,fill:Uc[S.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:x=>{x.currentTarget.setAttribute("r","7"),d({x:S.x,y:S.y,entry:S.entry})},onMouseLeave:x=>{x.currentTarget.setAttribute("r","5"),d(null)}},p)),lv(o).map(S=>n.jsx("text",{x:m[S].x,y:it+Dl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:xm(r[S].timestamp)},S))]}),u&&n.jsxs("div",{style:{position:"absolute",left:u.x,top:u.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:xm(u.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:u.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:Uc[u.entry.type]??"var(--text-tertiary)",color:"#fff"},children:mm[u.entry.type]??u.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(u.entry.passRate*100),"%"]})]})]})]})}function lv(r){return r<=3?Array.from({length:r},(u,d)=>d):r<=6?[0,Math.floor(r/2),r-1]:[0,Math.floor(r/3),Math.floor(2*r/3),r-1]}function di(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function av(r){return r>=1e3?`${(r/1e3).toFixed(1)}s`:`${Math.round(r)}ms`}function nv({rate:r,label:u}){const d=Math.round(r*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:u}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:di(r)},children:[d,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${d}%`,background:di(r)}})})]})})}function sv({points:r}){if(r.length<2)return null;const u=200,d=48,o=4,m=r.length,v=r.map((p,x)=>{const j=o+x/(m-1)*(u-o*2),b=o+(d-o*2)-p.passRate*(d-o*2);return{x:j,y:b}}),h=`M ${v[0].x},${d-o} `+v.map(p=>`L ${p.x},${p.y}`).join(" ")+` L ${v[v.length-1].x},${d-o} Z`,S=v.map((p,x)=>`${x===0?"M":"L"} ${p.x},${p.y}`).join(" ");return n.jsxs("svg",{width:u,height:d,style:{display:"block"},children:[n.jsx("path",{d:h,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 iv({plugin:r,skill:u}){const[d,o]=y.useState(null),[m,v]=y.useState(!0);if(y.useEffect(()=>{v(!0),Se.getStats(r,u).then(o).catch(()=>o(null)).finally(()=>v(!1))},[r,u]),m)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!d||d.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const h=d.trendPoints.length>0?d.trendPoints[d.trendPoints.length-1].passRate:0,S=d.trendPoints.length>0?d.trendPoints[0].passRate:0,p=h-S,x=d.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:di(h)},children:[Math.round(h*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:p>=0?"var(--green)":"var(--red)"},children:[p>=0?"+":"",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:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.modelStats.length})]})]}),d.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(sv,{points:d.trendPoints})]}),d.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:d.modelStats.map(j=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:j.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:j.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:di(j.avgPassRate)},children:[Math.round(j.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:av(j.avgDurationMs)})]},j.model))})]})]}),x.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:x.map(j=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--surface-2)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",j.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:j.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[j.totalRuns," runs"]})]}),n.jsx(nv,{rate:j.passRate,label:j.text})]},`${j.evalId}:${j.id}`))})]})]})}function rv({plugin:r,skill:u}){const[d,o]=y.useState(null),[m,v]=y.useState(null),[h,S]=y.useState({}),[p,x]=y.useState({});y.useEffect(()=>{Se.getEvals(r,u).then(o).catch(()=>o(null))},[r,u]);async function j(b){if(m===b){v(null);return}if(v(b),!h[b]){x(R=>({...R,[b]:!0}));try{const R=await Se.getCaseHistory(r,u,b);S(U=>({...U,[b]:R}))}catch{S(R=>({...R,[b]:[]}))}finally{x(R=>({...R,[b]:!1}))}}}return d?n.jsx("div",{className:"space-y-2 stagger-children",children:d.evals.map(b=>{const R=h[b.id]||[],U=m===b.id,Y=p[b.id],Z=R.length>0?R[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>j(b.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:U?"var(--surface-2)":"transparent"},onMouseEnter:X=>{U||(X.currentTarget.style.background="var(--surface-2)")},onMouseLeave:X=>{U||(X.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:U?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",b.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:b.name}),R.length>=2&&n.jsx(Sm,{entries:R}),Z!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:Qc(Z)},children:[Math.round(Z*100),"%"]}),R.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[R.length," runs"]})]}),U&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:Y?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..."})]}):R.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:R.map((X,ne)=>n.jsxs("div",{className:"p-4",style:{background:ne===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:bm(X.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:X.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:X.type==="benchmark"?"rgba(99,131,255,0.15)":X.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:X.type==="benchmark"?"#6383ff":X.type==="comparison"?"var(--purple)":"#fb923c"},children:X.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Qc(X.pass_rate)},children:[Math.round(X.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:[X.durationMs!=null&&n.jsx("span",{children:jm(X.durationMs)}),X.tokens!=null&&n.jsxs("span",{children:[X.tokens>=1e3?`${(X.tokens/1e3).toFixed(1)}k`:X.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:X.assertions.map(se=>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:se.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:se.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:se.text}),se.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:se.reasoning})]})]},se.id))})]},ne))})})]},b.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function cv(){const{state:r,dispatch:u}=Yt(),{plugin:d,skill:o}=r,[m,v]=y.useState("timeline"),[h,S]=y.useState([]),[p,x]=y.useState(!0),[j,b]=y.useState(""),[R,U]=y.useState(""),[Y,Z]=y.useState(!1),[X,ne]=y.useState([]),[se,F]=y.useState(null),[G,ee]=y.useState(!1),[J,I]=y.useState(null),[P,me]=y.useState(!1);y.useEffect(()=>{x(!0),Se.getHistory(d,o,{model:j||void 0,type:R||void 0}).then(K=>{S(K),K.length>=2&&Se.compareRuns(d,o,K[0].timestamp,K[1].timestamp).then($=>{const W=$.regressions.filter(k=>k.change==="regression");u({type:"SET_REGRESSIONS",regressions:W})}).catch(()=>{})}).catch(()=>{}).finally(()=>x(!1))},[d,o,j,R]);const xe=y.useCallback(async K=>{if(Y){ne($=>$.includes(K)?$.filter(W=>W!==K):$.length>=2?[$[1],K]:[...$,K]);return}me(!0);try{const $=await Se.getHistoryEntry(d,o,K);I($)}catch{}finally{me(!1)}},[d,o,Y]),Ne=y.useCallback(async()=>{if(X.length===2){ee(!0);try{const K=await Se.compareRuns(d,o,X[0],X[1]);F(K)}catch{}finally{ee(!1)}}},[d,o,X]),ye=[...new Set(h.map(K=>K.model))];return p?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(K=>n.jsx("button",{onClick:()=>v(K),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:m===K?"var(--accent-muted)":"transparent",color:m===K?"var(--accent)":"var(--text-tertiary)"},children:K==="timeline"?"Timeline":K==="per-eval"?"Per Eval":"Statistics"},K))}),m==="timeline"&&n.jsxs("div",{children:[h.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(tv,{entries:h})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:j,onChange:K=>b(K.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ye.map(K=>n.jsx("option",{value:K,children:K},K))]}),n.jsxs("select",{value:R,onChange:K=>U(K.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("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{Z(!Y),ne([]),F(null)},className:`btn text-[12px] ${Y?"btn-primary":"btn-secondary"}`,children:Y?"Exit Compare":"Compare Runs"}),Y&&X.length===2&&n.jsx("button",{onClick:Ne,disabled:G,className:"btn btn-primary text-[12px]",children:G?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:h.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):h.map(K=>{const $=X.includes(K.timestamp);return n.jsx("button",{onClick:()=>xe(K.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:$?"var(--accent-muted)":"var(--surface-1)",border:$?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:W=>{$||(W.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:W=>{$||(W.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:[Y&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:$?"var(--accent)":"var(--border-default)",background:$?"var(--accent)":"transparent"},children:$&&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(K.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:K.type==="comparison"?"var(--purple-muted)":K.type==="baseline"?"var(--surface-3)":K.type==="model-compare"?"rgba(56,189,248,0.15)":K.type==="improve"||K.type==="instruct"?"rgba(168,85,247,0.15)":"var(--accent-muted)",color:K.type==="comparison"?"var(--purple)":K.type==="baseline"?"var(--text-tertiary)":K.type==="model-compare"?"#38bdf8":K.type==="improve"||K.type==="instruct"?"#a855f7":"var(--accent)"},children:K.type==="model-compare"?"model compare":K.type==="improve"?"ai improve":K.type==="instruct"?"ai edit":K.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:K.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:K.passRate>=.8?"var(--green)":K.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(K.passRate*100),"%"]})]})]})},K.timestamp)})}),se&&n.jsx(uv,{result:se}),J&&!Y&&n.jsx(ov,{run:J,onClose:()=>I(null)})]}),m==="per-eval"&&n.jsx(rv,{plugin:d,skill:o}),m==="statistics"&&n.jsx(iv,{plugin:d,skill:o})]})}function uv({result:r}){const u=r.regressions.filter(o=>o.change==="regression"),d=r.regressions.filter(o=>o.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(r.runA.timestamp).toLocaleDateString()," vs ",new Date(r.runB.timestamp).toLocaleDateString()]}),u.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 (",u.length,")"]}),u.map(o=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",o.evalId," ",o.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:o.assertionId})," (was passing, now failing)"]},`${o.evalId}-${o.assertionId}`))]}),d.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",d.length,")"]}),d.map(o=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",o.evalId," ",o.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:o.assertionId})," (was failing, now passing)"]},`${o.evalId}-${o.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:r.caseDiffs.map(o=>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:["#",o.eval_id," ",o.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:o.passRateA!=null?o.passRateA>=.8?"var(--green)":o.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:o.passRateA!=null?`${Math.round(o.passRateA*100)}%`:o.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:o.passRateB!=null?o.passRateB>=.8?"var(--green)":o.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:o.passRateB!=null?`${Math.round(o.passRateB*100)}%`:o.statusB})]},o.eval_id))})]})})]})}function ov({run:r,onClose:u}){return(r.type==="improve"||r.type==="instruct")&&r.improve?n.jsx(dv,{run:r,onClose:u}):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(r.timestamp).toLocaleString()]}),n.jsx("button",{onClick:u,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",r.model," | Cases: ",r.cases.length," | Pass Rate: ",r.overall_pass_rate!=null?`${Math.round(r.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:r.cases.map(d=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.pass_rate!=null?`${Math.round(d.pass_rate*100)}%`:d.status})]})},d.eval_id))})]})}function dv({run:r,onClose:u}){var v;const d=y.useMemo(()=>r.improve?Jc(r.improve.original,r.improve.improved):[],[r.improve]),o=y.useMemo(()=>{const h=d.filter(p=>p.type==="added").length,S=d.filter(p=>p.type==="removed").length;return{added:h,removed:S}},[d]),m=y.useMemo(()=>{let h=0,S=0;return d.map(p=>p.type==="removed"?(h++,{...p,origNum:h,newNum:null}):p.type==="added"?(S++,{...p,origNum:null,newNum:S}):(h++,S++,{...p,origNum:h,newNum:S}))},[d]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(r.timestamp).toLocaleString()," · ",r.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:["+",o.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",o.removed]})]}),n.jsx("button",{onClick:u,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--surface-3)"},onMouseLeave:h=>{h.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=r.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: "}),r.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:m.map((h,S)=>n.jsxs("tr",{style:{background:h.type==="added"?"rgba(34,197,94,0.08)":h.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:h.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:h.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:h.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:h.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:h.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:h.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:h.type==="added"?"var(--green)":h.type==="removed"?"var(--red)":"transparent",borderRight:h.type==="added"?"2px solid var(--green)":h.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:h.type==="added"?"+":h.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:h.type==="added"?"var(--green)":h.type==="removed"?"var(--red)":"var(--text-secondary)"},children:h.content||""})]},S))})})})]})}function fv({plugin:r,skill:u}){const[d,o]=y.useState([]),[m,v]=y.useState([]),[h,S]=y.useState(!0),[p,x]=y.useState(null);y.useEffect(()=>{Se.getDependencies(r,u).then(b=>{o(b.mcpDependencies),v(b.skillDependencies)}).catch(()=>{}).finally(()=>S(!1))},[r,u]);async function j(b,R){try{await navigator.clipboard.writeText(R),x(b),setTimeout(()=>x(null),2e3)}catch{}}return h?null:d.length===0&&m.length===0?n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:d.length+m.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[d.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),d.map(b=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:b.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.transport})]}),n.jsx("button",{onClick:()=>j(b.server,b.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:p===b.server?"var(--green)":"var(--accent)"},children:p===b.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:b.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.matchedTools.map(R=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:R},R))})]},b.server))]}),m.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:m.map(b=>n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.source==="frontmatter"?"frontmatter":"referenced"})]},b.name))})]})]})]})}function mv(){const{state:r}=Yt(),{plugin:u,skill:d}=r,[o,m]=y.useState(null),[v,h]=y.useState(!0);return y.useEffect(()=>{Se.getDependencies(u,d).then(m).catch(()=>{}).finally(()=>h(!1))},[u,d]),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"})]}):o?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(fv,{plugin:u,skill:d})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const xv=["editor","tests","run","activation","history","deps"];function pv(r){return r!=null&&xv.includes(r)}function hv(){const{state:r,dispatch:u,saveContent:d}=Yt();y.useEffect(()=>{const h=new URLSearchParams(window.location.search).get("panel");pv(h)&&h!==r.activePanel&&u({type:"SET_PANEL",panel:h})},[]),y.useEffect(()=>{const v=new URLSearchParams(window.location.search);v.set("panel",r.activePanel);const h=`${window.location.pathname}?${v.toString()}${window.location.hash}`;history.replaceState(null,"",h)},[r.activePanel]);const o=y.useCallback(v=>{const h=v.ctrlKey||v.metaKey;if(h&&v.key>="1"&&v.key<="6"){v.preventDefault(),u({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(v.key)-1]});return}if(h&&v.key==="s"&&!v.shiftKey){v.preventDefault(),r.isDirty&&d();return}},[r.isDirty,d,u]);if(y.useEffect(()=>(window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)),[o]),r.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 m=Array.from(r.caseRunStates.values()).some(v=>v.status==="running"||v.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(yh,{state:r}),n.jsx(Sh,{activePanel:r.activePanel,onPanelChange:v=>u({type:"SET_PANEL",panel:v}),isDirty:r.isDirty,isRunning:m,hasRegressions:r.regressions.length>0,isActivationRunning:r.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:[r.activePanel==="editor"&&n.jsx(Uh,{}),r.activePanel==="tests"&&n.jsx(Yh,{}),r.activePanel==="run"&&n.jsx(Jh,{}),r.activePanel==="activation"&&n.jsx(Ph,{}),r.activePanel==="history"&&n.jsx(cv,{}),r.activePanel==="deps"&&n.jsx(mv,{})]},r.activePanel)})]})}function qc(r,u=!0){let d=r.toLowerCase().replace(/[^a-z0-9]+/g,"-");return u&&(d=d.replace(/^-+|-+$/g,"")),d}function vv(r,u,d,o){const v=`.../${r.split("/").slice(-2).join("/")}`;switch(u){case 1:return`${v}/${d}/skills/${o}/SKILL.md`;case 2:return`${v}/plugins/${d}/skills/${o}/SKILL.md`;case 3:return`${v}/skills/${o}/SKILL.md`}}const Ll={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Xn({size:r=14,color:u="currentColor"}){return n.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:u,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 yv({onCreated:r,onCancel:u}){const[d,o]=y.useState("manual"),[m,v]=y.useState(null),[h,S]=y.useState(!0),[p,x]=y.useState(null),[j,b]=y.useState(""),[R,U]=y.useState(3),[Y,Z]=y.useState(""),[X,ne]=y.useState(""),[se,F]=y.useState(""),[G,ee]=y.useState(""),[J,I]=y.useState(""),[P,me]=y.useState(""),[xe,Ne]=y.useState(null),[ye,K]=y.useState(!1),[$,W]=y.useState(null),[k,w]=y.useState(""),[D,le]=y.useState(!1),[pe,N]=y.useState(null),[T,O]=y.useState(null),[q,V]=y.useState(null),[te,ce]=y.useState([]),Ye=y.useRef(null),ze=y.useRef(null);y.useEffect(()=>{Se.getProjectLayout().then(Q=>{v(Q),U(Q.suggestedLayout);const Oe=Q.detectedLayouts.find(ul=>ul.layout===Q.suggestedLayout);Oe!=null&&Oe.existingPlugins.length&&Z(Oe.existingPlugins[0])}).catch(()=>{}).finally(()=>S(!1)),Se.getConfig().then(x).catch(()=>{})},[]),y.useEffect(()=>{var Q;d==="ai"&&((Q=Ye.current)==null||Q.focus())},[d]),y.useEffect(()=>()=>{var Q;(Q=ze.current)==null||Q.abort()},[]);const Bl=y.useMemo(()=>{var Q;return m?((Q=m.detectedLayouts.find(Oe=>Oe.layout===R))==null?void 0:Q.existingPlugins)||[]:[]},[m,R]),cl=Y==="__new__"?X:Y,Za=m?vv(m.root,R,cl||"{plugin}",j||"{skill}"):"",Ka=y.useMemo(()=>m?m.detectedLayouts.filter(Q=>Q.layout!==4):[],[m]),Lt=y.useMemo(()=>{if(!p)return null;for(const Q of p.providers)for(const Oe of Q.models)if(Q.id===p.provider&&(Q.id==="claude-cli"?p.model===`claude-${Oe.id}`:p.model===Oe.id))return Oe.label;return p.model||null},[p]),Ja=y.useCallback(()=>{if(!p)return{provider:"claude-cli",model:"sonnet"};const Q=p.provider||"claude-cli";let Oe=p.model||"sonnet";return Q==="claude-cli"&&Oe.startsWith("claude-")&&(Oe=Oe.replace("claude-","")),{provider:Q,model:Oe}},[p]),$a=y.useCallback(()=>{var Q;(Q=ze.current)==null||Q.abort(),le(!1)},[]);async function na(){var Kn;if(O(null),V(null),N(null),ce([]),!k.trim()){O("Describe what your skill should do");return}le(!0);const Q=new AbortController;ze.current=Q;const{provider:Oe,model:ul}=Ja();try{const Gt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:k.trim(),provider:Oe,model:ul}),signal:Q.signal});if(!Gt.ok||!Gt.body)throw new Error(`HTTP ${Gt.status}`);const nt=Gt.body.getReader(),xi=new TextDecoder;let sa="",Vt="";for(;;){const{done:ia,value:pi}=await nt.read();if(ia)break;sa+=xi.decode(pi,{stream:!0});const Wa=sa.split(`
|
|
68
|
-
`);sa=Wa.pop()||"";for(const ra of Wa)if(ra.startsWith("event: "))Vt=ra.slice(7).trim();else if(ra.startsWith("data: ")){try{const lt=JSON.parse(ra.slice(6));Vt==="progress"?ce(Ul=>[...Ul,{phase:lt.phase,message:lt.message,timestamp:Date.now()}]):Vt==="done"||Vt==="complete"?(b(lt.name),F(lt.description),ee(lt.model||""),I(lt.allowedTools||""),me(lt.body),Ne((Kn=lt.evals)!=null&&Kn.length?lt.evals:null),N(lt.reasoning),o("manual")):Vt==="error"&&(O(lt.message||lt.description||"Unknown error"),lt.category&&V(lt))}catch{}Vt=""}}}catch(Gt){Gt.name!=="AbortError"&&O(Gt.message)}finally{le(!1),ze.current=null}}async function Zn(){if(W(null),!j.trim()){W("Skill name is required");return}if(!se.trim()){W("Description is required");return}if(R!==3&&!cl.trim()){W("Plugin name is required");return}K(!0);try{const Q=await Se.createSkill({name:qc(j),plugin:cl||"",layout:R,description:se,model:G||void 0,allowedTools:J||void 0,body:P,evals:xe||void 0});r(Q.plugin,Q.skill)}catch(Q){W(Q.message)}finally{K(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>o("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:d==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:d==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>o("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="ai"?"rgba(168,85,247,0.15)":"transparent",color:d==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:d==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Xn,{size:12}),"AI-Assisted"]})})]})})]}),h&&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"})]}),!h&&m&&d==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Xn,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:Ye,value:k,onChange:Q=>w(Q.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
69
|
-
|
|
70
|
-
Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:D,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...Ll,minHeight:"120px"},onKeyDown:Q=>{Q.key==="Enter"&&(Q.metaKey||Q.ctrlKey)&&(Q.preventDefault(),na())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),D&&te.length>0&&n.jsx(fi,{entries:te,isRunning:!0}),T&&n.jsx("div",{children:q?n.jsx(mi,{error:q,onRetry:na,onDismiss:()=>{O(null),V(null)}}):n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:T}),n.jsx("button",{onClick:na,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:[D?n.jsx("button",{onClick:$a,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:na,disabled:!k.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:k.trim()?"#a855f7":"var(--surface-3)",color:k.trim()?"#fff":"var(--text-tertiary)",cursor:k.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Xn,{size:14}),Lt?`Generate with ${Lt}`:"Generate Skill"]}),n.jsx("button",{onClick:u,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"}),!D&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>o("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!h&&m&&d==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[pe&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Xn,{size:11,color:"#a855f7"})}),n.jsxs("div",{children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Generated"}),n.jsx("span",{className:"mx-1.5",style:{color:"var(--text-tertiary)"},children:"—"}),n.jsx("span",{children:pe}),xe&&xe.length>0&&n.jsxs("span",{className:"ml-2 px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"rgba(168,85,247,0.12)",color:"#a855f7"},children:["+",xe.length," test cases"]})]})]}),n.jsx("button",{onClick:()=>{N(null),Ne(null)},className:"flex-shrink-0 w-5 h-5 rounded flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:Q=>{Q.currentTarget.style.background="var(--surface-3)"},onMouseLeave:Q=>{Q.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:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),Ka.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:Ka.map(Q=>n.jsx("button",{onClick:()=>{U(Q.layout),Z(Q.existingPlugins[0]||""),ne("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:R===Q.layout?"var(--accent)":"var(--surface-3)",color:R===Q.layout?"#fff":"var(--text-secondary)",border:`1px solid ${R===Q.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:Q.label},Q.layout))})]}),R!==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:Y,onChange:Q=>{Z(Q.target.value),ne("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Ll,children:[Bl.map(Q=>n.jsx("option",{value:Q,children:Q},Q)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),Y==="__new__"&&n.jsx("input",{type:"text",value:X,onChange:Q=>ne(qc(Q.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:Ll})]}),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:Za})]}),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:j,onChange:Q=>b(qc(Q.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Ll})]}),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:se,onChange:Q=>F(Q.target.value),placeholder:"Brief description",rows:2,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-none",style:Ll})]}),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:G,onChange:Q=>ee(Q.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Ll,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:J,onChange:Q=>I(Q.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Ll})]})]})]}),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:"System Prompt"}),n.jsx("textarea",{value:P,onChange:Q=>me(Q.target.value),placeholder:`# /my-skill
|
|
71
|
-
|
|
72
|
-
You are an expert at...
|
|
73
|
-
`,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...Ll,minHeight:"150px"}})]}),xe&&xe.length>0&&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(Xn,{size:13,color:"#a855f7"}),"Generated Test Cases",n.jsxs("span",{className:"text-[11px] font-normal",style:{color:"var(--text-tertiary)"},children:["(",xe.length," evals will be saved with the skill)"]})]}),n.jsx("div",{className:"space-y-2",children:xe.map(Q=>n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"font-medium mb-1",style:{color:"var(--text-primary)"},children:Q.name}),n.jsxs("div",{className:"text-[11px] mb-1",style:{color:"var(--text-tertiary)"},children:["Prompt: ",Q.prompt.length>120?Q.prompt.slice(0,120)+"...":Q.prompt]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:Q.assertions.map(Oe=>n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(168,85,247,0.1)",color:"#a855f7"},children:Oe.text.length>50?Oe.text.slice(0,50)+"...":Oe.text},Oe.id))})]},Q.id))})]}),$&&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:$}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Zn,disabled:ye||!j||!se,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:ye||!j||!se?"var(--surface-3)":"var(--accent)",color:ye||!j||!se?"var(--text-tertiary)":"#fff",cursor:ye||!j||!se?"not-allowed":"pointer",border:"none"},children:ye?"Creating...":"Create Skill"}),n.jsx("button",{onClick:u,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 gv(){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 Yc({variant:r,message:u,onRetry:d}){const{setMode:o,setSearch:m}=aa(),[v,h]=y.useState(!1);return r==="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(gv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>h(!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"})]}):r==="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:()=>o("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"]})]}):r==="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:u||"Failed to load skill data"}),d&&n.jsx("button",{onClick:d,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>m(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function pm(){const{state:r,setMobileView:u}=aa();return r.isMobile?n.jsxs("button",{onClick:()=>u("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 bv(){const{state:r,selectSkill:u,setMode:d,refreshSkills:o}=aa();if(r.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(pm,{}),n.jsx(yv,{onCreated:(h,S)=>{d("browse"),o(),u({plugin:h,skill:S})},onCancel:()=>d("browse")})]});if(!r.selectedSkill)return r.skillsError?n.jsx(Yc,{variant:"error",message:r.skillsError,onRetry:o}):!r.skillsLoading&&r.skills.length===0?n.jsx(Yc,{variant:"no-skills"}):n.jsx(Yc,{variant:"no-selection"});const{plugin:m,skill:v}=r.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(pm,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(vh,{plugin:m,skill:v,children:n.jsx(hv,{})},`${m}/${v}`)})]})}function jv(){return n.jsx(th,{children:n.jsx(lh,{left:n.jsx(oh,{}),right:n.jsx(bv,{})})})}$p.createRoot(document.getElementById("root")).render(n.jsx(y.StrictMode,{children:n.jsx(jv,{})}));
|