vskill 0.5.12 → 0.5.13

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.
Files changed (84) hide show
  1. package/dist/commands/eval/credentials.d.ts +12 -0
  2. package/dist/commands/eval/credentials.js +140 -0
  3. package/dist/commands/eval/credentials.js.map +1 -0
  4. package/dist/commands/eval/generate-all.d.ts +1 -1
  5. package/dist/commands/eval/generate-all.js +57 -12
  6. package/dist/commands/eval/generate-all.js.map +1 -1
  7. package/dist/commands/eval/init.d.ts +2 -1
  8. package/dist/commands/eval/init.js +76 -10
  9. package/dist/commands/eval/init.js.map +1 -1
  10. package/dist/commands/eval/run.d.ts +7 -1
  11. package/dist/commands/eval/run.js +207 -26
  12. package/dist/commands/eval/run.js.map +1 -1
  13. package/dist/commands/eval/sweep.d.ts +7 -0
  14. package/dist/commands/eval/sweep.js +99 -0
  15. package/dist/commands/eval/sweep.js.map +1 -0
  16. package/dist/commands/eval.d.ts +10 -0
  17. package/dist/commands/eval.js +62 -4
  18. package/dist/commands/eval.js.map +1 -1
  19. package/dist/eval/batch-judge.d.ts +27 -0
  20. package/dist/eval/batch-judge.js +242 -0
  21. package/dist/eval/batch-judge.js.map +1 -0
  22. package/dist/eval/chrome-profile.d.ts +16 -0
  23. package/dist/eval/chrome-profile.js +65 -0
  24. package/dist/eval/chrome-profile.js.map +1 -0
  25. package/dist/eval/comparator.d.ts +3 -1
  26. package/dist/eval/comparator.js +19 -3
  27. package/dist/eval/comparator.js.map +1 -1
  28. package/dist/eval/concurrency.d.ts +13 -0
  29. package/dist/eval/concurrency.js +53 -0
  30. package/dist/eval/concurrency.js.map +1 -0
  31. package/dist/eval/credential-resolver.d.ts +31 -0
  32. package/dist/eval/credential-resolver.js +111 -0
  33. package/dist/eval/credential-resolver.js.map +1 -0
  34. package/dist/eval/integration-runner.d.ts +12 -0
  35. package/dist/eval/integration-runner.js +303 -0
  36. package/dist/eval/integration-runner.js.map +1 -0
  37. package/dist/eval/integration-types.d.ts +65 -0
  38. package/dist/eval/integration-types.js +18 -0
  39. package/dist/eval/integration-types.js.map +1 -0
  40. package/dist/eval/judge-cache.d.ts +29 -0
  41. package/dist/eval/judge-cache.js +109 -0
  42. package/dist/eval/judge-cache.js.map +1 -0
  43. package/dist/eval/judge.d.ts +1 -1
  44. package/dist/eval/judge.js +20 -3
  45. package/dist/eval/judge.js.map +1 -1
  46. package/dist/eval/llm.d.ts +2 -1
  47. package/dist/eval/llm.js +54 -2
  48. package/dist/eval/llm.js.map +1 -1
  49. package/dist/eval/prompt-builder.d.ts +10 -0
  50. package/dist/eval/prompt-builder.js +167 -0
  51. package/dist/eval/prompt-builder.js.map +1 -1
  52. package/dist/eval/rate-limiter.d.ts +20 -0
  53. package/dist/eval/rate-limiter.js +62 -0
  54. package/dist/eval/rate-limiter.js.map +1 -0
  55. package/dist/eval/schema.d.ts +14 -0
  56. package/dist/eval/schema.js +55 -5
  57. package/dist/eval/schema.js.map +1 -1
  58. package/dist/eval-server/api-routes.js +71 -2
  59. package/dist/eval-server/api-routes.js.map +1 -1
  60. package/dist/eval-server/benchmark-runner.d.ts +7 -0
  61. package/dist/eval-server/benchmark-runner.js +158 -42
  62. package/dist/eval-server/benchmark-runner.js.map +1 -1
  63. package/dist/eval-server/concurrency.d.ts +1 -13
  64. package/dist/eval-server/concurrency.js +3 -49
  65. package/dist/eval-server/concurrency.js.map +1 -1
  66. package/dist/eval-server/eval-server.js +4 -0
  67. package/dist/eval-server/eval-server.js.map +1 -1
  68. package/dist/eval-server/integration-routes.d.ts +2 -0
  69. package/dist/eval-server/integration-routes.js +100 -0
  70. package/dist/eval-server/integration-routes.js.map +1 -0
  71. package/dist/eval-server/skill-create-routes.js +151 -22
  72. package/dist/eval-server/skill-create-routes.js.map +1 -1
  73. package/dist/eval-server/sweep-routes.d.ts +2 -0
  74. package/dist/eval-server/sweep-routes.js +93 -0
  75. package/dist/eval-server/sweep-routes.js.map +1 -0
  76. package/dist/eval-server/sweep-runner.d.ts +93 -0
  77. package/dist/eval-server/sweep-runner.js +275 -0
  78. package/dist/eval-server/sweep-runner.js.map +1 -0
  79. package/dist/eval-ui/assets/index-KfkLPyh3.js +74 -0
  80. package/dist/eval-ui/index.html +1 -1
  81. package/dist/index.js +8 -0
  82. package/dist/index.js.map +1 -1
  83. package/package.json +1 -1
  84. package/dist/eval-ui/assets/index-C7MIPqI-.js +0 -74
@@ -1,74 +0,0 @@
1
- (function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))u(x);new MutationObserver(x=>{for(const h of x)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function c(x){const h={};return x.integrity&&(h.integrity=x.integrity),x.referrerPolicy&&(h.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?h.credentials="include":x.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(x){if(x.ep)return;x.ep=!0;const h=c(x);fetch(x.href,h)}})();var Bc={exports:{}},Fn={};/**
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 nx;function oh(){if(nx)return Fn;nx=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,x,h){var m=null;if(h!==void 0&&(m=""+h),x.key!==void 0&&(m=""+x.key),"key"in x){h={};for(var N in x)N!=="key"&&(h[N]=x[N])}else h=x;return x=h.ref,{$$typeof:i,type:u,key:m,ref:x!==void 0?x:null,props:h}}return Fn.Fragment=o,Fn.jsx=c,Fn.jsxs=c,Fn}var sx;function uh(){return sx||(sx=1,Bc.exports=oh()),Bc.exports}var n=uh(),Uc={exports:{}},xe={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var rx;function dh(){if(rx)return xe;rx=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),T=Symbol.iterator;function z(b){return b===null||typeof b!="object"?null:(b=T&&b[T]||b["@@iterator"],typeof b=="function"?b:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,Y={};function J(b,M,X){this.props=b,this.context=M,this.refs=Y,this.updater=X||B}J.prototype.isReactComponent={},J.prototype.setState=function(b,M){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,M,"setState")},J.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function P(){}P.prototype=J.prototype;function ne(b,M,X){this.props=b,this.context=M,this.refs=Y,this.updater=X||B}var V=ne.prototype=new P;V.constructor=ne,q(V,J.prototype),V.isPureReactComponent=!0;var I=Array.isArray;function Q(){}var Z={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function me(b,M,X){var F=X.ref;return{$$typeof:i,type:b,key:M,ref:F!==void 0?F:null,props:X}}function Ce(b,M){return me(b.type,M,b.props)}function _e(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function ye(b){var M={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(X){return M[X]})}var D=/\/+/g;function se(b,M){return typeof b=="object"&&b!==null&&b.key!=null?ye(""+b.key):M.toString(36)}function fe(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(Q,Q):(b.status="pending",b.then(function(M){b.status==="pending"&&(b.status="fulfilled",b.value=M)},function(M){b.status==="pending"&&(b.status="rejected",b.reason=M)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function k(b,M,X,F,ie){var O=typeof b;(O==="undefined"||O==="boolean")&&(b=null);var $=!1;if(b===null)$=!0;else switch(O){case"bigint":case"string":case"number":$=!0;break;case"object":switch(b.$$typeof){case i:case o:$=!0;break;case S:return $=b._init,k($(b._payload),M,X,F,ie)}}if($)return ie=ie(b),$=F===""?"."+se(b,0):F,I(ie)?(X="",$!=null&&(X=$.replace(D,"$&/")+"/"),k(ie,M,X,"",function(ke){return ke})):ie!=null&&(_e(ie)&&(ie=Ce(ie,X+(ie.key==null||b&&b.key===ie.key?"":(""+ie.key).replace(D,"$&/")+"/")+$)),M.push(ie)),1;$=0;var le=F===""?".":F+":";if(I(b))for(var oe=0;oe<b.length;oe++)F=b[oe],O=le+se(F,oe),$+=k(F,M,X,O,ie);else if(oe=z(b),typeof oe=="function")for(b=oe.call(b),oe=0;!(F=b.next()).done;)F=F.value,O=le+se(F,oe++),$+=k(F,M,X,O,ie);else if(O==="object"){if(typeof b.then=="function")return k(fe(b),M,X,F,ie);throw M=String(b),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return $}function _(b,M,X){if(b==null)return b;var F=[],ie=0;return k(b,F,"","",function(O){return M.call(X,O,ie++)}),F}function W(b){if(b._status===-1){var M=b._result;M=M(),M.then(function(X){(b._status===0||b._status===-1)&&(b._status=1,b._result=X)},function(X){(b._status===0||b._status===-1)&&(b._status=2,b._result=X)}),b._status===-1&&(b._status=0,b._result=M)}if(b._status===1)return b._result.default;throw b._result}var K=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},ue={map:_,forEach:function(b,M,X){_(b,function(){M.apply(this,arguments)},X)},count:function(b){var M=0;return _(b,function(){M++}),M},toArray:function(b){return _(b,function(M){return M})||[]},only:function(b){if(!_e(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return xe.Activity=g,xe.Children=ue,xe.Component=J,xe.Fragment=c,xe.Profiler=x,xe.PureComponent=ne,xe.StrictMode=u,xe.Suspense=y,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,xe.__COMPILER_RUNTIME={__proto__:null,c:function(b){return Z.H.useMemoCache(b)}},xe.cache=function(b){return function(){return b.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(b,M,X){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var F=q({},b.props),ie=b.key;if(M!=null)for(O in M.key!==void 0&&(ie=""+M.key),M)!ee.call(M,O)||O==="key"||O==="__self"||O==="__source"||O==="ref"&&M.ref===void 0||(F[O]=M[O]);var O=arguments.length-2;if(O===1)F.children=X;else if(1<O){for(var $=Array(O),le=0;le<O;le++)$[le]=arguments[le+2];F.children=$}return me(b.type,ie,F)},xe.createContext=function(b){return b={$$typeof:m,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:h,_context:b},b},xe.createElement=function(b,M,X){var F,ie={},O=null;if(M!=null)for(F in M.key!==void 0&&(O=""+M.key),M)ee.call(M,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(ie[F]=M[F]);var $=arguments.length-2;if($===1)ie.children=X;else if(1<$){for(var le=Array($),oe=0;oe<$;oe++)le[oe]=arguments[oe+2];ie.children=le}if(b&&b.defaultProps)for(F in $=b.defaultProps,$)ie[F]===void 0&&(ie[F]=$[F]);return me(b,O,ie)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(b){return{$$typeof:N,render:b}},xe.isValidElement=_e,xe.lazy=function(b){return{$$typeof:S,_payload:{_status:-1,_result:b},_init:W}},xe.memo=function(b,M){return{$$typeof:f,type:b,compare:M===void 0?null:M}},xe.startTransition=function(b){var M=Z.T,X={};Z.T=X;try{var F=b(),ie=Z.S;ie!==null&&ie(X,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(Q,K)}catch(O){K(O)}finally{M!==null&&X.types!==null&&(M.types=X.types),Z.T=M}},xe.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},xe.use=function(b){return Z.H.use(b)},xe.useActionState=function(b,M,X){return Z.H.useActionState(b,M,X)},xe.useCallback=function(b,M){return Z.H.useCallback(b,M)},xe.useContext=function(b){return Z.H.useContext(b)},xe.useDebugValue=function(){},xe.useDeferredValue=function(b,M){return Z.H.useDeferredValue(b,M)},xe.useEffect=function(b,M){return Z.H.useEffect(b,M)},xe.useEffectEvent=function(b){return Z.H.useEffectEvent(b)},xe.useId=function(){return Z.H.useId()},xe.useImperativeHandle=function(b,M,X){return Z.H.useImperativeHandle(b,M,X)},xe.useInsertionEffect=function(b,M){return Z.H.useInsertionEffect(b,M)},xe.useLayoutEffect=function(b,M){return Z.H.useLayoutEffect(b,M)},xe.useMemo=function(b,M){return Z.H.useMemo(b,M)},xe.useOptimistic=function(b,M){return Z.H.useOptimistic(b,M)},xe.useReducer=function(b,M,X){return Z.H.useReducer(b,M,X)},xe.useRef=function(b){return Z.H.useRef(b)},xe.useState=function(b){return Z.H.useState(b)},xe.useSyncExternalStore=function(b,M,X){return Z.H.useSyncExternalStore(b,M,X)},xe.useTransition=function(){return Z.H.useTransition()},xe.version="19.2.4",xe}var ix;function so(){return ix||(ix=1,Uc.exports=dh()),Uc.exports}var v=so(),Hc={exports:{}},In={},qc={exports:{}},Gc={};/**
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 cx;function fh(){return cx||(cx=1,(function(i){function o(k,_){var W=k.length;k.push(_);e:for(;0<W;){var K=W-1>>>1,ue=k[K];if(0<x(ue,_))k[K]=_,k[W]=ue,W=K;else break e}}function c(k){return k.length===0?null:k[0]}function u(k){if(k.length===0)return null;var _=k[0],W=k.pop();if(W!==_){k[0]=W;e:for(var K=0,ue=k.length,b=ue>>>1;K<b;){var M=2*(K+1)-1,X=k[M],F=M+1,ie=k[F];if(0>x(X,W))F<ue&&0>x(ie,X)?(k[K]=ie,k[F]=W,K=F):(k[K]=X,k[M]=W,K=M);else if(F<ue&&0>x(ie,W))k[K]=ie,k[F]=W,K=F;else break e}}return _}function x(k,_){var W=k.sortIndex-_.sortIndex;return W!==0?W:k.id-_.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var m=Date,N=m.now();i.unstable_now=function(){return m.now()-N}}var y=[],f=[],S=1,g=null,T=3,z=!1,B=!1,q=!1,Y=!1,J=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;function V(k){for(var _=c(f);_!==null;){if(_.callback===null)u(f);else if(_.startTime<=k)u(f),_.sortIndex=_.expirationTime,o(y,_);else break;_=c(f)}}function I(k){if(q=!1,V(k),!B)if(c(y)!==null)B=!0,Q||(Q=!0,ye());else{var _=c(f);_!==null&&fe(I,_.startTime-k)}}var Q=!1,Z=-1,ee=5,me=-1;function Ce(){return Y?!0:!(i.unstable_now()-me<ee)}function _e(){if(Y=!1,Q){var k=i.unstable_now();me=k;var _=!0;try{e:{B=!1,q&&(q=!1,P(Z),Z=-1),z=!0;var W=T;try{t:{for(V(k),g=c(y);g!==null&&!(g.expirationTime>k&&Ce());){var K=g.callback;if(typeof K=="function"){g.callback=null,T=g.priorityLevel;var ue=K(g.expirationTime<=k);if(k=i.unstable_now(),typeof ue=="function"){g.callback=ue,V(k),_=!0;break t}g===c(y)&&u(y),V(k)}else u(y);g=c(y)}if(g!==null)_=!0;else{var b=c(f);b!==null&&fe(I,b.startTime-k),_=!1}}break e}finally{g=null,T=W,z=!1}_=void 0}}finally{_?ye():Q=!1}}}var ye;if(typeof ne=="function")ye=function(){ne(_e)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,se=D.port2;D.port1.onmessage=_e,ye=function(){se.postMessage(null)}}else ye=function(){J(_e,0)};function fe(k,_){Z=J(function(){k(i.unstable_now())},_)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(k){k.callback=null},i.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"):ee=0<k?Math.floor(1e3/k):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(k){switch(T){case 1:case 2:case 3:var _=3;break;default:_=T}var W=T;T=_;try{return k()}finally{T=W}},i.unstable_requestPaint=function(){Y=!0},i.unstable_runWithPriority=function(k,_){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var W=T;T=k;try{return _()}finally{T=W}},i.unstable_scheduleCallback=function(k,_,W){var K=i.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?K+W:K):W=K,k){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=W+ue,k={id:S++,callback:_,priorityLevel:k,startTime:W,expirationTime:ue,sortIndex:-1},W>K?(k.sortIndex=W,o(f,k),c(y)===null&&k===c(f)&&(q?(P(Z),Z=-1):q=!0,fe(I,W-K))):(k.sortIndex=ue,o(y,k),B||z||(B=!0,Q||(Q=!0,ye()))),k},i.unstable_shouldYield=Ce,i.unstable_wrapCallback=function(k){var _=T;return function(){var W=T;T=_;try{return k.apply(this,arguments)}finally{T=W}}}})(Gc)),Gc}var ox;function xh(){return ox||(ox=1,qc.exports=fh()),qc.exports}var Yc={exports:{}},dt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var ux;function ph(){if(ux)return dt;ux=1;var i=so();function o(y){var f="https://react.dev/errors/"+y;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)f+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+y+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},x=Symbol.for("react.portal");function h(y,f,S){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:g==null?null:""+g,children:y,containerInfo:f,implementation:S}}var m=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function N(y,f){if(y==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,dt.createPortal=function(y,f){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(o(299));return h(y,f,null,S)},dt.flushSync=function(y){var f=m.T,S=u.p;try{if(m.T=null,u.p=2,y)return y()}finally{m.T=f,u.p=S,u.d.f()}},dt.preconnect=function(y,f){typeof y=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,u.d.C(y,f))},dt.prefetchDNS=function(y){typeof y=="string"&&u.d.D(y)},dt.preinit=function(y,f){if(typeof y=="string"&&f&&typeof f.as=="string"){var S=f.as,g=N(S,f.crossOrigin),T=typeof f.integrity=="string"?f.integrity:void 0,z=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;S==="style"?u.d.S(y,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:T,fetchPriority:z}):S==="script"&&u.d.X(y,{crossOrigin:g,integrity:T,fetchPriority:z,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},dt.preinitModule=function(y,f){if(typeof y=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var S=N(f.as,f.crossOrigin);u.d.M(y,{crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&u.d.M(y)},dt.preload=function(y,f){if(typeof y=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var S=f.as,g=N(S,f.crossOrigin);u.d.L(y,S,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},dt.preloadModule=function(y,f){if(typeof y=="string")if(f){var S=N(f.as,f.crossOrigin);u.d.m(y,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:S,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else u.d.m(y)},dt.requestFormReset=function(y){u.d.r(y)},dt.unstable_batchedUpdates=function(y,f){return y(f)},dt.useFormState=function(y,f,S){return m.H.useFormState(y,f,S)},dt.useFormStatus=function(){return m.H.useHostTransitionStatus()},dt.version="19.2.4",dt}var dx;function mh(){if(dx)return Yc.exports;dx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}return i(),Yc.exports=ph(),Yc.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 fx;function hh(){if(fx)return In;fx=1;var i=xh(),o=so(),c=mh();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function m(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 N(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(h(e)!==e)throw Error(u(188))}function f(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return y(s),e;if(r===a)return y(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var d=!1,p=s.child;p;){if(p===l){d=!0,l=s,a=r;break}if(p===a){d=!0,a=s,l=r;break}p=p.sibling}if(!d){for(p=r.child;p;){if(p===l){d=!0,l=r,a=s;break}if(p===a){d=!0,a=r,l=s;break}p=p.sibling}if(!d)throw Error(u(189))}}if(l.alternate!==a)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,T=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),Ce=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=_e&&e[_e]||e["@@iterator"],typeof e=="function"?e:null)}var D=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===D?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case J:return"Profiler";case Y:return"StrictMode";case I:return"Suspense";case Q:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case ne:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case ee:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var fe=Array.isArray,k=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},K=[],ue=-1;function b(e){return{current:e}}function M(e){0>ue||(e.current=K[ue],K[ue]=null,ue--)}function X(e,t){ue++,K[ue]=e.current,e.current=t}var F=b(null),ie=b(null),O=b(null),$=b(null);function le(e,t){switch(X(O,t),X(ie,e),X(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cf(t),e=wf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(F),X(F,e)}function oe(){M(F),M(ie),M(O)}function ke(e){e.memoizedState!==null&&X($,e);var t=F.current,l=wf(t,e.type);t!==l&&(X(ie,e),X(F,l))}function Je(e){ie.current===e&&(M(F),M(ie)),$.current===e&&(M($),Kn._currentValue=W)}var yt,st;function Zt(e){if(yt===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);yt=t&&t[1]||"",st=-1<l.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+yt+e+st}var ft=!1;function al(e,t){if(!e||ft)return"";ft=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(L){var R=L}Reflect.construct(e,[],G)}else{try{G.call()}catch(L){R=L}e.call(G.prototype)}}else{try{throw Error()}catch(L){R=L}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(L){if(L&&R&&typeof L.stack=="string")return[L.stack,R.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),d=r[0],p=r[1];if(d&&p){var j=d.split(`
44
- `),A=p.split(`
45
- `);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===A.length)for(a=j.length-1,s=A.length-1;1<=a&&0<=s&&j[a]!==A[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==A[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==A[s]){var U=`
46
- `+j[a].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=a&&0<=s);break}}}finally{ft=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Zt(l):""}function ma(e,t){switch(e.tag){case 26:case 27:case 5:return Zt(e.type);case 16:return Zt("Lazy");case 13:return e.child!==t&&t!==null?Zt("Suspense Fallback"):Zt("Suspense");case 19:return Zt("SuspenseList");case 0:case 15:return al(e.type,!1);case 11:return al(e.type.render,!1);case 1:return al(e.type,!0);case 31:return Zt("Activity");default:return""}}function gt(e){try{var t="",l=null;do t+=ma(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
47
- Error generating stack: `+a.message+`
48
- `+a.stack}}var Ft=Object.prototype.hasOwnProperty,Kt=i.unstable_scheduleCallback,Wl=i.unstable_cancelCallback,an=i.unstable_shouldYield,te=i.unstable_requestPaint,Oe=i.unstable_now,he=i.unstable_getCurrentPriorityLevel,Ge=i.unstable_ImmediatePriority,bt=i.unstable_UserBlockingPriority,Me=i.unstable_NormalPriority,nn=i.unstable_LowPriority,ha=i.unstable_IdlePriority,nl=i.log,xt=i.unstable_setDisableYieldValue,pt=null,Xe=null;function jt(e){if(typeof nl=="function"&&xt(e),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(pt,e)}catch{}}var Ze=Math.clz32?Math.clz32:va,Te=Math.log,mt=Math.LN2;function va(e){return e>>>=0,e===0?32:31-(Te(e)/mt|0)|0}var ts=256,ls=262144,as=4194304;function Fl(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 ns(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=a&134217727;return p!==0?(a=p&~r,a!==0?s=Fl(a):(d&=p,d!==0?s=Fl(d):l||(l=p&~e,l!==0&&(s=Fl(l))))):(p=a&~r,p!==0?s=Fl(p):d!==0?s=Fl(d):l||(l=a&~e,l!==0&&(s=Fl(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function sn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Wx(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ro(){var e=as;return as<<=1,(as&62914560)===0&&(as=4194304),e}function kr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function rn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fx(e,t,l,a,s,r){var d=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var p=e.entanglements,j=e.expirationTimes,A=e.hiddenUpdates;for(l=d&~l;0<l;){var U=31-Ze(l),G=1<<U;p[U]=0,j[U]=-1;var R=A[U];if(R!==null)for(A[U]=null,U=0;U<R.length;U++){var L=R[U];L!==null&&(L.lane&=-536870913)}l&=~G}a!==0&&io(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function io(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ze(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function co(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Ze(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function oo(e,t){var l=t&-t;return l=(l&42)!==0?1:Tr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Tr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Cr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function uo(){var e=_.p;return e!==0?e:(e=window.event,e===void 0?32:Ff(e.type))}function fo(e,t){var l=_.p;try{return _.p=e,t()}finally{_.p=l}}var Nl=Math.random().toString(36).slice(2),rt="__reactFiber$"+Nl,St="__reactProps$"+Nl,ya="__reactContainer$"+Nl,wr="__reactEvents$"+Nl,Ix="__reactListeners$"+Nl,Px="__reactHandles$"+Nl,xo="__reactResources$"+Nl,cn="__reactMarker$"+Nl;function Ar(e){delete e[rt],delete e[St],delete e[wr],delete e[Ix],delete e[Px]}function ga(e){var t=e[rt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ya]||l[rt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Of(e);e!==null;){if(l=e[rt])return l;e=Of(e)}return t}e=l,l=e.parentNode}return null}function ba(e){if(e=e[rt]||e[ya]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function on(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ja(e){var t=e[xo];return t||(t=e[xo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[cn]=!0}var po=new Set,mo={};function Il(e,t){Sa(e,t),Sa(e+"Capture",t)}function Sa(e,t){for(mo[e]=t,e=0;e<t.length;e++)po.add(t[e])}var ep=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ho={},vo={};function tp(e){return Ft.call(vo,e)?!0:Ft.call(ho,e)?!1:ep.test(e)?vo[e]=!0:(ho[e]=!0,!1)}function ss(e,t,l){if(tp(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function rs(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 sl(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 Dt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lp(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){l=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=yo(e)?"checked":"value";e._valueTracker=lp(e,t,""+e[t])}}function go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=yo(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function is(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ap=/[\n"\\]/g;function Bt(e){return e.replace(ap,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rr(e,t,l,a,s,r,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Dt(t)):e.value!==""+Dt(t)&&(e.value=""+Dt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Mr(e,d,Dt(t)):l!=null?Mr(e,d,Dt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Dt(p):e.removeAttribute("name")}function bo(e,t,l,a,s,r,d,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){_r(e);return}l=l!=null?""+Dt(l):"",t=t!=null?""+Dt(t):l,p||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=p?e.checked:!!a,e.defaultChecked=!!a,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),_r(e)}function Mr(e,t,l){t==="number"&&is(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Na(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=""+Dt(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 jo(e,t,l){if(t!=null&&(t=""+Dt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Dt(l):""}function So(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(fe(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Dt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),_r(e)}function Ea(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var np=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function No(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||np.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Eo(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&No(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&No(e,r,t[r])}function zr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),rp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cs(e){return rp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rl(){}var Lr=null;function Or(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ka=null,Ta=null;function ko(e){var t=ba(e);if(t&&(e=t.stateNode)){var l=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Bt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[St]||null;if(!s)throw Error(u(90));Rr(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&go(a)}break e;case"textarea":jo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Na(e,!!l.multiple,t,!1)}}}var Dr=!1;function To(e,t,l){if(Dr)return e(t,l);Dr=!0;try{var a=e(t);return a}finally{if(Dr=!1,(ka!==null||Ta!==null)&&(Js(),ka&&(t=ka,e=Ta,Ta=ka=null,ko(t),e)))for(t=0;t<e.length;t++)ko(e[t])}}function un(e,t){var l=e.stateNode;if(l===null)return null;var a=l[St]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var il=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Br=!1;if(il)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){Br=!0}}),window.addEventListener("test",dn,dn),window.removeEventListener("test",dn,dn)}catch{Br=!1}var El=null,Ur=null,os=null;function Co(){if(os)return os;var e,t=Ur,l=t.length,a,s="value"in El?El.value:El.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var d=l-e;for(a=1;a<=d&&t[l-a]===s[r-a];a++);return os=s.slice(e,1<a?1-a:void 0)}function us(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 ds(){return!0}function wo(){return!1}function Nt(e){function t(l,a,s,r,d){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(l=e[p],this[p]=l?l(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ds:wo,this.isPropagationStopped=wo,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ds)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ds)},persist:function(){},isPersistent:ds}),t}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fs=Nt(Pl),fn=g({},Pl,{view:0,detail:0}),ip=Nt(fn),Hr,qr,xn,xs=g({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yr,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!==xn&&(xn&&e.type==="mousemove"?(Hr=e.screenX-xn.screenX,qr=e.screenY-xn.screenY):qr=Hr=0,xn=e),Hr)},movementY:function(e){return"movementY"in e?e.movementY:qr}}),Ao=Nt(xs),cp=g({},xs,{dataTransfer:0}),op=Nt(cp),up=g({},fn,{relatedTarget:0}),Gr=Nt(up),dp=g({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),fp=Nt(dp),xp=g({},Pl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pp=Nt(xp),mp=g({},Pl,{data:0}),_o=Nt(mp),hp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yp[e])?!!t[e]:!1}function Yr(){return gp}var bp=g({},fn,{key:function(e){if(e.key){var t=hp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=us(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yr,charCode:function(e){return e.type==="keypress"?us(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?us(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jp=Nt(bp),Sp=g({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ro=Nt(Sp),Np=g({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yr}),Ep=Nt(Np),kp=g({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tp=Nt(kp),Cp=g({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),wp=Nt(Cp),Ap=g({},Pl,{newState:0,oldState:0}),_p=Nt(Ap),Rp=[9,13,27,32],Vr=il&&"CompositionEvent"in window,pn=null;il&&"documentMode"in document&&(pn=document.documentMode);var Mp=il&&"TextEvent"in window&&!pn,Mo=il&&(!Vr||pn&&8<pn&&11>=pn),zo=" ",Lo=!1;function Oo(e,t){switch(e){case"keyup":return Rp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Do(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ca=!1;function zp(e,t){switch(e){case"compositionend":return Do(t);case"keypress":return t.which!==32?null:(Lo=!0,zo);case"textInput":return e=t.data,e===zo&&Lo?null:e;default:return null}}function Lp(e,t){if(Ca)return e==="compositionend"||!Vr&&Oo(e,t)?(e=Co(),os=Ur=El=null,Ca=!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 Mo&&t.locale!=="ko"?null:t.data;default:return null}}var Op={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Op[e.type]:t==="textarea"}function Uo(e,t,l,a){ka?Ta?Ta.push(a):Ta=[a]:ka=a,t=lr(t,"onChange"),0<t.length&&(l=new fs("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var mn=null,hn=null;function Dp(e){jf(e,0)}function ps(e){var t=on(e);if(go(t))return e}function Ho(e,t){if(e==="change")return t}var qo=!1;if(il){var Qr;if(il){var Xr="oninput"in document;if(!Xr){var Go=document.createElement("div");Go.setAttribute("oninput","return;"),Xr=typeof Go.oninput=="function"}Qr=Xr}else Qr=!1;qo=Qr&&(!document.documentMode||9<document.documentMode)}function Yo(){mn&&(mn.detachEvent("onpropertychange",Vo),hn=mn=null)}function Vo(e){if(e.propertyName==="value"&&ps(hn)){var t=[];Uo(t,hn,e,Or(e)),To(Dp,t)}}function Bp(e,t,l){e==="focusin"?(Yo(),mn=t,hn=l,mn.attachEvent("onpropertychange",Vo)):e==="focusout"&&Yo()}function Up(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ps(hn)}function Hp(e,t){if(e==="click")return ps(t)}function qp(e,t){if(e==="input"||e==="change")return ps(t)}function Gp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:Gp;function vn(e,t){if(At(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!Ft.call(t,s)||!At(e[s],t[s]))return!1}return!0}function Qo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xo(e,t){var l=Qo(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=Qo(l)}}function Zo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ko(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=is(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=is(e.document)}return t}function Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Yp=il&&"documentMode"in document&&11>=document.documentMode,wa=null,Kr=null,yn=null,$r=!1;function $o(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;$r||wa==null||wa!==is(a)||(a=wa,"selectionStart"in a&&Zr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),yn&&vn(yn,a)||(yn=a,a=lr(Kr,"onSelect"),0<a.length&&(t=new fs("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=wa)))}function ea(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Aa={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Jr={},Jo={};il&&(Jo=document.createElement("div").style,"AnimationEvent"in window||(delete Aa.animationend.animation,delete Aa.animationiteration.animation,delete Aa.animationstart.animation),"TransitionEvent"in window||delete Aa.transitionend.transition);function ta(e){if(Jr[e])return Jr[e];if(!Aa[e])return e;var t=Aa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Jo)return Jr[e]=t[l];return e}var Wo=ta("animationend"),Fo=ta("animationiteration"),Io=ta("animationstart"),Vp=ta("transitionrun"),Qp=ta("transitionstart"),Xp=ta("transitioncancel"),Po=ta("transitionend"),eu=new Map,Wr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wr.push("scrollEnd");function $t(e,t){eu.set(e,t),Il(t,[e])}var ms=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)},Ut=[],_a=0,Fr=0;function hs(){for(var e=_a,t=Fr=_a=0;t<e;){var l=Ut[t];Ut[t++]=null;var a=Ut[t];Ut[t++]=null;var s=Ut[t];Ut[t++]=null;var r=Ut[t];if(Ut[t++]=null,a!==null&&s!==null){var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}r!==0&&tu(l,s,r)}}function vs(e,t,l,a){Ut[_a++]=e,Ut[_a++]=t,Ut[_a++]=l,Ut[_a++]=a,Fr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ir(e,t,l,a){return vs(e,t,l,a),ys(e)}function la(e,t){return vs(e,null,null,t),ys(e)}function tu(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,r=e.return;r!==null;)r.childLanes|=l,a=r.alternate,a!==null&&(a.childLanes|=l),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Ze(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function ys(e){if(50<qn)throw qn=0,ic=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ra={};function Zp(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,l,a){return new Zp(e,t,l,a)}function Pr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cl(e,t){var l=e.alternate;return l===null?(l=_t(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 lu(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 gs(e,t,l,a,s,r){var d=0;if(a=e,typeof e=="function")Pr(e)&&(d=1);else if(typeof e=="string")d=Fm(e,l,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=_t(31,l,t,s),e.elementType=me,e.lanes=r,e;case q:return aa(l.children,s,r,t);case Y:d=8,s|=24;break;case J:return e=_t(12,l,t,s|2),e.elementType=J,e.lanes=r,e;case I:return e=_t(13,l,t,s),e.elementType=I,e.lanes=r,e;case Q:return e=_t(19,l,t,s),e.elementType=Q,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:d=10;break e;case P:d=9;break e;case V:d=11;break e;case Z:d=14;break e;case ee:d=16,a=null;break e}d=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=_t(d,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function aa(e,t,l,a){return e=_t(7,e,a,t),e.lanes=l,e}function ei(e,t,l){return e=_t(6,e,null,t),e.lanes=l,e}function au(e){var t=_t(18,null,null,0);return t.stateNode=e,t}function ti(e,t,l){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nu=new WeakMap;function Ht(e,t){if(typeof e=="object"&&e!==null){var l=nu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:gt(t)},nu.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var Ma=[],za=0,bs=null,gn=0,qt=[],Gt=0,kl=null,It=1,Pt="";function ol(e,t){Ma[za++]=gn,Ma[za++]=bs,bs=e,gn=t}function su(e,t,l){qt[Gt++]=It,qt[Gt++]=Pt,qt[Gt++]=kl,kl=e;var a=It;e=Pt;var s=32-Ze(a)-1;a&=~(1<<s),l+=1;var r=32-Ze(t)+s;if(30<r){var d=s-s%5;r=(a&(1<<d)-1).toString(32),a>>=d,s-=d,It=1<<32-Ze(t)+s|l<<s|a,Pt=r+e}else It=1<<r|l<<s|a,Pt=e}function li(e){e.return!==null&&(ol(e,1),su(e,1,0))}function ai(e){for(;e===bs;)bs=Ma[--za],Ma[za]=null,gn=Ma[--za],Ma[za]=null;for(;e===kl;)kl=qt[--Gt],qt[Gt]=null,Pt=qt[--Gt],qt[Gt]=null,It=qt[--Gt],qt[Gt]=null}function ru(e,t){qt[Gt++]=It,qt[Gt++]=Pt,qt[Gt++]=kl,It=t.id,Pt=t.overflow,kl=e}var it=null,Ye=null,Ee=!1,Tl=null,Yt=!1,ni=Error(u(519));function Cl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bn(Ht(t,e)),ni}function iu(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[rt]=e,t[St]=a,l){case"dialog":be("cancel",t),be("close",t);break;case"iframe":case"object":case"embed":be("load",t);break;case"video":case"audio":for(l=0;l<Yn.length;l++)be(Yn[l],t);break;case"source":be("error",t);break;case"img":case"image":case"link":be("error",t),be("load",t);break;case"details":be("toggle",t);break;case"input":be("invalid",t),bo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":be("invalid",t);break;case"textarea":be("invalid",t),So(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||kf(t.textContent,l)?(a.popover!=null&&(be("beforetoggle",t),be("toggle",t)),a.onScroll!=null&&be("scroll",t),a.onScrollEnd!=null&&be("scrollend",t),a.onClick!=null&&(t.onclick=rl),t=!0):t=!1,t||Cl(e,!0)}function cu(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:Yt=!1;return;case 27:case 3:Yt=!0;return;default:it=it.return}}function La(e){if(e!==it)return!1;if(!Ee)return cu(e),Ee=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Sc(e.type,e.memoizedProps)),l=!l),l&&Ye&&Cl(e),cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ye=Lf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ye=Lf(e)}else t===27?(t=Ye,Gl(e.type)?(e=Cc,Cc=null,Ye=e):Ye=t):Ye=it?Qt(e.stateNode.nextSibling):null;return!0}function na(){Ye=it=null,Ee=!1}function si(){var e=Tl;return e!==null&&(Ct===null?Ct=e:Ct.push.apply(Ct,e),Tl=null),e}function bn(e){Tl===null?Tl=[e]:Tl.push(e)}var ri=b(null),sa=null,ul=null;function wl(e,t,l){X(ri,t._currentValue),t._currentValue=l}function dl(e){e._currentValue=ri.current,M(ri)}function ii(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var d=s.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=s;for(var j=0;j<t.length;j++)if(p.context===t[j]){r.lanes|=l,p=r.alternate,p!==null&&(p.lanes|=l),ii(r.return,l,e),a||(d=null);break e}r=p.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=l,r=d.alternate,r!==null&&(r.lanes|=l),ii(d,l,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Oa(e,t,l,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var p=s.type;At(s.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(s===$.current){if(d=s.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Kn):e=[Kn])}s=s.return}e!==null&&ci(t,e,l,a),t.flags|=262144}function js(e){for(e=e.firstContext;e!==null;){if(!At(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){sa=e,ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return ou(sa,e)}function Ss(e,t){return sa===null&&ra(e),ou(e,t)}function ou(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ul===null){if(e===null)throw Error(u(308));ul=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ul=ul.next=t;return l}var Kp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},$p=i.unstable_scheduleCallback,Jp=i.unstable_NormalPriority,Ie={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oi(){return{controller:new Kp,data:new Map,refCount:0}}function jn(e){e.refCount--,e.refCount===0&&$p(Jp,function(){e.controller.abort()})}var Sn=null,ui=0,Da=0,Ba=null;function Wp(e,t){if(Sn===null){var l=Sn=[];ui=0,Da=xc(),Ba={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ui++,t.then(uu,uu),t}function uu(){if(--ui===0&&Sn!==null){Ba!==null&&(Ba.status="fulfilled");var e=Sn;Sn=null,Da=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fp(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var du=k.S;k.S=function(e,t){$d=Oe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Wp(e,t),du!==null&&du(e,t)};var ia=b(null);function di(){var e=ia.current;return e!==null?e:He.pooledCache}function Ns(e,t){t===null?X(ia,ia.current):X(ia,t.pool)}function fu(){var e=di();return e===null?null:{parent:Ie._currentValue,pool:e}}var Ua=Error(u(460)),fi=Error(u(474)),Es=Error(u(542)),ks={then:function(){}};function xu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(rl,rl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e;default:if(typeof t.status=="string")t.then(rl,rl);else{if(e=He,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e}throw oa=t,Ua}}function ca(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(oa=l,Ua):l}}var oa=null;function mu(){if(oa===null)throw Error(u(459));var e=oa;return oa=null,e}function hu(e){if(e===Ua||e===Es)throw Error(u(483))}var Ha=null,Nn=0;function Ts(e){var t=Nn;return Nn+=1,Ha===null&&(Ha=[]),pu(Ha,e,t)}function En(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cs(e,t){throw t.$$typeof===T?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vu(e){function t(C,E){if(e){var w=C.deletions;w===null?(C.deletions=[E],C.flags|=16):w.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=cl(C,E),C.index=0,C.sibling=null,C}function r(C,E,w){return C.index=w,e?(w=C.alternate,w!==null?(w=w.index,w<E?(C.flags|=67108866,E):w):(C.flags|=67108866,E)):(C.flags|=1048576,E)}function d(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function p(C,E,w,H){return E===null||E.tag!==6?(E=ei(w,C.mode,H),E.return=C,E):(E=s(E,w),E.return=C,E)}function j(C,E,w,H){var ce=w.type;return ce===q?U(C,E,w.props.children,H,w.key):E!==null&&(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ee&&ca(ce)===E.type)?(E=s(E,w.props),En(E,w),E.return=C,E):(E=gs(w.type,w.key,w.props,null,C.mode,H),En(E,w),E.return=C,E)}function A(C,E,w,H){return E===null||E.tag!==4||E.stateNode.containerInfo!==w.containerInfo||E.stateNode.implementation!==w.implementation?(E=ti(w,C.mode,H),E.return=C,E):(E=s(E,w.children||[]),E.return=C,E)}function U(C,E,w,H,ce){return E===null||E.tag!==7?(E=aa(w,C.mode,H,ce),E.return=C,E):(E=s(E,w),E.return=C,E)}function G(C,E,w){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=ei(""+E,C.mode,w),E.return=C,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case z:return w=gs(E.type,E.key,E.props,null,C.mode,w),En(w,E),w.return=C,w;case B:return E=ti(E,C.mode,w),E.return=C,E;case ee:return E=ca(E),G(C,E,w)}if(fe(E)||ye(E))return E=aa(E,C.mode,w,null),E.return=C,E;if(typeof E.then=="function")return G(C,Ts(E),w);if(E.$$typeof===ne)return G(C,Ss(C,E),w);Cs(C,E)}return null}function R(C,E,w,H){var ce=E!==null?E.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ce!==null?null:p(C,E,""+w,H);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case z:return w.key===ce?j(C,E,w,H):null;case B:return w.key===ce?A(C,E,w,H):null;case ee:return w=ca(w),R(C,E,w,H)}if(fe(w)||ye(w))return ce!==null?null:U(C,E,w,H,null);if(typeof w.then=="function")return R(C,E,Ts(w),H);if(w.$$typeof===ne)return R(C,E,Ss(C,w),H);Cs(C,w)}return null}function L(C,E,w,H,ce){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return C=C.get(w)||null,p(E,C,""+H,ce);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case z:return C=C.get(H.key===null?w:H.key)||null,j(E,C,H,ce);case B:return C=C.get(H.key===null?w:H.key)||null,A(E,C,H,ce);case ee:return H=ca(H),L(C,E,w,H,ce)}if(fe(H)||ye(H))return C=C.get(w)||null,U(E,C,H,ce,null);if(typeof H.then=="function")return L(C,E,w,Ts(H),ce);if(H.$$typeof===ne)return L(C,E,w,Ss(E,H),ce);Cs(E,H)}return null}function ae(C,E,w,H){for(var ce=null,we=null,re=E,ve=E=0,Se=null;re!==null&&ve<w.length;ve++){re.index>ve?(Se=re,re=null):Se=re.sibling;var Ae=R(C,re,w[ve],H);if(Ae===null){re===null&&(re=Se);break}e&&re&&Ae.alternate===null&&t(C,re),E=r(Ae,E,ve),we===null?ce=Ae:we.sibling=Ae,we=Ae,re=Se}if(ve===w.length)return l(C,re),Ee&&ol(C,ve),ce;if(re===null){for(;ve<w.length;ve++)re=G(C,w[ve],H),re!==null&&(E=r(re,E,ve),we===null?ce=re:we.sibling=re,we=re);return Ee&&ol(C,ve),ce}for(re=a(re);ve<w.length;ve++)Se=L(re,C,ve,w[ve],H),Se!==null&&(e&&Se.alternate!==null&&re.delete(Se.key===null?ve:Se.key),E=r(Se,E,ve),we===null?ce=Se:we.sibling=Se,we=Se);return e&&re.forEach(function(Zl){return t(C,Zl)}),Ee&&ol(C,ve),ce}function de(C,E,w,H){if(w==null)throw Error(u(151));for(var ce=null,we=null,re=E,ve=E=0,Se=null,Ae=w.next();re!==null&&!Ae.done;ve++,Ae=w.next()){re.index>ve?(Se=re,re=null):Se=re.sibling;var Zl=R(C,re,Ae.value,H);if(Zl===null){re===null&&(re=Se);break}e&&re&&Zl.alternate===null&&t(C,re),E=r(Zl,E,ve),we===null?ce=Zl:we.sibling=Zl,we=Zl,re=Se}if(Ae.done)return l(C,re),Ee&&ol(C,ve),ce;if(re===null){for(;!Ae.done;ve++,Ae=w.next())Ae=G(C,Ae.value,H),Ae!==null&&(E=r(Ae,E,ve),we===null?ce=Ae:we.sibling=Ae,we=Ae);return Ee&&ol(C,ve),ce}for(re=a(re);!Ae.done;ve++,Ae=w.next())Ae=L(re,C,ve,Ae.value,H),Ae!==null&&(e&&Ae.alternate!==null&&re.delete(Ae.key===null?ve:Ae.key),E=r(Ae,E,ve),we===null?ce=Ae:we.sibling=Ae,we=Ae);return e&&re.forEach(function(ch){return t(C,ch)}),Ee&&ol(C,ve),ce}function Ue(C,E,w,H){if(typeof w=="object"&&w!==null&&w.type===q&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case z:e:{for(var ce=w.key;E!==null;){if(E.key===ce){if(ce=w.type,ce===q){if(E.tag===7){l(C,E.sibling),H=s(E,w.props.children),H.return=C,C=H;break e}}else if(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===ee&&ca(ce)===E.type){l(C,E.sibling),H=s(E,w.props),En(H,w),H.return=C,C=H;break e}l(C,E);break}else t(C,E);E=E.sibling}w.type===q?(H=aa(w.props.children,C.mode,H,w.key),H.return=C,C=H):(H=gs(w.type,w.key,w.props,null,C.mode,H),En(H,w),H.return=C,C=H)}return d(C);case B:e:{for(ce=w.key;E!==null;){if(E.key===ce)if(E.tag===4&&E.stateNode.containerInfo===w.containerInfo&&E.stateNode.implementation===w.implementation){l(C,E.sibling),H=s(E,w.children||[]),H.return=C,C=H;break e}else{l(C,E);break}else t(C,E);E=E.sibling}H=ti(w,C.mode,H),H.return=C,C=H}return d(C);case ee:return w=ca(w),Ue(C,E,w,H)}if(fe(w))return ae(C,E,w,H);if(ye(w)){if(ce=ye(w),typeof ce!="function")throw Error(u(150));return w=ce.call(w),de(C,E,w,H)}if(typeof w.then=="function")return Ue(C,E,Ts(w),H);if(w.$$typeof===ne)return Ue(C,E,Ss(C,w),H);Cs(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,E!==null&&E.tag===6?(l(C,E.sibling),H=s(E,w),H.return=C,C=H):(l(C,E),H=ei(w,C.mode,H),H.return=C,C=H),d(C)):l(C,E)}return function(C,E,w,H){try{Nn=0;var ce=Ue(C,E,w,H);return Ha=null,ce}catch(re){if(re===Ua||re===Es)throw re;var we=_t(29,re,null,C.mode);return we.lanes=H,we.return=C,we}finally{}}}var ua=vu(!0),yu=vu(!1),Al=!1;function xi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pi(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 _l(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Re&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=ys(e),tu(e,null,l),t}return vs(e,a,t,l),ys(e)}function kn(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,co(e,l)}}function mi(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=d:r=r.next=d,l=l.next}while(l!==null);r===null?s=r=t:r=r.next=t}else s=r=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var hi=!1;function Tn(){if(hi){var e=Ba;if(e!==null)throw e}}function Cn(e,t,l,a){hi=!1;var s=e.updateQueue;Al=!1;var r=s.firstBaseUpdate,d=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var j=p,A=j.next;j.next=null,d===null?r=A:d.next=A,d=j;var U=e.alternate;U!==null&&(U=U.updateQueue,p=U.lastBaseUpdate,p!==d&&(p===null?U.firstBaseUpdate=A:p.next=A,U.lastBaseUpdate=j))}if(r!==null){var G=s.baseState;d=0,U=A=j=null,p=r;do{var R=p.lane&-536870913,L=R!==p.lane;if(L?(je&R)===R:(a&R)===R){R!==0&&R===Da&&(hi=!0),U!==null&&(U=U.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ae=e,de=p;R=t;var Ue=l;switch(de.tag){case 1:if(ae=de.payload,typeof ae=="function"){G=ae.call(Ue,G,R);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=de.payload,R=typeof ae=="function"?ae.call(Ue,G,R):ae,R==null)break e;G=g({},G,R);break e;case 2:Al=!0}}R=p.callback,R!==null&&(e.flags|=64,L&&(e.flags|=8192),L=s.callbacks,L===null?s.callbacks=[R]:L.push(R))}else L={lane:R,tag:p.tag,payload:p.payload,callback:p.callback,next:null},U===null?(A=U=L,j=G):U=U.next=L,d|=R;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;L=p,p=L.next,L.next=null,s.lastBaseUpdate=L,s.shared.pending=null}}while(!0);U===null&&(j=G),s.baseState=j,s.firstBaseUpdate=A,s.lastBaseUpdate=U,r===null&&(s.shared.lanes=0),Dl|=d,e.lanes=d,e.memoizedState=G}}function gu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function bu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)gu(l[e],t)}var qa=b(null),ws=b(0);function ju(e,t){e=bl,X(ws,e),X(qa,t),bl=e|t.baseLanes}function vi(){X(ws,bl),X(qa,qa.current)}function yi(){bl=ws.current,M(qa),M(ws)}var Rt=b(null),Vt=null;function Ml(e){var t=e.alternate;X(We,We.current&1),X(Rt,e),Vt===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&(Vt=e)}function gi(e){X(We,We.current),X(Rt,e),Vt===null&&(Vt=e)}function Su(e){e.tag===22?(X(We,We.current),X(Rt,e),Vt===null&&(Vt=e)):zl()}function zl(){X(We,We.current),X(Rt,Rt.current)}function Mt(e){M(Rt),Vt===e&&(Vt=null),M(We)}var We=b(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||kc(l)||Tc(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fl=0,pe=null,De=null,Pe=null,_s=!1,Ga=!1,da=!1,Rs=0,wn=0,Ya=null,Ip=0;function Ke(){throw Error(u(321))}function bi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!At(e[l],t[l]))return!1;return!0}function ji(e,t,l,a,s,r){return fl=r,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?sd:Di,da=!1,r=l(a,s),da=!1,Ga&&(r=Eu(t,l,a,s)),Nu(e),r}function Nu(e){k.H=Rn;var t=De!==null&&De.next!==null;if(fl=0,Pe=De=pe=null,_s=!1,wn=0,Ya=null,t)throw Error(u(300));e===null||et||(e=e.dependencies,e!==null&&js(e)&&(et=!0))}function Eu(e,t,l,a){pe=e;var s=0;do{if(Ga&&(Ya=null),wn=0,Ga=!1,25<=s)throw Error(u(301));if(s+=1,Pe=De=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}k.H=rd,r=t(l,a)}while(Ga);return r}function Pp(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?An(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(pe.flags|=1024),t}function Si(){var e=Rs!==0;return Rs=0,e}function Ni(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ei(e){if(_s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_s=!1}fl=0,Pe=De=pe=null,Ga=!1,wn=Rs=0,Ya=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?pe.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function Fe(){if(De===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=Pe===null?pe.memoizedState:Pe.next;if(t!==null)Pe=t,De=e;else{if(e===null)throw pe.alternate===null?Error(u(467)):Error(u(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},Pe===null?pe.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function An(e){var t=wn;return wn+=1,Ya===null&&(Ya=[]),e=pu(Ya,e,t),t=pe,(Pe===null?t.memoizedState:Pe.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?sd:Di),e}function zs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return An(e);if(e.$$typeof===ne)return ct(e)}throw Error(u(438,String(e)))}function ki(e){var t=null,l=pe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Ms(),pe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=Ce;return t.index++,l}function xl(e,t){return typeof t=="function"?t(e):t}function Ls(e){var t=Fe();return Ti(t,De,e)}function Ti(e,t,l){var a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var d=s.next;s.next=r.next,r.next=d}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var p=d=null,j=null,A=t,U=!1;do{var G=A.lane&-536870913;if(G!==A.lane?(je&G)===G:(fl&G)===G){var R=A.revertLane;if(R===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),G===Da&&(U=!0);else if((fl&R)===R){A=A.next,R===Da&&(U=!0);continue}else G={lane:0,revertLane:A.revertLane,gesture:null,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},j===null?(p=j=G,d=r):j=j.next=G,pe.lanes|=R,Dl|=R;G=A.action,da&&l(r,G),r=A.hasEagerState?A.eagerState:l(r,G)}else R={lane:G,revertLane:A.revertLane,gesture:A.gesture,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},j===null?(p=j=R,d=r):j=j.next=R,pe.lanes|=G,Dl|=G;A=A.next}while(A!==null&&A!==t);if(j===null?d=r:j.next=p,!At(r,e.memoizedState)&&(et=!0,U&&(l=Ba,l!==null)))throw l;e.memoizedState=r,e.baseState=d,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ci(e){var t=Fe(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var d=s=s.next;do r=e(r,d.action),d=d.next;while(d!==s);At(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function ku(e,t,l){var a=pe,s=Fe(),r=Ee;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var d=!At((De||s).memoizedState,l);if(d&&(s.memoizedState=l,et=!0),s=s.queue,_i(wu.bind(null,a,s,e),[e]),s.getSnapshot!==t||d||Pe!==null&&Pe.memoizedState.tag&1){if(a.flags|=2048,Va(9,{destroy:void 0},Cu.bind(null,a,s,l,t),null),He===null)throw Error(u(349));r||(fl&127)!==0||Tu(a,t,l)}return l}function Tu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=pe.updateQueue,t===null?(t=Ms(),pe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Cu(e,t,l,a){t.value=l,t.getSnapshot=a,Au(t)&&_u(e)}function wu(e,t,l){return l(function(){Au(t)&&_u(e)})}function Au(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!At(e,l)}catch{return!0}}function _u(e){var t=la(e,2);t!==null&&wt(t,e,2)}function wi(e){var t=ht();if(typeof e=="function"){var l=e;if(e=l(),da){jt(!0);try{l()}finally{jt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:e},t}function Ru(e,t,l,a){return e.baseState=l,Ti(e,De,typeof a=="function"?a:xl)}function em(e,t,l,a,s){if(Bs(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){r.listeners.push(d)}};k.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Mu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Mu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=k.T,d={};k.T=d;try{var p=l(s,a),j=k.S;j!==null&&j(d,p),zu(e,t,p)}catch(A){Ai(e,t,A)}finally{r!==null&&d.types!==null&&(r.types=d.types),k.T=r}}else try{r=l(s,a),zu(e,t,r)}catch(A){Ai(e,t,A)}}function zu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Lu(e,t,a)},function(a){return Ai(e,t,a)}):Lu(e,t,l)}function Lu(e,t,l){t.status="fulfilled",t.value=l,Ou(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Mu(e,l)))}function Ai(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Ou(t),t=t.next;while(t!==a)}e.action=null}function Ou(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Du(e,t){return t}function Bu(e,t){if(Ee){var l=He.formState;if(l!==null){e:{var a=pe;if(Ee){if(Ye){t:{for(var s=Ye,r=Yt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Qt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ye=Qt(s.nextSibling),a=s.data==="F!";break e}}Cl(a)}a=!1}a&&(t=l[0])}}return l=ht(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Du,lastRenderedState:t},l.queue=a,l=ld.bind(null,pe,a),a.dispatch=l,a=wi(!1),r=Oi.bind(null,pe,!1,a.queue),a=ht(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=em.bind(null,pe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Uu(e){var t=Fe();return Hu(t,De,e)}function Hu(e,t,l){if(t=Ti(e,t,Du)[0],e=Ls(xl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=An(t)}catch(d){throw d===Ua?Es:d}else a=t;t=Fe();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(pe.flags|=2048,Va(9,{destroy:void 0},tm.bind(null,s,l),null)),[a,r,e]}function tm(e,t){e.action=t}function qu(e){var t=Fe(),l=De;if(l!==null)return Hu(t,l,e);Fe(),t=t.memoizedState,l=Fe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Va(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=pe.updateQueue,t===null&&(t=Ms(),pe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Gu(){return Fe().memoizedState}function Os(e,t,l,a){var s=ht();pe.flags|=e,s.memoizedState=Va(1|t,{destroy:void 0},l,a===void 0?null:a)}function Ds(e,t,l,a){var s=Fe();a=a===void 0?null:a;var r=s.memoizedState.inst;De!==null&&a!==null&&bi(a,De.memoizedState.deps)?s.memoizedState=Va(t,r,l,a):(pe.flags|=e,s.memoizedState=Va(1|t,r,l,a))}function Yu(e,t){Os(8390656,8,e,t)}function _i(e,t){Ds(2048,8,e,t)}function lm(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=Ms(),pe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Vu(e){var t=Fe().memoizedState;return lm({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Qu(e,t){return Ds(4,2,e,t)}function Xu(e,t){return Ds(4,4,e,t)}function Zu(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 Ku(e,t,l){l=l!=null?l.concat([e]):null,Ds(4,4,Zu.bind(null,t,e),l)}function Ri(){}function $u(e,t){var l=Fe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&bi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Ju(e,t){var l=Fe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&bi(t,a[1]))return a[0];if(a=e(),da){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[a,t],a}function Mi(e,t,l){return l===void 0||(fl&1073741824)!==0&&(je&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Wd(),pe.lanes|=e,Dl|=e,l)}function Wu(e,t,l,a){return At(l,t)?l:qa.current!==null?(e=Mi(e,l,a),At(e,t)||(et=!0),e):(fl&42)===0||(fl&1073741824)!==0&&(je&261930)===0?(et=!0,e.memoizedState=l):(e=Wd(),pe.lanes|=e,Dl|=e,t)}function Fu(e,t,l,a,s){var r=_.p;_.p=r!==0&&8>r?r:8;var d=k.T,p={};k.T=p,Oi(e,!1,t,l);try{var j=s(),A=k.S;if(A!==null&&A(p,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var U=Fp(j,a);_n(e,t,U,Ot(e))}else _n(e,t,a,Ot(e))}catch(G){_n(e,t,{then:function(){},status:"rejected",reason:G},Ot())}finally{_.p=r,d!==null&&p.types!==null&&(d.types=p.types),k.T=d}}function am(){}function zi(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Iu(e).queue;Fu(e,s,t,W,l===null?am:function(){return Pu(e),l(a)})}function Iu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:W},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pu(e){var t=Iu(e);t.next===null&&(t=e.alternate.memoizedState),_n(e,t.next.queue,{},Ot())}function Li(){return ct(Kn)}function ed(){return Fe().memoizedState}function td(){return Fe().memoizedState}function nm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Ot();e=_l(l);var a=Rl(t,e,l);a!==null&&(wt(a,t,l),kn(a,t,l)),t={cache:oi()},e.payload=t;return}t=t.return}}function sm(e,t,l){var a=Ot();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bs(e)?ad(t,l):(l=Ir(e,t,l,a),l!==null&&(wt(l,e,a),nd(l,t,a)))}function ld(e,t,l){var a=Ot();_n(e,t,l,a)}function _n(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))ad(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,p=r(d,l);if(s.hasEagerState=!0,s.eagerState=p,At(p,d))return vs(e,t,s,0),He===null&&hs(),!1}catch{}finally{}if(l=Ir(e,t,s,a),l!==null)return wt(l,e,a),nd(l,t,a),!0}return!1}function Oi(e,t,l,a){if(a={lane:2,revertLane:xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(u(479))}else t=Ir(e,l,a,2),t!==null&&wt(t,e,2)}function Bs(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function ad(e,t){Ga=_s=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function nd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}var Rn={readContext:ct,use:zs,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke};Rn.useEffectEvent=Ke;var sd={readContext:ct,use:zs,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:Yu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Os(4194308,4,Zu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var l=ht();t=t===void 0?null:t;var a=e();if(da){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ht();if(l!==void 0){var s=l(t);if(da){jt(!0);try{l(t)}finally{jt(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=sm.bind(null,pe,e),[a.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=wi(e);var t=e.queue,l=ld.bind(null,pe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ri,useDeferredValue:function(e,t){var l=ht();return Mi(l,e,t)},useTransition:function(){var e=wi(!1);return e=Fu.bind(null,pe,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=pe,s=ht();if(Ee){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),He===null)throw Error(u(349));(je&127)!==0||Tu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Yu(wu.bind(null,a,r,e),[e]),a.flags|=2048,Va(9,{destroy:void 0},Cu.bind(null,a,r,l,t),null),l},useId:function(){var e=ht(),t=He.identifierPrefix;if(Ee){var l=Pt,a=It;l=(a&~(1<<32-Ze(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Rs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ip++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Li,useFormState:Bu,useActionState:Bu,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Oi.bind(null,pe,!0,l),l.dispatch=t,[e,t]},useMemoCache:ki,useCacheRefresh:function(){return ht().memoizedState=nm.bind(null,pe)},useEffectEvent:function(e){var t=ht(),l={impl:e};return t.memoizedState=l,function(){if((Re&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Di={readContext:ct,use:zs,useCallback:$u,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:Ju,useReducer:Ls,useRef:Gu,useState:function(){return Ls(xl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Fe();return Wu(l,De.memoizedState,e,t)},useTransition:function(){var e=Ls(xl)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:An(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Li,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=Fe();return Ru(l,De,e,t)},useMemoCache:ki,useCacheRefresh:td};Di.useEffectEvent=Vu;var rd={readContext:ct,use:zs,useCallback:$u,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:Ju,useReducer:Ci,useRef:Gu,useState:function(){return Ci(xl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Fe();return De===null?Mi(l,e,t):Wu(l,De.memoizedState,e,t)},useTransition:function(){var e=Ci(xl)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:An(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Li,useFormState:qu,useActionState:qu,useOptimistic:function(e,t){var l=Fe();return De!==null?Ru(l,De,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ki,useCacheRefresh:td};rd.useEffectEvent=Vu;function Bi(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ui={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Ot(),s=_l(a);s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(wt(t,e,a),kn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Ot(),s=_l(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(wt(t,e,a),kn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Ot(),a=_l(l);a.tag=2,t!=null&&(a.callback=t),t=Rl(e,a,l),t!==null&&(wt(t,e,l),kn(t,e,l))}};function id(e,t,l,a,s,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,d):t.prototype&&t.prototype.isPureReactComponent?!vn(l,a)||!vn(s,r):!0}function cd(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function fa(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function od(e){ms(e)}function ud(e){console.error(e)}function dd(e){ms(e)}function Us(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function fd(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Hi(e,t,l){return l=_l(l),l.tag=3,l.payload={element:null},l.callback=function(){Us(e,t)},l}function xd(e){return e=_l(e),e.tag=3,e}function pd(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){fd(t,l,a)}}var d=l.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){fd(t,l,a),typeof s!="function"&&(Bl===null?Bl=new Set([this]):Bl.add(this));var p=a.stack;this.componentDidCatch(a.value,{componentStack:p!==null?p:""})})}function rm(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Oa(t,l,s,!0),l=Rt.current,l!==null){switch(l.tag){case 31:case 13:return Vt===null?Ws():l.alternate===null&&$e===0&&($e=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===ks?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),uc(e,a,s)),!1;case 22:return l.flags|=65536,a===ks?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),uc(e,a,s)),!1}throw Error(u(435,l.tag))}return uc(e,a,s),Ws(),!1}if(Ee)return t=Rt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==ni&&(e=Error(u(422),{cause:a}),bn(Ht(e,l)))):(a!==ni&&(t=Error(u(423),{cause:a}),bn(Ht(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Ht(a,l),s=Hi(e.stateNode,a,s),mi(e,s),$e!==4&&($e=2)),!1;var r=Error(u(520),{cause:a});if(r=Ht(r,l),Hn===null?Hn=[r]:Hn.push(r),$e!==4&&($e=2),t===null)return!0;a=Ht(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Hi(l.stateNode,a,e),mi(l,e),!1;case 1:if(t=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Bl===null||!Bl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=xd(s),pd(s,e,l,a),mi(l,s),!1}l=l.return}while(l!==null);return!1}var qi=Error(u(461)),et=!1;function ot(e,t,l,a){t.child=e===null?yu(t,null,l,a):ua(t,e.child,l,a)}function md(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var d={};for(var p in a)p!=="ref"&&(d[p]=a[p])}else d=a;return ra(t),a=ji(e,t,l,d,r,s),p=Si(),e!==null&&!et?(Ni(e,t,s),pl(e,t,s)):(Ee&&p&&li(t),t.flags|=1,ot(e,t,a,s),t.child)}function hd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Pr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,vd(e,t,r,a,s)):(e=gs(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!$i(e,s)){var d=r.memoizedProps;if(l=l.compare,l=l!==null?l:vn,l(d,a)&&e.ref===t.ref)return pl(e,t,s)}return t.flags|=1,e=cl(r,a),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(vn(r,a)&&e.ref===t.ref)if(et=!1,t.pendingProps=a=r,$i(e,s))(e.flags&131072)!==0&&(et=!0);else return t.lanes=e.lanes,pl(e,t,s)}return Gi(e,t,l,a,s)}function yd(e,t,l,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return gd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ns(t,r!==null?r.cachePool:null),r!==null?ju(t,r):vi(),Su(t);else return a=t.lanes=536870912,gd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(Ns(t,r.cachePool),ju(t,r),zl(),t.memoizedState=null):(e!==null&&Ns(t,null),vi(),zl());return ot(e,t,s,l),t.child}function Mn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gd(e,t,l,a,s){var r=di();return r=r===null?null:{parent:Ie._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&Ns(t,null),vi(),Su(t),e!==null&&Oa(e,t,a,!0),t.childLanes=s,null}function Hs(e,t){return t=Gs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function bd(e,t,l){return ua(t,e.child,null,l),e=Hs(t,t.pendingProps),e.flags|=2,Mt(t),t.memoizedState=null,e}function im(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(a.mode==="hidden")return e=Hs(t,a),t.lanes=536870912,Mn(null,e);if(gi(t),(e=Ye)?(e=zf(e,Yt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kl!==null?{id:It,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ye=null)):e=null,e===null)throw Cl(t);return t.lanes=536870912,null}return Hs(t,a)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(gi(t),s)if(t.flags&256)t.flags&=-257,t=bd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(et||Oa(e,t,l,!1),s=(l&e.childLanes)!==0,et||s){if(a=He,a!==null&&(d=oo(a,l),d!==0&&d!==r.retryLane))throw r.retryLane=d,la(e,d),wt(a,e,d),qi;Ws(),t=bd(e,t,l)}else e=r.treeContext,Ye=Qt(d.nextSibling),it=t,Ee=!0,Tl=null,Yt=!1,e!==null&&ru(t,e),t=Hs(t,a),t.flags|=4096;return t}return e=cl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Gi(e,t,l,a,s){return ra(t),l=ji(e,t,l,a,void 0,s),a=Si(),e!==null&&!et?(Ni(e,t,s),pl(e,t,s)):(Ee&&a&&li(t),t.flags|=1,ot(e,t,l,s),t.child)}function jd(e,t,l,a,s,r){return ra(t),t.updateQueue=null,l=Eu(t,a,l,s),Nu(e),a=Si(),e!==null&&!et?(Ni(e,t,r),pl(e,t,r)):(Ee&&a&&li(t),t.flags|=1,ot(e,t,l,r),t.child)}function Sd(e,t,l,a,s){if(ra(t),t.stateNode===null){var r=Ra,d=l.contextType;typeof d=="object"&&d!==null&&(r=ct(d)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ui,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},xi(t),d=l.contextType,r.context=typeof d=="object"&&d!==null?ct(d):Ra,r.state=t.memoizedState,d=l.getDerivedStateFromProps,typeof d=="function"&&(Bi(t,l,d,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&Ui.enqueueReplaceState(r,r.state,null),Cn(t,a,r,s),Tn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,j=fa(l,p);r.props=j;var A=r.context,U=l.contextType;d=Ra,typeof U=="object"&&U!==null&&(d=ct(U));var G=l.getDerivedStateFromProps;U=typeof G=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,U||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||A!==d)&&cd(t,r,a,d),Al=!1;var R=t.memoizedState;r.state=R,Cn(t,a,r,s),Tn(),A=t.memoizedState,p||R!==A||Al?(typeof G=="function"&&(Bi(t,l,G,a),A=t.memoizedState),(j=Al||id(t,l,j,a,R,A,d))?(U||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=A),r.props=a,r.state=A,r.context=d,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,pi(e,t),d=t.memoizedProps,U=fa(l,d),r.props=U,G=t.pendingProps,R=r.context,A=l.contextType,j=Ra,typeof A=="object"&&A!==null&&(j=ct(A)),p=l.getDerivedStateFromProps,(A=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==G||R!==j)&&cd(t,r,a,j),Al=!1,R=t.memoizedState,r.state=R,Cn(t,a,r,s),Tn();var L=t.memoizedState;d!==G||R!==L||Al||e!==null&&e.dependencies!==null&&js(e.dependencies)?(typeof p=="function"&&(Bi(t,l,p,a),L=t.memoizedState),(U=Al||id(t,l,U,a,R,L,j)||e!==null&&e.dependencies!==null&&js(e.dependencies))?(A||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,L,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,L,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=L),r.props=a,r.state=L,r.context=j,a=U):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,qs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=ua(t,e.child,null,s),t.child=ua(t,null,l,s)):ot(e,t,l,s),t.memoizedState=r.state,e=t.child):e=pl(e,t,s),e}function Nd(e,t,l,a){return na(),t.flags|=256,ot(e,t,l,a),t.child}var Yi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vi(e){return{baseLanes:e,cachePool:fu()}}function Qi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Lt),e}function Ed(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(We.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(s?Ml(t):zl(),(e=Ye)?(e=zf(e,Yt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:kl!==null?{id:It,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ye=null)):e=null,e===null)throw Cl(t);return Tc(e)?t.lanes=32:t.lanes=536870912,null}var p=a.children;return a=a.fallback,s?(zl(),s=t.mode,p=Gs({mode:"hidden",children:p},s),a=aa(a,s,l,null),p.return=t,a.return=t,p.sibling=a,t.child=p,a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,d,l),t.memoizedState=Yi,Mn(null,a)):(Ml(t),Xi(t,p))}var j=e.memoizedState;if(j!==null&&(p=j.dehydrated,p!==null)){if(r)t.flags&256?(Ml(t),t.flags&=-257,t=Zi(e,t,l)):t.memoizedState!==null?(zl(),t.child=e.child,t.flags|=128,t=null):(zl(),p=a.fallback,s=t.mode,a=Gs({mode:"visible",children:a.children},s),p=aa(p,s,l,null),p.flags|=2,a.return=t,p.return=t,a.sibling=p,t.child=a,ua(t,e.child,null,l),a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,d,l),t.memoizedState=Yi,t=Mn(null,a));else if(Ml(t),Tc(p)){if(d=p.nextSibling&&p.nextSibling.dataset,d)var A=d.dgst;d=A,a=Error(u(419)),a.stack="",a.digest=d,bn({value:a,source:null,stack:null}),t=Zi(e,t,l)}else if(et||Oa(e,t,l,!1),d=(l&e.childLanes)!==0,et||d){if(d=He,d!==null&&(a=oo(d,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,la(e,a),wt(d,e,a),qi;kc(p)||Ws(),t=Zi(e,t,l)}else kc(p)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ye=Qt(p.nextSibling),it=t,Ee=!0,Tl=null,Yt=!1,e!==null&&ru(t,e),t=Xi(t,a.children),t.flags|=4096);return t}return s?(zl(),p=a.fallback,s=t.mode,j=e.child,A=j.sibling,a=cl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,A!==null?p=cl(A,p):(p=aa(p,s,l,null),p.flags|=2),p.return=t,a.return=t,a.sibling=p,t.child=a,Mn(null,a),a=t.child,p=e.child.memoizedState,p===null?p=Vi(l):(s=p.cachePool,s!==null?(j=Ie._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=fu(),p={baseLanes:p.baseLanes|l,cachePool:s}),a.memoizedState=p,a.childLanes=Qi(e,d,l),t.memoizedState=Yi,Mn(e.child,a)):(Ml(t),l=e.child,e=l.sibling,l=cl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=l,t.memoizedState=null,l)}function Xi(e,t){return t=Gs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Gs(e,t){return e=_t(22,e,null,t),e.lanes=0,e}function Zi(e,t,l){return ua(t,e.child,null,l),e=Xi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ii(e.return,t,l)}function Ki(e,t,l,a,s,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=l,d.tailMode=s,d.treeForkCount=r)}function Td(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var d=We.current,p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,X(We,d),ot(e,t,a,l),a=Ee?gn:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kd(e,l,t);else if(e.tag===19)kd(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&&As(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Ki(t,!1,s,l,r,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&As(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Ki(t,!0,l,null,r,a);break;case"together":Ki(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function pl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Dl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Oa(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=cl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=cl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function $i(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&js(e)))}function cm(e,t,l){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),wl(t,Ie,e.memoizedState.cache),na();break;case 27:case 5:ke(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:wl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ml(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ed(e,t,l):(Ml(t),e=pl(e,t,l),e!==null?e.sibling:null);Ml(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Oa(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Td(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),X(We,We.current),a)break;return null;case 22:return t.lanes=0,yd(e,t,l,t.pendingProps);case 24:wl(t,Ie,e.memoizedState.cache)}return pl(e,t,l)}function Cd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!$i(e,l)&&(t.flags&128)===0)return et=!1,cm(e,t,l);et=(e.flags&131072)!==0}else et=!1,Ee&&(t.flags&1048576)!==0&&su(t,gn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ca(t.elementType),t.type=e,typeof e=="function")Pr(e)?(a=fa(e,a),t.tag=1,t=Sd(null,t,e,a,l)):(t.tag=0,t=Gi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===V){t.tag=11,t=md(null,t,e,a,l);break e}else if(s===Z){t.tag=14,t=hd(null,t,e,a,l);break e}}throw t=se(e)||e,Error(u(306,t,""))}}return t;case 0:return Gi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=fa(a,t.pendingProps),Sd(e,t,a,s,l);case 3:e:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,pi(e,t),Cn(t,a,null,l);var d=t.memoizedState;if(a=d.cache,wl(t,Ie,a),a!==r.cache&&ci(t,[Ie],l,!0),Tn(),a=d.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Nd(e,t,a,l);break e}else if(a!==s){s=Ht(Error(u(424)),t),bn(s),t=Nd(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(Ye=Qt(e.firstChild),it=t,Ee=!0,Tl=null,Yt=!0,l=yu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(na(),a===s){t=pl(e,t,l);break e}ot(e,t,a,l)}t=t.child}return t;case 26:return qs(e,t),e===null?(l=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ee||(l=t.type,e=t.pendingProps,a=ar(O.current).createElement(l),a[rt]=t,a[St]=e,ut(a,l,e),at(a),t.stateNode=a):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&Ee&&(a=t.stateNode=Df(t.type,t.pendingProps,O.current),it=t,Yt=!0,s=Ye,Gl(t.type)?(Cc=s,Ye=Qt(a.firstChild)):Ye=s),ot(e,t,t.pendingProps.children,l),qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((s=a=Ye)&&(a=Um(a,t.type,t.pendingProps,Yt),a!==null?(t.stateNode=a,it=t,Ye=Qt(a.firstChild),Yt=!1,s=!0):s=!1),s||Cl(t)),ke(t),s=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,a=r.children,Sc(s,r)?a=null:d!==null&&Sc(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=ji(e,t,Pp,null,null,l),Kn._currentValue=s),qs(e,t),ot(e,t,a,l),t.child;case 6:return e===null&&Ee&&((e=l=Ye)&&(l=Hm(l,t.pendingProps,Yt),l!==null?(t.stateNode=l,it=t,Ye=null,e=!0):e=!1),e||Cl(t)),null;case 13:return Ed(e,t,l);case 4:return le(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ua(t,null,a,l):ot(e,t,a,l),t.child;case 11:return md(e,t,t.type,t.pendingProps,l);case 7:return ot(e,t,t.pendingProps,l),t.child;case 8:return ot(e,t,t.pendingProps.children,l),t.child;case 12:return ot(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,wl(t,t.type,a.value),ot(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,ra(t),s=ct(s),a=a(s),t.flags|=1,ot(e,t,a,l),t.child;case 14:return hd(e,t,t.type,t.pendingProps,l);case 15:return vd(e,t,t.type,t.pendingProps,l);case 19:return Td(e,t,l);case 31:return im(e,t,l);case 22:return yd(e,t,l,t.pendingProps);case 24:return ra(t),a=ct(Ie),e===null?(s=di(),s===null&&(s=He,r=oi(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},xi(t),wl(t,Ie,s)):((e.lanes&l)!==0&&(pi(e,t),Cn(t,null,null,l),Tn()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),wl(t,Ie,a)):(a=r.cache,wl(t,Ie,a),a!==s.cache&&ci(t,[Ie],l,!0))),ot(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ml(e){e.flags|=4}function Ji(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(ef())e.flags|=8192;else throw oa=ks,fi}else e.flags&=-16777217}function wd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t))if(ef())e.flags|=8192;else throw oa=ks,fi}function Ys(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ro():536870912,e.lanes|=t,Ka|=t)}function zn(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function om(e,t,l){var a=t.pendingProps;switch(ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),dl(Ie),oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(La(t)?ml(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,si())),Ve(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(ml(t),r!==null?(Ve(t),wd(t,r)):(Ve(t),Ji(t,s,null,a,l))):r?r!==e.memoizedState?(ml(t),Ve(t),wd(t,r)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ml(t),Ve(t),Ji(t,s,e,a,l)),null;case 27:if(Je(t),l=O.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ml(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}e=F.current,La(t)?iu(t):(e=Df(s,a,l),t.stateNode=e,ml(t))}return Ve(t),null;case 5:if(Je(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ml(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}if(r=F.current,La(t))iu(t);else{var d=ar(O.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?d.createElement("select",{is:a.is}):d.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?d.createElement(s,{is:a.is}):d.createElement(s)}}r[rt]=t,r[St]=a;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(ut(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ml(t)}}return Ve(t),Ji(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ml(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=O.current,La(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=it,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[rt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||kf(e.nodeValue,l)),e||Cl(t,!0)}else e=ar(e).createTextNode(a),e[rt]=t,t.stateNode=e}return Ve(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=La(t),l!==null){if(e===null){if(!a)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[rt]=t}else na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else l=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Mt(t),t):(Mt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ve(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=La(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[rt]=t}else na(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),s=!1}else s=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Mt(t),t):(Mt(t),null)}return Mt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ys(t,t.updateQueue),Ve(t),null);case 4:return oe(),e===null&&vc(t.stateNode.containerInfo),Ve(t),null;case 10:return dl(t.type),Ve(t),null;case 19:if(M(We),a=t.memoizedState,a===null)return Ve(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)zn(a,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=As(e),r!==null){for(t.flags|=128,zn(a,!1),e=r.updateQueue,t.updateQueue=e,Ys(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)lu(l,e),l=l.sibling;return X(We,We.current&1|2),Ee&&ol(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Oe()>Ks&&(t.flags|=128,s=!0,zn(a,!1),t.lanes=4194304)}else{if(!s)if(e=As(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ys(t,e),zn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Ee)return Ve(t),null}else 2*Oe()-a.renderingStartTime>Ks&&l!==536870912&&(t.flags|=128,s=!0,zn(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Oe(),e.sibling=null,l=We.current,X(We,s?l&1|2:l&1),Ee&&ol(t,a.treeForkCount),e):(Ve(t),null);case 22:case 23:return Mt(t),yi(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),l=t.updateQueue,l!==null&&Ys(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&&M(ia),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),dl(Ie),Ve(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function um(e,t){switch(ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dl(Ie),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(Mt(t),t.alternate===null)throw Error(u(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(We),null;case 4:return oe(),null;case 10:return dl(t.type),null;case 22:case 23:return Mt(t),yi(),e!==null&&M(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return dl(Ie),null;case 25:return null;default:return null}}function Ad(e,t){switch(ai(t),t.tag){case 3:dl(Ie),oe();break;case 26:case 27:case 5:Je(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&Mt(t);break;case 13:Mt(t);break;case 19:M(We);break;case 10:dl(t.type);break;case 22:case 23:Mt(t),yi(),e!==null&&M(ia);break;case 24:dl(Ie)}}function Ln(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var r=l.create,d=l.inst;a=r(),d.destroy=a}l=l.next}while(l!==s)}}catch(p){Le(t,t.return,p)}}function Ll(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var d=a.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,s=t;var j=l,A=p;try{A()}catch(U){Le(s,j,U)}}}a=a.next}while(a!==r)}}catch(U){Le(t,t.return,U)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{bu(t,l)}catch(a){Le(e,e.return,a)}}}function Rd(e,t,l){l.props=fa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Le(e,t,a)}}function On(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){Le(e,t,s)}}function el(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Le(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){Le(e,t,s)}else l.current=null}function Md(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){Le(e,e.return,s)}}function Wi(e,t,l){try{var a=e.stateNode;Mm(a,e.type,l,t),a[St]=t}catch(s){Le(e,e.return,s)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gl(e.type)||e.tag===4}function Fi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Gl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ii(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=rl));else if(a!==4&&(a===27&&Gl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Ii(e,t,l),e=e.sibling;e!==null;)Ii(e,t,l),e=e.sibling}function Vs(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&&Gl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Vs(e,t,l),e=e.sibling;e!==null;)Vs(e,t,l),e=e.sibling}function Ld(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ut(t,a,l),t[rt]=e,t[St]=l}catch(r){Le(e,e.return,r)}}var hl=!1,tt=!1,Pi=!1,Od=typeof WeakSet=="function"?WeakSet:Set,nt=null;function dm(e,t){if(e=e.containerInfo,bc=ur,e=Ko(e),Zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break e}var d=0,p=-1,j=-1,A=0,U=0,G=e,R=null;t:for(;;){for(var L;G!==l||s!==0&&G.nodeType!==3||(p=d+s),G!==r||a!==0&&G.nodeType!==3||(j=d+a),G.nodeType===3&&(d+=G.nodeValue.length),(L=G.firstChild)!==null;)R=G,G=L;for(;;){if(G===e)break t;if(R===l&&++A===s&&(p=d),R===r&&++U===a&&(j=d),(L=G.nextSibling)!==null)break;G=R,R=G.parentNode}G=L}l=p===-1||j===-1?null:{start:p,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(jc={focusedElem:e,selectionRange:l},ur=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,l=t,s=r.memoizedProps,r=r.memoizedState,a=l.stateNode;try{var ae=fa(l.type,s);e=a.getSnapshotBeforeUpdate(ae,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(de){Le(l,l.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ec(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ec(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function Dd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:yl(e,l),a&4&&Ln(5,l);break;case 1:if(yl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(d){Le(l,l.return,d)}else{var s=fa(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Le(l,l.return,d)}}a&64&&_d(l),a&512&&On(l,l.return);break;case 3:if(yl(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{bu(e,t)}catch(d){Le(l,l.return,d)}}break;case 27:t===null&&a&4&&Ld(l);case 26:case 5:yl(e,l),t===null&&a&4&&Md(l),a&512&&On(l,l.return);break;case 12:yl(e,l);break;case 31:yl(e,l),a&4&&Hd(e,l);break;case 13:yl(e,l),a&4&&qd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=bm.bind(null,l),qm(e,l))));break;case 22:if(a=l.memoizedState!==null||hl,!a){t=t!==null&&t.memoizedState!==null||tt,s=hl;var r=tt;hl=a,(tt=t)&&!r?gl(e,l,(l.subtreeFlags&8772)!==0):yl(e,l),hl=s,tt=r}break;case 30:break;default:yl(e,l)}}function Bd(e){var t=e.alternate;t!==null&&(e.alternate=null,Bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ar(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 Qe=null,Et=!1;function vl(e,t,l){for(l=l.child;l!==null;)Ud(e,t,l),l=l.sibling}function Ud(e,t,l){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(pt,l)}catch{}switch(l.tag){case 26:tt||el(l,t),vl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:tt||el(l,t);var a=Qe,s=Et;Gl(l.type)&&(Qe=l.stateNode,Et=!1),vl(e,t,l),Qn(l.stateNode),Qe=a,Et=s;break;case 5:tt||el(l,t);case 6:if(a=Qe,s=Et,Qe=null,vl(e,t,l),Qe=a,Et=s,Qe!==null)if(Et)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(l.stateNode)}catch(r){Le(l,t,r)}else try{Qe.removeChild(l.stateNode)}catch(r){Le(l,t,r)}break;case 18:Qe!==null&&(Et?(e=Qe,Rf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),tn(e)):Rf(Qe,l.stateNode));break;case 4:a=Qe,s=Et,Qe=l.stateNode.containerInfo,Et=!0,vl(e,t,l),Qe=a,Et=s;break;case 0:case 11:case 14:case 15:Ll(2,l,t),tt||Ll(4,l,t),vl(e,t,l);break;case 1:tt||(el(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Rd(l,t,a)),vl(e,t,l);break;case 21:vl(e,t,l);break;case 22:tt=(a=tt)||l.memoizedState!==null,vl(e,t,l),tt=a;break;default:vl(e,t,l)}}function Hd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{tn(e)}catch(l){Le(t,t.return,l)}}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{tn(e)}catch(l){Le(t,t.return,l)}}function fm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Od),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Od),t;default:throw Error(u(435,e.tag))}}function Qs(e,t){var l=fm(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=jm.bind(null,e,a);a.then(s,s)}})}function kt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,d=t,p=d;e:for(;p!==null;){switch(p.tag){case 27:if(Gl(p.type)){Qe=p.stateNode,Et=!1;break e}break;case 5:Qe=p.stateNode,Et=!1;break e;case 3:case 4:Qe=p.stateNode.containerInfo,Et=!0;break e}p=p.return}if(Qe===null)throw Error(u(160));Ud(r,d,s),Qe=null,Et=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Gd(t,e),t=t.sibling}var Jt=null;function Gd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kt(t,e),Tt(e),a&4&&(Ll(3,e,e.return),Ln(3,e),Ll(5,e,e.return));break;case 1:kt(t,e),Tt(e),a&512&&(tt||l===null||el(l,l.return)),a&64&&hl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=Jt;if(kt(t,e),Tt(e),a&512&&(tt||l===null||el(l,l.return)),a&4){var r=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[cn]||r[rt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ut(r,a,l),r[rt]=e,at(r),a=r;break e;case"link":var d=Yf("link","href",s).get(a+(l.href||""));if(d){for(var p=0;p<d.length;p++)if(r=d[p],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(p,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;case"meta":if(d=Yf("meta","content",s).get(a+(l.content||""))){for(p=0;p<d.length;p++)if(r=d[p],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(p,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[rt]=e,at(r),a=r}e.stateNode=a}else Vf(s,e.type,e.stateNode);else e.stateNode=Gf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Vf(s,e.type,e.stateNode):Gf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Wi(e,e.memoizedProps,l.memoizedProps)}break;case 27:kt(t,e),Tt(e),a&512&&(tt||l===null||el(l,l.return)),l!==null&&a&4&&Wi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(kt(t,e),Tt(e),a&512&&(tt||l===null||el(l,l.return)),e.flags&32){s=e.stateNode;try{Ea(s,"")}catch(ae){Le(e,e.return,ae)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Wi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Pi=!0);break;case 6:if(kt(t,e),Tt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ae){Le(e,e.return,ae)}}break;case 3:if(rr=null,s=Jt,Jt=nr(t.containerInfo),kt(t,e),Jt=s,Tt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{tn(t.containerInfo)}catch(ae){Le(e,e.return,ae)}Pi&&(Pi=!1,Yd(e));break;case 4:a=Jt,Jt=nr(e.stateNode.containerInfo),kt(t,e),Tt(e),Jt=a;break;case 12:kt(t,e),Tt(e);break;case 31:kt(t,e),Tt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 13:kt(t,e),Tt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Zs=Oe()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,A=hl,U=tt;if(hl=A||s,tt=U||j,kt(t,e),tt=U,hl=A,Tt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||hl||tt||xa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)d=r.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{p=j.stateNode;var G=j.memoizedProps.style,R=G!=null&&G.hasOwnProperty("display")?G.display:null;p.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(ae){Le(j,j.return,ae)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(ae){Le(j,j.return,ae)}}}else if(t.tag===18){if(l===null){j=t;try{var L=j.stateNode;s?Mf(L,!0):Mf(j.stateNode,!1)}catch(ae){Le(j,j.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,Qs(e,l))));break;case 19:kt(t,e),Tt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qs(e,a)));break;case 30:break;case 21:break;default:kt(t,e),Tt(e)}}function Tt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(zd(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Fi(e);Vs(e,r,s);break;case 5:var d=l.stateNode;l.flags&32&&(Ea(d,""),l.flags&=-33);var p=Fi(e);Vs(e,p,d);break;case 3:case 4:var j=l.stateNode.containerInfo,A=Fi(e);Ii(e,A,j);break;default:throw Error(u(161))}}catch(U){Le(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Dd(e,t.alternate,t),t=t.sibling}function xa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ll(4,t,t.return),xa(t);break;case 1:el(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Rd(t,t.return,l),xa(t);break;case 27:Qn(t.stateNode);case 26:case 5:el(t,t.return),xa(t);break;case 22:t.memoizedState===null&&xa(t);break;case 30:xa(t);break;default:xa(t)}e=e.sibling}}function gl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,d=r.flags;switch(r.tag){case 0:case 11:case 15:gl(s,r,l),Ln(4,r);break;case 1:if(gl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(A){Le(a,a.return,A)}if(a=r,s=a.updateQueue,s!==null){var p=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)gu(j[s],p)}catch(A){Le(a,a.return,A)}}l&&d&64&&_d(r),On(r,r.return);break;case 27:Ld(r);case 26:case 5:gl(s,r,l),l&&a===null&&d&4&&Md(r),On(r,r.return);break;case 12:gl(s,r,l);break;case 31:gl(s,r,l),l&&d&4&&Hd(s,r);break;case 13:gl(s,r,l),l&&d&4&&qd(s,r);break;case 22:r.memoizedState===null&&gl(s,r,l),On(r,r.return);break;case 30:break;default:gl(s,r,l)}t=t.sibling}}function ec(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&jn(l))}function tc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&jn(e))}function Wt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vd(e,t,l,a),t=t.sibling}function Vd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Wt(e,t,l,a),s&2048&&Ln(9,t);break;case 1:Wt(e,t,l,a);break;case 3:Wt(e,t,l,a),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&jn(e)));break;case 12:if(s&2048){Wt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,d=r.id,p=r.onPostCommit;typeof p=="function"&&p(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Le(t,t.return,j)}}else Wt(e,t,l,a);break;case 31:Wt(e,t,l,a);break;case 13:Wt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,d=t.alternate,t.memoizedState!==null?r._visibility&2?Wt(e,t,l,a):Dn(e,t):r._visibility&2?Wt(e,t,l,a):(r._visibility|=2,Qa(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&ec(d,t);break;case 24:Wt(e,t,l,a),s&2048&&tc(t.alternate,t);break;default:Wt(e,t,l,a)}}function Qa(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,p=l,j=a,A=d.flags;switch(d.tag){case 0:case 11:case 15:Qa(r,d,p,j,s),Ln(8,d);break;case 23:break;case 22:var U=d.stateNode;d.memoizedState!==null?U._visibility&2?Qa(r,d,p,j,s):Dn(r,d):(U._visibility|=2,Qa(r,d,p,j,s)),s&&A&2048&&ec(d.alternate,d);break;case 24:Qa(r,d,p,j,s),s&&A&2048&&tc(d.alternate,d);break;default:Qa(r,d,p,j,s)}t=t.sibling}}function Dn(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:Dn(l,a),s&2048&&ec(a.alternate,a);break;case 24:Dn(l,a),s&2048&&tc(a.alternate,a);break;default:Dn(l,a)}t=t.sibling}}var Bn=8192;function Xa(e,t,l){if(e.subtreeFlags&Bn)for(e=e.child;e!==null;)Qd(e,t,l),e=e.sibling}function Qd(e,t,l){switch(e.tag){case 26:Xa(e,t,l),e.flags&Bn&&e.memoizedState!==null&&Im(l,Jt,e.memoizedState,e.memoizedProps);break;case 5:Xa(e,t,l);break;case 3:case 4:var a=Jt;Jt=nr(e.stateNode.containerInfo),Xa(e,t,l),Jt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Bn,Bn=16777216,Xa(e,t,l),Bn=a):Xa(e,t,l));break;default:Xa(e,t,l)}}function Xd(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 Un(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];nt=a,Kd(a,e)}Xd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zd(e),e=e.sibling}function Zd(e){switch(e.tag){case 0:case 11:case 15:Un(e),e.flags&2048&&Ll(9,e,e.return);break;case 3:Un(e);break;case 12:Un(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xs(e)):Un(e);break;default:Un(e)}}function Xs(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];nt=a,Kd(a,e)}Xd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ll(8,t,t.return),Xs(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Xs(t));break;default:Xs(t)}e=e.sibling}}function Kd(e,t){for(;nt!==null;){var l=nt;switch(l.tag){case 0:case 11:case 15:Ll(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:jn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,nt=a;else e:for(l=e;nt!==null;){a=nt;var s=a.sibling,r=a.return;if(Bd(a),a===l){nt=null;break e}if(s!==null){s.return=r,nt=s;break e}nt=r}}}var xm={getCacheForType:function(e){var t=ct(Ie),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ct(Ie).controller.signal}},pm=typeof WeakMap=="function"?WeakMap:Map,Re=0,He=null,ge=null,je=0,ze=0,zt=null,Ol=!1,Za=!1,lc=!1,bl=0,$e=0,Dl=0,pa=0,ac=0,Lt=0,Ka=0,Hn=null,Ct=null,nc=!1,Zs=0,$d=0,Ks=1/0,$s=null,Bl=null,lt=0,Ul=null,$a=null,jl=0,sc=0,rc=null,Jd=null,qn=0,ic=null;function Ot(){return(Re&2)!==0&&je!==0?je&-je:k.T!==null?xc():uo()}function Wd(){if(Lt===0)if((je&536870912)===0||Ee){var e=ls;ls<<=1,(ls&3932160)===0&&(ls=262144),Lt=e}else Lt=536870912;return e=Rt.current,e!==null&&(e.flags|=32),Lt}function wt(e,t,l){(e===He&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(Ja(e,0),Hl(e,je,Lt,!1)),rn(e,l),((Re&2)===0||e!==He)&&(e===He&&((Re&2)===0&&(pa|=l),$e===4&&Hl(e,je,Lt,!1)),tl(e))}function Fd(e,t,l){if((Re&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||sn(e,t),s=a?vm(e,t):oc(e,t,!0),r=a;do{if(s===0){Za&&!a&&Hl(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!mm(l)){s=oc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;s=Hn;var j=p.current.memoizedState.isDehydrated;if(j&&(Ja(p,d).flags|=256),d=oc(p,d,!1),d!==2){if(lc&&!j){p.errorRecoveryDisabledLanes|=r,pa|=r,s=4;break e}r=Ct,Ct=s,r!==null&&(Ct===null?Ct=r:Ct.push.apply(Ct,r))}s=d}if(r=!1,s!==2)continue}}if(s===1){Ja(e,0),Hl(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Hl(a,t,Lt,!Ol);break e;case 2:Ct=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Zs+300-Oe(),10<s)){if(Hl(a,t,Lt,!Ol),ns(a,0,!0)!==0)break e;jl=t,a.timeoutHandle=Af(Id.bind(null,a,l,Ct,$s,nc,t,Lt,pa,Ka,Ol,r,"Throttled",-0,0),s);break e}Id(a,l,Ct,$s,nc,t,Lt,pa,Ka,Ol,r,null,-0,0)}}break}while(!0);tl(e)}function Id(e,t,l,a,s,r,d,p,j,A,U,G,R,L){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rl},Qd(t,r,G);var ae=(r&62914560)===r?Zs-Oe():(r&4194048)===r?$d-Oe():0;if(ae=Pm(G,ae),ae!==null){jl=r,e.cancelPendingCommit=ae(rf.bind(null,e,t,r,l,a,s,d,p,j,U,G,null,R,L)),Hl(e,r,d,!A);return}}rf(e,t,r,l,a,s,d,p,j)}function mm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var s=l[a],r=s.getSnapshot;s=s.value;try{if(!At(r(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Hl(e,t,l,a){t&=~ac,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Ze(s),d=1<<r;a[r]=-1,s&=~d}l!==0&&io(e,l,t)}function Js(){return(Re&6)===0?(Gn(0),!1):!0}function cc(){if(ge!==null){if(ze===0)var e=ge.return;else e=ge,ul=sa=null,Ei(e),Ha=null,Nn=0,e=ge;for(;e!==null;)Ad(e.alternate,e),e=e.return;ge=null}}function Ja(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Om(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),jl=0,cc(),He=e,ge=l=cl(e.current,null),je=t,ze=0,zt=null,Ol=!1,Za=sn(e,t),lc=!1,Ka=Lt=ac=pa=Dl=$e=0,Ct=Hn=null,nc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Ze(a),r=1<<s;t|=e[s],a&=~r}return bl=t,hs(),l}function Pd(e,t){pe=null,k.H=Rn,t===Ua||t===Es?(t=mu(),ze=3):t===fi?(t=mu(),ze=4):ze=t===qi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,zt=t,ge===null&&($e=1,Us(e,Ht(t,e.current)))}function ef(){var e=Rt.current;return e===null?!0:(je&4194048)===je?Vt===null:(je&62914560)===je||(je&536870912)!==0?e===Vt:!1}function tf(){var e=k.H;return k.H=Rn,e===null?Rn:e}function lf(){var e=k.A;return k.A=xm,e}function Ws(){$e=4,Ol||(je&4194048)!==je&&Rt.current!==null||(Za=!0),(Dl&134217727)===0&&(pa&134217727)===0||He===null||Hl(He,je,Lt,!1)}function oc(e,t,l){var a=Re;Re|=2;var s=tf(),r=lf();(He!==e||je!==t)&&($s=null,Ja(e,t)),t=!1;var d=$e;e:do try{if(ze!==0&&ge!==null){var p=ge,j=zt;switch(ze){case 8:cc(),d=6;break e;case 3:case 2:case 9:case 6:Rt.current===null&&(t=!0);var A=ze;if(ze=0,zt=null,Wa(e,p,j,A),l&&Za){d=0;break e}break;default:A=ze,ze=0,zt=null,Wa(e,p,j,A)}}hm(),d=$e;break}catch(U){Pd(e,U)}while(!0);return t&&e.shellSuspendCounter++,ul=sa=null,Re=a,k.H=s,k.A=r,ge===null&&(He=null,je=0,hs()),d}function hm(){for(;ge!==null;)af(ge)}function vm(e,t){var l=Re;Re|=2;var a=tf(),s=lf();He!==e||je!==t?($s=null,Ks=Oe()+500,Ja(e,t)):Za=sn(e,t);e:do try{if(ze!==0&&ge!==null){t=ge;var r=zt;t:switch(ze){case 1:ze=0,zt=null,Wa(e,t,r,1);break;case 2:case 9:if(xu(r)){ze=0,zt=null,nf(t);break}t=function(){ze!==2&&ze!==9||He!==e||(ze=7),tl(e)},r.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:xu(r)?(ze=0,zt=null,nf(t)):(ze=0,zt=null,Wa(e,t,r,7));break;case 5:var d=null;switch(ge.tag){case 26:d=ge.memoizedState;case 5:case 27:var p=ge;if(d?Qf(d):p.stateNode.complete){ze=0,zt=null;var j=p.sibling;if(j!==null)ge=j;else{var A=p.return;A!==null?(ge=A,Fs(A)):ge=null}break t}}ze=0,zt=null,Wa(e,t,r,5);break;case 6:ze=0,zt=null,Wa(e,t,r,6);break;case 8:cc(),$e=6;break e;default:throw Error(u(462))}}ym();break}catch(U){Pd(e,U)}while(!0);return ul=sa=null,k.H=a,k.A=s,Re=l,ge!==null?0:(He=null,je=0,hs(),$e)}function ym(){for(;ge!==null&&!an();)af(ge)}function af(e){var t=Cd(e.alternate,e,bl);e.memoizedProps=e.pendingProps,t===null?Fs(e):ge=t}function nf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=jd(l,t,t.pendingProps,t.type,void 0,je);break;case 11:t=jd(l,t,t.pendingProps,t.type.render,t.ref,je);break;case 5:Ei(t);default:Ad(l,t),t=ge=lu(t,bl),t=Cd(l,t,bl)}e.memoizedProps=e.pendingProps,t===null?Fs(e):ge=t}function Wa(e,t,l,a){ul=sa=null,Ei(t),Ha=null,Nn=0;var s=t.return;try{if(rm(e,s,t,l,je)){$e=1,Us(e,Ht(l,e.current)),ge=null;return}}catch(r){if(s!==null)throw ge=s,r;$e=1,Us(e,Ht(l,e.current)),ge=null;return}t.flags&32768?(Ee||a===1?e=!0:Za||(je&536870912)!==0?e=!1:(Ol=e=!0,(a===2||a===9||a===3||a===6)&&(a=Rt.current,a!==null&&a.tag===13&&(a.flags|=16384))),sf(t,e)):Fs(t)}function Fs(e){var t=e;do{if((t.flags&32768)!==0){sf(t,Ol);return}e=t.return;var l=om(t.alternate,t,bl);if(l!==null){ge=l;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);$e===0&&($e=5)}function sf(e,t){do{var l=um(e.alternate,e);if(l!==null){l.flags&=32767,ge=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){ge=e;return}ge=e=l}while(e!==null);$e=6,ge=null}function rf(e,t,l,a,s,r,d,p,j){e.cancelPendingCommit=null;do Is();while(lt!==0);if((Re&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Fr,Fx(e,l,r,d,p,j),e===He&&(ge=He=null,je=0),$a=t,Ul=e,jl=l,sc=r,rc=s,Jd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sm(Me,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null,s=_.p,_.p=2,d=Re,Re|=4;try{dm(e,t,l)}finally{Re=d,_.p=s,k.T=a}}lt=1,cf(),of(),uf()}}function cf(){if(lt===1){lt=0;var e=Ul,t=$a,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=k.T,k.T=null;var a=_.p;_.p=2;var s=Re;Re|=4;try{Gd(t,e);var r=jc,d=Ko(e.containerInfo),p=r.focusedElem,j=r.selectionRange;if(d!==p&&p&&p.ownerDocument&&Zo(p.ownerDocument.documentElement,p)){if(j!==null&&Zr(p)){var A=j.start,U=j.end;if(U===void 0&&(U=A),"selectionStart"in p)p.selectionStart=A,p.selectionEnd=Math.min(U,p.value.length);else{var G=p.ownerDocument||document,R=G&&G.defaultView||window;if(R.getSelection){var L=R.getSelection(),ae=p.textContent.length,de=Math.min(j.start,ae),Ue=j.end===void 0?de:Math.min(j.end,ae);!L.extend&&de>Ue&&(d=Ue,Ue=de,de=d);var C=Xo(p,de),E=Xo(p,Ue);if(C&&E&&(L.rangeCount!==1||L.anchorNode!==C.node||L.anchorOffset!==C.offset||L.focusNode!==E.node||L.focusOffset!==E.offset)){var w=G.createRange();w.setStart(C.node,C.offset),L.removeAllRanges(),de>Ue?(L.addRange(w),L.extend(E.node,E.offset)):(w.setEnd(E.node,E.offset),L.addRange(w))}}}}for(G=[],L=p;L=L.parentNode;)L.nodeType===1&&G.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<G.length;p++){var H=G[p];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}ur=!!bc,jc=bc=null}finally{Re=s,_.p=a,k.T=l}}e.current=t,lt=2}}function of(){if(lt===2){lt=0;var e=Ul,t=$a,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=k.T,k.T=null;var a=_.p;_.p=2;var s=Re;Re|=4;try{Dd(e,t.alternate,t)}finally{Re=s,_.p=a,k.T=l}}lt=3}}function uf(){if(lt===4||lt===3){lt=0,te();var e=Ul,t=$a,l=jl,a=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,$a=Ul=null,df(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Bl=null),Cr(l),t=t.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(pt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=k.T,s=_.p,_.p=2,k.T=null;try{for(var r=e.onRecoverableError,d=0;d<a.length;d++){var p=a[d];r(p.value,{componentStack:p.stack})}}finally{k.T=t,_.p=s}}(jl&3)!==0&&Is(),tl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===ic?qn++:(qn=0,ic=e):qn=0,Gn(0)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,jn(t)))}function Is(){return cf(),of(),uf(),ff()}function ff(){if(lt!==5)return!1;var e=Ul,t=sc;sc=0;var l=Cr(jl),a=k.T,s=_.p;try{_.p=32>l?32:l,k.T=null,l=rc,rc=null;var r=Ul,d=jl;if(lt=0,$a=Ul=null,jl=0,(Re&6)!==0)throw Error(u(331));var p=Re;if(Re|=4,Zd(r.current),Vd(r,r.current,d,l),Re=p,Gn(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(pt,r)}catch{}return!0}finally{_.p=s,k.T=a,df(e,t)}}function xf(e,t,l){t=Ht(l,t),t=Hi(e.stateNode,t,2),e=Rl(e,t,2),e!==null&&(rn(e,2),tl(e))}function Le(e,t,l){if(e.tag===3)xf(e,e,l);else for(;t!==null;){if(t.tag===3){xf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Bl===null||!Bl.has(a))){e=Ht(l,e),l=xd(2),a=Rl(t,l,2),a!==null&&(pd(l,a,t,e),rn(a,2),tl(a));break}}t=t.return}}function uc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new pm;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(lc=!0,s.add(l),e=gm.bind(null,e,t,l),t.then(e,e))}function gm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,He===e&&(je&l)===l&&($e===4||$e===3&&(je&62914560)===je&&300>Oe()-Zs?(Re&2)===0&&Ja(e,0):ac|=l,Ka===je&&(Ka=0)),tl(e)}function pf(e,t){t===0&&(t=ro()),e=la(e,t),e!==null&&(rn(e,t),tl(e))}function bm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),pf(e,l)}function jm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(u(314))}a!==null&&a.delete(t),pf(e,l)}function Sm(e,t){return Kt(e,t)}var Ps=null,Fa=null,dc=!1,er=!1,fc=!1,ql=0;function tl(e){e!==Fa&&e.next===null&&(Fa===null?Ps=Fa=e:Fa=Fa.next=e),er=!0,dc||(dc=!0,Em())}function Gn(e,t){if(!fc&&er){fc=!0;do for(var l=!1,a=Ps;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var d=a.suspendedLanes,p=a.pingedLanes;r=(1<<31-Ze(42|e)+1)-1,r&=s&~(d&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,yf(a,r))}else r=je,r=ns(a,a===He?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||sn(a,r)||(l=!0,yf(a,r));a=a.next}while(l);fc=!1}}function Nm(){mf()}function mf(){er=dc=!1;var e=0;ql!==0&&Lm()&&(e=ql);for(var t=Oe(),l=null,a=Ps;a!==null;){var s=a.next,r=hf(a,t);r===0?(a.next=null,l===null?Ps=s:l.next=s,s===null&&(Fa=l)):(l=a,(e!==0||(r&3)!==0)&&(er=!0)),a=s}lt!==0&&lt!==5||Gn(e),ql!==0&&(ql=0)}function hf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-Ze(r),p=1<<d,j=s[d];j===-1?((p&l)===0||(p&a)!==0)&&(s[d]=Wx(p,t)):j<=t&&(e.expiredLanes|=p),r&=~p}if(t=He,l=je,l=ns(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Wl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||sn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Wl(a),Cr(l)){case 2:case 8:l=bt;break;case 32:l=Me;break;case 268435456:l=ha;break;default:l=Me}return a=vf.bind(null,e),l=Kt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Wl(a),e.callbackPriority=2,e.callbackNode=null,2}function vf(e,t){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Is()&&e.callbackNode!==l)return null;var a=je;return a=ns(e,e===He?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Fd(e,a,t),hf(e,Oe()),e.callbackNode!=null&&e.callbackNode===l?vf.bind(null,e):null)}function yf(e,t){if(Is())return null;Fd(e,t,!0)}function Em(){Dm(function(){(Re&6)!==0?Kt(Ge,Nm):mf()})}function xc(){if(ql===0){var e=Da;e===0&&(e=ts,ts<<=1,(ts&261888)===0&&(ts=256)),ql=e}return ql}function gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cs(""+e)}function bf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function km(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=gf((s[St]||null).action),d=a.submitter;d&&(t=(t=d[St]||null)?gf(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var p=new fs("action","action",null,a,s);e.push({event:p,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ql!==0){var j=d?bf(s,d):new FormData(s);zi(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(p.preventDefault(),j=d?bf(s,d):new FormData(s),zi(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var pc=0;pc<Wr.length;pc++){var mc=Wr[pc],Tm=mc.toLowerCase(),Cm=mc[0].toUpperCase()+mc.slice(1);$t(Tm,"on"+Cm)}$t(Wo,"onAnimationEnd"),$t(Fo,"onAnimationIteration"),$t(Io,"onAnimationStart"),$t("dblclick","onDoubleClick"),$t("focusin","onFocus"),$t("focusout","onBlur"),$t(Vp,"onTransitionRun"),$t(Qp,"onTransitionStart"),$t(Xp,"onTransitionCancel"),$t(Po,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Il("onBeforeInput",["compositionend","keypress","textInput","paste"]),Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yn));function jf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var d=a.length-1;0<=d;d--){var p=a[d],j=p.instance,A=p.currentTarget;if(p=p.listener,j!==r&&s.isPropagationStopped())break e;r=p,s.currentTarget=A;try{r(s)}catch(U){ms(U)}s.currentTarget=null,r=j}else for(d=0;d<a.length;d++){if(p=a[d],j=p.instance,A=p.currentTarget,p=p.listener,j!==r&&s.isPropagationStopped())break e;r=p,s.currentTarget=A;try{r(s)}catch(U){ms(U)}s.currentTarget=null,r=j}}}}function be(e,t){var l=t[wr];l===void 0&&(l=t[wr]=new Set);var a=e+"__bubble";l.has(a)||(Sf(t,e,2,!1),l.add(a))}function hc(e,t,l){var a=0;t&&(a|=4),Sf(l,e,a,t)}var tr="_reactListening"+Math.random().toString(36).slice(2);function vc(e){if(!e[tr]){e[tr]=!0,po.forEach(function(l){l!=="selectionchange"&&(wm.has(l)||hc(l,!1,e),hc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tr]||(t[tr]=!0,hc("selectionchange",!1,t))}}function Sf(e,t,l,a){switch(Ff(t)){case 2:var s=lh;break;case 8:s=ah;break;default:s=Mc}l=s.bind(null,t,l,e),s=void 0,!Br||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function yc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var d=a.tag;if(d===3||d===4){var p=a.stateNode.containerInfo;if(p===s)break;if(d===4)for(d=a.return;d!==null;){var j=d.tag;if((j===3||j===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;p!==null;){if(d=ga(p),d===null)return;if(j=d.tag,j===5||j===6||j===26||j===27){a=r=d;continue e}p=p.parentNode}}a=a.return}To(function(){var A=r,U=Or(l),G=[];e:{var R=eu.get(e);if(R!==void 0){var L=fs,ae=e;switch(e){case"keypress":if(us(l)===0)break e;case"keydown":case"keyup":L=jp;break;case"focusin":ae="focus",L=Gr;break;case"focusout":ae="blur",L=Gr;break;case"beforeblur":case"afterblur":L=Gr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Ao;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=op;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Ep;break;case Wo:case Fo:case Io:L=fp;break;case Po:L=Tp;break;case"scroll":case"scrollend":L=ip;break;case"wheel":L=wp;break;case"copy":case"cut":case"paste":L=pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Ro;break;case"toggle":case"beforetoggle":L=_p}var de=(t&4)!==0,Ue=!de&&(e==="scroll"||e==="scrollend"),C=de?R!==null?R+"Capture":null:R;de=[];for(var E=A,w;E!==null;){var H=E;if(w=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||w===null||C===null||(H=un(E,C),H!=null&&de.push(Vn(E,H,w))),Ue)break;E=E.return}0<de.length&&(R=new L(R,ae,null,l,U),G.push({event:R,listeners:de}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",R&&l!==Lr&&(ae=l.relatedTarget||l.fromElement)&&(ga(ae)||ae[ya]))break e;if((L||R)&&(R=U.window===U?U:(R=U.ownerDocument)?R.defaultView||R.parentWindow:window,L?(ae=l.relatedTarget||l.toElement,L=A,ae=ae?ga(ae):null,ae!==null&&(Ue=h(ae),de=ae.tag,ae!==Ue||de!==5&&de!==27&&de!==6)&&(ae=null)):(L=null,ae=A),L!==ae)){if(de=Ao,H="onMouseLeave",C="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(de=Ro,H="onPointerLeave",C="onPointerEnter",E="pointer"),Ue=L==null?R:on(L),w=ae==null?R:on(ae),R=new de(H,E+"leave",L,l,U),R.target=Ue,R.relatedTarget=w,H=null,ga(U)===A&&(de=new de(C,E+"enter",ae,l,U),de.target=w,de.relatedTarget=Ue,H=de),Ue=H,L&&ae)t:{for(de=Am,C=L,E=ae,w=0,H=C;H;H=de(H))w++;H=0;for(var ce=E;ce;ce=de(ce))H++;for(;0<w-H;)C=de(C),w--;for(;0<H-w;)E=de(E),H--;for(;w--;){if(C===E||E!==null&&C===E.alternate){de=C;break t}C=de(C),E=de(E)}de=null}else de=null;L!==null&&Nf(G,R,L,de,!1),ae!==null&&Ue!==null&&Nf(G,Ue,ae,de,!0)}}e:{if(R=A?on(A):window,L=R.nodeName&&R.nodeName.toLowerCase(),L==="select"||L==="input"&&R.type==="file")var we=Ho;else if(Bo(R))if(qo)we=qp;else{we=Up;var re=Bp}else L=R.nodeName,!L||L.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?A&&zr(A.elementType)&&(we=Ho):we=Hp;if(we&&(we=we(e,A))){Uo(G,we,l,U);break e}re&&re(e,R,A),e==="focusout"&&A&&R.type==="number"&&A.memoizedProps.value!=null&&Mr(R,"number",R.value)}switch(re=A?on(A):window,e){case"focusin":(Bo(re)||re.contentEditable==="true")&&(wa=re,Kr=A,yn=null);break;case"focusout":yn=Kr=wa=null;break;case"mousedown":$r=!0;break;case"contextmenu":case"mouseup":case"dragend":$r=!1,$o(G,l,U);break;case"selectionchange":if(Yp)break;case"keydown":case"keyup":$o(G,l,U)}var ve;if(Vr)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Ca?Oo(e,l)&&(Se="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Se="onCompositionStart");Se&&(Mo&&l.locale!=="ko"&&(Ca||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Ca&&(ve=Co()):(El=U,Ur="value"in El?El.value:El.textContent,Ca=!0)),re=lr(A,Se),0<re.length&&(Se=new _o(Se,e,null,l,U),G.push({event:Se,listeners:re}),ve?Se.data=ve:(ve=Do(l),ve!==null&&(Se.data=ve)))),(ve=Mp?zp(e,l):Lp(e,l))&&(Se=lr(A,"onBeforeInput"),0<Se.length&&(re=new _o("onBeforeInput","beforeinput",null,l,U),G.push({event:re,listeners:Se}),re.data=ve)),km(G,e,A,l,U)}jf(G,t)})}function Vn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function lr(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=un(e,l),s!=null&&a.unshift(Vn(e,s,r)),s=un(e,t),s!=null&&a.push(Vn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Am(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nf(e,t,l,a,s){for(var r=t._reactName,d=[];l!==null&&l!==a;){var p=l,j=p.alternate,A=p.stateNode;if(p=p.tag,j!==null&&j===a)break;p!==5&&p!==26&&p!==27||A===null||(j=A,s?(A=un(l,r),A!=null&&d.unshift(Vn(l,A,j))):s||(A=un(l,r),A!=null&&d.push(Vn(l,A,j)))),l=l.return}d.length!==0&&e.push({event:t,listeners:d})}var _m=/\r\n?/g,Rm=/\u0000|\uFFFD/g;function Ef(e){return(typeof e=="string"?e:""+e).replace(_m,`
49
- `).replace(Rm,"")}function kf(e,t){return t=Ef(t),Ef(e)===t}function Be(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ea(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ea(e,""+a);break;case"className":rs(e,"class",a);break;case"tabIndex":rs(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":rs(e,l,a);break;case"style":Eo(e,a,r);break;case"data":if(t!=="object"){rs(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=cs(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(l==="formAction"?(t!=="input"&&Be(e,t,"name",s.name,s,null),Be(e,t,"formEncType",s.formEncType,s,null),Be(e,t,"formMethod",s.formMethod,s,null),Be(e,t,"formTarget",s.formTarget,s,null)):(Be(e,t,"encType",s.encType,s,null),Be(e,t,"method",s.method,s,null),Be(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=cs(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=rl);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=cs(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":be("beforetoggle",e),be("toggle",e),ss(e,"popover",a);break;case"xlinkActuate":sl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":sl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":sl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":sl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":sl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":sl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":sl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":sl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":sl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ss(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=sp.get(l)||l,ss(e,l,a))}}function gc(e,t,l,a,s,r){switch(l){case"style":Eo(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(u(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ea(e,a):(typeof a=="number"||typeof a=="bigint")&&Ea(e,""+a);break;case"onScroll":a!=null&&be("scroll",e);break;case"onScrollEnd":a!=null&&be("scrollend",e);break;case"onClick":a!=null&&(e.onclick=rl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!mo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),r=e[St]||null,r=r!=null?r[l]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):ss(e,l,a)}}}function ut(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var d=l[r];if(d!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Be(e,t,r,d,l,null)}}s&&Be(e,t,"srcSet",l.srcSet,l,null),a&&Be(e,t,"src",l.src,l,null);return;case"input":be("invalid",e);var p=r=d=s=null,j=null,A=null;for(a in l)if(l.hasOwnProperty(a)){var U=l[a];if(U!=null)switch(a){case"name":s=U;break;case"type":d=U;break;case"checked":j=U;break;case"defaultChecked":A=U;break;case"value":r=U;break;case"defaultValue":p=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(u(137,t));break;default:Be(e,t,a,U,l,null)}}bo(e,r,p,j,A,d,s,!1);return;case"select":be("invalid",e),a=d=r=null;for(s in l)if(l.hasOwnProperty(s)&&(p=l[s],p!=null))switch(s){case"value":r=p;break;case"defaultValue":d=p;break;case"multiple":a=p;default:Be(e,t,s,p,l,null)}t=r,l=d,e.multiple=!!a,t!=null?Na(e,!!a,t,!1):l!=null&&Na(e,!!a,l,!0);return;case"textarea":be("invalid",e),r=s=a=null;for(d in l)if(l.hasOwnProperty(d)&&(p=l[d],p!=null))switch(d){case"value":a=p;break;case"defaultValue":s=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:Be(e,t,d,p,l,null)}So(e,a,s,r);return;case"option":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Be(e,t,j,a,l,null)}return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(a=0;a<Yn.length;a++)be(Yn[a],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in l)if(l.hasOwnProperty(A)&&(a=l[A],a!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Be(e,t,A,a,l,null)}return;default:if(zr(t)){for(U in l)l.hasOwnProperty(U)&&(a=l[U],a!==void 0&&gc(e,t,U,a,l,void 0));return}}for(p in l)l.hasOwnProperty(p)&&(a=l[p],a!=null&&Be(e,t,p,a,l,null))}function Mm(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,d=null,p=null,j=null,A=null,U=null;for(L in l){var G=l[L];if(l.hasOwnProperty(L)&&G!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":j=G;default:a.hasOwnProperty(L)||Be(e,t,L,null,a,G)}}for(var R in a){var L=a[R];if(G=l[R],a.hasOwnProperty(R)&&(L!=null||G!=null))switch(R){case"type":r=L;break;case"name":s=L;break;case"checked":A=L;break;case"defaultChecked":U=L;break;case"value":d=L;break;case"defaultValue":p=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,t));break;default:L!==G&&Be(e,t,R,L,a,G)}}Rr(e,d,p,j,A,U,r,s);return;case"select":L=d=p=R=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":L=j;default:a.hasOwnProperty(r)||Be(e,t,r,null,a,j)}for(s in a)if(r=a[s],j=l[s],a.hasOwnProperty(s)&&(r!=null||j!=null))switch(s){case"value":R=r;break;case"defaultValue":p=r;break;case"multiple":d=r;default:r!==j&&Be(e,t,s,r,a,j)}t=p,l=d,a=L,R!=null?Na(e,!!l,R,!1):!!a!=!!l&&(t!=null?Na(e,!!l,t,!0):Na(e,!!l,l?[]:"",!1));return;case"textarea":L=R=null;for(p in l)if(s=l[p],l.hasOwnProperty(p)&&s!=null&&!a.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Be(e,t,p,null,a,s)}for(d in a)if(s=a[d],r=l[d],a.hasOwnProperty(d)&&(s!=null||r!=null))switch(d){case"value":R=s;break;case"defaultValue":L=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Be(e,t,d,s,a,r)}jo(e,R,L);return;case"option":for(var ae in l)if(R=l[ae],l.hasOwnProperty(ae)&&R!=null&&!a.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Be(e,t,ae,null,a,R)}for(j in a)if(R=a[j],L=l[j],a.hasOwnProperty(j)&&R!==L&&(R!=null||L!=null))switch(j){case"selected":e.selected=R&&typeof R!="function"&&typeof R!="symbol";break;default:Be(e,t,j,R,a,L)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var de in l)R=l[de],l.hasOwnProperty(de)&&R!=null&&!a.hasOwnProperty(de)&&Be(e,t,de,null,a,R);for(A in a)if(R=a[A],L=l[A],a.hasOwnProperty(A)&&R!==L&&(R!=null||L!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Be(e,t,A,R,a,L)}return;default:if(zr(t)){for(var Ue in l)R=l[Ue],l.hasOwnProperty(Ue)&&R!==void 0&&!a.hasOwnProperty(Ue)&&gc(e,t,Ue,void 0,a,R);for(U in a)R=a[U],L=l[U],!a.hasOwnProperty(U)||R===L||R===void 0&&L===void 0||gc(e,t,U,R,a,L);return}}for(var C in l)R=l[C],l.hasOwnProperty(C)&&R!=null&&!a.hasOwnProperty(C)&&Be(e,t,C,null,a,R);for(G in a)R=a[G],L=l[G],!a.hasOwnProperty(G)||R===L||R==null&&L==null||Be(e,t,G,R,a,L)}function Tf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],r=s.transferSize,d=s.initiatorType,p=s.duration;if(r&&p&&Tf(d)){for(d=0,p=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],A=j.startTime;if(A>p)break;var U=j.transferSize,G=j.initiatorType;U&&Tf(G)&&(j=j.responseEnd,d+=U*(j<p?1:(p-A)/(j-A)))}if(--a,t+=8*(r+d)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bc=null,jc=null;function ar(e){return e.nodeType===9?e:e.ownerDocument}function Cf(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 wf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Sc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Nc=null;function Lm(){var e=window.event;return e&&e.type==="popstate"?e===Nc?!1:(Nc=e,!0):(Nc=null,!1)}var Af=typeof setTimeout=="function"?setTimeout:void 0,Om=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,Dm=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(Bm)}:Af;function Bm(e){setTimeout(function(){throw e})}function Gl(e){return e==="head"}function Rf(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),tn(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Qn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Qn(l);for(var r=l.firstChild;r;){var d=r.nextSibling,p=r.nodeName;r[cn]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=d}}else l==="body"&&Qn(e.ownerDocument.body);l=s}while(l);tn(t)}function Mf(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ec(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ec(l),Ar(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Um(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[cn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Qt(e.nextSibling),e===null)break}return null}function Hm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Qt(e.nextSibling),e===null))return null;return e}function zf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Qt(e.nextSibling),e===null))return null;return e}function kc(e){return e.data==="$?"||e.data==="$~"}function Tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qm(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Qt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Cc=null;function Lf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Qt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Of(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 Df(e,t,l){switch(t=ar(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Qn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ar(e)}var Xt=new Map,Bf=new Set;function nr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sl=_.d;_.d={f:Gm,r:Ym,D:Vm,C:Qm,L:Xm,m:Zm,X:$m,S:Km,M:Jm};function Gm(){var e=Sl.f(),t=Js();return e||t}function Ym(e){var t=ba(e);t!==null&&t.tag===5&&t.type==="form"?Pu(t):Sl.r(e)}var Ia=typeof document>"u"?null:document;function Uf(e,t,l){var a=Ia;if(a&&typeof t=="string"&&t){var s=Bt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Bf.has(s)||(Bf.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ut(t,"link",e),at(t),a.head.appendChild(t)))}}function Vm(e){Sl.D(e),Uf("dns-prefetch",e,null)}function Qm(e,t){Sl.C(e,t),Uf("preconnect",e,t)}function Xm(e,t,l){Sl.L(e,t,l);var a=Ia;if(a&&e&&t){var s='link[rel="preload"][as="'+Bt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Bt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Bt(l.imageSizes)+'"]')):s+='[href="'+Bt(e)+'"]';var r=s;switch(t){case"style":r=Pa(e);break;case"script":r=en(e)}Xt.has(r)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Xt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Xn(r))||t==="script"&&a.querySelector(Zn(r))||(t=a.createElement("link"),ut(t,"link",e),at(t),a.head.appendChild(t)))}}function Zm(e,t){Sl.m(e,t);var l=Ia;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Bt(a)+'"][href="'+Bt(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=en(e)}if(!Xt.has(r)&&(e=g({rel:"modulepreload",href:e},t),Xt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Zn(r)))return}a=l.createElement("link"),ut(a,"link",e),at(a),l.head.appendChild(a)}}}function Km(e,t,l){Sl.S(e,t,l);var a=Ia;if(a&&e){var s=ja(a).hoistableStyles,r=Pa(e);t=t||"default";var d=s.get(r);if(!d){var p={loading:0,preload:null};if(d=a.querySelector(Xn(r)))p.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Xt.get(r))&&wc(e,l);var j=d=a.createElement("link");at(j),ut(j,"link",e),j._p=new Promise(function(A,U){j.onload=A,j.onerror=U}),j.addEventListener("load",function(){p.loading|=1}),j.addEventListener("error",function(){p.loading|=2}),p.loading|=4,sr(d,t,a)}d={type:"stylesheet",instance:d,count:1,state:p},s.set(r,d)}}}function $m(e,t){Sl.X(e,t);var l=Ia;if(l&&e){var a=ja(l).hoistableScripts,s=en(e),r=a.get(s);r||(r=l.querySelector(Zn(s)),r||(e=g({src:e,async:!0},t),(t=Xt.get(s))&&Ac(e,t),r=l.createElement("script"),at(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Jm(e,t){Sl.M(e,t);var l=Ia;if(l&&e){var a=ja(l).hoistableScripts,s=en(e),r=a.get(s);r||(r=l.querySelector(Zn(s)),r||(e=g({src:e,async:!0,type:"module"},t),(t=Xt.get(s))&&Ac(e,t),r=l.createElement("script"),at(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Hf(e,t,l,a){var s=(s=O.current)?nr(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Pa(l.href),l=ja(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=Pa(l.href);var r=ja(s).hoistableStyles,d=r.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=s.querySelector(Xn(e)))&&!r._p&&(d.instance=r,d.state.loading=5),Xt.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},Xt.set(e,l),r||Wm(s,e,l,d.state))),t&&a===null)throw Error(u(528,""));return d}if(t&&a!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=en(l),l=ja(s).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Pa(e){return'href="'+Bt(e)+'"'}function Xn(e){return'link[rel="stylesheet"]['+e+"]"}function qf(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",l),at(t),e.head.appendChild(t))}function en(e){return'[src="'+Bt(e)+'"]'}function Zn(e){return"script[async]"+e}function Gf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Bt(l.href)+'"]');if(a)return t.instance=a,at(a),a;var s=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),at(a),ut(a,"style",s),sr(a,l.precedence,e),t.instance=a;case"stylesheet":s=Pa(l.href);var r=e.querySelector(Xn(s));if(r)return t.state.loading|=4,t.instance=r,at(r),r;a=qf(l),(s=Xt.get(s))&&wc(a,s),r=(e.ownerDocument||e).createElement("link"),at(r);var d=r;return d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),ut(r,"link",a),t.state.loading|=4,sr(r,l.precedence,e),t.instance=r;case"script":return r=en(l.src),(s=e.querySelector(Zn(r)))?(t.instance=s,at(s),s):(a=l,(s=Xt.get(r))&&(a=g({},l),Ac(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),at(s),ut(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,sr(a,l.precedence,e));return t.instance}function sr(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,d=0;d<a.length;d++){var p=a[d];if(p.dataset.precedence===t)r=p;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rr=null;function Yf(e,t,l){if(rr===null){var a=new Map,s=rr=new Map;s.set(l,a)}else s=rr,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var r=l[s];if(!(r[cn]||r[rt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var p=a.get(d);p?p.push(r):a.set(d,[r])}}return a}function Vf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Fm(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Qf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Im(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=Pa(a.href),r=t.querySelector(Xn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ir.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,at(r);return}r=t.ownerDocument||t,a=qf(a),(s=Xt.get(s))&&wc(a,s),r=r.createElement("link"),at(r);var d=r;d._p=new Promise(function(p,j){d.onload=p,d.onerror=j}),ut(r,"link",a),l.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ir.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var _c=0;function Pm(e,t){return e.stylesheets&&e.count===0&&or(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&or(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*zm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&or(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function ir(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)or(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cr=null;function or(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cr=new Map,t.forEach(eh,e),cr=null,ir.call(e))}function eh(e,t){if(!(t.state.loading&4)){var l=cr.get(e);if(l)var a=l.get(null);else{l=new Map,cr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var d=s[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(l.set(d.dataset.precedence,d),a=d)}a&&l.set(null,a)}s=t.instance,d=s.getAttribute("data-precedence"),r=l.get(d)||a,r===a&&l.set(null,s),l.set(d,s),this.count++,a=ir.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Kn={$$typeof:ne,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function th(e,t,l,a,s,r,d,p,j){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kr(0),this.hiddenUpdates=kr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Xf(e,t,l,a,s,r,d,p,j,A,U,G){return e=new th(e,t,l,d,j,A,U,G,p),t=1,r===!0&&(t|=24),r=_t(3,null,null,t),e.current=r,r.stateNode=e,t=oi(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},xi(r),e}function Zf(e){return e?(e=Ra,e):Ra}function Kf(e,t,l,a,s,r){s=Zf(s),a.context===null?a.context=s:a.pendingContext=s,a=_l(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Rl(e,a,t),l!==null&&(wt(l,e,t),kn(l,e,t))}function $f(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Rc(e,t){$f(e,t),(e=e.alternate)&&$f(e,t)}function Jf(e){if(e.tag===13||e.tag===31){var t=la(e,67108864);t!==null&&wt(t,e,67108864),Rc(e,67108864)}}function Wf(e){if(e.tag===13||e.tag===31){var t=Ot();t=Tr(t);var l=la(e,t);l!==null&&wt(l,e,t),Rc(e,t)}}var ur=!0;function lh(e,t,l,a){var s=k.T;k.T=null;var r=_.p;try{_.p=2,Mc(e,t,l,a)}finally{_.p=r,k.T=s}}function ah(e,t,l,a){var s=k.T;k.T=null;var r=_.p;try{_.p=8,Mc(e,t,l,a)}finally{_.p=r,k.T=s}}function Mc(e,t,l,a){if(ur){var s=zc(a);if(s===null)yc(e,t,a,dr,l),If(e,a);else if(sh(s,e,t,l,a))a.stopPropagation();else if(If(e,a),t&4&&-1<nh.indexOf(e)){for(;s!==null;){var r=ba(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=Fl(r.pendingLanes);if(d!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var j=1<<31-Ze(d);p.entanglements[1]|=j,d&=~j}tl(r),(Re&6)===0&&(Ks=Oe()+500,Gn(0))}}break;case 31:case 13:p=la(r,2),p!==null&&wt(p,r,2),Js(),Rc(r,2)}if(r=zc(a),r===null&&yc(e,t,a,dr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else yc(e,t,a,null,l)}}function zc(e){return e=Or(e),Lc(e)}var dr=null;function Lc(e){if(dr=null,e=ga(e),e!==null){var t=h(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=m(t),e!==null)return e;e=null}else if(l===31){if(e=N(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 dr=e,null}function Ff(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(he()){case Ge:return 2;case bt:return 8;case Me:case nn:return 32;case ha:return 268435456;default:return 32}default:return 32}}var Oc=!1,Yl=null,Vl=null,Ql=null,$n=new Map,Jn=new Map,Xl=[],nh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function If(e,t){switch(e){case"focusin":case"focusout":Yl=null;break;case"dragenter":case"dragleave":Vl=null;break;case"mouseover":case"mouseout":Ql=null;break;case"pointerover":case"pointerout":$n.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jn.delete(t.pointerId)}}function Wn(e,t,l,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=ba(t),t!==null&&Jf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function sh(e,t,l,a,s){switch(t){case"focusin":return Yl=Wn(Yl,e,t,l,a,s),!0;case"dragenter":return Vl=Wn(Vl,e,t,l,a,s),!0;case"mouseover":return Ql=Wn(Ql,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return $n.set(r,Wn($n.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Jn.set(r,Wn(Jn.get(r)||null,e,t,l,a,s)),!0}return!1}function Pf(e){var t=ga(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=m(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(l)});return}}else if(t===31){if(t=N(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(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 fr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=zc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Lr=a,l.target.dispatchEvent(a),Lr=null}else return t=ba(l),t!==null&&Jf(t),e.blockedOn=l,!1;t.shift()}return!0}function ex(e,t,l){fr(e)&&l.delete(t)}function rh(){Oc=!1,Yl!==null&&fr(Yl)&&(Yl=null),Vl!==null&&fr(Vl)&&(Vl=null),Ql!==null&&fr(Ql)&&(Ql=null),$n.forEach(ex),Jn.forEach(ex)}function xr(e,t){e.blockedOn===t&&(e.blockedOn=null,Oc||(Oc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,rh)))}var pr=null;function tx(e){pr!==e&&(pr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){pr===e&&(pr=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(Lc(a||l)===null)continue;break}var r=ba(l);r!==null&&(e.splice(t,3),t-=3,zi(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function tn(e){function t(j){return xr(j,e)}Yl!==null&&xr(Yl,e),Vl!==null&&xr(Vl,e),Ql!==null&&xr(Ql,e),$n.forEach(t),Jn.forEach(t);for(var l=0;l<Xl.length;l++){var a=Xl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Xl.length&&(l=Xl[0],l.blockedOn===null);)Pf(l),l.blockedOn===null&&Xl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],d=s[St]||null;if(typeof r=="function")d||tx(l);else if(d){var p=null;if(r&&r.hasAttribute("formAction")){if(s=r,d=r[St]||null)p=d.formAction;else if(Lc(s)!==null)continue}else p=d.action;typeof p=="function"?l[a+1]=p:(l.splice(a,3),a-=3),tx(l)}}}function lx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Dc(e){this._internalRoot=e}mr.prototype.render=Dc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=Ot();Kf(l,a,e,t,null,null)},mr.prototype.unmount=Dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kf(e.current,2,null,e,null,null),Js(),t[ya]=null}};function mr(e){this._internalRoot=e}mr.prototype.unstable_scheduleHydration=function(e){if(e){var t=uo();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Xl.length&&t!==0&&t<Xl[l].priority;l++);Xl.splice(l,0,e),l===0&&Pf(e)}};var ax=o.version;if(ax!=="19.2.4")throw Error(u(527,ax,"19.2.4"));_.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=f(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var ih={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hr.isDisabled&&hr.supportsFiber)try{pt=hr.inject(ih),Xe=hr}catch{}}return In.createRoot=function(e,t){if(!x(e))throw Error(u(299));var l=!1,a="",s=od,r=ud,d=dd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Xf(e,1,!1,null,null,l,a,null,s,r,d,lx),e[ya]=t.current,vc(e),new Dc(t)},In.hydrateRoot=function(e,t,l){if(!x(e))throw Error(u(299));var a=!1,s="",r=od,d=ud,p=dd,j=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(d=l.onCaughtError),l.onRecoverableError!==void 0&&(p=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Xf(e,1,!0,t,l??null,a,s,j,r,d,p,lx),t.context=Zf(null),l=t.current,a=Ot(),a=Tr(a),s=_l(a),s.callback=null,Rl(l,s,a),l=a,t.current.lanes=l,rn(t,l),tl(t),e[ya]=t.current,vc(e),new mr(t)},In.version="19.2.4",In}var xx;function vh(){if(xx)return Hc.exports;xx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}return i(),Hc.exports=hh(),Hc.exports}var yh=vh();const Lx="";class Ox extends Error{constructor(o,c){super(o),this.name="ApiError",this.status=c}}async function qe(i,o){const c=await fetch(`${Lx}${i}`,o);if(!c.ok){const u=await c.json().catch(()=>({error:c.statusText}));throw new Ox(u.error||`HTTP ${c.status}`,c.status)}return c.json()}const Ne={getConfig(){return qe("/api/config")},setConfig(i,o){return qe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return qe("/api/skills")},getSkillDetail(i,o){return qe(`/api/skills/${i}/${o}`)},getEvals(i,o){return qe(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,c){return qe(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},generateEvals(i,o){return qe(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const c=await fetch(`${Lx}/api/skills/${i}/${o}/benchmark/latest`);if(c.status===404)return null;if(!c.ok){const u=await c.json().catch(()=>({error:c.statusText}));throw new Ox(u.error||`HTTP ${c.status}`,c.status)}return c.json()},getHistory(i,o,c){const u=new URLSearchParams;c!=null&&c.model&&u.set("model",c.model),c!=null&&c.type&&u.set("type",c.type),c!=null&&c.from&&u.set("from",c.from),c!=null&&c.to&&u.set("to",c.to);const x=u.toString();return qe(`/api/skills/${i}/${o}/history${x?"?"+x:""}`)},getHistoryEntry(i,o,c){return qe(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`)},compareRuns(i,o,c,u){return qe(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(c)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,o,c,u){const x=new URLSearchParams;u&&x.set("model",u);const h=x.toString();return qe(`/api/skills/${i}/${o}/history/case/${c}${h?"?"+h:""}`)},deleteHistoryEntry(i,o,c){return qe(`/api/skills/${i}/${o}/history/${encodeURIComponent(c)}`,{method:"DELETE"})},deleteSkill(i,o){return qe(`/api/skills/${i}/${o}`,{method:"DELETE"})},improveSkill(i,o,c){return qe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})},instructEdit(i,o,c){return qe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...c})})},applyImprovement(i,o,c){return qe(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:c})})},getStats(i,o){return qe(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return qe(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return qe("/api/project-layout")},createSkill(i){return qe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return qe("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return qe("/api/skill-creator-status")},generateSkill(i){return qe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,o){return qe(`/api/skills/${i}/${o}/files`)},getSkillFile(i,o,c){return qe(`/api/skills/${i}/${o}/file?path=${encodeURIComponent(c)}`)},saveSkillFile(i,o,c,u){return qe(`/api/skills/${i}/${o}/file`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:c,content:u})})}};function gh(i){const[o,c]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const u=window.matchMedia(i);c(u.matches);const x=h=>c(h.matches);return u.addEventListener("change",x),()=>u.removeEventListener("change",x)},[i]),o}const bh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function jh(i,o){switch(o.type){case"SELECT_SKILL":return{...i,selectedSkill:o.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:o.mode,selectedSkill:o.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:o.query};case"SET_SKILLS":return{...i,skills:o.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:o.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:o.loading};case"SET_MOBILE":return{...i,isMobile:o.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:o.view};default:return i}}const Dx=v.createContext(null);function Jl(){const i=v.useContext(Dx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function Sh({children:i}){const[o,c]=v.useReducer(jh,bh),u=gh("(max-width: 767px)");v.useEffect(()=>{c({type:"SET_MOBILE",isMobile:u})},[u]);const x=v.useCallback(()=>{c({type:"SET_SKILLS_LOADING",loading:!0}),Ne.getSkills().then(g=>{c({type:"SET_SKILLS",skills:g});const z=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(z){const[,B,q]=z,Y=g.find(J=>J.plugin===B&&J.skill===q);Y&&c({type:"SELECT_SKILL",skill:{plugin:B,skill:q,origin:Y.origin}})}}).catch(g=>c({type:"SET_SKILLS_ERROR",error:g.message}))},[]);v.useEffect(()=>{x()},[x]);const h=v.useCallback(g=>{c({type:"SELECT_SKILL",skill:g}),window.location.hash=`/skills/${g.plugin}/${g.skill}`},[]),m=v.useCallback(()=>{c({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),N=v.useCallback(g=>{c({type:"SET_MODE",mode:g})},[]),y=v.useCallback(g=>{c({type:"SET_SEARCH",query:g})},[]),f=v.useCallback(g=>{c({type:"SET_MOBILE_VIEW",view:g})},[]),S=v.useMemo(()=>({state:o,selectSkill:h,clearSelection:m,setMode:N,setSearch:y,setMobileView:f,refreshSkills:x}),[o,h,m,N,y,f,x]);return n.jsx(Dx.Provider,{value:S,children:i})}const Nh={config:null,loading:!0};function Eh(i,o){switch(o.type){case"SET_CONFIG":return{config:o.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const Bx=v.createContext(null);function ln(){const i=v.useContext(Bx);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function kh({children:i}){const[o,c]=v.useReducer(Eh,Nh),u=v.useCallback(()=>{Ne.getConfig().then(m=>c({type:"SET_CONFIG",config:m})).catch(()=>{})},[]);v.useEffect(()=>{u()},[u]);const x=v.useCallback(async(m,N)=>{const y=await Ne.setConfig(m,N);return c({type:"SET_CONFIG",config:y}),y},[]),h=v.useMemo(()=>({config:o.config,loading:o.loading,updateConfig:x,refreshConfig:u}),[o,x,u]);return n.jsx(Bx.Provider,{value:h,children:i})}function Th({left:i,right:o}){const{state:c}=Jl();return c.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:c.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:o})}):n.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:i}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:o})]})}function Ch(){const{state:i,setSearch:o}=Jl(),[c,u]=v.useState(i.searchQuery),x=v.useRef(null);v.useEffect(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{o(c)},200),()=>{x.current&&clearTimeout(x.current)}),[c,o]),v.useEffect(()=>{i.searchQuery===""&&c!==""&&u("")},[i.searchQuery]);const h=new Set(i.skills.map(m=>m.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:c,onChange:m=>u(m.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:m=>{m.currentTarget.style.borderColor="var(--accent)"},onBlur:m=>{m.currentTarget.style.borderColor="var(--border-subtle)"}}),c&&n.jsx("button",{onClick:()=>{u(""),o("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!i.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[i.skills.length," skill",i.skills.length!==1?"s":""," across ",h," plugin",h!==1?"s":""]})]})}const px={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 mx({skill:i,isSelected:o,onSelect:c}){const u=px[i.benchmarkStatus]||px.missing,x=i.origin==="installed";return n.jsxs("button",{onClick:c,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:o?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:o?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:x?.7:1},onMouseEnter:h=>{o||(h.currentTarget.style.background="var(--surface-2)")},onMouseLeave:h=>{o||(h.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[x&&n.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.skill]}),n.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex-shrink-0 ml-2",style:{background:u.bg,color:u.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:u.dot}}),u.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[i.evalCount," eval",i.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[i.assertionCount," assert",i.assertionCount!==1?"s":""]}),i.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(i.lastBenchmark).toLocaleDateString()})]})]})]})}function hx(i){var c;const o={};for(const u of i)(o[c=u.plugin]||(o[c]=[])).push(u);return o}function wh(){const{state:i,selectSkill:o}=Jl(),{skills:c,searchQuery:u,selectedSkill:x}=i,[h,m]=v.useState(!1),[N,y]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:S}=v.useMemo(()=>{const g=u.toLowerCase(),T=g?c.filter(q=>q.skill.toLowerCase().includes(g)||q.plugin.toLowerCase().includes(g)):c,z=T.filter(q=>q.origin==="source"),B=T.filter(q=>q.origin==="installed");return{sourceGroups:Object.entries(hx(z)),installedGroups:Object.entries(hx(B))}},[c,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(g=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},g))}):f.length===0&&S.length===0?n.jsx("div",{className:"px-4 py-8 text-center",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):n.jsxs("div",{className:"flex-1",children:[f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Ah,{title:"Your Skills",count:f.reduce((g,[,T])=>g+T.length,0)}),f.map(([g,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:g,count:T.length}),T.map(z=>{const B=(x==null?void 0:x.plugin)===z.plugin&&(x==null?void 0:x.skill)===z.skill;return n.jsx(mx,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]}),S.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>m(g=>!g),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:h?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",S.reduce((g,[,T])=>g+T.length,0),")"]}),n.jsx("div",{className:"flex-1"}),n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),h&&n.jsxs(n.Fragment,{children:[!N&&n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("p",{className:"flex-1 text-[10px] leading-relaxed",style:{color:"var(--text-tertiary)",margin:0},children:"Skills inside agent folders (.claude/, .cursor/, etc.) are installed copies for consuming. Edit skills in your project root instead."}),n.jsx("button",{onClick:()=>{y(!0);try{sessionStorage.setItem("vskill-origin-banner-dismissed","1")}catch{}},className:"flex-shrink-0 mt-0.5",style:{background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),S.map(([g,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:g,count:T.length}),T.map(z=>{const B=(x==null?void 0:x.plugin)===z.plugin&&(x==null?void 0:x.skill)===z.skill;return n.jsx(mx,{skill:z,isSelected:B,onSelect:()=>o({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},g))]})]})]})}function Ah({title:i,count:o}){return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",o,")"]})]})}function vx({plugin:i,count:o}){const[c,u]=v.useState(!1),x=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[c?n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):n.jsx("img",{src:x,width:16,height:16,alt:"",onError:()=>u(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",o,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function _h(){const{config:i,updateConfig:o,refreshConfig:c}=ln(),[u,x]=v.useState(!1),[h,m]=v.useState(!1),N=v.useRef(null);v.useEffect(()=>{function g(T){N.current&&!N.current.contains(T.target)&&x(!1)}return u&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[u]);async function y(g,T){m(!0);try{await o(g.id,T.id),x(!1)}catch{c()}finally{m(!1)}}if(!i)return null;const f=Mh(i),S=Rh(i);return n.jsxs("div",{ref:N,className:"relative",children:[n.jsxs("button",{onClick:()=>x(!u),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:u?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${u?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:g=>{u||(g.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:g=>{u||(g.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:S!=null&&S.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:u?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),u&&n.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(g=>n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:g.available?"var(--green)":"var(--text-tertiary)",opacity:g.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:g.available?1:.5},children:g.label})]}),g.models.map(T=>{const z=Ux(i,g.id,T.id),B=!g.available||h;return n.jsxs("button",{onClick:()=>!B&&y(g,T),disabled:B,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:z?"var(--accent-muted)":"transparent",color:B?"var(--text-tertiary)":"var(--text-primary)",opacity:B?.4:1,cursor:B?"not-allowed":"pointer"},onMouseEnter:q=>{!B&&!z&&(q.currentTarget.style.background="var(--surface-3)")},onMouseLeave:q=>{z||(q.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 ${z?"var(--accent)":"var(--border-subtle)"}`},children:z&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:z?600:400},title:T.id,children:T.label})]},`${g.id}-${T.id}`)})]},g.id))})]})]})}function Ux(i,o,c){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${c}`:i.model===c}function Rh(i){return i.providers.find(o=>o.id===i.provider)}function Mh(i){for(const o of i.providers)for(const c of o.models)if(Ux(i,o.id,c.id))return c.label;return i.model}function zh(){const{state:i,setMode:o}=Jl(),{config:c}=ln(),[u,x]=v.useState(null),[h,m]=v.useState(!1);return v.useEffect(()=>{Ne.getSkillCreatorStatus().then(x).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(c==null?void 0:c.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(_h,{})})]}),n.jsx(Ch,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("button",{onClick:()=>o("create"),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:i.mode==="create"?"var(--accent)":"var(--surface-3)",color:i.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:N=>{i.mode!=="create"&&(N.currentTarget.style.background="var(--surface-4)",N.currentTarget.style.color="var(--text-primary)")},onMouseLeave:N=>{i.mode!=="create"&&(N.currentTarget.style.background="var(--surface-3)",N.currentTarget.style.color="var(--text-secondary)")},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),u&&(()=>{const N=(c==null?void 0:c.provider)==="claude-cli";return u.installed&&N?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):u.installed&&!N?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!u.installed&&N?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),n.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),n.jsx("button",{onClick:()=>{navigator.clipboard.writeText(u.installCommand).then(()=>{m(!0),setTimeout(()=>m(!1),2e3)}).catch(()=>{})},className:"w-full text-left px-2 py-1 rounded text-[10px] font-mono cursor-pointer transition-colors duration-150",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},title:"Click to copy",onMouseEnter:y=>{y.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:y=>{y.currentTarget.style.borderColor="var(--border-subtle)"},children:h?"Copied!":u.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(wh,{})})]})}const Lh="modulepreload",Oh=function(i){return"/"+i},yx={},Dh=function(o,c,u){let x=Promise.resolve();if(c&&c.length>0){let m=function(f){return Promise.all(f.map(S=>Promise.resolve(S).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const N=document.querySelector("meta[property=csp-nonce]"),y=(N==null?void 0:N.nonce)||(N==null?void 0:N.getAttribute("nonce"));x=m(c.map(f=>{if(f=Oh(f),f in yx)return;yx[f]=!0;const S=f.endsWith(".css"),g=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const T=document.createElement("link");if(T.rel=S?"stylesheet":Lh,S||(T.as="script"),T.crossOrigin="",T.href=f,y&&T.setAttribute("nonce",y),document.head.appendChild(T),S)return new Promise((z,B)=>{T.addEventListener("load",z),T.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(m){const N=new Event("vite:preloadError",{cancelable:!0});if(N.payload=m,window.dispatchEvent(N),!N.defaultPrevented)throw m}return x.then(m=>{for(const N of m||[])N.status==="rejected"&&h(N.reason);return o().catch(h)})};function Vc(){const[i,o]=v.useState([]),[c,u]=v.useState(!1),[x,h]=v.useState(!1),[m,N]=v.useState(null),y=v.useRef(null),f=v.useCallback(async(g,T)=>{o([]),u(!0),h(!1),N(null);const z=new AbortController;y.current=z;try{const B=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:T?JSON.stringify(T):void 0,signal:z.signal});if(!B.ok||!B.body){let ne=`HTTP ${B.status}`;try{const V=await B.json();V.error&&(ne=V.error)}catch{}throw new Error(ne)}const q=B.body.getReader(),Y=new TextDecoder;let J="",P="";for(;;){const{done:ne,value:V}=await q.read();if(ne)break;J+=Y.decode(V,{stream:!0});const I=J.split(`
50
- `);J=I.pop()||"";for(const Q of I)if(Q.startsWith("event: "))P=Q.slice(7).trim();else if(Q.startsWith("data: ")){try{const Z=JSON.parse(Q.slice(6)),ee={event:P,data:Z};P==="done"?(h(!0),o(me=>[...me,ee])):o(me=>[...me,ee])}catch{}P=""}}}catch(B){B.name!=="AbortError"&&N(B.message)}finally{u(!1),y.current=null}},[]),S=v.useCallback(()=>{var g;(g=y.current)==null||g.abort()},[]);return{events:i,running:c,done:x,error:m,start:f,stop:S}}function Bh(i){const o=v.useRef(i);o.current=i;const[c,u]=v.useState(new Set),x=v.useRef(new Map),h=v.useCallback(async(f,S,g)=>{var z;(z=x.current.get(f))==null||z.abort();const T=new AbortController;x.current.set(f,T),u(B=>{const q=new Set(B);return q.add(f),q});try{const B=await fetch(S,{method:"POST",headers:{"Content-Type":"application/json"},body:g?JSON.stringify(g):void 0,signal:T.signal});if(!B.ok||!B.body){let ne=`HTTP ${B.status}`;try{const V=await B.json();V.error&&(ne=V.error)}catch{}throw new Error(ne)}const q=B.body.getReader(),Y=new TextDecoder;let J="",P="";for(;;){const{done:ne,value:V}=await q.read();if(ne)break;J+=Y.decode(V,{stream:!0});const I=J.split(`
51
- `);J=I.pop()||"";for(const Q of I)if(Q.startsWith("event: "))P=Q.slice(7).trim();else if(Q.startsWith("data: ")){try{const Z=JSON.parse(Q.slice(6)),ee={event:P,data:Z};o.current.onEvent(f,ee)}catch{}P=""}}o.current.onDone(f)}catch(B){B.name!=="AbortError"&&o.current.onError(f,B.message)}finally{u(B=>{const q=new Set(B);return q.delete(f),q}),x.current.delete(f)}},[]),m=v.useCallback(f=>{var S;(S=x.current.get(f))==null||S.abort()},[]),N=v.useCallback(()=>{for(const f of x.current.values())f.abort()},[]),y=c.size>0;return{runningSet:c,startCase:h,stopCase:m,stopAll:N,isAnyCaseRunning:y}}const Uh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,evalsError:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,activationTotalPrompts:0,activationStartedAt:null,loading:!0,error:null};function Hh(i,o){var c,u;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const x=new Map;if(o.benchmark)for(const m of o.benchmark.cases)x.set(m.eval_id,{status:m.status,passRate:m.pass_rate,errorMessage:m.error_message||void 0,durationMs:m.durationMs,tokens:m.tokens,output:m.output,assertions:m.assertions.map(N=>({assertion_id:N.id,text:N.text,pass:N.pass,reasoning:N.reasoning}))});const h=((u=(c=o.evals)==null?void 0:c.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,evalsError:o.evalsError??null,latestBenchmark:o.benchmark,inlineResults:x,selectedCaseId:h,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:o.panel};case"SET_CONTENT":return{...i,skillContent:o.content,isDirty:o.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:o.evals};case"SELECT_CASE":return{...i,selectedCaseId:o.caseId};case"CASE_RUN_START":{const x=new Map(i.caseRunStates);return x.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:x,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const x=new Map(i.caseRunStates),h=x.get(o.caseId);x.set(o.caseId,{status:"complete",mode:h==null?void 0:h.mode});const m=new Map(i.inlineResults);return m.set(o.caseId,o.result),{...i,caseRunStates:x,inlineResults:m}}case"CASE_RUN_ERROR":{const x=new Map(i.caseRunStates),h=x.get(o.caseId);x.set(o.caseId,{status:"error",mode:h==null?void 0:h.mode});const m=new Map(i.inlineResults);return m.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:x,inlineResults:m}}case"CASE_RUN_CANCEL":{const x=new Map(i.caseRunStates),h=x.get(o.caseId);return x.set(o.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:x}}case"BULK_RUN_START":{const x=new Map(i.caseRunStates);for(const h of o.caseIds)x.set(h,{status:"queued",mode:o.mode});return{...i,caseRunStates:x,bulkRunActive:!0,runMode:o.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:o.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const x=new Map(i.caseRunStates);for(const[h,m]of x)(m.status==="running"||m.status==="queued")&&x.set(h,{status:"cancelled"});return{...i,caseRunStates:x,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const x=new Map(i.inlineResults);return x.set(o.evalId,o.result),{...i,inlineResults:x}}case"OPEN_IMPROVE":return{...i,improveTarget:o.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...i,improveTarget:null};case"OPEN_AI_EDIT":return{...i,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...i,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...i,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...i,aiEditProgress:[...i.aiEditProgress,o.entry]};case"AI_EDIT_RESULT":{const x=o.evalChanges??[],h=new Map;for(let m=0;m<x.length;m++)h.set(m,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:x},aiEditEvalChanges:x,aiEditEvalSelections:h}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:o.message,aiEditClassifiedError:o.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,o.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:o.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:o.classified};case"TOGGLE_EVAL_CHANGE":{const x=new Map(i.aiEditEvalSelections);return x.set(o.index,!x.get(o.index)),{...i,aiEditEvalSelections:x}}case"SELECT_ALL_EVAL_CHANGES":{const x=new Map(i.aiEditEvalSelections);for(const h of x.keys())x.set(h,!0);return{...i,aiEditEvalSelections:x}}case"DESELECT_ALL_EVAL_CHANGES":{const x=new Map(i.aiEditEvalSelections);for(const h of x.keys())x.set(h,!1);return{...i,aiEditEvalSelections:x}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:o.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:o.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:o.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null,activationStartedAt:Date.now()};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,o.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:o.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:o.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_TIMEOUT":return{...i,activationRunning:!1,activationError:"Activation test timed out after 120 seconds"};case"ACTIVATION_CANCEL":return{...i,activationRunning:!1};default:return i}}function qh(i,o){const c=o.data;if(o.event==="output_ready"&&(i.output=c.output,c.durationMs!=null&&(i.durationMs=c.durationMs),c.tokens!=null&&(i.tokens=c.tokens)),o.event==="outputs_ready"&&(i.output=c.skillOutput,c.skillDurationMs!=null&&(i.durationMs=c.skillDurationMs),c.skillTokens!=null&&(i.tokens=c.skillTokens)),o.event==="assertion_result"){const u={assertion_id:c.assertion_id,text:c.text,pass:c.pass,reasoning:c.reasoning};i.assertions.find(x=>x.assertion_id===u.assertion_id)||i.assertions.push(u)}o.event==="case_complete"&&(i.status=c.status,i.passRate=c.pass_rate,i.errorMessage=c.error_message||void 0,i.classifiedError=c.classified_error||void 0)}const Hx=v.createContext(null);function ll(){const i=v.useContext(Hx);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Gh({plugin:i,skill:o,origin:c,children:u}){const x=c==="installed",[h,m]=v.useReducer(Hh,{...Uh,plugin:i,skill:o}),N=v.useRef(new Set),y=v.useRef(new Set),f=v.useRef(new Map),S=v.useCallback((O,$)=>{let le=f.current.get(O);le||(le={assertions:[]},f.current.set(O,le)),qh(le,$),m({type:"UPDATE_INLINE_RESULT",evalId:O,result:{...le,assertions:[...le.assertions]}})},[]),g=v.useCallback(O=>{if(y.current.has(O))return;y.current.add(O);const $=f.current.get(O)??{assertions:[]};m({type:"CASE_RUN_COMPLETE",caseId:O,result:{...$,assertions:[...$.assertions]}}),N.current.has(O)&&(N.current.delete(O),N.current.size===0&&Ne.getLatestBenchmark(i,o).then(le=>m({type:"BULK_RUN_COMPLETE",benchmark:le})).catch(()=>m({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),T=v.useCallback((O,$)=>{y.current.has(O)||(y.current.add(O),m({type:"CASE_RUN_ERROR",caseId:O,error:$}),N.current.has(O)&&(N.current.delete(O),N.current.size===0&&Ne.getLatestBenchmark(i,o).then(le=>m({type:"BULK_RUN_COMPLETE",benchmark:le})).catch(()=>m({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:z,stopCase:B,stopAll:q}=Bh({onEvent:S,onDone:g,onError:T});v.useEffect(()=>()=>{q()},[q]),v.useEffect(()=>{let O=!1;async function $(){try{const[le,oe,ke]=await Promise.allSettled([Ne.getSkillDetail(i,o),Ne.getEvals(i,o),Ne.getLatestBenchmark(i,o)]);if(O)return;let Je=null,yt=null;if(oe.status==="fulfilled")Je=oe.value;else{const st=oe.reason;(st==null?void 0:st.status)!==404&&(yt=(st==null?void 0:st.message)??"Failed to load test cases")}m({type:"INIT_DATA",skillContent:le.status==="fulfilled"?le.value.skillContent:"",evals:Je,evalsError:yt,benchmark:ke.status==="fulfilled"?ke.value:null})}catch(le){O||m({type:"SET_ERROR",error:le.message})}}return $(),()=>{O=!0}},[i,o]);const Y=v.useCallback(async()=>{if(!x)try{await Ne.applyImprovement(i,o,h.skillContent),m({type:"CONTENT_SAVED"})}catch(O){m({type:"SET_ERROR",error:O.message})}},[x,i,o,h.skillContent]),J=v.useCallback(async O=>{if(!x)try{const $=await Ne.saveEvals(i,o,O);m({type:"SET_EVALS",evals:$})}catch($){m({type:"SET_ERROR",error:$.message})}},[x,i,o]),P=v.useCallback((O,$="benchmark")=>{if(x)return;const le=h.caseRunStates.get(O);if((le==null?void 0:le.status)!=="running")if(f.current.delete(O),y.current.delete(O),m({type:"CASE_RUN_START",caseId:O,mode:$}),$==="comparison"){const oe=`/api/skills/${i}/${o}/compare`;z(O,oe,{eval_ids:[O]})}else{const oe=`/api/skills/${i}/${o}/benchmark/case/${O}`;z(O,oe,$==="baseline"?{baseline_only:!0}:void 0)}},[x,i,o,h.caseRunStates,z]),ne=v.useCallback((O="benchmark")=>{var oe;if(x)return;const $=((oe=h.evals)==null?void 0:oe.evals)??[];if($.length===0)return;const le=$.map(ke=>ke.id);for(const ke of le)f.current.delete(ke),y.current.delete(ke);m({type:"BULK_RUN_START",caseIds:le,mode:O}),N.current=new Set(le);for(const ke of le)if(O==="comparison")z(ke,`/api/skills/${i}/${o}/compare`,{eval_ids:[ke]});else{const Je=`/api/skills/${i}/${o}/benchmark/case/${ke}`;z(ke,Je,O==="baseline"?{baseline_only:!0}:void 0)}},[x,i,o,h.evals,z]),V=v.useCallback(O=>{B(O),m({type:"CASE_RUN_CANCEL",caseId:O}),N.current.delete(O),y.current.add(O)},[B]),I=v.useCallback(()=>{q(),m({type:"CANCEL_ALL"}),N.current.clear()},[q]),Q=v.useCallback(async(O,$)=>{m({type:"OPEN_IMPROVE",evalId:O})},[]),Z=v.useCallback(async(O,$)=>{try{await Ne.applyImprovement(i,o,$),m({type:"SET_CONTENT",content:$}),m({type:"CONTENT_SAVED"}),m({type:"CLOSE_IMPROVE"}),P(O,"benchmark")}catch(le){m({type:"SET_ERROR",error:le.message})}},[i,o,P]),ee=Vc(),me=v.useRef(null);v.useEffect(()=>{if(ee.events.length)for(const O of ee.events){const $=O.data;if(O.event==="progress"&&m({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:$.phase,message:$.message}}),O.event==="done"){const le=$.improved,oe=$.reasoning,ke=$.evalChanges??[];m({type:"AI_EDIT_RESULT",improved:le,reasoning:oe,evalChanges:ke})}if(O.event==="error"){const le=$;m({type:"AI_EDIT_ERROR",message:le.description||"Unknown error",classified:le})}}},[ee.events]),v.useEffect(()=>{ee.error&&m({type:"AI_EDIT_ERROR",message:ee.error})},[ee.error]),v.useEffect(()=>()=>{ee.stop()},[ee.stop]);const Ce=v.useCallback(async(O,$,le)=>{x||(m({type:"AI_EDIT_LOADING"}),me.current=ee.stop,ee.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:O,content:h.skillContent,evals:h.evals??{skill_name:o,evals:[]},provider:$,model:le}))},[x,i,o,h.skillContent,h.evals,ee]),_e=v.useCallback(()=>{ee.stop(),m({type:"AI_EDIT_ERROR",message:"Cancelled"})},[ee]),ye=v.useCallback(async()=>{const O=h.aiEditResult;if(O!=null&&O.improved)try{if(await Ne.applyImprovement(i,o,O.improved),m({type:"SET_CONTENT",content:O.improved}),m({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:le}=await Dh(async()=>{const{mergeEvalChanges:Je}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:Je}},[]),oe=h.evals??{skill_name:o,evals:[]},ke=le(oe,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const Je=await Ne.saveEvals(i,o,ke);m({type:"SET_EVALS",evals:Je})}catch(Je){m({type:"SET_EVALS_RETRY",evalsFile:ke}),m({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${Je.message}. You can retry from the AI Edit panel.`});return}}m({type:"CLOSE_AI_EDIT"})}catch($){m({type:"SET_ERROR",error:$.message})}},[i,o,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),D=v.useCallback(()=>{m({type:"CLOSE_AI_EDIT"})},[]),se=v.useCallback(O=>{m({type:"TOGGLE_EVAL_CHANGE",index:O})},[]),fe=v.useCallback(()=>{m({type:"SELECT_ALL_EVAL_CHANGES"})},[]),k=v.useCallback(()=>{m({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),_=v.useCallback(async()=>{const O=h.aiEditEvalsRetry;if(O)try{const $=await Ne.saveEvals(i,o,O);m({type:"SET_EVALS",evals:$}),m({type:"SET_ERROR",error:null}),m({type:"CLOSE_AI_EDIT"})}catch($){m({type:"SET_ERROR",error:`Retry failed: ${$.message}`})}},[i,o,h.aiEditEvalsRetry]),W=v.useCallback(async()=>{try{const O=await Ne.getSkillDetail(i,o);m({type:"SET_CONTENT",content:O.skillContent}),m({type:"CONTENT_SAVED"})}catch{}},[i,o]),K=Vc();v.useEffect(()=>{if(K.events.length)for(const O of K.events){const $=O.data;if(O.event==="progress"&&m({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:$.phase,message:$.message}}),O.event==="done"){const le=$;Ne.saveEvals(i,o,le).then(oe=>m({type:"GENERATE_EVALS_DONE",evals:oe})).catch(oe=>m({type:"SET_ERROR",error:oe.message}))}O.event==="error"&&m({type:"GENERATE_EVALS_ERROR",classified:$})}},[K.events,i,o]),v.useEffect(()=>{K.error&&m({type:"SET_ERROR",error:K.error})},[K.error]),v.useEffect(()=>()=>{K.stop()},[K.stop]);const ue=v.useCallback(async()=>{x||(m({type:"GENERATE_EVALS_START"}),K.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[x,i,o,K]),b=Vc();v.useEffect(()=>()=>{b.stop()},[b.stop]),v.useEffect(()=>{if(b.events.length)for(const O of b.events)O.event==="prompt_result"&&m({type:"ACTIVATION_RESULT",result:O.data}),O.event==="done"&&(M.current&&(clearTimeout(M.current),M.current=null),m({type:"ACTIVATION_DONE",summary:O.data}))},[b.events]),v.useEffect(()=>{b.error&&(M.current&&(clearTimeout(M.current),M.current=null),m({type:"ACTIVATION_ERROR",error:b.error}))},[b.error]);const M=v.useRef(null),X=v.useCallback(()=>{M.current&&(clearTimeout(M.current),M.current=null),b.stop(),m({type:"ACTIVATION_CANCEL",totalPrompts:0})},[b]),F=v.useCallback(O=>{const le=O.trim().split(`
52
- `).filter(Boolean).map(oe=>oe.startsWith("!")?{prompt:oe.slice(1).trim(),expected:"should_not_activate"}:oe.startsWith("+")?{prompt:oe.slice(1).trim(),expected:"should_activate"}:{prompt:oe.trim(),expected:"auto"});m({type:"ACTIVATION_START"}),m({type:"SET_ACTIVATION_PROMPTS",prompts:O}),b.start(`/api/skills/${i}/${o}/activation-test`,{prompts:le}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{b.stop(),m({type:"ACTIVATION_TIMEOUT"}),M.current=null},12e4)},[i,o,b]),ie=v.useMemo(()=>({state:h,dispatch:m,isReadOnly:x,saveContent:Y,saveEvals:J,runCase:P,runAll:ne,cancelCase:V,cancelAll:I,improveForCase:Q,applyImproveAndRerun:Z,refreshSkillContent:W,generateEvals:ue,runActivationTest:F,cancelActivation:X,submitAiEdit:Ce,cancelAiEdit:_e,applyAiEdit:ye,discardAiEdit:D,toggleEvalChange:se,selectAllEvalChanges:fe,deselectAllEvalChanges:k,retryEvalsSave:_}),[h,x,Y,J,P,ne,V,I,Q,Z,W,ue,F,X,Ce,_e,ye,D,se,fe,k,_]);return n.jsx(Hx.Provider,{value:ie,children:u})}function Yh(i){return i==null?"var(--text-tertiary)":i>=.7?"var(--green)":i>=.4?"var(--yellow)":"var(--red)"}function Vh(i){return i==null?"var(--surface-3)":i>=.7?"var(--green-muted)":i>=.4?"var(--yellow-muted)":"var(--red-muted)"}function Qh({state:i,isReadOnly:o,onDelete:c}){const{plugin:u,skill:x,evals:h,latestBenchmark:m,isDirty:N,caseRunStates:y,regressions:f,iterationCount:S}=i,g=Array.from(y.values()).some(J=>J.status==="running"||J.status==="queued"),T=m==null?void 0:m.overall_pass_rate,z=(h==null?void 0:h.evals.reduce((J,P)=>J+P.assertions.length,0))??0,B=(h==null?void 0:h.evals.length)??0,q=Yh(T),Y=Vh(T);return n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:u}),n.jsx(Xh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:x}),o&&n.jsxs("span",{className:"ml-2 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),N&&n.jsx("span",{className:"ml-2 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--yellow-muted)",color:"var(--yellow)"},children:"unsaved"}),g&&n.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!o&&c&&n.jsx("button",{disabled:g,onClick:()=>{window.confirm(`Delete skill "${x}"? This cannot be undone.`)&&c()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:g?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:g?.4:1,borderRadius:4},onMouseEnter:J=>{g||(J.currentTarget.style.color="var(--red)")},onMouseLeave:J=>{J.currentTarget.style.color="var(--text-tertiary)"},children:n.jsx(Zh,{})}),f.length>0&&n.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),n.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),n.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),f.length," regression",f.length>1?"s":""]}),S>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",S]}),n.jsx("span",{className:"pill",style:{background:Y,color:q},children:T!=null?`${Math.round(T*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[B," case",B!==1?"s":""," / ",z," assert",z!==1?"s":""]})]})]})}function Xh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Zh(){return n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),n.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Kh=[{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 $h({id:i}){const o={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(i){case"editor":return n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"tests":return n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]});case"run":return n.jsx("svg",{...o,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...o,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return n.jsxs("svg",{...o,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"deps":return n.jsxs("svg",{...o,children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}}function Jh({activePanel:i,onPanelChange:o,isDirty:c,isRunning:u,hasRegressions:x,isActivationRunning:h}){return n.jsx("div",{className:"flex items-center gap-0.5 px-3 overflow-x-auto",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:Kh.map((m,N)=>n.jsxs("div",{className:"flex items-center",children:[N>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),m.tabs.map(y=>{const f=i===y.id,S=y.id==="editor"&&c||y.id==="run"&&u||y.id==="activation"&&h||y.id==="history"&&x,g=y.id==="run"||y.id==="activation"?"var(--accent)":y.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>o(y.id),title:`${y.label} (Ctrl+${y.shortcut})`,className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[12px] font-medium transition-colors duration-150",style:{background:"transparent",color:f?"var(--text-primary)":"var(--text-tertiary)",borderBottom:f?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:f?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:T=>{f||(T.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:T=>{f||(T.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx($h,{id:y.id}),y.label,S&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:g}})]},y.id)})]},m.label))})}function Wh(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const c=o[1],u=o[2].trim(),x={},h=c.split(`
53
- `);let m="",N=!1;for(const y of h){const f=y.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&m&&N){const T=f[1],z=f[2].trim();let B=x[m];if((typeof B!="object"||Array.isArray(B))&&(B={},x[m]=B),!z)B[T]=[];else{const q=z.match(/^\[(.+)\]$/);q?B[T]=q[1].split(",").map(Y=>Y.trim().replace(/^["']|["']$/g,"")).filter(Boolean):B[T]=z.replace(/^["']|["']$/g,"")}continue}const S=y.match(/^\s+-\s+(.+)$/);if(S&&m){N=!1;const T=x[m];Array.isArray(T)?T.push(S[1].trim().replace(/^["']|["']$/g,"")):x[m]=[S[1].trim().replace(/^["']|["']$/g,"")];continue}const g=y.match(/^([\w-]+):\s*(.*)$/);if(g){m=g[1];const T=g[2].trim();if(N=!1,!T){x[m]={},N=!0;continue}const z=T.match(/^\[(.+)\]$/);if(z){x[m]=z[1].split(",").map(B=>B.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}x[m]=T.replace(/^["']|["']$/g,"")}}return{metadata:x,body:u}}function Sr(i){if(!i)return"";try{let o=i.replace(/^---\n[\s\S]*?\n---\n?/,""),c=Fh(o);return c=c.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:var(--surface-2);padding:0.75rem;border-radius:6px;overflow-x:auto;font-size:12px;line-height:1.5;margin:0.5rem 0;border:1px solid var(--border-subtle)"><code>$2</code></pre>'),c=c.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),c=c.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),c=c.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),c=c.replace(/\*([^*]+)\*/g,"<em>$1</em>"),c=c.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),c=c.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),c=c.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),c=c.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),c=c.replace(/\n/g,"<br/>"),c}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</pre>`}}function Fh(i){const o=i.split(`
54
- `),c=[];let u=0;for(;u<o.length;)if(o[u].trim().startsWith("|")&&u+1<o.length&&o[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(o[u+1])){const x=gx(o[u]);u+=2;const h=[];for(;u<o.length&&o[u].trim().startsWith("|");)h.push(gx(o[u])),u++;const m='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)"',N='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let y='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';y+="<thead><tr>";for(const f of x)y+=`<th ${m}>${f}</th>`;y+="</tr></thead><tbody>";for(const f of h){y+="<tr>";for(const S of f)y+=`<td ${N}>${S}</td>`;y+="</tr>"}y+="</tbody></table>",c.push(y)}else c.push(o[u]),u++;return c.join(`
55
- `)}function gx(i){return i.split("|").map(o=>o.trim()).filter(o=>o.length>0)}function Nr(i,o){const c=i.split(`
56
- `),u=o.split(`
57
- `);if(c.length>1e3||u.length>1e3)return[...c.map(S=>({type:"unchanged",content:S}))];const x=c.length,h=u.length,m=Array.from({length:x+1},()=>new Array(h+1).fill(0));for(let S=1;S<=x;S++)for(let g=1;g<=h;g++)c[S-1]===u[g-1]?m[S][g]=m[S-1][g-1]+1:m[S][g]=Math.max(m[S-1][g],m[S][g-1]);const N=[];let y=x,f=h;for(;y>0||f>0;)y>0&&f>0&&c[y-1]===u[f-1]?(N.push({type:"unchanged",content:c[y-1]}),y--,f--):f>0&&(y===0||m[y][f-1]>=m[y-1][f])?(N.push({type:"added",content:u[f-1]}),f--):(N.push({type:"removed",content:c[y-1]}),y--);return N.reverse()}function Ih(i,o){if(o&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(i))return n.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const u=new Set(["generating","comparing","preparing","generating_skill","generating_baseline","scoring","action_items"]);return n.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u.has(i)?"var(--accent)":"var(--green)"}})}function es({entries:i,isRunning:o}){const[c,u]=v.useState(!1),x=v.useRef(null);return v.useEffect(()=>{x.current&&!c&&(x.current.scrollTop=x.current.scrollHeight)},[i,c]),i.length===0&&!o?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>u(!c),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-tertiary)"},children:[n.jsxs("span",{className:"flex items-center gap-2",children:[o&&n.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",i.length,")"]}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:c?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!c&&n.jsx("div",{ref:x,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((h,m)=>{const N=m===i.length-1&&o,y=m===0?"0s":`+${((h.timestamp-i[0].timestamp)/1e3).toFixed(1)}s`;return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:N?1:.7},children:[Ih(h.phase,N),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:y}),n.jsx("span",{style:{color:N?"var(--text-primary)":"var(--text-secondary)"},children:h.message}),h.current!=null&&h.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",h.current,"/",h.total,"]"]})]},m)})})]})}const bx={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 Er({error:i,onRetry:o,onDismiss:c}){const[u,x]=v.useState(null),h=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?x(Math.ceil(i.retryAfterMs/1e3)):x(null),()=>{h.current&&clearInterval(h.current)}),[i]),v.useEffect(()=>{if(!(u==null||u<=0))return h.current=setInterval(()=>{x(y=>y==null||y<=1?(h.current&&clearInterval(h.current),0):y-1)},1e3),()=>{h.current&&clearInterval(h.current)}},[u!=null&&u>0]);const m=bx[i.category]||bx.unknown,N=u!=null&&u>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${m.color} 30%, transparent)`,background:`color-mix(in srgb, ${m.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:m.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:m.color},children:i.title})]}),c&&n.jsx("button",{onClick:c,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(o||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:o&&n.jsx("button",{onClick:o,disabled:N,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:N?.5:1},children:N?`Retry in ${u}s`:"Retry"})})]})]})}function Ph({plugin:i,skill:o,skillContent:c,onApplied:u}){const[x,h]=v.useState("closed"),{config:m}=ln(),[N,y]=v.useState("claude-cli"),[f,S]=v.useState("opus"),[g,T]=v.useState([]),[z,B]=v.useState(""),[q,Y]=v.useState(""),[J,P]=v.useState(null),[ne,V]=v.useState(null),[I,Q]=v.useState([]),[Z,ee]=v.useState(!1),me=v.useRef(null);v.useEffect(()=>{if(!m)return;m.providers.find(_=>_.id==="claude-cli"&&_.available)&&(y("claude-cli"),S("opus"))},[m]),v.useEffect(()=>()=>{var k;(k=me.current)==null||k.abort()},[]);function Ce(){return m==null?void 0:m.providers.find(k=>k.id===N&&k.available)}const _e=v.useCallback(()=>{var k;(k=me.current)==null||k.abort(),h("open")},[]);async function ye(){h("loading"),P(null),V(null),Q([]);const k=new AbortController;me.current=k;try{const _=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:N,model:f}),signal:k.signal});if(!_.ok||!_.body){let M=`HTTP ${_.status}`;try{const X=await _.json();X.error&&(M=X.error)}catch{}throw new Error(M)}const W=_.body.getReader(),K=new TextDecoder;let ue="",b="";for(;;){const{done:M,value:X}=await W.read();if(M)break;ue+=K.decode(X,{stream:!0});const F=ue.split(`
58
- `);ue=F.pop()||"";for(const ie of F)if(ie.startsWith("event: "))b=ie.slice(7).trim();else if(ie.startsWith("data: ")){try{const O=JSON.parse(ie.slice(6));b==="progress"?Q($=>[...$,{phase:O.phase,message:O.message,timestamp:Date.now()}]):b==="done"||b==="complete"?(B(O.improved),Y(O.reasoning||""),T(Nr(O.original||c,O.improved)),h("diff_shown")):b==="error"&&(P(O.message||O.description||"Unknown error"),O.category&&V(O),h("open"))}catch{}b=""}}}catch(_){_.name!=="AbortError"&&(P(_.message),h("open"))}finally{me.current=null}}async function D(){ee(!0);try{await Ne.applyImprovement(i,o,z),u(z),h("closed")}catch(k){P(k.message)}finally{ee(!1)}}function se(){h("closed"),T([]),B(""),Y(""),P(null)}if(x==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!c,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const fe=Ce();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:se,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:k=>{k.currentTarget.style.background="var(--surface-3)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(x==="open"||x==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:N,onChange:k=>{y(k.target.value);const _=m==null?void 0:m.providers.find(W=>W.id===k.target.value);_!=null&&_.models[0]&&S(_.models[0].id)},disabled:x==="loading",children:m==null?void 0:m.providers.filter(k=>k.available).map(k=>n.jsx("option",{value:k.id,children:k.label},k.id))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:k=>S(k.target.value),disabled:x==="loading",children:fe==null?void 0:fe.models.map(k=>n.jsx("option",{value:k.id,children:k.label},k.id))})]}),x==="loading"?n.jsx("button",{onClick:_e,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ye,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),x==="loading"&&I.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(es,{entries:I,isRunning:!0})})]}),J&&n.jsx("div",{className:"mb-4",children:ne?n.jsx(Er,{error:ne,onRetry:ye,onDismiss:()=>{P(null),V(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:J})}),x==="diff_shown"&&n.jsxs(n.Fragment,{children:[q&&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: "}),q]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:g.map((k,_)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:k.type==="added"?"rgba(34,197,94,0.1)":k.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:k.type==="added"?"var(--green)":k.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:k.type==="added"?"3px solid var(--green)":k.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:k.type==="added"?"+":k.type==="removed"?"-":" "}),k.content]},_))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:D,disabled:Z,className:"btn btn-primary",children:Z?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:se,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const jx={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"}},ev={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function tv({change:i,index:o,selected:c,onToggle:u,originalEval:x}){var g;const[h,m]=v.useState(!1),N=jx[i.action]??jx.add,y=ev[i.action]??"var(--border-subtle)",f=i.action==="remove"?(x==null?void 0:x.name)??`Eval #${i.evalId}`:((g=i.eval)==null?void 0:g.name)??"Unnamed",S=v.useCallback(()=>u(o),[u,o]);return n.jsxs("div",{className:"rounded-lg transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderLeft:`3px solid ${y}`,opacity:c?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:c,onChange:S,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:N.bg,color:N.color,padding:"1px 6px"},children:N.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>m(!h),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:T=>{T.currentTarget.style.background="var(--surface-3)"},onMouseLeave:T=>{T.currentTarget.style.background="transparent"},children:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:h?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&n.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[i.action==="add"&&i.eval&&n.jsx(lv,{evalCase:i.eval}),i.action==="modify"&&i.eval&&x&&n.jsx(av,{original:x,proposed:i.eval}),i.action==="remove"&&x&&n.jsx(nv,{evalCase:x})]})]})}function lv({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Pc,{label:"Prompt",value:i.prompt}),n.jsx(Pc,{label:"Expected",value:i.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(c=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",c.text]},c.id))})]})]})}function av({original:i,proposed:o}){const c=[];i.name!==o.name&&c.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&c.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&c.push({label:"Expected",old:i.expected_output,new:o.expected_output});const u=i.assertions??[],x=o.assertions??[],h=new Set(u.map(f=>f.text)),m=new Set(x.map(f=>f.text)),N=x.filter(f=>!h.has(f.text)),y=u.filter(f=>!m.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[c.map(f=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),n.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[n.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",eo(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",eo(f.new,120)]})]})]},f.label)),(N.length>0||y.length>0)&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),n.jsxs("div",{className:"mt-1 space-y-0.5",children:[y.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),N.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),c.length===0&&N.length===0&&y.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function nv({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Pc,{label:"Prompt",value:i.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((o=i.assertions)==null?void 0:o.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(c=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:c.text},c.id))})]})]})}function Pc({label:i,value:o}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),n.jsx("div",{className:"mt-0.5 text-[11px] p-2 rounded font-mono",style:{background:"var(--surface-1)",color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:eo(o,300)})]})}function eo(i,o){return i.length>o?i.slice(0,o)+"...":i}const Sx={remove:0,modify:1,add:2};function sv({changes:i,selections:o,currentEvals:c,onToggle:u,onSelectAll:x,onDeselectAll:h}){if(i.length===0)return null;const m=i.map((y,f)=>({change:y,originalIndex:f}));m.sort((y,f)=>(Sx[y.change.action]??2)-(Sx[f.change.action]??2));const N=Array.from(o.values()).filter(Boolean).length;return n.jsxs("div",{className:"mt-3 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",N,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:x,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Select All"}),n.jsx("button",{onClick:h,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--surface-3)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:m.map(({change:y,originalIndex:f})=>n.jsx(tv,{change:y,index:f,selected:o.get(f)??!1,onToggle:u,originalEval:y.evalId!=null?c.find(S=>S.id===y.evalId):void 0},f))})]})}function rv(){var k;const{state:i,dispatch:o,submitAiEdit:c,applyAiEdit:u,discardAiEdit:x,cancelAiEdit:h,toggleEvalChange:m,selectAllEvalChanges:N,deselectAllEvalChanges:y,retryEvalsSave:f}=ll(),{aiEditLoading:S,aiEditResult:g,aiEditError:T,aiEditClassifiedError:z,aiEditProgress:B,aiEditEvalChanges:q,aiEditEvalSelections:Y,aiEditEvalsRetry:J}=i,[P,ne]=v.useState(""),{config:V}=ln(),[I,Q]=v.useState("claude-cli"),[Z,ee]=v.useState("opus"),me=v.useRef(null);v.useEffect(()=>{var _;(_=me.current)==null||_.focus()},[]),v.useEffect(()=>{if(!V)return;V.providers.find(W=>W.id==="claude-cli"&&W.available)&&(Q("claude-cli"),ee("opus"))},[V]);const Ce=V==null?void 0:V.providers.find(_=>_.id===I&&_.available),_e=v.useCallback(()=>{const _=P.trim();!_||S||c(_,I,Z)},[P,S,c,I,Z]),ye=v.useCallback(_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),_e()),_.key==="Escape"&&(_.preventDefault(),S?h():x())},[_e,S,h,x]),D=v.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),se=g?Nr(i.skillContent,g.improved):[],fe=((k=i.evals)==null?void 0:k.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:x,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:_=>{_.currentTarget.style.background="var(--surface-3)"},onMouseLeave:_=>{_.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!g&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:me,value:P,onChange:_=>ne(_.target.value),onKeyDown:ye,placeholder:"e.g., Add an error handling section...",disabled:S,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:_=>{const W=_.currentTarget;W.style.height="auto",W.style.height=Math.min(W.scrollHeight,96)+"px"}})}),n.jsxs("div",{style:{minWidth:100},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:I,onChange:_=>{Q(_.target.value);const W=V==null?void 0:V.providers.find(K=>K.id===_.target.value);W!=null&&W.models[0]&&ee(W.models[0].id)},disabled:S,style:{width:"100%"},children:V==null?void 0:V.providers.filter(_=>_.available).map(_=>n.jsx("option",{value:_.id,children:_.label},_.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:Z,onChange:_=>ee(_.target.value),disabled:S,style:{width:"100%"},children:Ce==null?void 0:Ce.models.map(_=>n.jsx("option",{value:_.id,children:_.label},_.id))})]}),S?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:_e,disabled:!P.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),S&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(es,{entries:B,isRunning:!0})})]}),T&&n.jsx("div",{className:"mt-3",children:z?n.jsx(Er,{error:z,onRetry:D,onDismiss:x}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),g&&n.jsxs("div",{className:"animate-fade-in",children:[g.reasoning&&n.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),g.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:se.map((_,W)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:_.type==="added"?"rgba(34,197,94,0.1)":_.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:_.type==="added"?"var(--green)":_.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:_.type==="added"?"3px solid var(--green)":_.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:_.type==="added"?"+":_.type==="removed"?"-":" "}),_.content]},W))}),n.jsx(sv,{changes:q,selections:Y,currentEvals:fe,onToggle:m,onSelectAll:N,onDeselectAll:y}),J&&n.jsxs("div",{className:"mt-3 px-3 py-2.5 rounded-lg text-[12px] flex items-center justify-between",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.3)",color:"#fbbf24"},children:[n.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),n.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("button",{onClick:u,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:x,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:D,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function iv(i,o){const[c,u]=v.useState([]),[x,h]=v.useState("SKILL.md"),[m,N]=v.useState(null),[y,f]=v.useState(!1),[S,g]=v.useState(null),T=v.useCallback(async()=>{try{const q=await Ne.getSkillFiles(i,o);u(q.files)}catch{u([])}},[i,o]);v.useEffect(()=>{h("SKILL.md"),N(null),g(null),T()},[i,o,T]);const z=v.useCallback(async q=>{if(h(q),q==="SKILL.md"){N(null),g(null);return}f(!0),g(null);try{const Y=await Ne.getSkillFile(i,o,q);N(Y)}catch(Y){g(`Unable to open file: ${Y.message}`),N(null)}finally{f(!1)}},[i,o]),B=v.useCallback(()=>{T()},[T]);return{files:c,activeFile:x,secondaryContent:m,loading:y,error:S,selectFile:z,refresh:B,isSkillMd:x==="SKILL.md"}}function cv(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function ov(i){const o=[],c=new Map;for(const u of i){const x=u.path.split("/"),m={name:x[x.length-1],path:u.path,type:u.type,size:u.size,children:[]};c.set(u.path,m)}for(const u of i){const x=u.path.split("/");if(x.length===1){const h=c.get(u.path);h&&o.push(h)}else{const h=x.slice(0,-1).join("/"),m=c.get(h),N=c.get(u.path);m&&N&&m.children.push(N)}}return o}function qx({expanded:i}){return n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Gx(){return n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function uv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function dv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("polyline",{points:"1 20 1 14 7 14"}),n.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Yx({node:i,depth:o,activeFile:c,onSelect:u}){const[x,h]=v.useState(!0),m=i.path===c;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>h(!x),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*14}px`,paddingTop:2,paddingBottom:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left"},children:[n.jsx(qx,{expanded:x}),n.jsx(Gx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),x&&i.children.map(N=>n.jsx(Yx,{node:N,depth:o+1,activeFile:c,onSelect:u},N.path))]}):n.jsxs("button",{onClick:()=>u(i.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+o*14}px`,paddingTop:2,paddingBottom:2,background:m?"var(--accent-muted)":"none",border:"none",cursor:"pointer",color:m?"var(--accent)":"var(--text-tertiary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left",borderRadius:3},children:[n.jsx("span",{style:{width:10}}),n.jsx(uv,{}),n.jsx("span",{style:{flex:1},children:i.name}),n.jsx("span",{style:{fontSize:9,color:"var(--text-tertiary)",marginRight:4,whiteSpace:"nowrap"},children:cv(i.size)})]})}function fv({files:i,activeFile:o,onSelect:c,onRefresh:u}){const[x,h]=v.useState(!1),m=v.useMemo(()=>ov(i),[i]);return n.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>h(!x),children:[n.jsx(qx,{expanded:x}),n.jsx(Gx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),n.jsx("button",{onClick:N=>{N.stopPropagation(),u()},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"2px 4px",display:"flex",alignItems:"center",borderRadius:3},title:"Refresh file list",children:n.jsx(dv,{})})]}),x&&n.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:m.length===0?n.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):m.map(N=>n.jsx(Yx,{node:N,depth:0,activeFile:o,onSelect:y=>{c(y),h(!1)}},N.path))})]})}function vr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function xv(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function pv(i){const o=i.toLowerCase();return o.endsWith(".json")?"json":o.endsWith(".md")?"md":"other"}function Nx({content:i}){return n.jsx("textarea",{readOnly:!0,value:i,style:{flex:1,width:"100%",resize:"none",background:"var(--surface-1)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}})}function Ex({content:i,fileType:o}){if(o==="json"){const c=xv(i);return n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:c})}return o==="md"?n.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px 20px",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:13,lineHeight:1.6},dangerouslySetInnerHTML:{__html:Sr(i)}}):n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})}function kx(i){try{return JSON.stringify(JSON.parse(i),null,2).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"([^"\\]|\\.)*"\s*:/g,c=>`<span style="color:#6383ff">${c}</span>`).replace(/:\s*"([^"\\]|\\.)*"/g,c=>`<span style="color:#22c55e">${c.slice(0,2)}<span style="color:#22c55e">${c.slice(2)}</span></span>`).replace(/:\s*(-?\d+\.?\d*)/g,(c,u)=>`: <span style="color:#fb923c">${u}</span>`).replace(/:\s*(true|false|null)/g,(c,u)=>`: <span style="color:#a855f7">${u}</span>`)}catch{return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}function mv({file:i,loading:o,error:c,viewMode:u,plugin:x,skill:h,onSaved:m}){const[N,y]=v.useState(u),[f,S]=v.useState(!1),[g,T]=v.useState(""),[z,B]=v.useState(!1),[q,Y]=v.useState(null),J=u!==N?u:N,P=v.useCallback(()=>{(i==null?void 0:i.content)!=null&&(T(i.content),S(!0))},[i]),ne=v.useCallback(async()=>{if(!(!x||!h||!i)){B(!0);try{await Ne.saveSkillFile(x,h,i.path,g),Y("Saved"),S(!1),m==null||m(),setTimeout(()=>Y(null),2e3)}catch(Q){Y(`Save failed: ${Q.message}`),setTimeout(()=>Y(null),3e3)}finally{B(!1)}}},[x,h,i,g,m]);if(o)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(c)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:n.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[n.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),n.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:c})]})});if(!i)return null;if(i.binary)return n.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",vr(i.size),") — cannot be displayed"]});const V=i.content??"",I=pv(i.path);return n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[i.truncated&&n.jsxs("div",{style:{padding:"4px 12px",background:"var(--warning-muted, #fef3c7)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:"var(--warning-text, #92400e)"},children:["File truncated at ",vr(512*1024)," — ",vr(i.size)," total"]}),I!=="other"&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[["raw","split","preview"].map(Q=>n.jsx("button",{onClick:()=>y(Q),style:{padding:"2px 8px",fontSize:11,background:J===Q?"var(--accent-muted)":"none",color:J===Q?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:Q},Q)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center",gap:6},children:[vr(i.size),x&&h&&!i.binary&&!f&&n.jsx("button",{onClick:P,style:{padding:"1px 6px",fontSize:10,background:"var(--accent-muted)",color:"var(--accent)",border:"none",borderRadius:3,cursor:"pointer"},children:"Edit"}),f&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:ne,disabled:z,style:{padding:"1px 6px",fontSize:10,background:"var(--accent)",color:"#fff",border:"none",borderRadius:3,cursor:"pointer",opacity:z?.6:1},children:z?"Saving...":"Save"}),n.jsx("button",{onClick:()=>S(!1),style:{padding:"1px 6px",fontSize:10,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer"},children:"Cancel"})]})]})]}),q&&n.jsx("div",{style:{padding:"4px 12px",background:q.startsWith("Save failed")?"var(--red-muted)":"var(--green-muted)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:q.startsWith("Save failed")?"var(--red)":"var(--green)"},children:q}),n.jsx("div",{style:{flex:1,display:"flex",minHeight:0},children:f?n.jsx("textarea",{value:g,onChange:Q=>T(Q.target.value),style:{flex:1,width:"100%",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}}):J==="split"&&I!=="other"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:n.jsx(Nx,{content:V})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:I==="json"?n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:kx(V)}}):n.jsx(Ex,{content:V,fileType:I})})]}):J==="preview"&&I!=="other"?I==="json"?n.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:kx(V)}}):n.jsx(Ex,{content:V,fileType:I}):n.jsx(Nx,{content:V})})]})}function hv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function vv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function yv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("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 gv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}function Qc({size:i=15}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function bv(){const{state:i,dispatch:o,saveContent:c,isReadOnly:u}=ll(),{plugin:x,skill:h,skillContent:m,isDirty:N,improveTarget:y,aiEditOpen:f}=i,[S,g]=v.useState("split"),[T,z]=v.useState(!1),B=v.useRef(null),[q,Y]=v.useState(!1),[J,P]=v.useState(""),[ne,V]=v.useState(!1),[I,Q]=v.useState(null),[Z,ee]=v.useState([]),[me,Ce]=v.useState([]),[_e,ye]=v.useState(null),D=v.useRef(null),{config:se}=ln(),{files:fe,activeFile:k,secondaryContent:_,loading:W,error:K,selectFile:ue,refresh:b,isSkillMd:M}=iv(x??"",h??"");v.useEffect(()=>()=>{var te;(te=D.current)==null||te.abort()},[]);const{metadata:X,body:F}=Wh(m),ie=X["allowed-tools"],O=Array.isArray(ie)?ie:typeof ie=="string"?[ie]:[],$=X.name,le=X.description,oe=X.metadata,ke=typeof oe=="object"&&!Array.isArray(oe)?oe:null,Je=X.version||(ke==null?void 0:ke.version),yt=X.tags||(ke==null?void 0:ke.tags),st=Array.isArray(yt)?yt:typeof yt=="string"?yt.split(",").map(te=>te.trim()).filter(Boolean):[],Zt=new Set(["name","description","metadata","allowed-tools","version","tags"]),ft=Object.entries(X).filter(([te])=>!Zt.has(te)),al=v.useCallback(async()=>{z(!0),await c(),z(!1)},[c]),ma=v.useCallback(te=>{(te.ctrlKey||te.metaKey)&&te.key==="s"&&(te.preventDefault(),te.stopPropagation(),N&&al()),(te.ctrlKey||te.metaKey)&&te.key==="k"&&(te.preventDefault(),te.stopPropagation(),o({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[N,al,f,o]),gt=v.useCallback(async()=>{var Oe,he;if(!J.trim())return;(Oe=D.current)==null||Oe.abort();const te=new AbortController;D.current=te,V(!0),ye(null),Ce([]),Q(null),ee([]);try{const Ge=(se==null?void 0:se.provider)||"claude-cli",bt=(se==null?void 0:se.model)||"sonnet",Me=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:J,provider:Ge,model:bt}),signal:te.signal});if(!Me.ok||!Me.body){let pt=`HTTP ${Me.status}`;try{const Xe=await Me.json();Xe.error&&(pt=Xe.error)}catch{}throw new Error(pt)}const nn=Me.body.getReader(),ha=new TextDecoder;let nl="",xt="";for(;;){const{done:pt,value:Xe}=await nn.read();if(pt)break;nl+=ha.decode(Xe,{stream:!0});const jt=nl.split(`
59
- `);nl=jt.pop()||"";for(const Ze of jt)if(Ze.startsWith("event: "))xt=Ze.slice(7).trim();else if(Ze.startsWith("data: ")){try{const Te=JSON.parse(Ze.slice(6));if(xt==="progress")Ce(mt=>[...mt,{phase:Te.phase,message:Te.message,timestamp:Date.now()}]);else if(xt==="done"||xt==="complete"){const mt=["---"];Te.name&&mt.push(`name: ${Te.name}`),Te.description&&mt.push(`description: "${Te.description.replace(/"/g,'\\"')}"`),Te.model&&mt.push(`model: ${Te.model}`),(he=Te.allowedTools)!=null&&he.trim()&&mt.push(`allowed-tools: ${Te.allowedTools.trim()}`),mt.push("---","",Te.body||"");const va=mt.join(`
60
- `);Q(va),ee(Nr(m,va)),V(!1)}else xt==="error"&&(ye(Te.message||Te.description||"Generation failed"),V(!1))}catch{}xt=""}}}catch(Ge){Ge.name!=="AbortError"&&ye(Ge.message)}finally{V(!1),D.current=null}},[J,se,m]),Ft=v.useCallback(()=>{I&&o({type:"SET_CONTENT",content:I}),Y(!1),Q(null),ee([]),P(""),Ce([])},[I,o]),Kt=v.useCallback(()=>{Y(!1),Q(null),ee([]),P(""),Ce([]),ye(null)},[]),Wl=v.useCallback(()=>{var te;q?((te=D.current)==null||te.abort(),Kt()):(f&&o({type:"CLOSE_AI_EDIT"}),Y(!0))},[q,f,o,Kt]),an=[{mode:"raw",icon:n.jsx(hv,{}),label:"Editor"},{mode:"split",icon:n.jsx(vv,{}),label:"Split"},{mode:"preview",icon:n.jsx(yv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:ma,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:an.map(({mode:te,icon:Oe,label:he})=>n.jsxs("button",{onClick:()=>g(te),title:he,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:S===te?"var(--surface-4)":"transparent",color:S===te?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:S===te?600:400,border:"none",cursor:"pointer"},children:[Oe,n.jsx("span",{style:{letterSpacing:"0.01em"},children:he})]},te))}),M?u?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{f?o({type:"CLOSE_AI_EDIT"}):(q&&Kt(),o({type:"OPEN_AI_EDIT"}))},title:"Edit with AI (Ctrl+K)",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:f?600:400,border:"none",cursor:"pointer",color:f?"#a855f7":"var(--text-tertiary)",background:f?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(gv,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Wl,title:"Regenerate skill from prompt",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:q?600:400,border:"none",cursor:"pointer",color:q?"#a855f7":"var(--text-tertiary)",background:q?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Qc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),N&&n.jsx("button",{onClick:()=>o({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:al,disabled:!N||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),x&&h&&n.jsx(fv,{files:fe,activeFile:k,onSelect:ue,onRefresh:b}),!M&&n.jsx(mv,{file:_,loading:W,error:K,viewMode:S,plugin:x??void 0,skill:h??void 0,onSaved:()=>{ue(k),b()}}),M&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:S==="raw"||S==="preview"?"1fr":"1fr 1fr"},children:[S!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:S==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:m,onChange:te=>{u||o({type:"SET_CONTENT",content:te.target.value})},onKeyDown:ma,spellCheck:!1,readOnly:u,className:"flex-1 w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",fontSize:12.5,lineHeight:1.7,tabSize:2,border:"none",padding:"16px 20px",opacity:u?.7:1}})}),S!=="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:[($||Je||le)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[$&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:$}),Je&&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",Je]})]}),le&&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:le})]}),st.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:st.map(te=>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:te},te))}),O.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"}),O.map(te=>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:te},te))]})}),ft.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:ft.map(([te,Oe],he)=>{const Ge=Array.isArray(Oe)?Oe.join(", "):typeof Oe=="object"?Object.entries(Oe).map(([bt,Me])=>`${bt}: ${Array.isArray(Me)?Me.join(", "):Me}`).join(" | "):Oe;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:he>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:te}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Ge})]},te)})}),($||le||st.length>0||O.length>0||ft.length>0)&&F&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),F&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Sr(F)}})]})})]}),M&&f&&n.jsx(rv,{}),M&&q&&n.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:n.jsxs("div",{className:"px-4 py-3",children:[!I&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),n.jsx("div",{className:"flex gap-2 mb-2",children:n.jsx("textarea",{value:J,onChange:te=>P(te.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ne,className:"flex-1 px-3 py-2 rounded-lg text-[12px] resize-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none",opacity:ne?.5:1},onKeyDown:te=>{te.key==="Enter"&&(te.ctrlKey||te.metaKey)&&J.trim()&&!ne&&(te.preventDefault(),gt())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[ne?n.jsx("button",{onClick:()=>{var te;(te=D.current)==null||te.abort(),V(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:gt,disabled:!J.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Kt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ne&&me.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(es,{entries:me,isRunning:!0})}),_e&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[_e,n.jsx("button",{onClick:gt,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),I&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:Z.map((te,Oe)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:te.type==="added"?"rgba(34,197,94,0.1)":te.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:te.type==="added"?"var(--green)":te.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:te.type==="added"?"3px solid var(--green)":te.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:te.type==="added"?"+":te.type==="removed"?"-":" "}),te.content]},Oe))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Ft,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:Kt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),M&&y!==null&&x&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Ph,{plugin:x,skill:h,skillContent:m,onApplied:te=>{o({type:"SET_CONTENT",content:te}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function Pn(i){return i.testType==="integration"?"integration":"unit"}function to(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Vx(i){const o=new Date(i);return o.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Qx(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}const jv=new Set(["benchmark","comparison","baseline"]);function Tx(i,o,c,u){return i.map(({rate:x,idx:h,total:m})=>{const N=u+h/(m-1)*(o-u*2),y=u+(c-u*2)-x*(c-u*2);return`${N},${y}`})}function Xx({entries:i}){const o=i.filter(g=>jv.has(g.type)).slice().reverse(),c=o.map((g,T,z)=>({rate:g.pass_rate,idx:T,total:z.length})).filter((g,T)=>{const z=o[T].type;return z==="benchmark"||z==="comparison"}),u=o.flatMap((g,T)=>g.type==="baseline"?[{rate:g.pass_rate,idx:T,total:o.length}]:g.type==="comparison"&&g.baselinePassRate!=null?[{rate:g.baselinePassRate,idx:T,total:o.length}]:[]);if(c.length<2&&u.length<2)return null;const x=80,h=24,m=2,N=c.length>=2?Tx(c,x,h,m):[],y=u.length>=2?Tx(u,x,h,m):[],f=N[N.length-1],S=y[y.length-1];return n.jsxs("svg",{width:x,height:h,style:{display:"block",flexShrink:0},children:[y.length>0&&n.jsx("polyline",{points:y.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),N.length>0&&n.jsx("polyline",{points:N.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),S&&n.jsx("circle",{cx:parseFloat(S.split(",")[0]),cy:parseFloat(S.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&n.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Zx(i,o,c){const u=[],x=[],h=[];if((i==="PASS"||i==="EFFECTIVE")&&o>=.7){const y=u.length>0?` Met criteria: ${u.map(f=>f.criterion).join(", ")}.`:"";return{explanation:`${i} (score ${o.toFixed(2)}): evaluation met expectations.${y}`}}if((i==="FAIL"||i==="DEGRADING")&&o<.4){const y=x.length>0?` Failed criteria: ${x.map(S=>S.criterion).join(", ")}.`:"",f=[...x.map(S=>`Improve "${S.criterion}" (score: ${S.score.toFixed(2)})`),...h.map(S=>`Strengthen "${S.criterion}" (score: ${S.score.toFixed(2)})`)];return f.length===0&&f.push("Review prompt instructions and add more specific guidance"),{explanation:`${i} (score ${o.toFixed(2)}): evaluation did not meet expectations.${y}`,recommendations:f}}if(i==="INEFFECTIVE"&&o<.2){const y=[...x.map(f=>`Rework "${f.criterion}" — currently at ${f.score.toFixed(2)}`),"Consider adding examples to your system prompt","Review the rubric criteria for achievability"];return{explanation:`${i} (score ${o.toFixed(2)}): evaluation is significantly below expectations.`,recommendations:y}}const m=u.length>0?` Passing: ${u.map(y=>y.criterion).join(", ")}.`:"",N=h.length>0?` Needs improvement: ${h.map(y=>y.criterion).join(", ")}.`:"";return{explanation:`${i} (score ${o.toFixed(2)}): mixed results.${m}${N}`}}function Sv(i,o,c){const[u,x]=v.useState(null),[h,m]=v.useState(!1),N=v.useRef("");v.useEffect(()=>{const f=`${i}/${o}/${c}`;N.current!==f&&(N.current=f,m(!0),Ne.getCaseHistory(i,o,c).then(S=>x(S)).catch(()=>x([])).finally(()=>m(!1)))},[i,o,c]);const y=v.useCallback(()=>{m(!0),N.current="",Ne.getCaseHistory(i,o,c).then(f=>x(f)).catch(()=>x([])).finally(()=>m(!1))},[i,o,c]);return{entries:u,loading:h,refetch:y}}function Nv(i,o,c){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!c||c.length===0)return u;const h=c.slice(0,10).map(y=>y.assertions.find(f=>f.id===i)).filter(Boolean);if(h.length>=2){const f=h.filter(S=>S.pass).length/h.length;f>=.3&&f<=.7&&(u.flaky=!0)}const m=c.find(y=>y.type==="benchmark"),N=c.find(y=>y.type==="baseline");if(m&&N){const y=m.assertions.find(S=>S.id===i),f=N.assertions.find(S=>S.id===i);y!=null&&y.pass&&(f!=null&&f.pass)&&(u.nonDiscriminating=!0)}if(o&&!o.pass&&c.length>=1){const f=c[0].assertions.find(S=>S.id===i);f!=null&&f.pass&&(u.regression=!0)}return u}function Ev(){var ye;const{state:i,dispatch:o,saveEvals:c,runCase:u,runAll:x,cancelCase:h,cancelAll:m,generateEvals:N,isReadOnly:y}=ll(),{evals:f,evalsError:S,selectedCaseId:g,inlineResults:T,caseRunStates:z,generateEvalsLoading:B,generateEvalsProgress:q,generateEvalsError:Y}=i,J=v.useMemo(()=>{for(const D of z.values())if(D.status==="running"||D.status==="queued")return!0;return!1},[z]),[P,ne]=v.useState(!1),[V,I]=v.useState("all"),Q={skill_name:i.skill,evals:[]},Z=f??Q,ee=Z.evals,me=V==="all"?ee:ee.filter(D=>Pn(D)===V),Ce=me.find(D=>D.id===g)??null,_e=v.useCallback(()=>{N()},[N]);return!f||me.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:S?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:S?n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--error, #f87171)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsx("div",{className:"text-center",children:S?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),n.jsx("div",{className:"text-[11px] font-mono px-3 py-2 rounded mt-1 max-w-sm text-left break-words",style:{color:"var(--text-secondary)",background:"var(--surface-2)"},children:S}),n.jsx("div",{className:"text-[12px] mt-2",style:{color:"var(--text-tertiary)"},children:"Fix the evals.json file and reload, or regenerate test cases with AI"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>ne(!0),disabled:y,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:_e,disabled:B||y,className:"btn btn-secondary text-[12px]",children:B?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),B&&q.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(es,{entries:q,isRunning:!0})}),Y&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Er,{error:Y,onRetry:_e})}),P&&n.jsx(Cx,{evals:Z,onSave:D=>{c(D),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 (",me.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:J?n.jsx("button",{onClick:m,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>x("benchmark"),disabled:me.length===0||y,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>x("comparison"),disabled:me.length===0||y,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"flex px-3 py-1.5 gap-1",style:{borderBottom:"1px solid var(--border-subtle)"},children:["all","unit","integration"].map(D=>n.jsx("button",{onClick:()=>I(D),style:{padding:"2px 8px",fontSize:10,fontWeight:V===D?600:400,background:V===D?"var(--accent-muted)":"transparent",color:V===D?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer",textTransform:"capitalize"},children:D==="all"?`All (${ee.length})`:D==="unit"?`Unit (${ee.filter(se=>Pn(se)==="unit").length})`:`Integration (${ee.filter(se=>Pn(se)==="integration").length})`},D))}),n.jsx("div",{className:"py-1",children:me.map(D=>{const se=T.get(D.id),fe=g===D.id,k=Pn(D);return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:D.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:fe?"var(--accent-muted)":"transparent",borderLeft:fe?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:_=>{fe||(_.currentTarget.style.background="var(--surface-2)")},onMouseLeave:_=>{fe||(_.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate flex items-center gap-1.5",style:{color:fe?"var(--text-primary)":"var(--text-secondary)"},children:["#",D.id," ",D.name,n.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:9999,background:k==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:k==="unit"?"#6383ff":"#fb923c",whiteSpace:"nowrap"},children:k==="unit"?"Unit":"Integration"})]}),n.jsx(Kx,{result:se})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[D.assertions.length," assertion",D.assertions.length!==1?"s":"",(se==null?void 0:se.passRate)!=null&&n.jsx(Cv,{passRate:se.passRate})]})]},D.id)})}),n.jsx("div",{className:"px-3 py-2",children:!y&&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:D=>{D.currentTarget.style.borderColor="var(--accent)",D.currentTarget.style.color="var(--accent)"},onMouseLeave:D=>{D.currentTarget.style.borderColor="var(--border-default)",D.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:Ce?n.jsx(kv,{evalCase:Ce,result:T.get(Ce.id),evals:f,caseStatus:((ye=z.get(Ce.id))==null?void 0:ye.status)??"idle",onSaveEvals:c,onRun:D=>u(D,"benchmark"),onCompare:D=>u(D,"comparison"),onCancel:D=>h(D),onImprove:D=>o({type:"OPEN_IMPROVE",evalId:D})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),P&&n.jsx(Cx,{evals:Z,onSave:D=>{c(D),ne(!1)},onCancel:()=>ne(!1)})]})}function kv({evalCase:i,result:o,evals:c,caseStatus:u,onSaveEvals:x,onRun:h,onCompare:m,onCancel:N,onImprove:y}){const{state:f,isReadOnly:S}=ll(),{plugin:g,skill:T}=f,{entries:z,loading:B}=Sv(g,T,i.id),[q,Y]=v.useState(!1),[J,P]=v.useState(i.prompt),[ne,V]=v.useState(!1),[I,Q]=v.useState(i.expected_output);v.useState(()=>{P(i.prompt),Q(i.expected_output)});const Z=v.useCallback(K=>{x({...c,evals:c.evals.map(ue=>ue.id===K.id?K:ue)})},[c,x]),ee=v.useCallback(()=>{Z({...i,prompt:J}),Y(!1)},[i,J,Z]),me=v.useCallback(()=>{Z({...i,expected_output:I}),V(!1)},[i,I,Z]),Ce=v.useCallback(()=>{Z({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,Z]),_e=v.useCallback((K,ue)=>{Z({...i,assertions:i.assertions.map(b=>b.id===K?{...b,text:ue}:b)})},[i,Z]),ye=v.useCallback(K=>{Z({...i,assertions:i.assertions.filter(ue=>ue.id!==K)})},[i,Z]),D=v.useCallback(()=>{confirm("Delete this test case?")&&x({...c,evals:c.evals.filter(K=>K.id!==i.id)})},[c,i.id,x]),se=o&&o.assertions.length>0&&o.assertions.every(K=>K.pass),fe=o&&o.assertions.some(K=>!K.pass),k=Pn(i),_=i.requiredCredentials??[],W=k==="integration"&&_.length>0;return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:9999,background:k==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:k==="unit"?"#6383ff":"#fb923c"},children:k==="unit"?"Unit":"Integration"}),n.jsx(Kx,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>N(i.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>h(i.id),disabled:S,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>m(i.id),disabled:S,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),fe&&!S&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>y(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!S&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:D,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"})]})})]})]}),se&&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"})]}),W&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl",style:{background:"rgba(251,146,60,0.1)",border:"1px solid rgba(251,146,60,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"Required Credentials"})]}),n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:"This integration test requires the following environment variables:"}),n.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:_.map(K=>n.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono, monospace)",padding:"2px 6px",borderRadius:4,background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:K},K))})]}),n.jsx(yr,{title:"Prompt",children:q?n.jsxs("div",{children:[n.jsx("textarea",{value:J,onChange:K=>P(K.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:ee,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{P(i.prompt),Y(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:S?"default":"pointer"},onClick:()=>{S||Y(!0)},onMouseEnter:K=>{S||(K.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:K=>{K.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:S?"No prompt":"Click to edit prompt..."})})}),n.jsx(yr,{title:"Expected Output",children:ne?n.jsxs("div",{children:[n.jsx("textarea",{value:I,onChange:K=>Q(K.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:me,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{Q(i.expected_output),V(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:S?"default":"pointer"},onClick:()=>{S||V(!0)},onMouseEnter:K=>{S||(K.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:K=>{K.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:S?"No expected output":"Click to edit expected output..."})})}),n.jsx(yr,{title:`Assertions (${i.assertions.length})`,action:S?void 0:n.jsx("button",{onClick:Ce,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:i.assertions.length===0?n.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):n.jsx("div",{className:"space-y-2",children:i.assertions.map(K=>{const ue=o==null?void 0:o.assertions.find(M=>M.assertion_id===K.id),b=Nv(K.id,ue,z);return n.jsx(Tv,{assertion:K,result:ue,badges:b,isReadOnly:S,onUpdate:M=>_e(K.id,M),onDelete:()=>ye(K.id)},K.id)})})}),(o==null?void 0:o.output)&&n.jsx(wv,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),o&&o.passRate!=null&&o.passRate<.2&&(()=>{const K=Zx("INEFFECTIVE",o.passRate);return K.recommendations&&K.recommendations.length>0?n.jsx(yr,{title:"Recommendations",children:n.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(251,146,60,0.08)",border:"1px solid rgba(251,146,60,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"This eval is significantly below expectations"})]}),n.jsx("ul",{className:"space-y-1.5 ml-1",children:K.recommendations.map((ue,b)=>n.jsxs("li",{className:"flex items-start gap-2 text-[12px]",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"#fb923c",fontWeight:600,flexShrink:0},children:"•"}),ue]},b))})]})}):null})(),n.jsx(Av,{evalId:i.id,sharedEntries:z,sharedLoading:B})]},i.id)}function Tv({assertion:i,result:o,badges:c,isReadOnly:u,onUpdate:x,onDelete:h}){const[m,N]=v.useState(!1),[y,f]=v.useState(i.text),[S,g]=v.useState(!1),T=()=>{x(y),N(!1)};return n.jsx("div",{className:"rounded-lg px-3 py-2.5 transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:n.jsxs("div",{className:"flex items-start gap-2",children:[o?n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.pass?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,border:"1.5px dashed var(--text-tertiary)",background:"transparent"},title:"Not run yet"}),(c==null?void 0:c.regression)&&n.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(c==null?void 0:c.flaky)&&n.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(c==null?void 0:c.nonDiscriminating)&&n.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),m?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:y,onChange:z=>f(z.target.value),onKeyDown:z=>{z.key==="Enter"&&T(),z.key==="Escape"&&N(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:T,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:u?"default":"pointer"},onClick:()=>{u||(f(i.text),N(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>g(!S),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:S?"Hide reasoning":"Show reasoning"}),S&&(o==null?void 0:o.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:o.reasoning})]}),!u&&n.jsx("button",{onClick:h,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:z=>{z.currentTarget.style.color="var(--red)",z.currentTarget.style.opacity="1"},onMouseLeave:z=>{z.currentTarget.style.color="var(--text-tertiary)",z.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 yr({title:i,action:o,children:c}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),o]}),c]})}function Kx({result:i}){const[o,c]=v.useState(!1);if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const u=i.status==="pass",x=i.passRate??0,m=Zx(u?"PASS":"FAIL",x);return n.jsxs("span",{className:"pill text-[10px]",style:{background:u?"var(--green-muted)":"var(--red-muted)",color:u?"var(--green)":"var(--red)",position:"relative",cursor:"default"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),"aria-describedby":o?"verdict-tooltip":void 0,children:[i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status,o&&n.jsx("div",{id:"verdict-tooltip",role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,padding:"6px 10px",background:"var(--surface-4)",border:"1px solid var(--border-subtle)",borderRadius:6,fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap",zIndex:50,maxWidth:300,width:"max-content",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:m.explanation})]})}function Cv({passRate:i}){const o=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${o}%`,background:o>=80?"var(--green)":o>=50?"var(--yellow)":"var(--red)"}})})})}function wv({output:i,durationMs:o,tokens:c}){const[u,x]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>x(!u),className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:u?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",o!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(o/1e3).toFixed(1),"s)"]}),c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",c," tokens)"]})]}),u&&n.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})]})}function Xc(i){return i==="baseline"?"right":i==="comparison"?"full":"left"}function Zc({entry:i}){return n.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Vx(i.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:i.type==="benchmark"?"rgba(99,131,255,0.15)":i.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:i.type==="benchmark"?"#6383ff":i.type==="comparison"?"var(--purple)":"#fb923c"},children:i.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:to(i.pass_rate)},children:[Math.round(i.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[i.durationMs!=null&&n.jsx("span",{children:Qx(i.durationMs)}),i.tokens!=null&&n.jsxs("span",{children:[i.tokens>=1e3?`${(i.tokens/1e3).toFixed(1)}k`:i.tokens," tok"]})]}),i.type==="comparison"&&i.baselinePassRate!=null&&(()=>{const o=i.pass_rate-i.baselinePassRate,c=o>.001?"skill":o<-.001?"baseline":"tie",u=o>0?"+":"",x=c==="skill"?"var(--green)":c==="baseline"?"var(--red)":"var(--text-tertiary)";return n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:o>=0?"var(--green)":"var(--red)"},children:[u,(o*100).toFixed(1),"%"]}),n.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:x},children:c})]})})(),n.jsx("div",{className:"space-y-0.5",children:i.assertions.map(o=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:o.pass?"var(--green-muted)":"var(--red-muted)"},children:o.pass?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:o.text})]},o.id))})]})}function Av({evalId:i,sharedEntries:o,sharedLoading:c}){const{state:u,dispatch:x}=ll(),{plugin:h,skill:m}=u,[N,y]=v.useState(!0),f=o??null,S=c??!1,g=v.useCallback(()=>{y(q=>!q)},[]),T=f?f.slice(0,10):[],z=T.some(q=>{const Y=Xc(q.type);return Y==="left"||Y==="full"}),B=T.some(q=>{const Y=Xc(q.type);return Y==="right"||Y==="full"});return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:g,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:N?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),N&&n.jsx("div",{className:"animate-fade-in",children:S?n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?n.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):n.jsxs("div",{children:[T.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Xx,{entries:T})}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!z&&n.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!B&&n.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((q,Y)=>{const J=Xc(q.type);return J==="full"?n.jsx("div",{style:{gridColumn:"1 / -1"},children:n.jsx(Zc,{entry:q})},Y):J==="left"?n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"},children:n.jsx(Zc,{entry:q})}),n.jsx("div",{style:{gridColumn:"2"}})]},Y):n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"}}),n.jsx("div",{style:{gridColumn:"2"},children:n.jsx(Zc,{entry:q})})]},Y)})]}),n.jsx("button",{onClick:()=>x({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:q=>{q.currentTarget.style.textDecoration="underline"},onMouseLeave:q=>{q.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function Cx({evals:i,onSave:o,onCancel:c}){const[u,x]=v.useState(""),[h,m]=v.useState(""),[N,y]=v.useState(""),[f,S]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),g=Math.max(0,...i.evals.map(z=>z.id))+1,T=()=>{if(!u.trim()||!h.trim())return;const z={id:g,name:u.trim(),prompt:h.trim(),expected_output:N.trim(),files:[],assertions:f.filter(B=>B.text.trim())};o({...i,evals:[...i.evals,z]})};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:n.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:u,onChange:z=>x(z.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:h,onChange:z=>m(z.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:N,onChange:z=>y(z.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((z,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:z.text,onChange:q=>S(f.map((Y,J)=>J===B?{...Y,text:q.target.value}:Y)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>S(f.filter((q,Y)=>Y!==B)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},z.id)),n.jsx("button",{onClick:()=>S([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:c,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:T,disabled:!u.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function _v(i,o){const c=i+o,u=c*10,x=c*25,h=m=>m>=60?`${Math.round(m/60)}m`:`${m}s`;return`${h(u)}–${h(x)}`}function Rv(){const{state:i,runCase:o,runAll:c,cancelCase:u,cancelAll:x,isReadOnly:h}=ll(),{evals:m,caseRunStates:N,bulkRunActive:y,latestBenchmark:f,inlineResults:S}=i,g=(m==null?void 0:m.evals)??[],T=v.useMemo(()=>{for(const V of N.values())if(V.status==="running"||V.status==="queued")return!0;return!1},[N]),z=g.filter(V=>{const I=N.get(V.id);return I&&(I.status==="complete"||I.status==="error"||I.status==="cancelled")}).length,B=g.filter(V=>{const I=N.get(V.id);return I&&(I.status==="running"||I.status==="queued")}).length,q=v.useRef(null),[Y,J]=v.useState(0);v.useEffect(()=>{if(T&&!q.current&&(q.current=Date.now()),!T){q.current=null,J(0);return}const V=setInterval(()=>{q.current&&J(Math.round((Date.now()-q.current)/1e3))},1e3);return()=>clearInterval(V)},[T]);const P=g.reduce((V,I)=>V+I.assertions.length,0),ne=v.useMemo(()=>_v(g.length,P),[g.length,P]);return n.jsxs("div",{className:"p-5",children:[h&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-4 text-[11px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),n.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),T&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[B," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T&&n.jsxs("button",{onClick:x,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>c("comparison"),disabled:g.length===0||T||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>c("benchmark"),disabled:g.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>c("baseline"),disabled:g.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&g.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",z,"/",g.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(z/g.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${z/g.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",Y>=60?`${Math.floor(Y/60)}m ${Y%60}s`:`${Y}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ne]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:g.map(V=>{const I=S.get(V.id),Q=N.get(V.id),Z=(Q==null?void 0:Q.status)??"idle";return n.jsx(zv,{name:V.name,evalId:V.id,result:I,caseStatus:Z,runMode:(Q==null?void 0:Q.mode)??null,isReadOnly:h,onRun:ee=>o(ee,"benchmark"),onBaseline:ee=>o(ee,"baseline"),onCompare:ee=>o(ee,"comparison"),onCancel:ee=>u(ee)},V.id)})}),!T&&f&&f.cases.length>0&&n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),n.jsx("span",{className:"text-[20px] font-bold",style:{color:(f.overall_pass_rate??0)>=.8?"var(--green)":(f.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:f.overall_pass_rate!=null?`${Math.round(f.overall_pass_rate*100)}%`:"--"})]}),f.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(f.totalDurationMs/1e3).toFixed(1),"s",f.model&&` | Model: ${f.model}`]}),f.overall_pass_rate===1&&!f.comparison&&n.jsx("button",{onClick:()=>c("comparison"),disabled:g.length===0||h,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:g.length===0?.5:1},children:"Run Final A/B Comparison"})]}),f.comparison&&n.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(wx,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(wx,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:f.comparison.delta>0?"var(--green)":f.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",f.comparison.delta>0?"+":"",(f.comparison.delta*100).toFixed(1),"%",f.verdict&&` | ${f.verdict}`]})]})]})]})}const Mv={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 zv({name:i,evalId:o,result:c,caseStatus:u,runMode:x,isReadOnly:h,onRun:m,onBaseline:N,onCompare:y,onCancel:f}){const[S,g]=v.useState(!1),T=u==="running"||u==="queued",z=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:T?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:T?"0 0 12px rgba(99, 131, 255, 0.15)":"none"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),u==="queued"&&n.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),n.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",o," ",i]}),x&&(T||z)&&(()=>{const B=Mv[x];return B?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:B.bg,color:B.color,padding:"1px 6px"},children:B.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T?n.jsx("button",{onClick:()=>f(o),className:"btn text-[10px] px-2 py-1",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>y(o),disabled:h,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>m(o),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>N(o),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),c&&c.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:c.status==="pass"?"var(--green-muted)":(c.status==="error","var(--red-muted)"),color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.passRate!=null?`${Math.round(c.passRate*100)}%`:c.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),c&&c.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:c.assertions.map(B=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:B.pass?"var(--green)":"var(--red)"},children:B.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:B.text})]},B.assertion_id))}),c.output&&n.jsx("button",{onClick:()=>g(!S),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:S?"Hide output":"Show output"}),S&&c.output&&n.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:c.output})]}),c&&c.errorMessage&&n.jsx(Lv,{errorMessage:c.errorMessage,classifiedError:c.classifiedError})]})}const Kc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Lv({errorMessage:i,classifiedError:o}){const[c,u]=v.useState(!1),x=(o==null?void 0:o.title)??"Error",h=o==null?void 0:o.hint,m=o?Kc[o.category]??Kc.unknown:Kc.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:m}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:x}),n.jsx("button",{onClick:()=>u(!c),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:c?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),c&&n.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:i})]})})}function wx({label:i,value:o,color:c}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:c},children:[Math.round(o*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${o*100}%`,background:c}})})]})}const Ax={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)"}},Ov=[{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 Dv(){const{state:i,dispatch:o,runActivationTest:c,cancelActivation:u}=ll(),{plugin:x,skill:h,activationPrompts:m,activationResults:N,activationSummary:y,activationRunning:f,activationError:S,activationStartedAt:g}=i,[T,z]=v.useState(m),[B,q]=v.useState(null);v.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:T})},[T,o]),v.useEffect(()=>{fetch(`/api/skills/${x}/${h}/description`).then(Q=>Q.json()).then(Q=>q(Q.rawContent||Q.description||null)).catch(()=>q(null))},[x,h]);function Y(){c(T)}function J(Q){const Z=T.trim(),ee=Z?`${Z}
61
- ${Q.join(`
62
- `)}`:Q.join(`
63
- `);z(ee)}const P=T.trim().split(`
64
- `).filter(Boolean).length,ne=N.filter(Q=>Q.classification==="TP"||Q.classification==="TN"),V=N.filter(Q=>Q.classification==="FP"||Q.classification==="FN"),I=(B==null?void 0:B.replace(/^---[\s\S]*?---\s*/,"").trim())??null;return n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-0.5",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[n.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:Ov.map(Q=>n.jsxs("button",{onClick:()=>J(Q.prompts),className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},onMouseEnter:Z=>{Z.currentTarget.style.color="var(--text-primary)",Z.currentTarget.style.background="var(--surface-3)"},onMouseLeave:Z=>{Z.currentTarget.style.color="var(--text-tertiary)",Z.currentTarget.style.background="var(--surface-2)"},children:["+ ",Q.label]},Q.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:T,onChange:Q=>z(Q.target.value),placeholder:`How do I write a unit test?
65
- What edge cases should I test?
66
- +Deploy this to production
67
- !What's the weather like today?
68
- !Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx(gr,{}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsx(gr,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),n.jsx(gr,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),n.jsx(gr,{}),n.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[P," prompt",P!==1?"s":""]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Y,disabled:f||!T.trim(),className:"btn btn-primary",children:f?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})}),f&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[N.length," / ",P," prompts tested",g&&n.jsx(Bv,{startedAt:g})]})]})]})]}),n.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[n.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),n.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:I?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Sr(I)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),S&&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:S}),f&&N.length===0&&n.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),N.length>0&&n.jsxs("div",{className:"space-y-5",children:[V.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 (",V.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:V.map((Q,Z)=>n.jsx(_x,{result:Q},`incorrect-${Z}`))})]}),ne.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 (",ne.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:ne.map((Q,Z)=>n.jsx(_x,{result:Q},`correct-${Z}`))})]})]}),y&&n.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),y.autoClassifiedCount!=null&&y.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[y.autoClassifiedCount," of ",y.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx($c,{label:"Precision",value:y.precision,description:"Of all activations, how many were correct?",detail:`${y.tp} true / ${y.tp+y.fp} total activations`}),n.jsx($c,{label:"Recall",value:y.recall,description:"Of expected activations, how many fired?",detail:`${y.tp} activated / ${y.tp+y.fn} expected`}),n.jsx($c,{label:"Reliability",value:y.reliability,description:"Overall correct classification rate",detail:`${y.tp+y.tn} correct / ${y.total} total`})]}),n.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[n.jsx(br,{label:"True Positive",abbr:"TP",count:y.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(br,{label:"False Positive",abbr:"FP",count:y.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(br,{label:"False Negative",abbr:"FN",count:y.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(br,{label:"True Negative",abbr:"TN",count:y.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]})]})}function gr(){return n.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function _x({result:i}){const o=Ax[i.classification]||Ax.FN,c=i.classification==="TP"||i.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:o.bg,border:"1px solid transparent"},children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:`color-mix(in srgb, ${o.text} 20%, transparent)`},children:c?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:o.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:o.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:i.prompt})}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[n.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:o.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:i.classification}),n.jsx("span",{style:{color:i.activate?"var(--green)":"var(--text-tertiary)"},children:i.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",i.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[i.confidence," confidence"]}),i.autoClassified&&n.jsx("span",{className:"pill",style:{background:"rgba(139,92,246,0.1)",color:"rgba(139,92,246,0.8)",fontSize:"9px",padding:"1px 5px"},children:"auto"})]}),i.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:i.reasoning})]})]})}function $c({label:i,value:o,description:c,detail:u}){const x=Math.round(o*100),h=x>=80?"var(--green)":x>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:h},children:[x,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:c}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function br({abbr:i,count:o,bg:c,color:u,description:x}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:c},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:o}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:u},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:x})]})}function Bv({startedAt:i}){const[o,c]=v.useState(0);return v.useEffect(()=>{const u=setInterval(()=>c(Math.floor((Date.now()-i)/1e3)),1e3);return()=>clearInterval(u)},[i]),n.jsxs("span",{className:"ml-2",children:["(",o,"s)"]})}const Jc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},Rx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},lo=600,ao=180,vt=40,Wc=lo-vt*2,Kl=ao-vt*2,Uv=[25,50,75,100];function Mx(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Hv(i){return i==null?"--":`${(i/1e3).toFixed(1)}s`}function qv({entries:i,onPointClick:o}){const[c,u]=v.useState(null),x=v.useMemo(()=>[...i].reverse(),[i]);if(x.length<2)return null;const h=x.length,m=x.map((f,S)=>{const g=vt+S/(h-1)*Wc,T=f.passRate*100,z=vt+Kl-T/100*Kl;return{x:g,y:z,pct:T,entry:f}}),N=m.map(f=>`${f.x},${f.y}`).join(" "),y=Array.from(new Set(x.map(f=>f.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative",overflowX:h>=20?"auto":void 0},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:y.map(f=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Jc[f]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Rx[f]??f})]},f))}),n.jsxs("svg",{width:lo,height:ao,viewBox:`0 0 ${lo} ${ao}`,style:{display:"block",overflow:"visible"},children:[Uv.map(f=>{const S=vt+Kl-f/100*Kl;return n.jsxs("g",{children:[n.jsx("line",{x1:vt,y1:S,x2:vt+Wc,y2:S,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:vt-8,y:S+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[f,"%"]})]},f)}),n.jsx("line",{x1:vt,y1:vt+Kl,x2:vt+Wc,y2:vt+Kl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:vt-8,y:vt+Kl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:N,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),m.map((f,S)=>n.jsx("circle",{cx:f.x,cy:f.y,r:5,fill:Jc[f.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:g=>{g.currentTarget.setAttribute("r","7"),u({x:f.x,y:f.y,entry:f.entry})},onMouseLeave:g=>{g.currentTarget.setAttribute("r","5"),u(null)},onClick:()=>o==null?void 0:o(f.entry)},S)),Gv(h).map(f=>n.jsx("text",{x:m[f].x,y:vt+Kl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:Mx(x[f].timestamp)},f))]}),c&&n.jsxs("div",{style:{position:"absolute",left:c.x,top:c.y-12,transform:"translate(-50%, -100%)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"8px 12px",pointerEvents:"none",zIndex:10,whiteSpace:"nowrap"},children:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:Mx(c.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:c.entry.model}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Jc[c.entry.type]??"var(--text-tertiary)",color:"#fff"},children:Rx[c.entry.type]??c.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(c.entry.passRate*100),"%"]})]}),n.jsxs("div",{className:"text-[10px] mt-1.5 flex items-center gap-3",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:Hv(c.entry.totalDurationMs)}),n.jsx("span",{children:c.entry.totalTokens!=null?`${c.entry.totalTokens} tokens`:"--"})]})]})]})}function Gv(i){if(i<=3)return Array.from({length:i},(u,x)=>x);if(i<=6)return[0,Math.floor(i/2),i-1];if(i<20)return[0,Math.floor(i/3),Math.floor(2*i/3),i-1];const o=Math.ceil(i/10),c=[0];for(let u=o;u<i-1;u+=o)c.push(u);return c.push(i-1),c}function jr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Yv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function Vv({rate:i,label:o}){const c=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:o}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:jr(i)},children:[c,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,background:jr(i)}})})]})})}function Qv({points:i}){if(i.length<2)return null;const o=200,c=48,u=4,x=i.length,h=i.map((y,f)=>{const S=u+f/(x-1)*(o-u*2),g=u+(c-u*2)-y.passRate*(c-u*2);return{x:S,y:g}}),m=`M ${h[0].x},${c-u} `+h.map(y=>`L ${y.x},${y.y}`).join(" ")+` L ${h[h.length-1].x},${c-u} Z`,N=h.map((y,f)=>`${f===0?"M":"L"} ${y.x},${y.y}`).join(" ");return n.jsxs("svg",{width:o,height:c,style:{display:"block"},children:[n.jsx("path",{d:m,fill:"var(--accent-muted)"}),n.jsx("path",{d:N,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:h[h.length-1].x,cy:h[h.length-1].y,r:3,fill:"var(--accent)"})]})}function Xv({plugin:i,skill:o}){const[c,u]=v.useState(null),[x,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),Ne.getStats(i,o).then(u).catch(()=>u(null)).finally(()=>h(!1))},[i,o]),x)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!c||c.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const m=c.trendPoints.length>0?c.trendPoints[c.trendPoints.length-1].passRate:0,N=c.trendPoints.length>0?c.trendPoints[0].passRate:0,y=m-N,f=c.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:c.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:jr(m)},children:[Math.round(m*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:y>=0?"var(--green)":"var(--red)"},children:[y>=0?"+":"",Math.round(y*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:c.modelStats.length})]})]}),c.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(Qv,{points:c.trendPoints})]}),c.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:c.modelStats.map(S=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:S.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:S.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:jr(S.avgPassRate)},children:[Math.round(S.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Yv(S.avgDurationMs)})]},S.model))})]})]}),f.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),n.jsx("div",{className:"space-y-3",children:f.map(S=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:g=>{g.currentTarget.style.background="var(--surface-2)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",S.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:S.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[S.totalRuns," runs"]})]}),n.jsx(Vv,{rate:S.passRate,label:S.text})]},`${S.evalId}:${S.id}`))})]})]})}function Zv({plugin:i,skill:o}){const[c,u]=v.useState(null),[x,h]=v.useState(null),[m,N]=v.useState({}),[y,f]=v.useState({});v.useEffect(()=>{Ne.getEvals(i,o).then(u).catch(()=>u(null))},[i,o]);async function S(g){if(x===g){h(null);return}if(h(g),!m[g]){f(T=>({...T,[g]:!0}));try{const T=await Ne.getCaseHistory(i,o,g);N(z=>({...z,[g]:T}))}catch{N(T=>({...T,[g]:[]}))}finally{f(T=>({...T,[g]:!1}))}}}return c?n.jsx("div",{className:"space-y-2 stagger-children",children:c.evals.map(g=>{const T=m[g.id]||[],z=x===g.id,B=y[g.id],q=T.length>0?T[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>S(g.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:z?"var(--surface-2)":"transparent"},onMouseEnter:Y=>{z||(Y.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Y=>{z||(Y.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:z?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",g.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name}),T.length>=2&&n.jsx(Xx,{entries:T}),q!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:to(q)},children:[Math.round(q*100),"%"]}),T.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.length," runs"]})]}),z&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:B?n.jsxs("div",{className:"p-4 flex items-center gap-2",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):T.length===0?n.jsx("div",{className:"p-4",children:n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):n.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:T.map((Y,J)=>n.jsxs("div",{className:"p-4",style:{background:J===0?"var(--surface-2)":"transparent"},children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Vx(Y.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Y.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:Y.type==="benchmark"?"rgba(99,131,255,0.15)":Y.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:Y.type==="benchmark"?"#6383ff":Y.type==="comparison"?"var(--purple)":"#fb923c"},children:Y.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:to(Y.pass_rate)},children:[Math.round(Y.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[Y.durationMs!=null&&n.jsx("span",{children:Qx(Y.durationMs)}),Y.tokens!=null&&n.jsxs("span",{children:[Y.tokens>=1e3?`${(Y.tokens/1e3).toFixed(1)}k`:Y.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:Y.assertions.map(P=>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:P.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:P.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:P.text}),P.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:P.reasoning})]})]},P.id))})]},J))})})]},g.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function Kv(){const{state:i,dispatch:o}=ll(),{plugin:c,skill:u}=i,[x,h]=v.useState("timeline"),[m,N]=v.useState([]),[y,f]=v.useState(!0),[S,g]=v.useState(""),[T,z]=v.useState(""),[B,q]=v.useState(!1),[Y,J]=v.useState([]),[P,ne]=v.useState(null),[V,I]=v.useState(!1),[Q,Z]=v.useState(null),[ee,me]=v.useState(!1);v.useEffect(()=>{f(!0),Ne.getHistory(c,u,{model:S||void 0,type:T||void 0}).then(D=>{N(D),D.length>=2&&Ne.compareRuns(c,u,D[0].timestamp,D[1].timestamp).then(se=>{const fe=se.regressions.filter(k=>k.change==="regression");o({type:"SET_REGRESSIONS",regressions:fe})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[c,u,S,T]);const Ce=v.useCallback(async D=>{if(B){J(se=>se.includes(D)?se.filter(fe=>fe!==D):se.length>=2?[se[1],D]:[...se,D]);return}me(!0);try{const se=await Ne.getHistoryEntry(c,u,D);Z(se)}catch{}finally{me(!1)}},[c,u,B]),_e=v.useCallback(async()=>{if(Y.length===2){I(!0);try{const D=await Ne.compareRuns(c,u,Y[0],Y[1]);ne(D)}catch{}finally{I(!1)}}},[c,u,Y]),ye=[...new Set(m.map(D=>D.model))];return y?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"skeleton h-12 rounded-lg"}),n.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(D=>n.jsx("button",{onClick:()=>h(D),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:x===D?"var(--accent-muted)":"transparent",color:x===D?"var(--accent)":"var(--text-tertiary)"},children:D==="timeline"?"Timeline":D==="per-eval"?"Per Eval":"Statistics"},D))}),x==="timeline"&&n.jsxs("div",{children:[m.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(qv,{entries:m,onPointClick:D=>Ce(D.timestamp)})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:S,onChange:D=>g(D.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ye.map(D=>n.jsx("option",{value:D,children:D},D))]}),n.jsxs("select",{value:T,onChange:D=>z(D.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"benchmark",children:"Benchmark"}),n.jsx("option",{value:"comparison",children:"Comparison"}),n.jsx("option",{value:"baseline",children:"Baseline"}),n.jsx("option",{value:"model-compare",children:"Model Compare"}),n.jsx("option",{value:"improve",children:"AI Improve"}),n.jsx("option",{value:"instruct",children:"AI Edit"}),n.jsx("option",{value:"ai-generate",children:"AI Generate"}),n.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{q(!B),J([]),ne(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&Y.length===2&&n.jsx("button",{onClick:_e,disabled:V,className:"btn btn-primary text-[12px]",children:V?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:m.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):m.map(D=>{const se=Y.includes(D.timestamp);return n.jsx("button",{onClick:()=>Ce(D.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:se?"var(--accent-muted)":"var(--surface-1)",border:se?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:fe=>{se||(fe.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:fe=>{se||(fe.currentTarget.style.borderColor="var(--border-subtle)")},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:se?"var(--accent)":"var(--border-default)",background:se?"var(--accent)":"transparent"},children:se&&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(D.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:D.type==="comparison"?"var(--purple-muted)":D.type==="baseline"?"var(--surface-3)":D.type==="model-compare"?"rgba(56,189,248,0.15)":D.type==="improve"||D.type==="instruct"?"rgba(168,85,247,0.15)":D.type==="ai-generate"?"rgba(34,197,94,0.15)":D.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:D.type==="comparison"?"var(--purple)":D.type==="baseline"?"var(--text-tertiary)":D.type==="model-compare"?"#38bdf8":D.type==="improve"||D.type==="instruct"?"#a855f7":D.type==="ai-generate"?"#22c55e":D.type==="eval-generate"?"#fb923c":"var(--accent)"},children:D.type==="model-compare"?"model compare":D.type==="improve"?"ai improve":D.type==="instruct"?"ai edit":D.type==="ai-generate"?"ai generate":D.type==="eval-generate"?"eval generate":D.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:D.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:D.passRate>=.8?"var(--green)":D.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(D.passRate*100),"%"]})]})]})},D.timestamp)})}),P&&n.jsx($v,{result:P}),Q&&!B&&n.jsx(Jv,{run:Q,onClose:()=>Z(null)})]}),x==="per-eval"&&n.jsx(Zv,{plugin:c,skill:u}),x==="statistics"&&n.jsx(Xv,{plugin:c,skill:u})]})}function $v({result:i}){const o=i.regressions.filter(u=>u.change==="regression"),c=i.regressions.filter(u=>u.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),o.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",o.length,")"]}),o.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:u.assertionId})," (was passing, now failing)"]},`${u.evalId}-${u.assertionId}`))]}),c.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",c.length,")"]}),c.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(u=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function Jv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Wv,{run:i,onClose:o}):n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(i.timestamp).toLocaleString()]}),n.jsx("button",{onClick:o,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",i.model," | Cases: ",i.cases.length," | Pass Rate: ",i.overall_pass_rate!=null?`${Math.round(i.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:i.cases.map(c=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",c.eval_id," ",c.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:c.status==="pass"?"var(--green)":"var(--red)"},children:c.pass_rate!=null?`${Math.round(c.pass_rate*100)}%`:c.status})]})},c.eval_id))})]})}function Wv({run:i,onClose:o}){var h;const c=v.useMemo(()=>i.improve?Nr(i.improve.original,i.improve.improved):[],[i.improve]),u=v.useMemo(()=>{const m=c.filter(y=>y.type==="added").length,N=c.filter(y=>y.type==="removed").length;return{added:m,removed:N}},[c]),x=v.useMemo(()=>{let m=0,N=0;return c.map(y=>y.type==="removed"?(m++,{...y,origNum:m,newNum:null}):y.type==="added"?(N++,{...y,origNum:null,newNum:N}):(m++,N++,{...y,origNum:m,newNum:N}))},[c]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),n.jsx("button",{onClick:o,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--surface-3)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((h=i.improve)==null?void 0:h.reasoning)&&n.jsxs("div",{className:"mx-4 mt-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.06)",border:"1px solid rgba(168,85,247,0.15)",color:"var(--text-secondary)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),i.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:x.map((m,N)=>n.jsxs("tr",{style:{background:m.type==="added"?"rgba(34,197,94,0.08)":m.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:m.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:m.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:m.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:m.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:m.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:m.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:m.type==="added"?"var(--green)":m.type==="removed"?"var(--red)":"transparent",borderRight:m.type==="added"?"2px solid var(--green)":m.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:m.type==="added"?"+":m.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:m.type==="added"?"var(--green)":m.type==="removed"?"var(--red)":"var(--text-secondary)"},children:m.content||"​"})]},N))})})})]})}function Fv({plugin:i,skill:o}){const[c,u]=v.useState([]),[x,h]=v.useState([]),[m,N]=v.useState(!0),[y,f]=v.useState(null);v.useEffect(()=>{Ne.getDependencies(i,o).then(g=>{u(g.mcpDependencies),h(g.skillDependencies)}).catch(()=>{}).finally(()=>N(!1))},[i,o]);async function S(g,T){try{await navigator.clipboard.writeText(T),f(g),setTimeout(()=>f(null),2e3)}catch{}}return m?null:c.length===0&&x.length===0?n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:c.length+x.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[c.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),c.map(g=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:g.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.transport})]}),n.jsx("button",{onClick:()=>S(g.server,g.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:y===g.server?"var(--green)":"var(--accent)"},children:y===g.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:g.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.matchedTools.map(T=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:T},T))})]},g.server))]}),x.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:x.map(g=>n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:g.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:g.source==="frontmatter"?"frontmatter":"referenced"})]},g.name))})]})]})]})}function Iv(){const{state:i}=ll(),{plugin:o,skill:c}=i,[u,x]=v.useState(null),[h,m]=v.useState(!0);return v.useEffect(()=>{Ne.getDependencies(o,c).then(x).catch(()=>{}).finally(()=>m(!1))},[o,c]),h?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):u?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(Fv,{plugin:o,skill:c})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const Pv=["editor","tests","run","activation","history","deps"];function ey(i){return i!=null&&Pv.includes(i)}function ty(){const{state:i,dispatch:o,saveContent:c,isReadOnly:u}=ll(),{refreshSkills:x,clearSelection:h}=Jl(),m=v.useCallback(async()=>{try{await Ne.deleteSkill(i.plugin,i.skill),x(),h()}catch(f){const S=f instanceof Error?f.message:String(f);o({type:"SET_ERROR",error:`Failed to delete skill: ${S}`})}},[i.plugin,i.skill,x,h,o]);v.useEffect(()=>{const S=new URLSearchParams(window.location.search).get("panel");ey(S)&&S!==i.activePanel&&o({type:"SET_PANEL",panel:S})},[]),v.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const S=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",S)},[i.activePanel]);const N=v.useCallback(f=>{const S=f.ctrlKey||f.metaKey;if(S&&f.key>="1"&&f.key<="6"){f.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(f.key)-1]});return}if(S&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&c();return}},[i.isDirty,c,o]);if(v.useEffect(()=>(window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)),[N]),i.loading)return n.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"spinner spinner-lg"}),n.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const y=Array.from(i.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Qh,{state:i,isReadOnly:u,onDelete:u?void 0:m}),i.error&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"flex-1",children:i.error}),n.jsx("button",{onClick:()=>o({type:"SET_ERROR",error:null}),style:{background:"none",border:"none",cursor:"pointer",color:"var(--red)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsx(Jh,{activePanel:i.activePanel,onPanelChange:f=>o({type:"SET_PANEL",panel:f}),isDirty:i.isDirty,isRunning:y,hasRegressions:i.regressions.length>0,isActivationRunning:i.activationRunning}),n.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[i.activePanel==="editor"&&n.jsx(bv,{}),i.activePanel==="tests"&&n.jsx(Ev,{}),i.activePanel==="run"&&n.jsx(Rv,{}),i.activePanel==="activation"&&n.jsx(Dv,{}),i.activePanel==="history"&&n.jsx(Kv,{}),i.activePanel==="deps"&&n.jsx(Iv,{})]},i.activePanel)})]})}function no(i,o=!0){let c=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(c=c.replace(/^-+|-+$/g,"")),c}function ly(i,o,c,u){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${h}/${c}/skills/${u}/SKILL.md`;case 2:return`${h}/plugins/${c}/skills/${u}/SKILL.md`;case 3:return`${h}/skills/${u}/SKILL.md`}}function ay({onCreated:i,resolveAiConfigOverride:o}){const[c,u]=v.useState("ai"),[x,h]=v.useState(null),[m,N]=v.useState(!0),{config:y}=ln(),[f,S]=v.useState(""),[g,T]=v.useState(3),[z,B]=v.useState(""),[q,Y]=v.useState(""),[J,P]=v.useState(""),[ne,V]=v.useState(""),[I,Q]=v.useState(""),[Z,ee]=v.useState(""),[me,Ce]=v.useState("write"),[_e,ye]=v.useState(!1),[D,se]=v.useState(null),[fe,k]=v.useState(""),[_,W]=v.useState(!1),[K,ue]=v.useState(!1),[b,M]=v.useState(null),[X,F]=v.useState(null),[ie,O]=v.useState([]),$=v.useRef(null),le=v.useRef(null),oe=v.useRef(null),[ke,Je]=v.useState(!1),[yt,st]=v.useState(!1);v.useEffect(()=>{Ne.getProjectLayout().then(he=>{h(he),T(he.suggestedLayout);const Ge=he.detectedLayouts.find(bt=>bt.layout===he.suggestedLayout);Ge!=null&&Ge.existingPlugins.length&&B(Ge.existingPlugins[0])}).catch(()=>{}).finally(()=>N(!1))},[]),v.useEffect(()=>{var he;c==="ai"&&((he=$.current)==null||he.focus())},[c]),v.useEffect(()=>()=>{var he;(he=le.current)==null||he.abort()},[]);const Zt=v.useMemo(()=>{var he;return x?((he=x.detectedLayouts.find(Ge=>Ge.layout===g))==null?void 0:he.existingPlugins)||[]:[]},[x,g]),ft=z==="__new__"?q:z,al=x?ly(x.root,g,ft||"{plugin}",f||"{skill}"):"",ma=v.useMemo(()=>x?x.detectedLayouts.filter(he=>he.layout!==4):[],[x]),gt=v.useMemo(()=>{if(!x)return null;const he=x.detectedLayouts.find(Me=>Me.layout===2&&Me.existingPlugins.length>0),Ge=x.detectedLayouts.find(Me=>Me.layout===1&&Me.existingPlugins.length>0),bt=he||Ge;return bt?{layout:bt.layout,plugins:bt.existingPlugins}:null},[x]),Ft=v.useCallback(()=>{if(o)return o();if(!y)return{provider:"claude-cli",model:"sonnet"};const he=y.provider||"claude-cli";let Ge=y.model||"sonnet";return he==="claude-cli"&&Ge.startsWith("claude-")&&(Ge=Ge.replace("claude-","")),{provider:he,model:Ge}},[y,o]),Kt=v.useCallback(()=>{var he;(he=le.current)==null||he.abort(),W(!1)},[]),Wl=v.useCallback(()=>{M(null),F(null)},[]),an=v.useCallback(async()=>{if(M(null),F(null),O([]),oe.current=null,!fe.trim()){M("Describe what your skill should do");return}W(!0);const he=new AbortController;le.current=he;const{provider:Ge,model:bt}=Ft();try{const Me=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:fe.trim(),provider:Ge,model:bt}),signal:he.signal});if(!Me.ok||!Me.body){let pt=`HTTP ${Me.status}`;try{const Xe=await Me.json();Xe.error&&(pt=Xe.error)}catch{}throw new Error(pt)}const nn=Me.body.getReader(),ha=new TextDecoder;let nl="",xt="";for(;;){const{done:pt,value:Xe}=await nn.read();if(pt)break;nl+=ha.decode(Xe,{stream:!0});const jt=nl.split(`
69
- `);nl=jt.pop()||"";for(const Ze of jt)if(Ze.startsWith("event: "))xt=Ze.slice(7).trim();else if(Ze.startsWith("data: ")){try{const Te=JSON.parse(Ze.slice(6));if(xt==="progress")O(mt=>[...mt,{phase:Te.phase,message:Te.message,timestamp:Date.now()}]);else if(xt==="done"||xt==="complete"){const mt={prompt:fe.trim(),provider:Ft().provider,model:Ft().model,reasoning:Te.reasoning||""};S(Te.name),P(Te.description),V(Te.model||""),Q(Te.allowedTools||""),ee(Te.body),ue(!0),oe.current=mt,u("manual"),g===3&&gt&&st(!0);const va={name:Te.name,plugin:ft||"",layout:g,description:Te.description,model:Te.model||void 0,allowedTools:Te.allowedTools||void 0,body:Te.body,aiMeta:mt};Ne.saveDraft(va).then(()=>{Je(!0)}).catch(()=>{})}else xt==="error"&&(M(Te.message||Te.description||"Unknown error"),Te.category&&F(Te))}catch{}xt=""}}}catch(Me){Me.name!=="AbortError"&&M(Me.message)}finally{W(!1),le.current=null}},[fe,Ft,g,gt,ft]),te=v.useCallback(async()=>{if(se(null),!f.trim()){se("Skill name is required");return}if(!J.trim()){se("Description is required");return}if(g!==3&&!ft.trim()){se("Plugin name is required");return}ye(!0);try{const he=await Ne.createSkill({name:no(f),plugin:ft||"",layout:g,description:J,model:ne||void 0,allowedTools:I||void 0,body:Z,aiMeta:oe.current||void 0});i(he.plugin,he.skill)}catch(he){se(he.message)}finally{ye(!1)}},[f,J,g,ft,ne,I,Z,i]),Oe=v.useCallback(()=>{gt&&(T(gt.layout),B(gt.plugins[0]),st(!1))},[gt]);return{mode:c,setMode:u,layout:x,layoutLoading:m,selectedLayout:g,setSelectedLayout:T,creatableLayouts:ma,availablePlugins:Zt,pathPreview:al,plugin:z,setPlugin:B,newPlugin:q,setNewPlugin:Y,effectivePlugin:ft,name:f,setName:S,description:J,setDescription:P,model:ne,setModel:V,allowedTools:I,setAllowedTools:Q,body:Z,setBody:ee,bodyViewMode:me,setBodyViewMode:Ce,aiPrompt:fe,setAiPrompt:k,generating:_,aiGenerated:K,aiError:b,aiClassifiedError:X,aiProgress:ie,promptRef:$,handleGenerate:an,handleCancelGenerate:Kt,clearAiError:Wl,draftSaved:ke,showPluginRecommendation:yt,setShowPluginRecommendation:st,pluginLayoutInfo:gt,applyPluginRecommendation:Oe,creating:_e,error:D,handleCreate:te}}function $x(){return n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function ny(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Jx({node:i,depth:o=0}){var c;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${o*16}px`,color:i.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[i.type==="dir"?n.jsx($x,{}):n.jsx(ny,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(c=i.children)==null?void 0:c.map(u=>n.jsx(Jx,{node:u,depth:o+1},u.name))]})}function sy(i,o,c){const u=[];o&&u.push({name:"evals.json",type:"file"}),u.push({name:"history",type:"dir"});const x=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:u}];return c&&x.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:x}}function ry({skillName:i,hasEvals:o,isDraft:c}){const u=sy(i,o,c);return n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsx($x,{})}),"Skill Structure"]}),n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:n.jsx(Jx,{node:u})})]})}const $l={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Fc({size:i=14,color:o="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function iy({onCreated:i,onCancel:o}){const c=ay({onCreated:i});return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>c.setMode("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="ai"?"rgba(168,85,247,0.15)":"transparent",color:c.mode==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:c.mode==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Fc,{size:12}),"AI-Assisted"]})}),n.jsx("button",{onClick:()=>c.setMode("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:c.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:c.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:c.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"})]})})]}),c.layoutLoading&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!c.layoutLoading&&c.layout&&c.mode==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Fc,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:c.promptRef,value:c.aiPrompt,onChange:u=>c.setAiPrompt(u.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
70
-
71
- Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:c.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...$l,minHeight:"120px"},onKeyDown:u=>{u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),c.handleGenerate())}}),n.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),c.generating&&c.aiProgress.length>0&&n.jsx(es,{entries:c.aiProgress,isRunning:!0}),c.aiError&&n.jsx("div",{children:c.aiClassifiedError?n.jsx(Er,{error:c.aiClassifiedError,onRetry:c.handleGenerate,onDismiss:c.clearAiError}):n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:c.aiError}),n.jsx("button",{onClick:c.handleGenerate,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[c.generating?n.jsx("button",{onClick:c.handleCancelGenerate,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)",border:"none",cursor:"pointer"},children:"Cancel Generation"}):n.jsxs("button",{onClick:c.handleGenerate,disabled:!c.aiPrompt.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:c.aiPrompt.trim()?"#a855f7":"var(--surface-3)",color:c.aiPrompt.trim()?"#fff":"var(--text-tertiary)",cursor:c.aiPrompt.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Fc,{size:14}),"Generate"]}),n.jsx("button",{onClick:o,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"}),!c.generating&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>c.setMode("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!c.layoutLoading&&c.layout&&c.mode==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),c.creatableLayouts.length>1&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),n.jsx("div",{className:"flex gap-2",children:c.creatableLayouts.map(u=>n.jsx("button",{onClick:()=>{c.setSelectedLayout(u.layout),c.setPlugin(u.existingPlugins[0]||""),c.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:c.selectedLayout===u.layout?"var(--accent)":"var(--surface-3)",color:c.selectedLayout===u.layout?"#fff":"var(--text-secondary)",border:`1px solid ${c.selectedLayout===u.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:u.label},u.layout))})]}),c.selectedLayout!==3&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),n.jsxs("select",{value:c.plugin,onChange:u=>{c.setPlugin(u.target.value),c.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:$l,children:[c.availablePlugins.map(u=>n.jsx("option",{value:u,children:u},u)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),c.plugin==="__new__"&&n.jsx("input",{type:"text",value:c.newPlugin,onChange:u=>c.setNewPlugin(no(u.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:$l})]}),n.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:c.pathPreview})]}),c.showPluginRecommendation&&c.pluginLayoutInfo&&c.selectedLayout===3&&n.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex items-center justify-between gap-3",style:{background:"rgba(59,130,246,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(59,130,246,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),n.jsxs("span",{children:["Plugins detected (",n.jsx("strong",{children:c.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:c.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),n.jsx("button",{onClick:()=>c.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("input",{type:"text",value:c.name,onChange:u=>c.setName(no(u.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:$l})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("textarea",{value:c.description,onChange:u=>c.setDescription(u.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...$l,minHeight:"72px"}})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsxs("select",{value:c.model,onChange:u=>c.setModel(u.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:$l,children:[n.jsx("option",{value:"",children:"Any"}),n.jsx("option",{value:"opus",children:"Opus"}),n.jsx("option",{value:"sonnet",children:"Sonnet"}),n.jsx("option",{value:"haiku",children:"Haiku"})]})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),n.jsx("input",{type:"text",value:c.allowedTools,onChange:u=>c.setAllowedTools(u.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:$l})]})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),n.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(u=>n.jsxs("button",{onClick:()=>c.setBodyViewMode(u),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:c.bodyViewMode===u?"var(--surface-4)":"transparent",color:c.bodyViewMode===u?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:c.bodyViewMode===u?600:400,border:"none",cursor:"pointer"},children:[u==="write"?n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]}):n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),n.jsx("span",{children:u==="write"?"Write":"Preview"})]},u))})]}),c.bodyViewMode==="write"?n.jsx("textarea",{value:c.body,onChange:u=>c.setBody(u.target.value),placeholder:`# /my-skill
72
-
73
- You are an expert at...
74
- `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...$l,minHeight:"150px"}}):c.body.trim()?n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:Sr(c.body)}}):n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},children:n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),n.jsx(ry,{skillName:c.name||"{skill}",hasEvals:!1,isDraft:c.draftSaved}),c.error&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:c.error}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:c.handleCreate,disabled:c.creating||!c.name||!c.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:c.creating||!c.name||!c.description?"var(--surface-3)":"var(--accent)",color:c.creating||!c.name||!c.description?"var(--text-tertiary)":"#fff",cursor:c.creating||!c.name||!c.description?"not-allowed":"pointer",border:"none"},children:c.creating?"Creating...":"Create Skill"}),n.jsx("button",{onClick:o,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})}function cy(){return n.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),n.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),n.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function Ic({variant:i,message:o,onRetry:c}){const{setMode:u,setSearch:x}=Jl(),[h,m]=v.useState(!1);return i==="no-selection"?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[n.jsx("div",{className:"mb-5",children:h?n.jsx(cy,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>m(!0),style:{objectFit:"contain"}})}),n.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):i==="no-skills"?n.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),n.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),n.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",n.jsx("code",{className:"px-1.5 py-0.5 rounded text-[11px]",style:{background:"var(--surface-2)"},children:"--root"})," directory, or create your first skill"]}),n.jsxs("button",{onClick:()=>u("create"),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:"var(--accent)",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:N=>{N.currentTarget.style.opacity="0.9"},onMouseLeave:N=>{N.currentTarget.style.opacity="1"},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):i==="error"?n.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:n.jsxs("div",{className:"px-5 py-4 rounded-lg text-center max-w-sm",style:{background:"var(--red-muted)",border:"1px solid rgba(248,113,113,0.2)"},children:[n.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:o||"Failed to load skill data"}),c&&n.jsx("button",{onClick:c,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>x(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function zx(){const{state:i,setMobileView:o}=Jl();return i.isMobile?n.jsxs("button",{onClick:()=>o("list"),className:"flex items-center gap-1.5 px-3 py-2 text-[12px] font-medium",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"none",borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",width:"100%"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function oy(){const{state:i,selectSkill:o,setMode:c,refreshSkills:u}=Jl();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(zx,{}),n.jsx(iy,{onCreated:(N,y)=>{c("browse"),u(),o({plugin:N,skill:y,origin:"source"})},onCancel:()=>c("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Ic,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Ic,{variant:"no-skills"}):n.jsx(Ic,{variant:"no-selection"});const{plugin:x,skill:h,origin:m}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(zx,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Gh,{plugin:x,skill:h,origin:m,children:n.jsx(ty,{})},`${x}/${h}`)})]})}function uy(){return n.jsx(kh,{children:n.jsx(Sh,{children:n.jsx(Th,{left:n.jsx(zh,{}),right:n.jsx(oy,{})})})})}yh.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(uy,{})}));