vskill 0.4.1 → 0.4.2

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.
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ff;function Jp(){if(Ff)return me;Ff=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),x=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),k=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=k&&S[k]||S["@@iterator"],typeof S=="function"?S:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,$={};function se(S,L,X){this.props=S,this.context=L,this.refs=$,this.updater=X||H}se.prototype.isReactComponent={},se.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},se.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function I(){}I.prototype=se.prototype;function ce(S,L,X){this.props=S,this.context=L,this.refs=$,this.updater=X||H}var Q=ce.prototype=new I;Q.constructor=ce,Z(Q,se.prototype),Q.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var F={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function te(S,L,X){var w=X.ref;return{$$typeof:i,type:S,key:L,ref:w!==void 0?w:null,props:X}}function pe(S,L){return te(S.type,L,S.props)}function Ee(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function he(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(X){return L[X]})}var J=/\/+/g;function oe(S,L){return typeof S=="object"&&S!==null&&S.key!=null?he(""+S.key):L.toString(36)}function Ce(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ne,ne):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function C(S,L,X,w,Y){var V=typeof S;(V==="undefined"||V==="boolean")&&(S=null);var K=!1;if(S===null)K=!0;else switch(V){case"bigint":case"string":case"number":K=!0;break;case"object":switch(S.$$typeof){case i:case o:K=!0;break;case N:return K=S._init,C(K(S._payload),L,X,w,Y)}}if(K)return Y=Y(S),K=w===""?"."+oe(S,0):w,W(Y)?(X="",K!=null&&(X=K.replace(J,"$&/")+"/"),C(Y,L,X,"",function(_t){return _t})):Y!=null&&(Ee(Y)&&(Y=pe(Y,X+(Y.key==null||S&&S.key===Y.key?"":(""+Y.key).replace(J,"$&/")+"/")+K)),L.push(Y)),1;K=0;var fe=w===""?".":w+":";if(W(S))for(var ye=0;ye<S.length;ye++)w=S[ye],V=fe+oe(w,ye),K+=C(w,L,X,V,Y);else if(ye=M(S),typeof ye=="function")for(S=ye.call(S),ye=0;!(w=S.next()).done;)w=w.value,V=fe+oe(w,ye++),K+=C(w,L,X,V,Y);else if(V==="object"){if(typeof S.then=="function")return C(Ce(S),L,X,w,Y);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return K}function z(S,L,X){if(S==null)return S;var w=[],Y=0;return C(S,w,"","",function(V){return L.call(X,V,Y++)}),w}function D(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(X){(S._status===0||S._status===-1)&&(S._status=1,S._result=X)},function(X){(S._status===0||S._status===-1)&&(S._status=2,S._result=X)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var ee=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},de={map:z,forEach:function(S,L,X){z(S,function(){L.apply(this,arguments)},X)},count:function(S){var L=0;return z(S,function(){L++}),L},toArray:function(S){return z(S,function(L){return L})||[]},only:function(S){if(!Ee(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return me.Activity=b,me.Children=de,me.Component=se,me.Fragment=d,me.Profiler=p,me.PureComponent=ce,me.StrictMode=u,me.Suspense=h,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,me.__COMPILER_RUNTIME={__proto__:null,c:function(S){return F.H.useMemoCache(S)}},me.cache=function(S){return function(){return S.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(S,L,X){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var w=Z({},S.props),Y=S.key;if(L!=null)for(V in L.key!==void 0&&(Y=""+L.key),L)!le.call(L,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&L.ref===void 0||(w[V]=L[V]);var V=arguments.length-2;if(V===1)w.children=X;else if(1<V){for(var K=Array(V),fe=0;fe<V;fe++)K[fe]=arguments[fe+2];w.children=K}return te(S.type,Y,w)},me.createContext=function(S){return S={$$typeof:x,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:y,_context:S},S},me.createElement=function(S,L,X){var w,Y={},V=null;if(L!=null)for(w in L.key!==void 0&&(V=""+L.key),L)le.call(L,w)&&w!=="key"&&w!=="__self"&&w!=="__source"&&(Y[w]=L[w]);var K=arguments.length-2;if(K===1)Y.children=X;else if(1<K){for(var fe=Array(K),ye=0;ye<K;ye++)fe[ye]=arguments[ye+2];Y.children=fe}if(S&&S.defaultProps)for(w in K=S.defaultProps,K)Y[w]===void 0&&(Y[w]=K[w]);return te(S,V,Y)},me.createRef=function(){return{current:null}},me.forwardRef=function(S){return{$$typeof:j,render:S}},me.isValidElement=Ee,me.lazy=function(S){return{$$typeof:N,_payload:{_status:-1,_result:S},_init:D}},me.memo=function(S,L){return{$$typeof:m,type:S,compare:L===void 0?null:L}},me.startTransition=function(S){var L=F.T,X={};F.T=X;try{var w=S(),Y=F.S;Y!==null&&Y(X,w),typeof w=="object"&&w!==null&&typeof w.then=="function"&&w.then(ne,ee)}catch(V){ee(V)}finally{L!==null&&X.types!==null&&(L.types=X.types),F.T=L}},me.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},me.use=function(S){return F.H.use(S)},me.useActionState=function(S,L,X){return F.H.useActionState(S,L,X)},me.useCallback=function(S,L){return F.H.useCallback(S,L)},me.useContext=function(S){return F.H.useContext(S)},me.useDebugValue=function(){},me.useDeferredValue=function(S,L){return F.H.useDeferredValue(S,L)},me.useEffect=function(S,L){return F.H.useEffect(S,L)},me.useEffectEvent=function(S){return F.H.useEffectEvent(S)},me.useId=function(){return F.H.useId()},me.useImperativeHandle=function(S,L,X){return F.H.useImperativeHandle(S,L,X)},me.useInsertionEffect=function(S,L){return F.H.useInsertionEffect(S,L)},me.useLayoutEffect=function(S,L){return F.H.useLayoutEffect(S,L)},me.useMemo=function(S,L){return F.H.useMemo(S,L)},me.useOptimistic=function(S,L){return F.H.useOptimistic(S,L)},me.useReducer=function(S,L,X){return F.H.useReducer(S,L,X)},me.useRef=function(S){return F.H.useRef(S)},me.useState=function(S){return F.H.useState(S)},me.useSyncExternalStore=function(S,L,X){return F.H.useSyncExternalStore(S,L,X)},me.useTransition=function(){return F.H.useTransition()},me.version="19.2.4",me}var If;function $c(){return If||(If=1,Rc.exports=Jp()),Rc.exports}var v=$c(),wc={exports:{}},Jn={},Mc={exports:{}},zc={};/**
17
+ */var Ff;function Jp(){if(Ff)return me;Ff=1;var i=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),x=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),k=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=k&&S[k]||S["@@iterator"],typeof S=="function"?S:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,$={};function se(S,L,X){this.props=S,this.context=L,this.refs=$,this.updater=X||H}se.prototype.isReactComponent={},se.prototype.setState=function(S,L){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,L,"setState")},se.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function I(){}I.prototype=se.prototype;function ie(S,L,X){this.props=S,this.context=L,this.refs=$,this.updater=X||H}var G=ie.prototype=new I;G.constructor=ie,Z(G,se.prototype),G.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var F={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function te(S,L,X){var R=X.ref;return{$$typeof:i,type:S,key:L,ref:R!==void 0?R:null,props:X}}function pe(S,L){return te(S.type,L,S.props)}function Ee(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function he(S){var L={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(X){return L[X]})}var J=/\/+/g;function oe(S,L){return typeof S=="object"&&S!==null&&S.key!=null?he(""+S.key):L.toString(36)}function Ce(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ne,ne):(S.status="pending",S.then(function(L){S.status==="pending"&&(S.status="fulfilled",S.value=L)},function(L){S.status==="pending"&&(S.status="rejected",S.reason=L)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function C(S,L,X,R,Y){var Q=typeof S;(Q==="undefined"||Q==="boolean")&&(S=null);var K=!1;if(S===null)K=!0;else switch(Q){case"bigint":case"string":case"number":K=!0;break;case"object":switch(S.$$typeof){case i:case o:K=!0;break;case N:return K=S._init,C(K(S._payload),L,X,R,Y)}}if(K)return Y=Y(S),K=R===""?"."+oe(S,0):R,W(Y)?(X="",K!=null&&(X=K.replace(J,"$&/")+"/"),C(Y,L,X,"",function(Rt){return Rt})):Y!=null&&(Ee(Y)&&(Y=pe(Y,X+(Y.key==null||S&&S.key===Y.key?"":(""+Y.key).replace(J,"$&/")+"/")+K)),L.push(Y)),1;K=0;var fe=R===""?".":R+":";if(W(S))for(var ye=0;ye<S.length;ye++)R=S[ye],Q=fe+oe(R,ye),K+=C(R,L,X,Q,Y);else if(ye=M(S),typeof ye=="function")for(S=ye.call(S),ye=0;!(R=S.next()).done;)R=R.value,Q=fe+oe(R,ye++),K+=C(R,L,X,Q,Y);else if(Q==="object"){if(typeof S.then=="function")return C(Ce(S),L,X,R,Y);throw L=String(S),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return K}function z(S,L,X){if(S==null)return S;var R=[],Y=0;return C(S,R,"","",function(Q){return L.call(X,Q,Y++)}),R}function D(S){if(S._status===-1){var L=S._result;L=L(),L.then(function(X){(S._status===0||S._status===-1)&&(S._status=1,S._result=X)},function(X){(S._status===0||S._status===-1)&&(S._status=2,S._result=X)}),S._status===-1&&(S._status=0,S._result=L)}if(S._status===1)return S._result.default;throw S._result}var ee=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},de={map:z,forEach:function(S,L,X){z(S,function(){L.apply(this,arguments)},X)},count:function(S){var L=0;return z(S,function(){L++}),L},toArray:function(S){return z(S,function(L){return L})||[]},only:function(S){if(!Ee(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return me.Activity=b,me.Children=de,me.Component=se,me.Fragment=d,me.Profiler=p,me.PureComponent=ie,me.StrictMode=u,me.Suspense=h,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,me.__COMPILER_RUNTIME={__proto__:null,c:function(S){return F.H.useMemoCache(S)}},me.cache=function(S){return function(){return S.apply(null,arguments)}},me.cacheSignal=function(){return null},me.cloneElement=function(S,L,X){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var R=Z({},S.props),Y=S.key;if(L!=null)for(Q in L.key!==void 0&&(Y=""+L.key),L)!le.call(L,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&L.ref===void 0||(R[Q]=L[Q]);var Q=arguments.length-2;if(Q===1)R.children=X;else if(1<Q){for(var K=Array(Q),fe=0;fe<Q;fe++)K[fe]=arguments[fe+2];R.children=K}return te(S.type,Y,R)},me.createContext=function(S){return S={$$typeof:x,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:y,_context:S},S},me.createElement=function(S,L,X){var R,Y={},Q=null;if(L!=null)for(R in L.key!==void 0&&(Q=""+L.key),L)le.call(L,R)&&R!=="key"&&R!=="__self"&&R!=="__source"&&(Y[R]=L[R]);var K=arguments.length-2;if(K===1)Y.children=X;else if(1<K){for(var fe=Array(K),ye=0;ye<K;ye++)fe[ye]=arguments[ye+2];Y.children=fe}if(S&&S.defaultProps)for(R in K=S.defaultProps,K)Y[R]===void 0&&(Y[R]=K[R]);return te(S,Q,Y)},me.createRef=function(){return{current:null}},me.forwardRef=function(S){return{$$typeof:j,render:S}},me.isValidElement=Ee,me.lazy=function(S){return{$$typeof:N,_payload:{_status:-1,_result:S},_init:D}},me.memo=function(S,L){return{$$typeof:m,type:S,compare:L===void 0?null:L}},me.startTransition=function(S){var L=F.T,X={};F.T=X;try{var R=S(),Y=F.S;Y!==null&&Y(X,R),typeof R=="object"&&R!==null&&typeof R.then=="function"&&R.then(ne,ee)}catch(Q){ee(Q)}finally{L!==null&&X.types!==null&&(L.types=X.types),F.T=L}},me.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},me.use=function(S){return F.H.use(S)},me.useActionState=function(S,L,X){return F.H.useActionState(S,L,X)},me.useCallback=function(S,L){return F.H.useCallback(S,L)},me.useContext=function(S){return F.H.useContext(S)},me.useDebugValue=function(){},me.useDeferredValue=function(S,L){return F.H.useDeferredValue(S,L)},me.useEffect=function(S,L){return F.H.useEffect(S,L)},me.useEffectEvent=function(S){return F.H.useEffectEvent(S)},me.useId=function(){return F.H.useId()},me.useImperativeHandle=function(S,L,X){return F.H.useImperativeHandle(S,L,X)},me.useInsertionEffect=function(S,L){return F.H.useInsertionEffect(S,L)},me.useLayoutEffect=function(S,L){return F.H.useLayoutEffect(S,L)},me.useMemo=function(S,L){return F.H.useMemo(S,L)},me.useOptimistic=function(S,L){return F.H.useOptimistic(S,L)},me.useReducer=function(S,L,X){return F.H.useReducer(S,L,X)},me.useRef=function(S){return F.H.useRef(S)},me.useState=function(S){return F.H.useState(S)},me.useSyncExternalStore=function(S,L,X){return F.H.useSyncExternalStore(S,L,X)},me.useTransition=function(){return F.H.useTransition()},me.version="19.2.4",me}var If;function $c(){return If||(If=1,Rc.exports=Jp()),Rc.exports}var v=$c(),wc={exports:{}},Jn={},Mc={exports:{}},zc={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var Pf;function $p(){return Pf||(Pf=1,(function(i){function o(C,z){var D=C.length;C.push(z);e:for(;0<D;){var ee=D-1>>>1,de=C[ee];if(0<p(de,z))C[ee]=z,C[D]=de,D=ee;else break e}}function d(C){return C.length===0?null:C[0]}function u(C){if(C.length===0)return null;var z=C[0],D=C.pop();if(D!==z){C[0]=D;e:for(var ee=0,de=C.length,S=de>>>1;ee<S;){var L=2*(ee+1)-1,X=C[L],w=L+1,Y=C[w];if(0>p(X,D))w<de&&0>p(Y,X)?(C[ee]=Y,C[w]=D,ee=w):(C[ee]=X,C[L]=D,ee=L);else if(w<de&&0>p(Y,D))C[ee]=Y,C[w]=D,ee=w;else break e}}return z}function p(C,z){var D=C.sortIndex-z.sortIndex;return D!==0?D:C.id-z.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;i.unstable_now=function(){return y.now()}}else{var x=Date,j=x.now();i.unstable_now=function(){return x.now()-j}}var h=[],m=[],N=1,b=null,k=3,M=!1,H=!1,Z=!1,$=!1,se=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,ce=typeof setImmediate<"u"?setImmediate:null;function Q(C){for(var z=d(m);z!==null;){if(z.callback===null)u(m);else if(z.startTime<=C)u(m),z.sortIndex=z.expirationTime,o(h,z);else break;z=d(m)}}function W(C){if(Z=!1,Q(C),!H)if(d(h)!==null)H=!0,ne||(ne=!0,he());else{var z=d(m);z!==null&&Ce(W,z.startTime-C)}}var ne=!1,F=-1,le=5,te=-1;function pe(){return $?!0:!(i.unstable_now()-te<le)}function Ee(){if($=!1,ne){var C=i.unstable_now();te=C;var z=!0;try{e:{H=!1,Z&&(Z=!1,I(F),F=-1),M=!0;var D=k;try{t:{for(Q(C),b=d(h);b!==null&&!(b.expirationTime>C&&pe());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,k=b.priorityLevel;var de=ee(b.expirationTime<=C);if(C=i.unstable_now(),typeof de=="function"){b.callback=de,Q(C),z=!0;break t}b===d(h)&&u(h),Q(C)}else u(h);b=d(h)}if(b!==null)z=!0;else{var S=d(m);S!==null&&Ce(W,S.startTime-C),z=!1}}break e}finally{b=null,k=D,M=!1}z=void 0}}finally{z?he():ne=!1}}}var he;if(typeof ce=="function")he=function(){ce(Ee)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,oe=J.port2;J.port1.onmessage=Ee,he=function(){oe.postMessage(null)}}else he=function(){se(Ee,0)};function Ce(C,z){F=se(function(){C(i.unstable_now())},z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(C){C.callback=null},i.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<C?Math.floor(1e3/C):5},i.unstable_getCurrentPriorityLevel=function(){return k},i.unstable_next=function(C){switch(k){case 1:case 2:case 3:var z=3;break;default:z=k}var D=k;k=z;try{return C()}finally{k=D}},i.unstable_requestPaint=function(){$=!0},i.unstable_runWithPriority=function(C,z){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var D=k;k=C;try{return z()}finally{k=D}},i.unstable_scheduleCallback=function(C,z,D){var ee=i.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?ee+D:ee):D=ee,C){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=D+de,C={id:N++,callback:z,priorityLevel:C,startTime:D,expirationTime:de,sortIndex:-1},D>ee?(C.sortIndex=D,o(m,C),d(h)===null&&C===d(m)&&(Z?(I(F),F=-1):Z=!0,Ce(W,D-ee))):(C.sortIndex=de,o(h,C),H||M||(H=!0,ne||(ne=!0,he()))),C},i.unstable_shouldYield=pe,i.unstable_wrapCallback=function(C){var z=k;return function(){var D=k;k=z;try{return C.apply(this,arguments)}finally{k=D}}}})(zc)),zc}var em;function Wp(){return em||(em=1,Mc.exports=$p()),Mc.exports}var Oc={exports:{}},ct={};/**
25
+ */var Pf;function $p(){return Pf||(Pf=1,(function(i){function o(C,z){var D=C.length;C.push(z);e:for(;0<D;){var ee=D-1>>>1,de=C[ee];if(0<p(de,z))C[ee]=z,C[D]=de,D=ee;else break e}}function d(C){return C.length===0?null:C[0]}function u(C){if(C.length===0)return null;var z=C[0],D=C.pop();if(D!==z){C[0]=D;e:for(var ee=0,de=C.length,S=de>>>1;ee<S;){var L=2*(ee+1)-1,X=C[L],R=L+1,Y=C[R];if(0>p(X,D))R<de&&0>p(Y,X)?(C[ee]=Y,C[R]=D,ee=R):(C[ee]=X,C[L]=D,ee=L);else if(R<de&&0>p(Y,D))C[ee]=Y,C[R]=D,ee=R;else break e}}return z}function p(C,z){var D=C.sortIndex-z.sortIndex;return D!==0?D:C.id-z.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var y=performance;i.unstable_now=function(){return y.now()}}else{var x=Date,j=x.now();i.unstable_now=function(){return x.now()-j}}var h=[],m=[],N=1,b=null,k=3,M=!1,H=!1,Z=!1,$=!1,se=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,ie=typeof setImmediate<"u"?setImmediate:null;function G(C){for(var z=d(m);z!==null;){if(z.callback===null)u(m);else if(z.startTime<=C)u(m),z.sortIndex=z.expirationTime,o(h,z);else break;z=d(m)}}function W(C){if(Z=!1,G(C),!H)if(d(h)!==null)H=!0,ne||(ne=!0,he());else{var z=d(m);z!==null&&Ce(W,z.startTime-C)}}var ne=!1,F=-1,le=5,te=-1;function pe(){return $?!0:!(i.unstable_now()-te<le)}function Ee(){if($=!1,ne){var C=i.unstable_now();te=C;var z=!0;try{e:{H=!1,Z&&(Z=!1,I(F),F=-1),M=!0;var D=k;try{t:{for(G(C),b=d(h);b!==null&&!(b.expirationTime>C&&pe());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,k=b.priorityLevel;var de=ee(b.expirationTime<=C);if(C=i.unstable_now(),typeof de=="function"){b.callback=de,G(C),z=!0;break t}b===d(h)&&u(h),G(C)}else u(h);b=d(h)}if(b!==null)z=!0;else{var S=d(m);S!==null&&Ce(W,S.startTime-C),z=!1}}break e}finally{b=null,k=D,M=!1}z=void 0}}finally{z?he():ne=!1}}}var he;if(typeof ie=="function")he=function(){ie(Ee)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,oe=J.port2;J.port1.onmessage=Ee,he=function(){oe.postMessage(null)}}else he=function(){se(Ee,0)};function Ce(C,z){F=se(function(){C(i.unstable_now())},z)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(C){C.callback=null},i.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<C?Math.floor(1e3/C):5},i.unstable_getCurrentPriorityLevel=function(){return k},i.unstable_next=function(C){switch(k){case 1:case 2:case 3:var z=3;break;default:z=k}var D=k;k=z;try{return C()}finally{k=D}},i.unstable_requestPaint=function(){$=!0},i.unstable_runWithPriority=function(C,z){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var D=k;k=C;try{return z()}finally{k=D}},i.unstable_scheduleCallback=function(C,z,D){var ee=i.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?ee+D:ee):D=ee,C){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=D+de,C={id:N++,callback:z,priorityLevel:C,startTime:D,expirationTime:de,sortIndex:-1},D>ee?(C.sortIndex=D,o(m,C),d(h)===null&&C===d(m)&&(Z?(I(F),F=-1):Z=!0,Ce(W,D-ee))):(C.sortIndex=de,o(h,C),H||M||(H=!0,ne||(ne=!0,he()))),C},i.unstable_shouldYield=pe,i.unstable_wrapCallback=function(C){var z=k;return function(){var D=k;k=z;try{return C.apply(this,arguments)}finally{k=D}}}})(zc)),zc}var em;function Wp(){return em||(em=1,Mc.exports=$p()),Mc.exports}var Oc={exports:{}},ct={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -38,38 +38,38 @@
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var am;function Pp(){if(am)return Jn;am=1;var i=Wp(),o=$c(),d=Ip();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 p(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function y(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 x(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(y(e)!==e)throw Error(u(188))}function m(e){var t=e.alternate;if(!t){if(t=y(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 h(s),e;if(r===a)return h(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var c=!1,f=s.child;f;){if(f===l){c=!0,l=s,a=r;break}if(f===a){c=!0,a=s,l=r;break}f=f.sibling}if(!c){for(f=r.child;f;){if(f===l){c=!0,l=r,a=s;break}if(f===a){c=!0,a=r,l=s;break}f=f.sibling}if(!c)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 N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,k=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),Ee=Symbol.iterator;function he(e){return e===null||typeof e!="object"?null:(e=Ee&&e[Ee]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case se:return"Profiler";case $:return"StrictMode";case W:return"Suspense";case ne:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case H:return"Portal";case ce:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var Ce=Array.isArray,C=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},ee=[],de=-1;function S(e){return{current:e}}function L(e){0>de||(e.current=ee[de],ee[de]=null,de--)}function X(e,t){de++,ee[de]=e.current,e.current=t}var w=S(null),Y=S(null),V=S(null),K=S(null);function fe(e,t){switch(X(V,t),X(Y,e),X(w,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=yf(t),e=gf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(w),X(w,e)}function ye(){L(w),L(Y),L(V)}function _t(e){e.memoizedState!==null&&X(K,e);var t=w.current,l=gf(t,e.type);t!==l&&(X(Y,e),X(w,l))}function gt(e){Y.current===e&&(L(w),L(Y)),K.current===e&&(L(K),Vn._currentValue=D)}var Jl,Rt;function Vt(e){if(Jl===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Jl=t&&t[1]||"",Rt=-1<l.stack.indexOf(`
41
+ */var am;function Pp(){if(am)return Jn;am=1;var i=Wp(),o=$c(),d=Ip();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 p(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function y(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 x(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(y(e)!==e)throw Error(u(188))}function m(e){var t=e.alternate;if(!t){if(t=y(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 h(s),e;if(r===a)return h(s),t;r=r.sibling}throw Error(u(188))}if(l.return!==a.return)l=s,a=r;else{for(var c=!1,f=s.child;f;){if(f===l){c=!0,l=s,a=r;break}if(f===a){c=!0,a=s,l=r;break}f=f.sibling}if(!c){for(f=r.child;f;){if(f===l){c=!0,l=r,a=s;break}if(f===a){c=!0,a=r,l=s;break}f=f.sibling}if(!c)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 N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,k=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),Z=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),Ee=Symbol.iterator;function he(e){return e===null||typeof e!="object"?null:(e=Ee&&e[Ee]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case se:return"Profiler";case $:return"StrictMode";case W:return"Suspense";case ne:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case H:return"Portal";case ie:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case G:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case le:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var Ce=Array.isArray,C=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D={pending:!1,data:null,method:null,action:null},ee=[],de=-1;function S(e){return{current:e}}function L(e){0>de||(e.current=ee[de],ee[de]=null,de--)}function X(e,t){de++,ee[de]=e.current,e.current=t}var R=S(null),Y=S(null),Q=S(null),K=S(null);function fe(e,t){switch(X(Q,t),X(Y,e),X(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?yf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=yf(t),e=gf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(R),X(R,e)}function ye(){L(R),L(Y),L(Q)}function Rt(e){e.memoizedState!==null&&X(K,e);var t=R.current,l=gf(t,e.type);t!==l&&(X(Y,e),X(R,l))}function bt(e){Y.current===e&&(L(R),L(Y)),K.current===e&&(L(K),Vn._currentValue=D)}var Wl,wt;function Vt(e){if(Wl===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Wl=t&&t[1]||"",wt=-1<l.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Jl+e+Rt}var bl=!1;function P(e,t){if(!e||bl)return"";bl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(O){var R=O}Reflect.construct(e,[],q)}else{try{q.call()}catch(O){R=O}e.call(q.prototype)}}else{try{throw Error()}catch(O){R=O}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(O){if(O&&R&&typeof O.stack=="string")return[O.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(),c=r[0],f=r[1];if(c&&f){var g=c.split(`
43
+ `+Wl+e+wt}var Sl=!1;function P(e,t){if(!e||Sl)return"";Sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(O){var w=O}Reflect.construct(e,[],q)}else{try{q.call()}catch(O){w=O}e.call(q.prototype)}}else{try{throw Error()}catch(O){w=O}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(O){if(O&&w&&typeof O.stack=="string")return[O.stack,w.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(),c=r[0],f=r[1];if(c&&f){var g=c.split(`
44
44
  `),_=f.split(`
45
45
  `);for(s=a=0;a<g.length&&!g[a].includes("DetermineComponentFrameRoot");)a++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(a===g.length||s===_.length)for(a=g.length-1,s=_.length-1;1<=a&&0<=s&&g[a]!==_[s];)s--;for(;1<=a&&0<=s;a--,s--)if(g[a]!==_[s]){if(a!==1||s!==1)do if(a--,s--,0>s||g[a]!==_[s]){var B=`
46
- `+g[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=s);break}}}finally{bl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Vt(l):""}function rt(e,t){switch(e.tag){case 26:case 27:case 5:return Vt(e.type);case 16:return Vt("Lazy");case 13:return e.child!==t&&t!==null?Vt("Suspense Fallback"):Vt("Suspense");case 19:return Vt("SuspenseList");case 0:case 15:return P(e.type,!1);case 11:return P(e.type.render,!1);case 1:return P(e.type,!0);case 31:return Vt("Activity");default:return""}}function wt(e){try{var t="",l=null;do t+=rt(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
46
+ `+g[a].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=a&&0<=s);break}}}finally{Sl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Vt(l):""}function it(e,t){switch(e.tag){case 26:case 27:case 5:return Vt(e.type);case 16:return Vt("Lazy");case 13:return e.child!==t&&t!==null?Vt("Suspense Fallback"):Vt("Suspense");case 19:return Vt("SuspenseList");case 0:case 15:return P(e.type,!1);case 11:return P(e.type.render,!1);case 1:return P(e.type,!0);case 31:return Vt("Activity");default:return""}}function Mt(e){try{var t="",l=null;do t+=it(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
47
47
  Error generating stack: `+a.message+`
48
- `+a.stack}}var ot=Object.prototype.hasOwnProperty,tl=i.unstable_scheduleCallback,G=i.unstable_cancelCallback,Be=i.unstable_shouldYield,jl=i.unstable_requestPaint,Ze=i.unstable_now,it=i.unstable_getCurrentPriorityLevel,pa=i.unstable_ImmediatePriority,ha=i.unstable_UserBlockingPriority,Qt=i.unstable_NormalPriority,bt=i.unstable_LowPriority,Ie=i.unstable_IdlePriority,Mt=i.log,$l=i.unstable_setDisableYieldValue,Jt=null,Me=null;function $t(e){if(typeof Mt=="function"&&$l(e),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Jt,e)}catch{}}var jt=Math.clz32?Math.clz32:Mm,Rm=Math.log,wm=Math.LN2;function Mm(e){return e>>>=0,e===0?32:31-(Rm(e)/wm|0)|0}var Fn=256,In=262144,Pn=4194304;function Wl(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 es(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~r,a!==0?s=Wl(a):(c&=f,c!==0?s=Wl(c):l||(l=f&~e,l!==0&&(s=Wl(l))))):(f=a&~r,f!==0?s=Wl(f):c!==0?s=Wl(c):l||(l=a&~e,l!==0&&(s=Wl(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 tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zm(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 Fc(){var e=Pn;return Pn<<=1,(Pn&62914560)===0&&(Pn=4194304),e}function vr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ln(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Om(e,t,l,a,s,r){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,g=e.expirationTimes,_=e.hiddenUpdates;for(l=c&~l;0<l;){var B=31-jt(l),q=1<<B;f[B]=0,g[B]=-1;var R=_[B];if(R!==null)for(_[B]=null,B=0;B<R.length;B++){var O=R[B];O!==null&&(O.lane&=-536870913)}l&=~q}a!==0&&Ic(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(c&~t))}function Ic(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-jt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Pc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-jt(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function eo(e,t){var l=t&-t;return l=(l&42)!==0?1:yr(l),(l&(e.suspendedLanes|t))!==0?0:l}function yr(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 gr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function to(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Gf(e.type))}function lo(e,t){var l=z.p;try{return z.p=e,t()}finally{z.p=l}}var Sl=Math.random().toString(36).slice(2),tt="__reactFiber$"+Sl,ft="__reactProps$"+Sl,va="__reactContainer$"+Sl,br="__reactEvents$"+Sl,Dm="__reactListeners$"+Sl,Lm="__reactHandles$"+Sl,ao="__reactResources$"+Sl,an="__reactMarker$"+Sl;function jr(e){delete e[tt],delete e[ft],delete e[br],delete e[Dm],delete e[Lm]}function ya(e){var t=e[tt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[va]||l[tt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Cf(e);e!==null;){if(l=e[tt])return l;e=Cf(e)}return t}e=l,l=e.parentNode}return null}function ga(e){if(e=e[tt]||e[va]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ba(e){var t=e[ao];return t||(t=e[ao]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[an]=!0}var no=new Set,so={};function Fl(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(so[e]=t,e=0;e<t.length;e++)no.add(t[e])}var Bm=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]*$"),ro={},io={};function Um(e){return ot.call(io,e)?!0:ot.call(ro,e)?!1:Bm.test(e)?io[e]=!0:(ro[e]=!0,!1)}function ts(e,t,l){if(Um(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 ls(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 ll(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function co(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hm(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(c){l=""+c,r.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=co(e)?"checked":"value";e._valueTracker=Hm(e,t,""+e[t])}}function oo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=co(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function as(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 qm=/[\n"\\]/g;function Ot(e){return e.replace(qm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Nr(e,t,l,a,s,r,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Er(e,c,zt(t)):l!=null?Er(e,c,zt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+zt(f):e.removeAttribute("name")}function uo(e,t,l,a,s,r,c,f){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)){Sr(e);return}l=l!=null?""+zt(l):"",t=t!=null?""+zt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Sr(e)}function Er(e,t,l){t==="number"&&as(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Sa(e,t,l,a){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&a&&(e[l].defaultSelected=!0)}else{for(l=""+zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fo(e,t,l){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+zt(l):""}function mo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(Ce(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),Sr(e)}function Na(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Ym=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 xo(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||Ym.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function po(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&&xo(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&xo(e,r,t[r])}function Tr(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 Gm=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"]]),Vm=/^[\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 ns(e){return Vm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function al(){}var Cr=null;function kr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,Ta=null;function ho(e){var t=ga(e);if(t&&(e=t.stateNode)){var l=e[ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(Nr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[ft]||null;if(!s)throw Error(u(90));Nr(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&&oo(a)}break e;case"textarea":fo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Sa(e,!!l.multiple,t,!1)}}}var Ar=!1;function vo(e,t,l){if(Ar)return e(t,l);Ar=!0;try{var a=e(t);return a}finally{if(Ar=!1,(Ea!==null||Ta!==null)&&(Xs(),Ea&&(t=Ea,e=Ta,Ta=Ea=null,ho(t),e)))for(t=0;t<e.length;t++)ho(e[t])}}function sn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[ft]||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 nl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_r=!1;if(nl)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){_r=!0}}),window.addEventListener("test",rn,rn),window.removeEventListener("test",rn,rn)}catch{_r=!1}var Nl=null,Rr=null,ss=null;function yo(){if(ss)return ss;var e,t=Rr,l=t.length,a,s="value"in Nl?Nl.value:Nl.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===s[r-a];a++);return ss=s.slice(e,1<a?1-a:void 0)}function rs(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 is(){return!0}function go(){return!1}function mt(e){function t(l,a,s,r,c){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(r):r[f]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?is:go,this.isPropagationStopped=go,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=is)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=is)},persist:function(){},isPersistent:is}),t}var Il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cs=mt(Il),cn=b({},Il,{view:0,detail:0}),Qm=mt(cn),wr,Mr,on,os=b({},cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Or,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!==on&&(on&&e.type==="mousemove"?(wr=e.screenX-on.screenX,Mr=e.screenY-on.screenY):Mr=wr=0,on=e),wr)},movementY:function(e){return"movementY"in e?e.movementY:Mr}}),bo=mt(os),Xm=b({},os,{dataTransfer:0}),Zm=mt(Xm),Km=b({},cn,{relatedTarget:0}),zr=mt(Km),Jm=b({},Il,{animationName:0,elapsedTime:0,pseudoElement:0}),$m=mt(Jm),Wm=b({},Il,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fm=mt(Wm),Im=b({},Il,{data:0}),jo=mt(Im),Pm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ex={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"},tx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tx[e])?!!t[e]:!1}function Or(){return lx}var ax=b({},cn,{key:function(e){if(e.key){var t=Pm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ex[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Or,charCode:function(e){return e.type==="keypress"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nx=mt(ax),sx=b({},os,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),So=mt(sx),rx=b({},cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Or}),ix=mt(rx),cx=b({},Il,{propertyName:0,elapsedTime:0,pseudoElement:0}),ox=mt(cx),ux=b({},os,{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}),dx=mt(ux),fx=b({},Il,{newState:0,oldState:0}),mx=mt(fx),xx=[9,13,27,32],Dr=nl&&"CompositionEvent"in window,un=null;nl&&"documentMode"in document&&(un=document.documentMode);var px=nl&&"TextEvent"in window&&!un,No=nl&&(!Dr||un&&8<un&&11>=un),Eo=" ",To=!1;function Co(e,t){switch(e){case"keyup":return xx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ko(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ca=!1;function hx(e,t){switch(e){case"compositionend":return ko(t);case"keypress":return t.which!==32?null:(To=!0,Eo);case"textInput":return e=t.data,e===Eo&&To?null:e;default:return null}}function vx(e,t){if(Ca)return e==="compositionend"||!Dr&&Co(e,t)?(e=yo(),ss=Rr=Nl=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 No&&t.locale!=="ko"?null:t.data;default:return null}}var yx={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 Ao(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!yx[e.type]:t==="textarea"}function _o(e,t,l,a){Ea?Ta?Ta.push(a):Ta=[a]:Ea=a,t=Is(t,"onChange"),0<t.length&&(l=new cs("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var dn=null,fn=null;function gx(e){ff(e,0)}function us(e){var t=nn(e);if(oo(t))return e}function Ro(e,t){if(e==="change")return t}var wo=!1;if(nl){var Lr;if(nl){var Br="oninput"in document;if(!Br){var Mo=document.createElement("div");Mo.setAttribute("oninput","return;"),Br=typeof Mo.oninput=="function"}Lr=Br}else Lr=!1;wo=Lr&&(!document.documentMode||9<document.documentMode)}function zo(){dn&&(dn.detachEvent("onpropertychange",Oo),fn=dn=null)}function Oo(e){if(e.propertyName==="value"&&us(fn)){var t=[];_o(t,fn,e,kr(e)),vo(gx,t)}}function bx(e,t,l){e==="focusin"?(zo(),dn=t,fn=l,dn.attachEvent("onpropertychange",Oo)):e==="focusout"&&zo()}function jx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return us(fn)}function Sx(e,t){if(e==="click")return us(t)}function Nx(e,t){if(e==="input"||e==="change")return us(t)}function Ex(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var St=typeof Object.is=="function"?Object.is:Ex;function mn(e,t){if(St(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(!ot.call(t,s)||!St(e[s],t[s]))return!1}return!0}function Do(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lo(e,t){var l=Do(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=Do(l)}}function Bo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=as(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=as(e.document)}return t}function Ur(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 Tx=nl&&"documentMode"in document&&11>=document.documentMode,ka=null,Hr=null,xn=null,qr=!1;function Ho(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;qr||ka==null||ka!==as(a)||(a=ka,"selectionStart"in a&&Ur(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}),xn&&mn(xn,a)||(xn=a,a=Is(Hr,"onSelect"),0<a.length&&(t=new cs("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ka)))}function Pl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Aa={animationend:Pl("Animation","AnimationEnd"),animationiteration:Pl("Animation","AnimationIteration"),animationstart:Pl("Animation","AnimationStart"),transitionrun:Pl("Transition","TransitionRun"),transitionstart:Pl("Transition","TransitionStart"),transitioncancel:Pl("Transition","TransitionCancel"),transitionend:Pl("Transition","TransitionEnd")},Yr={},qo={};nl&&(qo=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 ea(e){if(Yr[e])return Yr[e];if(!Aa[e])return e;var t=Aa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in qo)return Yr[e]=t[l];return e}var Yo=ea("animationend"),Go=ea("animationiteration"),Vo=ea("animationstart"),Cx=ea("transitionrun"),kx=ea("transitionstart"),Ax=ea("transitioncancel"),Qo=ea("transitionend"),Xo=new Map,Gr="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(" ");Gr.push("scrollEnd");function Xt(e,t){Xo.set(e,t),Fl(t,[e])}var ds=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Dt=[],_a=0,Vr=0;function fs(){for(var e=_a,t=Vr=_a=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}r!==0&&Zo(l,s,r)}}function ms(e,t,l,a){Dt[_a++]=e,Dt[_a++]=t,Dt[_a++]=l,Dt[_a++]=a,Vr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Qr(e,t,l,a){return ms(e,t,l,a),xs(e)}function ta(e,t){return ms(e,null,null,t),xs(e)}function Zo(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-jt(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function xs(e){if(50<Ln)throw Ln=0,Pi=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 _x(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 Nt(e,t,l,a){return new _x(e,t,l,a)}function Xr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sl(e,t){var l=e.alternate;return l===null?(l=Nt(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 Ko(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 ps(e,t,l,a,s,r){var c=0;if(a=e,typeof e=="function")Xr(e)&&(c=1);else if(typeof e=="string")c=Op(e,l,w.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Nt(31,l,t,s),e.elementType=te,e.lanes=r,e;case Z:return la(l.children,s,r,t);case $:c=8,s|=24;break;case se:return e=Nt(12,l,t,s|2),e.elementType=se,e.lanes=r,e;case W:return e=Nt(13,l,t,s),e.elementType=W,e.lanes=r,e;case ne:return e=Nt(19,l,t,s),e.elementType=ne,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ce:c=10;break e;case I:c=9;break e;case Q:c=11;break e;case F:c=14;break e;case le:c=16,a=null;break e}c=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Nt(c,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function la(e,t,l,a){return e=Nt(7,e,a,t),e.lanes=l,e}function Zr(e,t,l){return e=Nt(6,e,null,t),e.lanes=l,e}function Jo(e){var t=Nt(18,null,null,0);return t.stateNode=e,t}function Kr(e,t,l){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var $o=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var l=$o.get(e);return l!==void 0?l:(t={value:e,source:t,stack:wt(t)},$o.set(e,t),t)}return{value:e,source:t,stack:wt(t)}}var wa=[],Ma=0,hs=null,pn=0,Bt=[],Ut=0,El=null,Wt=1,Ft="";function rl(e,t){wa[Ma++]=pn,wa[Ma++]=hs,hs=e,pn=t}function Wo(e,t,l){Bt[Ut++]=Wt,Bt[Ut++]=Ft,Bt[Ut++]=El,El=e;var a=Wt;e=Ft;var s=32-jt(a)-1;a&=~(1<<s),l+=1;var r=32-jt(t)+s;if(30<r){var c=s-s%5;r=(a&(1<<c)-1).toString(32),a>>=c,s-=c,Wt=1<<32-jt(t)+s|l<<s|a,Ft=r+e}else Wt=1<<r|l<<s|a,Ft=e}function Jr(e){e.return!==null&&(rl(e,1),Wo(e,1,0))}function $r(e){for(;e===hs;)hs=wa[--Ma],wa[Ma]=null,pn=wa[--Ma],wa[Ma]=null;for(;e===El;)El=Bt[--Ut],Bt[Ut]=null,Ft=Bt[--Ut],Bt[Ut]=null,Wt=Bt[--Ut],Bt[Ut]=null}function Fo(e,t){Bt[Ut++]=Wt,Bt[Ut++]=Ft,Bt[Ut++]=El,Wt=t.id,Ft=t.overflow,El=e}var lt=null,Ue=null,Te=!1,Tl=null,Ht=!1,Wr=Error(u(519));function Cl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hn(Lt(t,e)),Wr}function Io(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[tt]=e,t[ft]=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<Un.length;l++)be(Un[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),uo(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),mo(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||hf(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=al),t=!0):t=!1,t||Cl(e,!0)}function Po(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:lt=lt.return}}function za(e){if(e!==lt)return!1;if(!Te)return Po(e),Te=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||xc(e.type,e.memoizedProps)),l=!l),l&&Ue&&Cl(e),Po(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Tf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Tf(e)}else t===27?(t=Ue,ql(e.type)?(e=gc,gc=null,Ue=e):Ue=t):Ue=lt?Yt(e.stateNode.nextSibling):null;return!0}function aa(){Ue=lt=null,Te=!1}function Fr(){var e=Tl;return e!==null&&(vt===null?vt=e:vt.push.apply(vt,e),Tl=null),e}function hn(e){Tl===null?Tl=[e]:Tl.push(e)}var Ir=S(null),na=null,il=null;function kl(e,t,l){X(Ir,t._currentValue),t._currentValue=l}function cl(e){e._currentValue=Ir.current,L(Ir)}function Pr(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 ei(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var c=s.child;r=r.firstContext;e:for(;r!==null;){var f=r;r=s;for(var g=0;g<t.length;g++)if(f.context===t[g]){r.lanes|=l,f=r.alternate,f!==null&&(f.lanes|=l),Pr(r.return,l,e),a||(c=null);break e}r=f.next}}else if(s.tag===18){if(c=s.return,c===null)throw Error(u(341));c.lanes|=l,r=c.alternate,r!==null&&(r.lanes|=l),Pr(c,l,e),c=null}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===e){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}}function 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 c=s.alternate;if(c===null)throw Error(u(387));if(c=c.memoizedProps,c!==null){var f=s.type;St(s.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(s===K.current){if(c=s.alternate,c===null)throw Error(u(387));c.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Vn):e=[Vn])}s=s.return}e!==null&&ei(t,e,l,a),t.flags|=262144}function vs(e){for(e=e.firstContext;e!==null;){if(!St(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){na=e,il=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return eu(na,e)}function ys(e,t){return na===null&&sa(e),eu(e,t)}function eu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},il===null){if(e===null)throw Error(u(308));il=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else il=il.next=t;return l}var Rx=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()})}},wx=i.unstable_scheduleCallback,Mx=i.unstable_NormalPriority,Ke={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ti(){return{controller:new Rx,data:new Map,refCount:0}}function vn(e){e.refCount--,e.refCount===0&&wx(Mx,function(){e.controller.abort()})}var yn=null,li=0,Da=0,La=null;function zx(e,t){if(yn===null){var l=yn=[];li=0,Da=sc(),La={status:"pending",value:void 0,then:function(a){l.push(a)}}}return li++,t.then(tu,tu),t}function tu(){if(--li===0&&yn!==null){La!==null&&(La.status="fulfilled");var e=yn;yn=null,Da=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ox(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 lu=C.S;C.S=function(e,t){Hd=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zx(e,t),lu!==null&&lu(e,t)};var ra=S(null);function ai(){var e=ra.current;return e!==null?e:Le.pooledCache}function gs(e,t){t===null?X(ra,ra.current):X(ra,t.pool)}function au(){var e=ai();return e===null?null:{parent:Ke._currentValue,pool:e}}var Ba=Error(u(460)),ni=Error(u(474)),bs=Error(u(542)),js={then:function(){}};function nu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function su(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(al,al),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,iu(e),e;default:if(typeof t.status=="string")t.then(al,al);else{if(e=Le,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,iu(e),e}throw ca=t,Ba}}function ia(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ca=l,Ba):l}}var ca=null;function ru(){if(ca===null)throw Error(u(459));var e=ca;return ca=null,e}function iu(e){if(e===Ba||e===bs)throw Error(u(483))}var Ua=null,gn=0;function Ss(e){var t=gn;return gn+=1,Ua===null&&(Ua=[]),su(Ua,e,t)}function bn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ns(e,t){throw t.$$typeof===k?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cu(e){function t(T,E){if(e){var A=T.deletions;A===null?(T.deletions=[E],T.flags|=16):A.push(E)}}function l(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function a(T){for(var E=new Map;T!==null;)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function s(T,E){return T=sl(T,E),T.index=0,T.sibling=null,T}function r(T,E,A){return T.index=A,e?(A=T.alternate,A!==null?(A=A.index,A<E?(T.flags|=67108866,E):A):(T.flags|=67108866,E)):(T.flags|=1048576,E)}function c(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function f(T,E,A,U){return E===null||E.tag!==6?(E=Zr(A,T.mode,U),E.return=T,E):(E=s(E,A),E.return=T,E)}function g(T,E,A,U){var ie=A.type;return ie===Z?B(T,E,A.props.children,U,A.key):E!==null&&(E.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===le&&ia(ie)===E.type)?(E=s(E,A.props),bn(E,A),E.return=T,E):(E=ps(A.type,A.key,A.props,null,T.mode,U),bn(E,A),E.return=T,E)}function _(T,E,A,U){return E===null||E.tag!==4||E.stateNode.containerInfo!==A.containerInfo||E.stateNode.implementation!==A.implementation?(E=Kr(A,T.mode,U),E.return=T,E):(E=s(E,A.children||[]),E.return=T,E)}function B(T,E,A,U,ie){return E===null||E.tag!==7?(E=la(A,T.mode,U,ie),E.return=T,E):(E=s(E,A),E.return=T,E)}function q(T,E,A){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Zr(""+E,T.mode,A),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case M:return A=ps(E.type,E.key,E.props,null,T.mode,A),bn(A,E),A.return=T,A;case H:return E=Kr(E,T.mode,A),E.return=T,E;case le:return E=ia(E),q(T,E,A)}if(Ce(E)||he(E))return E=la(E,T.mode,A,null),E.return=T,E;if(typeof E.then=="function")return q(T,Ss(E),A);if(E.$$typeof===ce)return q(T,ys(T,E),A);Ns(T,E)}return null}function R(T,E,A,U){var ie=E!==null?E.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ie!==null?null:f(T,E,""+A,U);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case M:return A.key===ie?g(T,E,A,U):null;case H:return A.key===ie?_(T,E,A,U):null;case le:return A=ia(A),R(T,E,A,U)}if(Ce(A)||he(A))return ie!==null?null:B(T,E,A,U,null);if(typeof A.then=="function")return R(T,E,Ss(A),U);if(A.$$typeof===ce)return R(T,E,ys(T,A),U);Ns(T,A)}return null}function O(T,E,A,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return T=T.get(A)||null,f(E,T,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case M:return T=T.get(U.key===null?A:U.key)||null,g(E,T,U,ie);case H:return T=T.get(U.key===null?A:U.key)||null,_(E,T,U,ie);case le:return U=ia(U),O(T,E,A,U,ie)}if(Ce(U)||he(U))return T=T.get(A)||null,B(E,T,U,ie,null);if(typeof U.then=="function")return O(T,E,A,Ss(U),ie);if(U.$$typeof===ce)return O(T,E,A,ys(E,U),ie);Ns(E,U)}return null}function ae(T,E,A,U){for(var ie=null,ke=null,re=E,ve=E=0,Ne=null;re!==null&&ve<A.length;ve++){re.index>ve?(Ne=re,re=null):Ne=re.sibling;var Ae=R(T,re,A[ve],U);if(Ae===null){re===null&&(re=Ne);break}e&&re&&Ae.alternate===null&&t(T,re),E=r(Ae,E,ve),ke===null?ie=Ae:ke.sibling=Ae,ke=Ae,re=Ne}if(ve===A.length)return l(T,re),Te&&rl(T,ve),ie;if(re===null){for(;ve<A.length;ve++)re=q(T,A[ve],U),re!==null&&(E=r(re,E,ve),ke===null?ie=re:ke.sibling=re,ke=re);return Te&&rl(T,ve),ie}for(re=a(re);ve<A.length;ve++)Ne=O(re,T,ve,A[ve],U),Ne!==null&&(e&&Ne.alternate!==null&&re.delete(Ne.key===null?ve:Ne.key),E=r(Ne,E,ve),ke===null?ie=Ne:ke.sibling=Ne,ke=Ne);return e&&re.forEach(function(Xl){return t(T,Xl)}),Te&&rl(T,ve),ie}function ue(T,E,A,U){if(A==null)throw Error(u(151));for(var ie=null,ke=null,re=E,ve=E=0,Ne=null,Ae=A.next();re!==null&&!Ae.done;ve++,Ae=A.next()){re.index>ve?(Ne=re,re=null):Ne=re.sibling;var Xl=R(T,re,Ae.value,U);if(Xl===null){re===null&&(re=Ne);break}e&&re&&Xl.alternate===null&&t(T,re),E=r(Xl,E,ve),ke===null?ie=Xl:ke.sibling=Xl,ke=Xl,re=Ne}if(Ae.done)return l(T,re),Te&&rl(T,ve),ie;if(re===null){for(;!Ae.done;ve++,Ae=A.next())Ae=q(T,Ae.value,U),Ae!==null&&(E=r(Ae,E,ve),ke===null?ie=Ae:ke.sibling=Ae,ke=Ae);return Te&&rl(T,ve),ie}for(re=a(re);!Ae.done;ve++,Ae=A.next())Ae=O(re,T,ve,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&re.delete(Ae.key===null?ve:Ae.key),E=r(Ae,E,ve),ke===null?ie=Ae:ke.sibling=Ae,ke=Ae);return e&&re.forEach(function(Xp){return t(T,Xp)}),Te&&rl(T,ve),ie}function De(T,E,A,U){if(typeof A=="object"&&A!==null&&A.type===Z&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case M:e:{for(var ie=A.key;E!==null;){if(E.key===ie){if(ie=A.type,ie===Z){if(E.tag===7){l(T,E.sibling),U=s(E,A.props.children),U.return=T,T=U;break e}}else if(E.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===le&&ia(ie)===E.type){l(T,E.sibling),U=s(E,A.props),bn(U,A),U.return=T,T=U;break e}l(T,E);break}else t(T,E);E=E.sibling}A.type===Z?(U=la(A.props.children,T.mode,U,A.key),U.return=T,T=U):(U=ps(A.type,A.key,A.props,null,T.mode,U),bn(U,A),U.return=T,T=U)}return c(T);case H:e:{for(ie=A.key;E!==null;){if(E.key===ie)if(E.tag===4&&E.stateNode.containerInfo===A.containerInfo&&E.stateNode.implementation===A.implementation){l(T,E.sibling),U=s(E,A.children||[]),U.return=T,T=U;break e}else{l(T,E);break}else t(T,E);E=E.sibling}U=Kr(A,T.mode,U),U.return=T,T=U}return c(T);case le:return A=ia(A),De(T,E,A,U)}if(Ce(A))return ae(T,E,A,U);if(he(A)){if(ie=he(A),typeof ie!="function")throw Error(u(150));return A=ie.call(A),ue(T,E,A,U)}if(typeof A.then=="function")return De(T,E,Ss(A),U);if(A.$$typeof===ce)return De(T,E,ys(T,A),U);Ns(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,E!==null&&E.tag===6?(l(T,E.sibling),U=s(E,A),U.return=T,T=U):(l(T,E),U=Zr(A,T.mode,U),U.return=T,T=U),c(T)):l(T,E)}return function(T,E,A,U){try{gn=0;var ie=De(T,E,A,U);return Ua=null,ie}catch(re){if(re===Ba||re===bs)throw re;var ke=Nt(29,re,null,T.mode);return ke.lanes=U,ke.return=T,ke}finally{}}}var oa=cu(!0),ou=cu(!1),Al=!1;function si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ri(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,(_e&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=xs(e),Zo(e,null,l),t}return ms(e,a,t,l),xs(e)}function jn(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,Pc(e,l)}}function ii(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 c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=c:r=r.next=c,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 ci=!1;function Sn(){if(ci){var e=La;if(e!==null)throw e}}function Nn(e,t,l,a){ci=!1;var s=e.updateQueue;Al=!1;var r=s.firstBaseUpdate,c=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var g=f,_=g.next;g.next=null,c===null?r=_:c.next=_,c=g;var B=e.alternate;B!==null&&(B=B.updateQueue,f=B.lastBaseUpdate,f!==c&&(f===null?B.firstBaseUpdate=_:f.next=_,B.lastBaseUpdate=g))}if(r!==null){var q=s.baseState;c=0,B=_=g=null,f=r;do{var R=f.lane&-536870913,O=R!==f.lane;if(O?(Se&R)===R:(a&R)===R){R!==0&&R===Da&&(ci=!0),B!==null&&(B=B.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var ae=e,ue=f;R=t;var De=l;switch(ue.tag){case 1:if(ae=ue.payload,typeof ae=="function"){q=ae.call(De,q,R);break e}q=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ue.payload,R=typeof ae=="function"?ae.call(De,q,R):ae,R==null)break e;q=b({},q,R);break e;case 2:Al=!0}}R=f.callback,R!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[R]:O.push(R))}else O={lane:R,tag:f.tag,payload:f.payload,callback:f.callback,next:null},B===null?(_=B=O,g=q):B=B.next=O,c|=R;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;O=f,f=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);B===null&&(g=q),s.baseState=g,s.firstBaseUpdate=_,s.lastBaseUpdate=B,r===null&&(s.shared.lanes=0),Dl|=c,e.lanes=c,e.memoizedState=q}}function uu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function du(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)uu(l[e],t)}var Ha=S(null),Es=S(0);function fu(e,t){e=vl,X(Es,e),X(Ha,t),vl=e|t.baseLanes}function oi(){X(Es,vl),X(Ha,Ha.current)}function ui(){vl=Es.current,L(Ha),L(Es)}var Et=S(null),qt=null;function wl(e){var t=e.alternate;X(Ve,Ve.current&1),X(Et,e),qt===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(qt=e)}function di(e){X(Ve,Ve.current),X(Et,e),qt===null&&(qt=e)}function mu(e){e.tag===22?(X(Ve,Ve.current),X(Et,e),qt===null&&(qt=e)):Ml()}function Ml(){X(Ve,Ve.current),X(Et,Et.current)}function Tt(e){L(Et),qt===e&&(qt=null),L(Ve)}var Ve=S(0);function Ts(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vc(l)||yc(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 ol=0,xe=null,ze=null,Je=null,Cs=!1,qa=!1,ua=!1,ks=0,En=0,Ya=null,Dx=0;function Ye(){throw Error(u(321))}function fi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!St(e[l],t[l]))return!1;return!0}function mi(e,t,l,a,s,r){return ol=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Wu:Ai,ua=!1,r=l(a,s),ua=!1,qa&&(r=pu(t,l,a,s)),xu(e),r}function xu(e){C.H=kn;var t=ze!==null&&ze.next!==null;if(ol=0,Je=ze=xe=null,Cs=!1,En=0,Ya=null,t)throw Error(u(300));e===null||$e||(e=e.dependencies,e!==null&&vs(e)&&($e=!0))}function pu(e,t,l,a){xe=e;var s=0;do{if(qa&&(Ya=null),En=0,qa=!1,25<=s)throw Error(u(301));if(s+=1,Je=ze=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}C.H=Fu,r=t(l,a)}while(qa);return r}function Lx(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Tn(t):t,e=e.useState()[0],(ze!==null?ze.memoizedState:null)!==e&&(xe.flags|=1024),t}function xi(){var e=ks!==0;return ks=0,e}function pi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function hi(e){if(Cs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cs=!1}ol=0,Je=ze=xe=null,qa=!1,En=ks=0,Ya=null}function ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?xe.memoizedState=Je=e:Je=Je.next=e,Je}function Qe(){if(ze===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Je===null?xe.memoizedState:Je.next;if(t!==null)Je=t,ze=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Je===null?xe.memoizedState=Je=e:Je=Je.next=e}return Je}function As(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tn(e){var t=En;return En+=1,Ya===null&&(Ya=[]),e=su(Ya,e,t),t=xe,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Wu:Ai),e}function _s(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tn(e);if(e.$$typeof===ce)return at(e)}throw Error(u(438,String(e)))}function vi(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=As(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=pe;return t.index++,l}function ul(e,t){return typeof t=="function"?t(e):t}function Rs(e){var t=Qe();return yi(t,ze,e)}function yi(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 c=s.next;s.next=r.next,r.next=c}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var f=c=null,g=null,_=t,B=!1;do{var q=_.lane&-536870913;if(q!==_.lane?(Se&q)===q:(ol&q)===q){var R=_.revertLane;if(R===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),q===Da&&(B=!0);else if((ol&R)===R){_=_.next,R===Da&&(B=!0);continue}else q={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=q,c=r):g=g.next=q,xe.lanes|=R,Dl|=R;q=_.action,ua&&l(r,q),r=_.hasEagerState?_.eagerState:l(r,q)}else R={lane:q,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=R,c=r):g=g.next=R,xe.lanes|=q,Dl|=q;_=_.next}while(_!==null&&_!==t);if(g===null?c=r:g.next=f,!St(r,e.memoizedState)&&($e=!0,B&&(l=La,l!==null)))throw l;e.memoizedState=r,e.baseState=c,e.baseQueue=g,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function gi(e){var t=Qe(),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 c=s=s.next;do r=e(r,c.action),c=c.next;while(c!==s);St(r,t.memoizedState)||($e=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function hu(e,t,l){var a=xe,s=Qe(),r=Te;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var c=!St((ze||s).memoizedState,l);if(c&&(s.memoizedState=l,$e=!0),s=s.queue,Si(gu.bind(null,a,s,e),[e]),s.getSnapshot!==t||c||Je!==null&&Je.memoizedState.tag&1){if(a.flags|=2048,Ga(9,{destroy:void 0},yu.bind(null,a,s,l,t),null),Le===null)throw Error(u(349));r||(ol&127)!==0||vu(a,t,l)}return l}function vu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=As(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function yu(e,t,l,a){t.value=l,t.getSnapshot=a,bu(t)&&ju(e)}function gu(e,t,l){return l(function(){bu(t)&&ju(e)})}function bu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!St(e,l)}catch{return!0}}function ju(e){var t=ta(e,2);t!==null&&yt(t,e,2)}function bi(e){var t=ut();if(typeof e=="function"){var l=e;if(e=l(),ua){$t(!0);try{l()}finally{$t(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t}function Su(e,t,l,a){return e.baseState=l,yi(e,ze,typeof a=="function"?a:ul)}function Bx(e,t,l,a,s){if(zs(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(c){r.listeners.push(c)}};C.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Nu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Nu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=C.T,c={};C.T=c;try{var f=l(s,a),g=C.S;g!==null&&g(c,f),Eu(e,t,f)}catch(_){ji(e,t,_)}finally{r!==null&&c.types!==null&&(r.types=c.types),C.T=r}}else try{r=l(s,a),Eu(e,t,r)}catch(_){ji(e,t,_)}}function Eu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Tu(e,t,a)},function(a){return ji(e,t,a)}):Tu(e,t,l)}function Tu(e,t,l){t.status="fulfilled",t.value=l,Cu(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Nu(e,l)))}function ji(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Cu(t),t=t.next;while(t!==a)}e.action=null}function Cu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ku(e,t){return t}function Au(e,t){if(Te){var l=Le.formState;if(l!==null){e:{var a=xe;if(Te){if(Ue){t:{for(var s=Ue,r=Ht;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ue=Yt(s.nextSibling),a=s.data==="F!";break e}}Cl(a)}a=!1}a&&(t=l[0])}}return l=ut(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ku,lastRenderedState:t},l.queue=a,l=Ku.bind(null,xe,a),a.dispatch=l,a=bi(!1),r=ki.bind(null,xe,!1,a.queue),a=ut(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Bx.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function _u(e){var t=Qe();return Ru(t,ze,e)}function Ru(e,t,l){if(t=yi(e,t,ku)[0],e=Rs(ul)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Tn(t)}catch(c){throw c===Ba?bs:c}else a=t;t=Qe();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Ga(9,{destroy:void 0},Ux.bind(null,s,l),null)),[a,r,e]}function Ux(e,t){e.action=t}function wu(e){var t=Qe(),l=ze;if(l!==null)return Ru(t,l,e);Qe(),t=t.memoizedState,l=Qe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Ga(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=As(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Mu(){return Qe().memoizedState}function ws(e,t,l,a){var s=ut();xe.flags|=e,s.memoizedState=Ga(1|t,{destroy:void 0},l,a===void 0?null:a)}function Ms(e,t,l,a){var s=Qe();a=a===void 0?null:a;var r=s.memoizedState.inst;ze!==null&&a!==null&&fi(a,ze.memoizedState.deps)?s.memoizedState=Ga(t,r,l,a):(xe.flags|=e,s.memoizedState=Ga(1|t,r,l,a))}function zu(e,t){ws(8390656,8,e,t)}function Si(e,t){Ms(2048,8,e,t)}function Hx(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=As(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Ou(e){var t=Qe().memoizedState;return Hx({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Du(e,t){return Ms(4,2,e,t)}function Lu(e,t){return Ms(4,4,e,t)}function Bu(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 Uu(e,t,l){l=l!=null?l.concat([e]):null,Ms(4,4,Bu.bind(null,t,e),l)}function Ni(){}function Hu(e,t){var l=Qe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&fi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function qu(e,t){var l=Qe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&fi(t,a[1]))return a[0];if(a=e(),ua){$t(!0);try{e()}finally{$t(!1)}}return l.memoizedState=[a,t],a}function Ei(e,t,l){return l===void 0||(ol&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Yd(),xe.lanes|=e,Dl|=e,l)}function Yu(e,t,l,a){return St(l,t)?l:Ha.current!==null?(e=Ei(e,l,a),St(e,t)||($e=!0),e):(ol&42)===0||(ol&1073741824)!==0&&(Se&261930)===0?($e=!0,e.memoizedState=l):(e=Yd(),xe.lanes|=e,Dl|=e,t)}function Gu(e,t,l,a,s){var r=z.p;z.p=r!==0&&8>r?r:8;var c=C.T,f={};C.T=f,ki(e,!1,t,l);try{var g=s(),_=C.S;if(_!==null&&_(f,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var B=Ox(g,a);Cn(e,t,B,At(e))}else Cn(e,t,a,At(e))}catch(q){Cn(e,t,{then:function(){},status:"rejected",reason:q},At())}finally{z.p=r,c!==null&&f.types!==null&&(c.types=f.types),C.T=c}}function qx(){}function Ti(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Vu(e).queue;Gu(e,s,t,D,l===null?qx:function(){return Qu(e),l(a)})}function Vu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:D},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qu(e){var t=Vu(e);t.next===null&&(t=e.alternate.memoizedState),Cn(e,t.next.queue,{},At())}function Ci(){return at(Vn)}function Xu(){return Qe().memoizedState}function Zu(){return Qe().memoizedState}function Yx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=At();e=_l(l);var a=Rl(t,e,l);a!==null&&(yt(a,t,l),jn(a,t,l)),t={cache:ti()},e.payload=t;return}t=t.return}}function Gx(e,t,l){var a=At();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zs(e)?Ju(t,l):(l=Qr(e,t,l,a),l!==null&&(yt(l,e,a),$u(l,t,a)))}function Ku(e,t,l){var a=At();Cn(e,t,l,a)}function Cn(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Ju(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var c=t.lastRenderedState,f=r(c,l);if(s.hasEagerState=!0,s.eagerState=f,St(f,c))return ms(e,t,s,0),Le===null&&fs(),!1}catch{}finally{}if(l=Qr(e,t,s,a),l!==null)return yt(l,e,a),$u(l,t,a),!0}return!1}function ki(e,t,l,a){if(a={lane:2,revertLane:sc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(u(479))}else t=Qr(e,l,a,2),t!==null&&yt(t,e,2)}function zs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Ju(e,t){qa=Cs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $u(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Pc(e,l)}}var kn={readContext:at,use:_s,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};kn.useEffectEvent=Ye;var Wu={readContext:at,use:_s,useCallback:function(e,t){return ut().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:zu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,ws(4194308,4,Bu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return ws(4194308,4,e,t)},useInsertionEffect:function(e,t){ws(4,2,e,t)},useMemo:function(e,t){var l=ut();t=t===void 0?null:t;var a=e();if(ua){$t(!0);try{e()}finally{$t(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ut();if(l!==void 0){var s=l(t);if(ua){$t(!0);try{l(t)}finally{$t(!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=Gx.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=ut();return e={current:e},t.memoizedState=e},useState:function(e){e=bi(e);var t=e.queue,l=Ku.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ni,useDeferredValue:function(e,t){var l=ut();return Ei(l,e,t)},useTransition:function(){var e=bi(!1);return e=Gu.bind(null,xe,e.queue,!0,!1),ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=ut();if(Te){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Le===null)throw Error(u(349));(Se&127)!==0||vu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,zu(gu.bind(null,a,r,e),[e]),a.flags|=2048,Ga(9,{destroy:void 0},yu.bind(null,a,r,l,t),null),l},useId:function(){var e=ut(),t=Le.identifierPrefix;if(Te){var l=Ft,a=Wt;l=(a&~(1<<32-jt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ks++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Dx++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ci,useFormState:Au,useActionState:Au,useOptimistic:function(e){var t=ut();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=ki.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:vi,useCacheRefresh:function(){return ut().memoizedState=Yx.bind(null,xe)},useEffectEvent:function(e){var t=ut(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Ai={readContext:at,use:_s,useCallback:Hu,useContext:at,useEffect:Si,useImperativeHandle:Uu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:qu,useReducer:Rs,useRef:Mu,useState:function(){return Rs(ul)},useDebugValue:Ni,useDeferredValue:function(e,t){var l=Qe();return Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=Rs(ul)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:hu,useId:Xu,useHostTransitionStatus:Ci,useFormState:_u,useActionState:_u,useOptimistic:function(e,t){var l=Qe();return Su(l,ze,e,t)},useMemoCache:vi,useCacheRefresh:Zu};Ai.useEffectEvent=Ou;var Fu={readContext:at,use:_s,useCallback:Hu,useContext:at,useEffect:Si,useImperativeHandle:Uu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:qu,useReducer:gi,useRef:Mu,useState:function(){return gi(ul)},useDebugValue:Ni,useDeferredValue:function(e,t){var l=Qe();return ze===null?Ei(l,e,t):Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=gi(ul)[0],t=Qe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:hu,useId:Xu,useHostTransitionStatus:Ci,useFormState:wu,useActionState:wu,useOptimistic:function(e,t){var l=Qe();return ze!==null?Su(l,ze,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:vi,useCacheRefresh:Zu};Fu.useEffectEvent=Ou;function _i(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ri={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=At(),s=_l(a);s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(yt(t,e,a),jn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=At(),s=_l(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Rl(e,s,a),t!==null&&(yt(t,e,a),jn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=At(),a=_l(l);a.tag=2,t!=null&&(a.callback=t),t=Rl(e,a,l),t!==null&&(yt(t,e,l),jn(t,e,l))}};function Iu(e,t,l,a,s,r,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,c):t.prototype&&t.prototype.isPureReactComponent?!mn(l,a)||!mn(s,r):!0}function Pu(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&&Ri.enqueueReplaceState(t,t.state,null)}function da(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function ed(e){ds(e)}function td(e){console.error(e)}function ld(e){ds(e)}function Os(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ad(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 wi(e,t,l){return l=_l(l),l.tag=3,l.payload={element:null},l.callback=function(){Os(e,t)},l}function nd(e){return e=_l(e),e.tag=3,e}function sd(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(){ad(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){ad(t,l,a),typeof s!="function"&&(Ll===null?Ll=new Set([this]):Ll.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function Vx(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=Et.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Zs():l.alternate===null&&Ge===0&&(Ge=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===js?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),lc(e,a,s)),!1;case 22:return l.flags|=65536,a===js?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)),lc(e,a,s)),!1}throw Error(u(435,l.tag))}return lc(e,a,s),Zs(),!1}if(Te)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Wr&&(e=Error(u(422),{cause:a}),hn(Lt(e,l)))):(a!==Wr&&(t=Error(u(423),{cause:a}),hn(Lt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Lt(a,l),s=wi(e.stateNode,a,s),ii(e,s),Ge!==4&&(Ge=2)),!1;var r=Error(u(520),{cause:a});if(r=Lt(r,l),Dn===null?Dn=[r]:Dn.push(r),Ge!==4&&(Ge=2),t===null)return!0;a=Lt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=wi(l.stateNode,a,e),ii(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"&&(Ll===null||!Ll.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=nd(s),sd(s,e,l,a),ii(l,s),!1}l=l.return}while(l!==null);return!1}var Mi=Error(u(461)),$e=!1;function nt(e,t,l,a){t.child=e===null?ou(t,null,l,a):oa(t,e.child,l,a)}function rd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return sa(t),a=mi(e,t,l,c,r,s),f=xi(),e!==null&&!$e?(pi(e,t,s),dl(e,t,s)):(Te&&f&&Jr(t),t.flags|=1,nt(e,t,a,s),t.child)}function id(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Xr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,cd(e,t,r,a,s)):(e=ps(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!qi(e,s)){var c=r.memoizedProps;if(l=l.compare,l=l!==null?l:mn,l(c,a)&&e.ref===t.ref)return dl(e,t,s)}return t.flags|=1,e=sl(r,a),e.ref=t.ref,e.return=t,t.child=e}function cd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(mn(r,a)&&e.ref===t.ref)if($e=!1,t.pendingProps=a=r,qi(e,s))(e.flags&131072)!==0&&($e=!0);else return t.lanes=e.lanes,dl(e,t,s)}return zi(e,t,l,a,s)}function od(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 ud(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gs(t,r!==null?r.cachePool:null),r!==null?fu(t,r):oi(),mu(t);else return a=t.lanes=536870912,ud(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(gs(t,r.cachePool),fu(t,r),Ml(),t.memoizedState=null):(e!==null&&gs(t,null),oi(),Ml());return nt(e,t,s,l),t.child}function An(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ud(e,t,l,a,s){var r=ai();return r=r===null?null:{parent:Ke._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&gs(t,null),oi(),mu(t),e!==null&&Oa(e,t,a,!0),t.childLanes=s,null}function Ds(e,t){return t=Bs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dd(e,t,l){return oa(t,e.child,null,l),e=Ds(t,t.pendingProps),e.flags|=2,Tt(t),t.memoizedState=null,e}function Qx(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(a.mode==="hidden")return e=Ds(t,a),t.lanes=536870912,An(null,e);if(di(t),(e=Ue)?(e=Ef(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:El!==null?{id:Wt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=Jo(e),l.return=t,t.child=l,lt=t,Ue=null)):e=null,e===null)throw Cl(t);return t.lanes=536870912,null}return Ds(t,a)}var r=e.memoizedState;if(r!==null){var c=r.dehydrated;if(di(t),s)if(t.flags&256)t.flags&=-257,t=dd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if($e||Oa(e,t,l,!1),s=(l&e.childLanes)!==0,$e||s){if(a=Le,a!==null&&(c=eo(a,l),c!==0&&c!==r.retryLane))throw r.retryLane=c,ta(e,c),yt(a,e,c),Mi;Zs(),t=dd(e,t,l)}else e=r.treeContext,Ue=Yt(c.nextSibling),lt=t,Te=!0,Tl=null,Ht=!1,e!==null&&Fo(t,e),t=Ds(t,a),t.flags|=4096;return t}return e=sl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ls(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 zi(e,t,l,a,s){return sa(t),l=mi(e,t,l,a,void 0,s),a=xi(),e!==null&&!$e?(pi(e,t,s),dl(e,t,s)):(Te&&a&&Jr(t),t.flags|=1,nt(e,t,l,s),t.child)}function fd(e,t,l,a,s,r){return sa(t),t.updateQueue=null,l=pu(t,a,l,s),xu(e),a=xi(),e!==null&&!$e?(pi(e,t,r),dl(e,t,r)):(Te&&a&&Jr(t),t.flags|=1,nt(e,t,l,r),t.child)}function md(e,t,l,a,s){if(sa(t),t.stateNode===null){var r=Ra,c=l.contextType;typeof c=="object"&&c!==null&&(r=at(c)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ri,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},si(t),c=l.contextType,r.context=typeof c=="object"&&c!==null?at(c):Ra,r.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(_i(t,l,c,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(c=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),c!==r.state&&Ri.enqueueReplaceState(r,r.state,null),Nn(t,a,r,s),Sn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var f=t.memoizedProps,g=da(l,f);r.props=g;var _=r.context,B=l.contextType;c=Ra,typeof B=="object"&&B!==null&&(c=at(B));var q=l.getDerivedStateFromProps;B=typeof q=="function"||typeof r.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f||_!==c)&&Pu(t,r,a,c),Al=!1;var R=t.memoizedState;r.state=R,Nn(t,a,r,s),Sn(),_=t.memoizedState,f||R!==_||Al?(typeof q=="function"&&(_i(t,l,q,a),_=t.memoizedState),(g=Al||Iu(t,l,g,a,R,_,c))?(B||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),r.props=a,r.state=_,r.context=c,a=g):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,ri(e,t),c=t.memoizedProps,B=da(l,c),r.props=B,q=t.pendingProps,R=r.context,_=l.contextType,g=Ra,typeof _=="object"&&_!==null&&(g=at(_)),f=l.getDerivedStateFromProps,(_=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(c!==q||R!==g)&&Pu(t,r,a,g),Al=!1,R=t.memoizedState,r.state=R,Nn(t,a,r,s),Sn();var O=t.memoizedState;c!==q||R!==O||Al||e!==null&&e.dependencies!==null&&vs(e.dependencies)?(typeof f=="function"&&(_i(t,l,f,a),O=t.memoizedState),(B=Al||Iu(t,l,B,a,R,O,g)||e!==null&&e.dependencies!==null&&vs(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,O,g),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,O,g)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),r.props=a,r.state=O,r.context=g,a=B):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Ls(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=oa(t,e.child,null,s),t.child=oa(t,null,l,s)):nt(e,t,l,s),t.memoizedState=r.state,e=t.child):e=dl(e,t,s),e}function xd(e,t,l,a){return aa(),t.flags|=256,nt(e,t,l,a),t.child}var Oi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Di(e){return{baseLanes:e,cachePool:au()}}function Li(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=kt),e}function pd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,c;if((c=r)||(c=e!==null&&e.memoizedState===null?!1:(Ve.current&2)!==0),c&&(s=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(s?wl(t):Ml(),(e=Ue)?(e=Ef(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:El!==null?{id:Wt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=Jo(e),l.return=t,t.child=l,lt=t,Ue=null)):e=null,e===null)throw Cl(t);return yc(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,s?(Ml(),s=t.mode,f=Bs({mode:"hidden",children:f},s),a=la(a,s,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=Di(l),a.childLanes=Li(e,c,l),t.memoizedState=Oi,An(null,a)):(wl(t),Bi(t,f))}var g=e.memoizedState;if(g!==null&&(f=g.dehydrated,f!==null)){if(r)t.flags&256?(wl(t),t.flags&=-257,t=Ui(e,t,l)):t.memoizedState!==null?(Ml(),t.child=e.child,t.flags|=128,t=null):(Ml(),f=a.fallback,s=t.mode,a=Bs({mode:"visible",children:a.children},s),f=la(f,s,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,oa(t,e.child,null,l),a=t.child,a.memoizedState=Di(l),a.childLanes=Li(e,c,l),t.memoizedState=Oi,t=An(null,a));else if(wl(t),yc(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var _=c.dgst;c=_,a=Error(u(419)),a.stack="",a.digest=c,hn({value:a,source:null,stack:null}),t=Ui(e,t,l)}else if($e||Oa(e,t,l,!1),c=(l&e.childLanes)!==0,$e||c){if(c=Le,c!==null&&(a=eo(c,l),a!==0&&a!==g.retryLane))throw g.retryLane=a,ta(e,a),yt(c,e,a),Mi;vc(f)||Zs(),t=Ui(e,t,l)}else vc(f)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,Ue=Yt(f.nextSibling),lt=t,Te=!0,Tl=null,Ht=!1,e!==null&&Fo(t,e),t=Bi(t,a.children),t.flags|=4096);return t}return s?(Ml(),f=a.fallback,s=t.mode,g=e.child,_=g.sibling,a=sl(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,_!==null?f=sl(_,f):(f=la(f,s,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,An(null,a),a=t.child,f=e.child.memoizedState,f===null?f=Di(l):(s=f.cachePool,s!==null?(g=Ke._currentValue,s=s.parent!==g?{parent:g,pool:g}:s):s=au(),f={baseLanes:f.baseLanes|l,cachePool:s}),a.memoizedState=f,a.childLanes=Li(e,c,l),t.memoizedState=Oi,An(e.child,a)):(wl(t),l=e.child,e=l.sibling,l=sl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Bi(e,t){return t=Bs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bs(e,t){return e=Nt(22,e,null,t),e.lanes=0,e}function Ui(e,t,l){return oa(t,e.child,null,l),e=Bi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Pr(e.return,t,l)}function Hi(e,t,l,a,s,r){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=s,c.treeForkCount=r)}function vd(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var c=Ve.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,X(Ve,c),nt(e,t,a,l),a=Te?pn:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hd(e,l,t);else if(e.tag===19)hd(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&&Ts(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Hi(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&&Ts(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Hi(t,!0,l,null,r,a);break;case"together":Hi(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function dl(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=sl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=sl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function qi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vs(e)))}function Xx(e,t,l){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),kl(t,Ke,e.memoizedState.cache),aa();break;case 27:case 5:_t(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:kl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,di(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(wl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?pd(e,t,l):(wl(t),e=dl(e,t,l),e!==null?e.sibling:null);wl(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 vd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),X(Ve,Ve.current),a)break;return null;case 22:return t.lanes=0,od(e,t,l,t.pendingProps);case 24:kl(t,Ke,e.memoizedState.cache)}return dl(e,t,l)}function yd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)$e=!0;else{if(!qi(e,l)&&(t.flags&128)===0)return $e=!1,Xx(e,t,l);$e=(e.flags&131072)!==0}else $e=!1,Te&&(t.flags&1048576)!==0&&Wo(t,pn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ia(t.elementType),t.type=e,typeof e=="function")Xr(e)?(a=da(e,a),t.tag=1,t=md(null,t,e,a,l)):(t.tag=0,t=zi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===Q){t.tag=11,t=rd(null,t,e,a,l);break e}else if(s===F){t.tag=14,t=id(null,t,e,a,l);break e}}throw t=oe(e)||e,Error(u(306,t,""))}}return t;case 0:return zi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=da(a,t.pendingProps),md(e,t,a,s,l);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,ri(e,t),Nn(t,a,null,l);var c=t.memoizedState;if(a=c.cache,kl(t,Ke,a),a!==r.cache&&ei(t,[Ke],l,!0),Sn(),a=c.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=xd(e,t,a,l);break e}else if(a!==s){s=Lt(Error(u(424)),t),hn(s),t=xd(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ue=Yt(e.firstChild),lt=t,Te=!0,Tl=null,Ht=!0,l=ou(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(aa(),a===s){t=dl(e,t,l);break e}nt(e,t,a,l)}t=t.child}return t;case 26:return Ls(e,t),e===null?(l=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Te||(l=t.type,e=t.pendingProps,a=Ps(V.current).createElement(l),a[tt]=t,a[ft]=e,st(a,l,e),Pe(a),t.stateNode=a):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _t(t),e===null&&Te&&(a=t.stateNode=kf(t.type,t.pendingProps,V.current),lt=t,Ht=!0,s=Ue,ql(t.type)?(gc=s,Ue=Yt(a.firstChild)):Ue=s),nt(e,t,t.pendingProps.children,l),Ls(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((s=a=Ue)&&(a=jp(a,t.type,t.pendingProps,Ht),a!==null?(t.stateNode=a,lt=t,Ue=Yt(a.firstChild),Ht=!1,s=!0):s=!1),s||Cl(t)),_t(t),s=t.type,r=t.pendingProps,c=e!==null?e.memoizedProps:null,a=r.children,xc(s,r)?a=null:c!==null&&xc(s,c)&&(t.flags|=32),t.memoizedState!==null&&(s=mi(e,t,Lx,null,null,l),Vn._currentValue=s),Ls(e,t),nt(e,t,a,l),t.child;case 6:return e===null&&Te&&((e=l=Ue)&&(l=Sp(l,t.pendingProps,Ht),l!==null?(t.stateNode=l,lt=t,Ue=null,e=!0):e=!1),e||Cl(t)),null;case 13:return pd(e,t,l);case 4:return fe(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=oa(t,null,a,l):nt(e,t,a,l),t.child;case 11:return rd(e,t,t.type,t.pendingProps,l);case 7:return nt(e,t,t.pendingProps,l),t.child;case 8:return nt(e,t,t.pendingProps.children,l),t.child;case 12:return nt(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,kl(t,t.type,a.value),nt(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,sa(t),s=at(s),a=a(s),t.flags|=1,nt(e,t,a,l),t.child;case 14:return id(e,t,t.type,t.pendingProps,l);case 15:return cd(e,t,t.type,t.pendingProps,l);case 19:return vd(e,t,l);case 31:return Qx(e,t,l);case 22:return od(e,t,l,t.pendingProps);case 24:return sa(t),a=at(Ke),e===null?(s=ai(),s===null&&(s=Le,r=ti(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},si(t),kl(t,Ke,s)):((e.lanes&l)!==0&&(ri(e,t),Nn(t,null,null,l),Sn()),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),kl(t,Ke,a)):(a=r.cache,kl(t,Ke,a),a!==s.cache&&ei(t,[Ke],l,!0))),nt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function fl(e){e.flags|=4}function Yi(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(Xd())e.flags|=8192;else throw ca=js,ni}else e.flags&=-16777217}function gd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Df(t))if(Xd())e.flags|=8192;else throw ca=js,ni}function Us(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fc():536870912,e.lanes|=t,Za|=t)}function _n(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Zx(e,t,l){var a=t.pendingProps;switch($r(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),cl(Ke),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(za(t)?fl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fr())),He(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(fl(t),r!==null?(He(t),gd(t,r)):(He(t),Yi(t,s,null,a,l))):r?r!==e.memoizedState?(fl(t),He(t),gd(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&fl(t),He(t),Yi(t,s,e,a,l)),null;case 27:if(gt(t),l=V.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}e=w.current,za(t)?Io(t):(e=kf(s,a,l),t.stateNode=e,fl(t))}return He(t),null;case 5:if(gt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}if(r=w.current,za(t))Io(t);else{var c=Ps(V.current);switch(r){case 1:r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=c.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?c.createElement(s,{is:a.is}):c.createElement(s)}}r[tt]=t,r[ft]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)r.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=r;e:switch(st(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&&fl(t)}}return He(t),Yi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&fl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=V.current,za(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=lt,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[tt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||hf(e.nodeValue,l)),e||Cl(t,!0)}else e=Ps(e).createTextNode(a),e[tt]=t,t.stateNode=e}return He(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=za(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[tt]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else l=Fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Tt(t),t):(Tt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return He(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=za(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[tt]=t}else aa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),s=!1}else s=Fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Tt(t),t):(Tt(t),null)}return Tt(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),Us(t,t.updateQueue),He(t),null);case 4:return ye(),e===null&&oc(t.stateNode.containerInfo),He(t),null;case 10:return cl(t.type),He(t),null;case 19:if(L(Ve),a=t.memoizedState,a===null)return He(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)_n(a,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Ts(e),r!==null){for(t.flags|=128,_n(a,!1),e=r.updateQueue,t.updateQueue=e,Us(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Ko(l,e),l=l.sibling;return X(Ve,Ve.current&1|2),Te&&rl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ze()>Vs&&(t.flags|=128,s=!0,_n(a,!1),t.lanes=4194304)}else{if(!s)if(e=Ts(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Us(t,e),_n(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Te)return He(t),null}else 2*Ze()-a.renderingStartTime>Vs&&l!==536870912&&(t.flags|=128,s=!0,_n(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Ze(),e.sibling=null,l=Ve.current,X(Ve,s?l&1|2:l&1),Te&&rl(t,a.treeForkCount),e):(He(t),null);case 22:case 23:return Tt(t),ui(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),l=t.updateQueue,l!==null&&Us(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&&L(ra),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),cl(Ke),He(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Kx(e,t){switch($r(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cl(Ke),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gt(t),null;case 31:if(t.memoizedState!==null){if(Tt(t),t.alternate===null)throw Error(u(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));aa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(Ve),null;case 4:return ye(),null;case 10:return cl(t.type),null;case 22:case 23:return Tt(t),ui(),e!==null&&L(ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return cl(Ke),null;case 25:return null;default:return null}}function bd(e,t){switch($r(t),t.tag){case 3:cl(Ke),ye();break;case 26:case 27:case 5:gt(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Tt(t);break;case 13:Tt(t);break;case 19:L(Ve);break;case 10:cl(t.type);break;case 22:case 23:Tt(t),ui(),e!==null&&L(ra);break;case 24:cl(Ke)}}function Rn(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,c=l.inst;a=r(),c.destroy=a}l=l.next}while(l!==s)}}catch(f){we(t,t.return,f)}}function zl(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 c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,s=t;var g=l,_=f;try{_()}catch(B){we(s,g,B)}}}a=a.next}while(a!==r)}}catch(B){we(t,t.return,B)}}function jd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{du(t,l)}catch(a){we(e,e.return,a)}}}function Sd(e,t,l){l.props=da(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){we(e,t,a)}}function wn(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){we(e,t,s)}}function It(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){we(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){we(e,t,s)}else l.current=null}function Nd(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){we(e,e.return,s)}}function Gi(e,t,l){try{var a=e.stateNode;pp(a,e.type,l,t),a[ft]=t}catch(s){we(e,e.return,s)}}function Ed(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ql(e.type)||e.tag===4}function Vi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ed(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&&ql(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 Qi(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=al));else if(a!==4&&(a===27&&ql(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Qi(e,t,l),e=e.sibling;e!==null;)Qi(e,t,l),e=e.sibling}function Hs(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&&ql(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Hs(e,t,l),e=e.sibling;e!==null;)Hs(e,t,l),e=e.sibling}function Td(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);st(t,a,l),t[tt]=e,t[ft]=l}catch(r){we(e,e.return,r)}}var ml=!1,We=!1,Xi=!1,Cd=typeof WeakSet=="function"?WeakSet:Set,et=null;function Jx(e,t){if(e=e.containerInfo,fc=rr,e=Uo(e),Ur(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 c=0,f=-1,g=-1,_=0,B=0,q=e,R=null;t:for(;;){for(var O;q!==l||s!==0&&q.nodeType!==3||(f=c+s),q!==r||a!==0&&q.nodeType!==3||(g=c+a),q.nodeType===3&&(c+=q.nodeValue.length),(O=q.firstChild)!==null;)R=q,q=O;for(;;){if(q===e)break t;if(R===l&&++_===s&&(f=c),R===r&&++B===a&&(g=c),(O=q.nextSibling)!==null)break;q=R,R=q.parentNode}q=O}l=f===-1||g===-1?null:{start:f,end:g}}else l=null}l=l||{start:0,end:0}}else l=null;for(mc={focusedElem:e,selectionRange:l},rr=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,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=da(l.type,s);e=a.getSnapshotBeforeUpdate(ae,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(ue){we(l,l.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)hc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hc(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,et=e;break}et=t.return}}function kd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:pl(e,l),a&4&&Rn(5,l);break;case 1:if(pl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){we(l,l.return,c)}else{var s=da(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){we(l,l.return,c)}}a&64&&jd(l),a&512&&wn(l,l.return);break;case 3:if(pl(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{du(e,t)}catch(c){we(l,l.return,c)}}break;case 27:t===null&&a&4&&Td(l);case 26:case 5:pl(e,l),t===null&&a&4&&Nd(l),a&512&&wn(l,l.return);break;case 12:pl(e,l);break;case 31:pl(e,l),a&4&&Rd(e,l);break;case 13:pl(e,l),a&4&&wd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=ap.bind(null,l),Np(e,l))));break;case 22:if(a=l.memoizedState!==null||ml,!a){t=t!==null&&t.memoizedState!==null||We,s=ml;var r=We;ml=a,(We=t)&&!r?hl(e,l,(l.subtreeFlags&8772)!==0):pl(e,l),ml=s,We=r}break;case 30:break;default:pl(e,l)}}function Ad(e){var t=e.alternate;t!==null&&(e.alternate=null,Ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jr(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,xt=!1;function xl(e,t,l){for(l=l.child;l!==null;)_d(e,t,l),l=l.sibling}function _d(e,t,l){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Jt,l)}catch{}switch(l.tag){case 26:We||It(l,t),xl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:We||It(l,t);var a=qe,s=xt;ql(l.type)&&(qe=l.stateNode,xt=!1),xl(e,t,l),qn(l.stateNode),qe=a,xt=s;break;case 5:We||It(l,t);case 6:if(a=qe,s=xt,qe=null,xl(e,t,l),qe=a,xt=s,qe!==null)if(xt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(l.stateNode)}catch(r){we(l,t,r)}else try{qe.removeChild(l.stateNode)}catch(r){we(l,t,r)}break;case 18:qe!==null&&(xt?(e=qe,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),en(e)):Sf(qe,l.stateNode));break;case 4:a=qe,s=xt,qe=l.stateNode.containerInfo,xt=!0,xl(e,t,l),qe=a,xt=s;break;case 0:case 11:case 14:case 15:zl(2,l,t),We||zl(4,l,t),xl(e,t,l);break;case 1:We||(It(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Sd(l,t,a)),xl(e,t,l);break;case 21:xl(e,t,l);break;case 22:We=(a=We)||l.memoizedState!==null,xl(e,t,l),We=a;break;default:xl(e,t,l)}}function Rd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{en(e)}catch(l){we(t,t.return,l)}}}function wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{en(e)}catch(l){we(t,t.return,l)}}function $x(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cd),t;default:throw Error(u(435,e.tag))}}function qs(e,t){var l=$x(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=np.bind(null,e,a);a.then(s,s)}})}function pt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(ql(f.type)){qe=f.stateNode,xt=!1;break e}break;case 5:qe=f.stateNode,xt=!1;break e;case 3:case 4:qe=f.stateNode.containerInfo,xt=!0;break e}f=f.return}if(qe===null)throw Error(u(160));_d(r,c,s),qe=null,xt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Md(t,e),t=t.sibling}var Zt=null;function Md(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),ht(e),a&4&&(zl(3,e,e.return),Rn(3,e),zl(5,e,e.return));break;case 1:pt(t,e),ht(e),a&512&&(We||l===null||It(l,l.return)),a&64&&ml&&(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=Zt;if(pt(t,e),ht(e),a&512&&(We||l===null||It(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[an]||r[tt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),st(r,a,l),r[tt]=e,Pe(r),a=r;break e;case"link":var c=zf("link","href",s).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(r=c[f],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)){c.splice(f,1);break t}}r=s.createElement(a),st(r,a,l),s.head.appendChild(r);break;case"meta":if(c=zf("meta","content",s).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(r=c[f],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)){c.splice(f,1);break t}}r=s.createElement(a),st(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[tt]=e,Pe(r),a=r}e.stateNode=a}else Of(s,e.type,e.stateNode);else e.stateNode=Mf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Of(s,e.type,e.stateNode):Mf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Gi(e,e.memoizedProps,l.memoizedProps)}break;case 27:pt(t,e),ht(e),a&512&&(We||l===null||It(l,l.return)),l!==null&&a&4&&Gi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(pt(t,e),ht(e),a&512&&(We||l===null||It(l,l.return)),e.flags&32){s=e.stateNode;try{Na(s,"")}catch(ae){we(e,e.return,ae)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Gi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Xi=!0);break;case 6:if(pt(t,e),ht(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ae){we(e,e.return,ae)}}break;case 3:if(lr=null,s=Zt,Zt=er(t.containerInfo),pt(t,e),Zt=s,ht(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{en(t.containerInfo)}catch(ae){we(e,e.return,ae)}Xi&&(Xi=!1,zd(e));break;case 4:a=Zt,Zt=er(e.stateNode.containerInfo),pt(t,e),ht(e),Zt=a;break;case 12:pt(t,e),ht(e);break;case 31:pt(t,e),ht(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 13:pt(t,e),ht(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Gs=Ze()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 22:s=e.memoizedState!==null;var g=l!==null&&l.memoizedState!==null,_=ml,B=We;if(ml=_||s,We=B||g,pt(t,e),We=B,ml=_,ht(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||g||ml||We||fa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){g=l=t;try{if(r=g.stateNode,s)c=r.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=g.stateNode;var q=g.memoizedProps.style,R=q!=null&&q.hasOwnProperty("display")?q.display:null;f.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(ae){we(g,g.return,ae)}}}else if(t.tag===6){if(l===null){g=t;try{g.stateNode.nodeValue=s?"":g.memoizedProps}catch(ae){we(g,g.return,ae)}}}else if(t.tag===18){if(l===null){g=t;try{var O=g.stateNode;s?Nf(O,!0):Nf(g.stateNode,!1)}catch(ae){we(g,g.return,ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,qs(e,l))));break;case 19:pt(t,e),ht(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 30:break;case 21:break;default:pt(t,e),ht(e)}}function ht(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Ed(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Vi(e);Hs(e,r,s);break;case 5:var c=l.stateNode;l.flags&32&&(Na(c,""),l.flags&=-33);var f=Vi(e);Hs(e,f,c);break;case 3:case 4:var g=l.stateNode.containerInfo,_=Vi(e);Qi(e,_,g);break;default:throw Error(u(161))}}catch(B){we(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function pl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kd(e,t.alternate,t),t=t.sibling}function fa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zl(4,t,t.return),fa(t);break;case 1:It(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Sd(t,t.return,l),fa(t);break;case 27:qn(t.stateNode);case 26:case 5:It(t,t.return),fa(t);break;case 22:t.memoizedState===null&&fa(t);break;case 30:fa(t);break;default:fa(t)}e=e.sibling}}function hl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,c=r.flags;switch(r.tag){case 0:case 11:case 15:hl(s,r,l),Rn(4,r);break;case 1:if(hl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){we(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var f=a.stateNode;try{var g=s.shared.hiddenCallbacks;if(g!==null)for(s.shared.hiddenCallbacks=null,s=0;s<g.length;s++)uu(g[s],f)}catch(_){we(a,a.return,_)}}l&&c&64&&jd(r),wn(r,r.return);break;case 27:Td(r);case 26:case 5:hl(s,r,l),l&&a===null&&c&4&&Nd(r),wn(r,r.return);break;case 12:hl(s,r,l);break;case 31:hl(s,r,l),l&&c&4&&Rd(s,r);break;case 13:hl(s,r,l),l&&c&4&&wd(s,r);break;case 22:r.memoizedState===null&&hl(s,r,l),wn(r,r.return);break;case 30:break;default:hl(s,r,l)}t=t.sibling}}function Zi(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&&vn(l))}function Ki(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vn(e))}function Kt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Od(e,t,l,a),t=t.sibling}function Od(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Kt(e,t,l,a),s&2048&&Rn(9,t);break;case 1:Kt(e,t,l,a);break;case 3:Kt(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&&vn(e)));break;case 12:if(s&2048){Kt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,c=r.id,f=r.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){we(t,t.return,g)}}else Kt(e,t,l,a);break;case 31:Kt(e,t,l,a);break;case 13:Kt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,c=t.alternate,t.memoizedState!==null?r._visibility&2?Kt(e,t,l,a):Mn(e,t):r._visibility&2?Kt(e,t,l,a):(r._visibility|=2,Va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Zi(c,t);break;case 24:Kt(e,t,l,a),s&2048&&Ki(t.alternate,t);break;default:Kt(e,t,l,a)}}function Va(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,c=t,f=l,g=a,_=c.flags;switch(c.tag){case 0:case 11:case 15:Va(r,c,f,g,s),Rn(8,c);break;case 23:break;case 22:var B=c.stateNode;c.memoizedState!==null?B._visibility&2?Va(r,c,f,g,s):Mn(r,c):(B._visibility|=2,Va(r,c,f,g,s)),s&&_&2048&&Zi(c.alternate,c);break;case 24:Va(r,c,f,g,s),s&&_&2048&&Ki(c.alternate,c);break;default:Va(r,c,f,g,s)}t=t.sibling}}function Mn(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:Mn(l,a),s&2048&&Zi(a.alternate,a);break;case 24:Mn(l,a),s&2048&&Ki(a.alternate,a);break;default:Mn(l,a)}t=t.sibling}}var zn=8192;function Qa(e,t,l){if(e.subtreeFlags&zn)for(e=e.child;e!==null;)Dd(e,t,l),e=e.sibling}function Dd(e,t,l){switch(e.tag){case 26:Qa(e,t,l),e.flags&zn&&e.memoizedState!==null&&Dp(l,Zt,e.memoizedState,e.memoizedProps);break;case 5:Qa(e,t,l);break;case 3:case 4:var a=Zt;Zt=er(e.stateNode.containerInfo),Qa(e,t,l),Zt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=zn,zn=16777216,Qa(e,t,l),zn=a):Qa(e,t,l));break;default:Qa(e,t,l)}}function Ld(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 On(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];et=a,Ud(a,e)}Ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bd(e),e=e.sibling}function Bd(e){switch(e.tag){case 0:case 11:case 15:On(e),e.flags&2048&&zl(9,e,e.return);break;case 3:On(e);break;case 12:On(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ys(e)):On(e);break;default:On(e)}}function Ys(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];et=a,Ud(a,e)}Ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zl(8,t,t.return),Ys(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ys(t));break;default:Ys(t)}e=e.sibling}}function Ud(e,t){for(;et!==null;){var l=et;switch(l.tag){case 0:case 11:case 15:zl(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:vn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,et=a;else e:for(l=e;et!==null;){a=et;var s=a.sibling,r=a.return;if(Ad(a),a===l){et=null;break e}if(s!==null){s.return=r,et=s;break e}et=r}}}var Wx={getCacheForType:function(e){var t=at(Ke),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return at(Ke).controller.signal}},Fx=typeof WeakMap=="function"?WeakMap:Map,_e=0,Le=null,ge=null,Se=0,Re=0,Ct=null,Ol=!1,Xa=!1,Ji=!1,vl=0,Ge=0,Dl=0,ma=0,$i=0,kt=0,Za=0,Dn=null,vt=null,Wi=!1,Gs=0,Hd=0,Vs=1/0,Qs=null,Ll=null,Fe=0,Bl=null,Ka=null,yl=0,Fi=0,Ii=null,qd=null,Ln=0,Pi=null;function At(){return(_e&2)!==0&&Se!==0?Se&-Se:C.T!==null?sc():to()}function Yd(){if(kt===0)if((Se&536870912)===0||Te){var e=In;In<<=1,(In&3932160)===0&&(In=262144),kt=e}else kt=536870912;return e=Et.current,e!==null&&(e.flags|=32),kt}function yt(e,t,l){(e===Le&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(Ja(e,0),Ul(e,Se,kt,!1)),ln(e,l),((_e&2)===0||e!==Le)&&(e===Le&&((_e&2)===0&&(ma|=l),Ge===4&&Ul(e,Se,kt,!1)),Pt(e))}function Gd(e,t,l){if((_e&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||tn(e,t),s=a?ep(e,t):tc(e,t,!0),r=a;do{if(s===0){Xa&&!a&&Ul(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!Ix(l)){s=tc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;s=Dn;var g=f.current.memoizedState.isDehydrated;if(g&&(Ja(f,c).flags|=256),c=tc(f,c,!1),c!==2){if(Ji&&!g){f.errorRecoveryDisabledLanes|=r,ma|=r,s=4;break e}r=vt,vt=s,r!==null&&(vt===null?vt=r:vt.push.apply(vt,r))}s=c}if(r=!1,s!==2)continue}}if(s===1){Ja(e,0),Ul(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:Ul(a,t,kt,!Ol);break e;case 2:vt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Gs+300-Ze(),10<s)){if(Ul(a,t,kt,!Ol),es(a,0,!0)!==0)break e;yl=t,a.timeoutHandle=bf(Vd.bind(null,a,l,vt,Qs,Wi,t,kt,ma,Za,Ol,r,"Throttled",-0,0),s);break e}Vd(a,l,vt,Qs,Wi,t,kt,ma,Za,Ol,r,null,-0,0)}}break}while(!0);Pt(e)}function Vd(e,t,l,a,s,r,c,f,g,_,B,q,R,O){if(e.timeoutHandle=-1,q=t.subtreeFlags,q&8192||(q&16785408)===16785408){q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:al},Dd(t,r,q);var ae=(r&62914560)===r?Gs-Ze():(r&4194048)===r?Hd-Ze():0;if(ae=Lp(q,ae),ae!==null){yl=r,e.cancelPendingCommit=ae(Fd.bind(null,e,t,r,l,a,s,c,f,g,B,q,null,R,O)),Ul(e,r,c,!_);return}}Fd(e,t,r,l,a,s,c,f,g)}function Ix(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(!St(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 Ul(e,t,l,a){t&=~$i,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-jt(s),c=1<<r;a[r]=-1,s&=~c}l!==0&&Ic(e,l,t)}function Xs(){return(_e&6)===0?(Bn(0),!1):!0}function ec(){if(ge!==null){if(Re===0)var e=ge.return;else e=ge,il=na=null,hi(e),Ua=null,gn=0,e=ge;for(;e!==null;)bd(e.alternate,e),e=e.return;ge=null}}function Ja(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,yp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),yl=0,ec(),Le=e,ge=l=sl(e.current,null),Se=t,Re=0,Ct=null,Ol=!1,Xa=tn(e,t),Ji=!1,Za=kt=$i=ma=Dl=Ge=0,vt=Dn=null,Wi=!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-jt(a),r=1<<s;t|=e[s],a&=~r}return vl=t,fs(),l}function Qd(e,t){xe=null,C.H=kn,t===Ba||t===bs?(t=ru(),Re=3):t===ni?(t=ru(),Re=4):Re=t===Mi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ct=t,ge===null&&(Ge=1,Os(e,Lt(t,e.current)))}function Xd(){var e=Et.current;return e===null?!0:(Se&4194048)===Se?qt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===qt:!1}function Zd(){var e=C.H;return C.H=kn,e===null?kn:e}function Kd(){var e=C.A;return C.A=Wx,e}function Zs(){Ge=4,Ol||(Se&4194048)!==Se&&Et.current!==null||(Xa=!0),(Dl&134217727)===0&&(ma&134217727)===0||Le===null||Ul(Le,Se,kt,!1)}function tc(e,t,l){var a=_e;_e|=2;var s=Zd(),r=Kd();(Le!==e||Se!==t)&&(Qs=null,Ja(e,t)),t=!1;var c=Ge;e:do try{if(Re!==0&&ge!==null){var f=ge,g=Ct;switch(Re){case 8:ec(),c=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var _=Re;if(Re=0,Ct=null,$a(e,f,g,_),l&&Xa){c=0;break e}break;default:_=Re,Re=0,Ct=null,$a(e,f,g,_)}}Px(),c=Ge;break}catch(B){Qd(e,B)}while(!0);return t&&e.shellSuspendCounter++,il=na=null,_e=a,C.H=s,C.A=r,ge===null&&(Le=null,Se=0,fs()),c}function Px(){for(;ge!==null;)Jd(ge)}function ep(e,t){var l=_e;_e|=2;var a=Zd(),s=Kd();Le!==e||Se!==t?(Qs=null,Vs=Ze()+500,Ja(e,t)):Xa=tn(e,t);e:do try{if(Re!==0&&ge!==null){t=ge;var r=Ct;t:switch(Re){case 1:Re=0,Ct=null,$a(e,t,r,1);break;case 2:case 9:if(nu(r)){Re=0,Ct=null,$d(t);break}t=function(){Re!==2&&Re!==9||Le!==e||(Re=7),Pt(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:nu(r)?(Re=0,Ct=null,$d(t)):(Re=0,Ct=null,$a(e,t,r,7));break;case 5:var c=null;switch(ge.tag){case 26:c=ge.memoizedState;case 5:case 27:var f=ge;if(c?Df(c):f.stateNode.complete){Re=0,Ct=null;var g=f.sibling;if(g!==null)ge=g;else{var _=f.return;_!==null?(ge=_,Ks(_)):ge=null}break t}}Re=0,Ct=null,$a(e,t,r,5);break;case 6:Re=0,Ct=null,$a(e,t,r,6);break;case 8:ec(),Ge=6;break e;default:throw Error(u(462))}}tp();break}catch(B){Qd(e,B)}while(!0);return il=na=null,C.H=a,C.A=s,_e=l,ge!==null?0:(Le=null,Se=0,fs(),Ge)}function tp(){for(;ge!==null&&!Be();)Jd(ge)}function Jd(e){var t=yd(e.alternate,e,vl);e.memoizedProps=e.pendingProps,t===null?Ks(e):ge=t}function $d(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=fd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=fd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:hi(t);default:bd(l,t),t=ge=Ko(t,vl),t=yd(l,t,vl)}e.memoizedProps=e.pendingProps,t===null?Ks(e):ge=t}function $a(e,t,l,a){il=na=null,hi(t),Ua=null,gn=0;var s=t.return;try{if(Vx(e,s,t,l,Se)){Ge=1,Os(e,Lt(l,e.current)),ge=null;return}}catch(r){if(s!==null)throw ge=s,r;Ge=1,Os(e,Lt(l,e.current)),ge=null;return}t.flags&32768?(Te||a===1?e=!0:Xa||(Se&536870912)!==0?e=!1:(Ol=e=!0,(a===2||a===9||a===3||a===6)&&(a=Et.current,a!==null&&a.tag===13&&(a.flags|=16384))),Wd(t,e)):Ks(t)}function Ks(e){var t=e;do{if((t.flags&32768)!==0){Wd(t,Ol);return}e=t.return;var l=Zx(t.alternate,t,vl);if(l!==null){ge=l;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);Ge===0&&(Ge=5)}function Wd(e,t){do{var l=Kx(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);Ge=6,ge=null}function Fd(e,t,l,a,s,r,c,f,g){e.cancelPendingCommit=null;do Js();while(Fe!==0);if((_e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Vr,Om(e,l,r,c,f,g),e===Le&&(ge=Le=null,Se=0),Ka=t,Bl=e,yl=l,Fi=r,Ii=s,qd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,sp(Qt,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,s=z.p,z.p=2,c=_e,_e|=4;try{Jx(e,t,l)}finally{_e=c,z.p=s,C.T=a}}Fe=1,Id(),Pd(),ef()}}function Id(){if(Fe===1){Fe=0;var e=Bl,t=Ka,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var a=z.p;z.p=2;var s=_e;_e|=4;try{Md(t,e);var r=mc,c=Uo(e.containerInfo),f=r.focusedElem,g=r.selectionRange;if(c!==f&&f&&f.ownerDocument&&Bo(f.ownerDocument.documentElement,f)){if(g!==null&&Ur(f)){var _=g.start,B=g.end;if(B===void 0&&(B=_),"selectionStart"in f)f.selectionStart=_,f.selectionEnd=Math.min(B,f.value.length);else{var q=f.ownerDocument||document,R=q&&q.defaultView||window;if(R.getSelection){var O=R.getSelection(),ae=f.textContent.length,ue=Math.min(g.start,ae),De=g.end===void 0?ue:Math.min(g.end,ae);!O.extend&&ue>De&&(c=De,De=ue,ue=c);var T=Lo(f,ue),E=Lo(f,De);if(T&&E&&(O.rangeCount!==1||O.anchorNode!==T.node||O.anchorOffset!==T.offset||O.focusNode!==E.node||O.focusOffset!==E.offset)){var A=q.createRange();A.setStart(T.node,T.offset),O.removeAllRanges(),ue>De?(O.addRange(A),O.extend(E.node,E.offset)):(A.setEnd(E.node,E.offset),O.addRange(A))}}}}for(q=[],O=f;O=O.parentNode;)O.nodeType===1&&q.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<q.length;f++){var U=q[f];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}rr=!!fc,mc=fc=null}finally{_e=s,z.p=a,C.T=l}}e.current=t,Fe=2}}function Pd(){if(Fe===2){Fe=0;var e=Bl,t=Ka,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var a=z.p;z.p=2;var s=_e;_e|=4;try{kd(e,t.alternate,t)}finally{_e=s,z.p=a,C.T=l}}Fe=3}}function ef(){if(Fe===4||Fe===3){Fe=0,jl();var e=Bl,t=Ka,l=yl,a=qd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Fe=5:(Fe=0,Ka=Bl=null,tf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ll=null),gr(l),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=C.T,s=z.p,z.p=2,C.T=null;try{for(var r=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];r(f.value,{componentStack:f.stack})}}finally{C.T=t,z.p=s}}(yl&3)!==0&&Js(),Pt(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Pi?Ln++:(Ln=0,Pi=e):Ln=0,Bn(0)}}function tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vn(t)))}function Js(){return Id(),Pd(),ef(),lf()}function lf(){if(Fe!==5)return!1;var e=Bl,t=Fi;Fi=0;var l=gr(yl),a=C.T,s=z.p;try{z.p=32>l?32:l,C.T=null,l=Ii,Ii=null;var r=Bl,c=yl;if(Fe=0,Ka=Bl=null,yl=0,(_e&6)!==0)throw Error(u(331));var f=_e;if(_e|=4,Bd(r.current),Od(r,r.current,c,l),_e=f,Bn(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Jt,r)}catch{}return!0}finally{z.p=s,C.T=a,tf(e,t)}}function af(e,t,l){t=Lt(l,t),t=wi(e.stateNode,t,2),e=Rl(e,t,2),e!==null&&(ln(e,2),Pt(e))}function we(e,t,l){if(e.tag===3)af(e,e,l);else for(;t!==null;){if(t.tag===3){af(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ll===null||!Ll.has(a))){e=Lt(l,e),l=nd(2),a=Rl(t,l,2),a!==null&&(sd(l,a,t,e),ln(a,2),Pt(a));break}}t=t.return}}function lc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Fx;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)||(Ji=!0,s.add(l),e=lp.bind(null,e,t,l),t.then(e,e))}function lp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Le===e&&(Se&l)===l&&(Ge===4||Ge===3&&(Se&62914560)===Se&&300>Ze()-Gs?(_e&2)===0&&Ja(e,0):$i|=l,Za===Se&&(Za=0)),Pt(e)}function nf(e,t){t===0&&(t=Fc()),e=ta(e,t),e!==null&&(ln(e,t),Pt(e))}function ap(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),nf(e,l)}function np(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),nf(e,l)}function sp(e,t){return tl(e,t)}var $s=null,Wa=null,ac=!1,Ws=!1,nc=!1,Hl=0;function Pt(e){e!==Wa&&e.next===null&&(Wa===null?$s=Wa=e:Wa=Wa.next=e),Ws=!0,ac||(ac=!0,ip())}function Bn(e,t){if(!nc&&Ws){nc=!0;do for(var l=!1,a=$s;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var c=a.suspendedLanes,f=a.pingedLanes;r=(1<<31-jt(42|e)+1)-1,r&=s&~(c&~f),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,of(a,r))}else r=Se,r=es(a,a===Le?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||tn(a,r)||(l=!0,of(a,r));a=a.next}while(l);nc=!1}}function rp(){sf()}function sf(){Ws=ac=!1;var e=0;Hl!==0&&vp()&&(e=Hl);for(var t=Ze(),l=null,a=$s;a!==null;){var s=a.next,r=rf(a,t);r===0?(a.next=null,l===null?$s=s:l.next=s,s===null&&(Wa=l)):(l=a,(e!==0||(r&3)!==0)&&(Ws=!0)),a=s}Fe!==0&&Fe!==5||Bn(e),Hl!==0&&(Hl=0)}function rf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var c=31-jt(r),f=1<<c,g=s[c];g===-1?((f&l)===0||(f&a)!==0)&&(s[c]=zm(f,t)):g<=t&&(e.expiredLanes|=f),r&=~f}if(t=Le,l=Se,l=es(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&G(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||tn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&G(a),gr(l)){case 2:case 8:l=ha;break;case 32:l=Qt;break;case 268435456:l=Ie;break;default:l=Qt}return a=cf.bind(null,e),l=tl(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&G(a),e.callbackPriority=2,e.callbackNode=null,2}function cf(e,t){if(Fe!==0&&Fe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Js()&&e.callbackNode!==l)return null;var a=Se;return a=es(e,e===Le?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Gd(e,a,t),rf(e,Ze()),e.callbackNode!=null&&e.callbackNode===l?cf.bind(null,e):null)}function of(e,t){if(Js())return null;Gd(e,t,!0)}function ip(){gp(function(){(_e&6)!==0?tl(pa,rp):sf()})}function sc(){if(Hl===0){var e=Da;e===0&&(e=Fn,Fn<<=1,(Fn&261888)===0&&(Fn=256)),Hl=e}return Hl}function uf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ns(""+e)}function df(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 cp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=uf((s[ft]||null).action),c=a.submitter;c&&(t=(t=c[ft]||null)?uf(t.formAction):c.getAttribute("formAction"),t!==null&&(r=t,c=null));var f=new cs("action","action",null,a,s);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Hl!==0){var g=c?df(s,c):new FormData(s);Ti(l,{pending:!0,data:g,method:s.method,action:r},null,g)}}else typeof r=="function"&&(f.preventDefault(),g=c?df(s,c):new FormData(s),Ti(l,{pending:!0,data:g,method:s.method,action:r},r,g))},currentTarget:s}]})}}for(var rc=0;rc<Gr.length;rc++){var ic=Gr[rc],op=ic.toLowerCase(),up=ic[0].toUpperCase()+ic.slice(1);Xt(op,"on"+up)}Xt(Yo,"onAnimationEnd"),Xt(Go,"onAnimationIteration"),Xt(Vo,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(Cx,"onTransitionRun"),Xt(kx,"onTransitionStart"),Xt(Ax,"onTransitionCancel"),Xt(Qo,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),Fl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Un="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(" "),dp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Un));function ff(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 c=a.length-1;0<=c;c--){var f=a[c],g=f.instance,_=f.currentTarget;if(f=f.listener,g!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=_;try{r(s)}catch(B){ds(B)}s.currentTarget=null,r=g}else for(c=0;c<a.length;c++){if(f=a[c],g=f.instance,_=f.currentTarget,f=f.listener,g!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=_;try{r(s)}catch(B){ds(B)}s.currentTarget=null,r=g}}}}function be(e,t){var l=t[br];l===void 0&&(l=t[br]=new Set);var a=e+"__bubble";l.has(a)||(mf(t,e,2,!1),l.add(a))}function cc(e,t,l){var a=0;t&&(a|=4),mf(l,e,a,t)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Fs]){e[Fs]=!0,no.forEach(function(l){l!=="selectionchange"&&(dp.has(l)||cc(l,!1,e),cc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fs]||(t[Fs]=!0,cc("selectionchange",!1,t))}}function mf(e,t,l,a){switch(Gf(t)){case 2:var s=Hp;break;case 8:s=qp;break;default:s=Ec}l=s.bind(null,t,l,e),s=void 0,!_r||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function uc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===s)break;if(c===4)for(c=a.return;c!==null;){var g=c.tag;if((g===3||g===4)&&c.stateNode.containerInfo===s)return;c=c.return}for(;f!==null;){if(c=ya(f),c===null)return;if(g=c.tag,g===5||g===6||g===26||g===27){a=r=c;continue e}f=f.parentNode}}a=a.return}vo(function(){var _=r,B=kr(l),q=[];e:{var R=Xo.get(e);if(R!==void 0){var O=cs,ae=e;switch(e){case"keypress":if(rs(l)===0)break e;case"keydown":case"keyup":O=nx;break;case"focusin":ae="focus",O=zr;break;case"focusout":ae="blur",O=zr;break;case"beforeblur":case"afterblur":O=zr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=bo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Zm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ix;break;case Yo:case Go:case Vo:O=$m;break;case Qo:O=ox;break;case"scroll":case"scrollend":O=Qm;break;case"wheel":O=dx;break;case"copy":case"cut":case"paste":O=Fm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=So;break;case"toggle":case"beforetoggle":O=mx}var ue=(t&4)!==0,De=!ue&&(e==="scroll"||e==="scrollend"),T=ue?R!==null?R+"Capture":null:R;ue=[];for(var E=_,A;E!==null;){var U=E;if(A=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||A===null||T===null||(U=sn(E,T),U!=null&&ue.push(Hn(E,U,A))),De)break;E=E.return}0<ue.length&&(R=new O(R,ae,null,l,B),q.push({event:R,listeners:ue}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",R&&l!==Cr&&(ae=l.relatedTarget||l.fromElement)&&(ya(ae)||ae[va]))break e;if((O||R)&&(R=B.window===B?B:(R=B.ownerDocument)?R.defaultView||R.parentWindow:window,O?(ae=l.relatedTarget||l.toElement,O=_,ae=ae?ya(ae):null,ae!==null&&(De=y(ae),ue=ae.tag,ae!==De||ue!==5&&ue!==27&&ue!==6)&&(ae=null)):(O=null,ae=_),O!==ae)){if(ue=bo,U="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ue=So,U="onPointerLeave",T="onPointerEnter",E="pointer"),De=O==null?R:nn(O),A=ae==null?R:nn(ae),R=new ue(U,E+"leave",O,l,B),R.target=De,R.relatedTarget=A,U=null,ya(B)===_&&(ue=new ue(T,E+"enter",ae,l,B),ue.target=A,ue.relatedTarget=De,U=ue),De=U,O&&ae)t:{for(ue=fp,T=O,E=ae,A=0,U=T;U;U=ue(U))A++;U=0;for(var ie=E;ie;ie=ue(ie))U++;for(;0<A-U;)T=ue(T),A--;for(;0<U-A;)E=ue(E),U--;for(;A--;){if(T===E||E!==null&&T===E.alternate){ue=T;break t}T=ue(T),E=ue(E)}ue=null}else ue=null;O!==null&&xf(q,R,O,ue,!1),ae!==null&&De!==null&&xf(q,De,ae,ue,!0)}}e:{if(R=_?nn(_):window,O=R.nodeName&&R.nodeName.toLowerCase(),O==="select"||O==="input"&&R.type==="file")var ke=Ro;else if(Ao(R))if(wo)ke=Nx;else{ke=jx;var re=bx}else O=R.nodeName,!O||O.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?_&&Tr(_.elementType)&&(ke=Ro):ke=Sx;if(ke&&(ke=ke(e,_))){_o(q,ke,l,B);break e}re&&re(e,R,_),e==="focusout"&&_&&R.type==="number"&&_.memoizedProps.value!=null&&Er(R,"number",R.value)}switch(re=_?nn(_):window,e){case"focusin":(Ao(re)||re.contentEditable==="true")&&(ka=re,Hr=_,xn=null);break;case"focusout":xn=Hr=ka=null;break;case"mousedown":qr=!0;break;case"contextmenu":case"mouseup":case"dragend":qr=!1,Ho(q,l,B);break;case"selectionchange":if(Tx)break;case"keydown":case"keyup":Ho(q,l,B)}var ve;if(Dr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Ca?Co(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(No&&l.locale!=="ko"&&(Ca||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Ca&&(ve=yo()):(Nl=B,Rr="value"in Nl?Nl.value:Nl.textContent,Ca=!0)),re=Is(_,Ne),0<re.length&&(Ne=new jo(Ne,e,null,l,B),q.push({event:Ne,listeners:re}),ve?Ne.data=ve:(ve=ko(l),ve!==null&&(Ne.data=ve)))),(ve=px?hx(e,l):vx(e,l))&&(Ne=Is(_,"onBeforeInput"),0<Ne.length&&(re=new jo("onBeforeInput","beforeinput",null,l,B),q.push({event:re,listeners:Ne}),re.data=ve)),cp(q,e,_,l,B)}ff(q,t)})}function Hn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Is(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=sn(e,l),s!=null&&a.unshift(Hn(e,s,r)),s=sn(e,t),s!=null&&a.push(Hn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function fp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xf(e,t,l,a,s){for(var r=t._reactName,c=[];l!==null&&l!==a;){var f=l,g=f.alternate,_=f.stateNode;if(f=f.tag,g!==null&&g===a)break;f!==5&&f!==26&&f!==27||_===null||(g=_,s?(_=sn(l,r),_!=null&&c.unshift(Hn(l,_,g))):s||(_=sn(l,r),_!=null&&c.push(Hn(l,_,g)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var mp=/\r\n?/g,xp=/\u0000|\uFFFD/g;function pf(e){return(typeof e=="string"?e:""+e).replace(mp,`
49
- `).replace(xp,"")}function hf(e,t){return t=pf(t),pf(e)===t}function Oe(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Na(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Na(e,""+a);break;case"className":ls(e,"class",a);break;case"tabIndex":ls(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ls(e,l,a);break;case"style":po(e,a,r);break;case"data":if(t!=="object"){ls(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=ns(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(l==="formAction"?(t!=="input"&&Oe(e,t,"name",s.name,s,null),Oe(e,t,"formEncType",s.formEncType,s,null),Oe(e,t,"formMethod",s.formMethod,s,null),Oe(e,t,"formTarget",s.formTarget,s,null)):(Oe(e,t,"encType",s.encType,s,null),Oe(e,t,"method",s.method,s,null),Oe(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ns(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=al);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=ns(""+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),ts(e,"popover",a);break;case"xlinkActuate":ll(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ll(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ll(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ll(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ll(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ll(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ll(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ll(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ll(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ts(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=Gm.get(l)||l,ts(e,l,a))}}function dc(e,t,l,a,s,r){switch(l){case"style":po(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"?Na(e,a):(typeof a=="number"||typeof a=="bigint")&&Na(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=al);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!so.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[ft]||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,""):ts(e,l,a)}}}function st(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 c=l[r];if(c!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,r,c,l,null)}}s&&Oe(e,t,"srcSet",l.srcSet,l,null),a&&Oe(e,t,"src",l.src,l,null);return;case"input":be("invalid",e);var f=r=c=s=null,g=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var B=l[a];if(B!=null)switch(a){case"name":s=B;break;case"type":c=B;break;case"checked":g=B;break;case"defaultChecked":_=B;break;case"value":r=B;break;case"defaultValue":f=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Oe(e,t,a,B,l,null)}}uo(e,r,f,g,_,c,s,!1);return;case"select":be("invalid",e),a=c=r=null;for(s in l)if(l.hasOwnProperty(s)&&(f=l[s],f!=null))switch(s){case"value":r=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Oe(e,t,s,f,l,null)}t=r,l=c,e.multiple=!!a,t!=null?Sa(e,!!a,t,!1):l!=null&&Sa(e,!!a,l,!0);return;case"textarea":be("invalid",e),r=s=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":s=f;break;case"children":r=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(u(91));break;default:Oe(e,t,c,f,l,null)}mo(e,a,s,r);return;case"option":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Oe(e,t,g,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<Un.length;a++)be(Un[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(_ in l)if(l.hasOwnProperty(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,_,a,l,null)}return;default:if(Tr(t)){for(B in l)l.hasOwnProperty(B)&&(a=l[B],a!==void 0&&dc(e,t,B,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Oe(e,t,f,a,l,null))}function pp(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,c=null,f=null,g=null,_=null,B=null;for(O in l){var q=l[O];if(l.hasOwnProperty(O)&&q!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":g=q;default:a.hasOwnProperty(O)||Oe(e,t,O,null,a,q)}}for(var R in a){var O=a[R];if(q=l[R],a.hasOwnProperty(R)&&(O!=null||q!=null))switch(R){case"type":r=O;break;case"name":s=O;break;case"checked":_=O;break;case"defaultChecked":B=O;break;case"value":c=O;break;case"defaultValue":f=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:O!==q&&Oe(e,t,R,O,a,q)}}Nr(e,c,f,g,_,B,r,s);return;case"select":O=c=f=R=null;for(r in l)if(g=l[r],l.hasOwnProperty(r)&&g!=null)switch(r){case"value":break;case"multiple":O=g;default:a.hasOwnProperty(r)||Oe(e,t,r,null,a,g)}for(s in a)if(r=a[s],g=l[s],a.hasOwnProperty(s)&&(r!=null||g!=null))switch(s){case"value":R=r;break;case"defaultValue":f=r;break;case"multiple":c=r;default:r!==g&&Oe(e,t,s,r,a,g)}t=f,l=c,a=O,R!=null?Sa(e,!!l,R,!1):!!a!=!!l&&(t!=null?Sa(e,!!l,t,!0):Sa(e,!!l,l?[]:"",!1));return;case"textarea":O=R=null;for(f in l)if(s=l[f],l.hasOwnProperty(f)&&s!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Oe(e,t,f,null,a,s)}for(c in a)if(s=a[c],r=l[c],a.hasOwnProperty(c)&&(s!=null||r!=null))switch(c){case"value":R=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Oe(e,t,c,s,a,r)}fo(e,R,O);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:Oe(e,t,ae,null,a,R)}for(g in a)if(R=a[g],O=l[g],a.hasOwnProperty(g)&&R!==O&&(R!=null||O!=null))switch(g){case"selected":e.selected=R&&typeof R!="function"&&typeof R!="symbol";break;default:Oe(e,t,g,R,a,O)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in l)R=l[ue],l.hasOwnProperty(ue)&&R!=null&&!a.hasOwnProperty(ue)&&Oe(e,t,ue,null,a,R);for(_ in a)if(R=a[_],O=l[_],a.hasOwnProperty(_)&&R!==O&&(R!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:Oe(e,t,_,R,a,O)}return;default:if(Tr(t)){for(var De in l)R=l[De],l.hasOwnProperty(De)&&R!==void 0&&!a.hasOwnProperty(De)&&dc(e,t,De,void 0,a,R);for(B in a)R=a[B],O=l[B],!a.hasOwnProperty(B)||R===O||R===void 0&&O===void 0||dc(e,t,B,R,a,O);return}}for(var T in l)R=l[T],l.hasOwnProperty(T)&&R!=null&&!a.hasOwnProperty(T)&&Oe(e,t,T,null,a,R);for(q in a)R=a[q],O=l[q],!a.hasOwnProperty(q)||R===O||R==null&&O==null||Oe(e,t,q,R,a,O)}function vf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hp(){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,c=s.initiatorType,f=s.duration;if(r&&f&&vf(c)){for(c=0,f=s.responseEnd,a+=1;a<l.length;a++){var g=l[a],_=g.startTime;if(_>f)break;var B=g.transferSize,q=g.initiatorType;B&&vf(q)&&(g=g.responseEnd,c+=B*(g<f?1:(f-_)/(g-_)))}if(--a,t+=8*(r+c)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fc=null,mc=null;function Ps(e){return e.nodeType===9?e:e.ownerDocument}function yf(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 gf(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 xc(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 pc=null;function vp(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var bf=typeof setTimeout=="function"?setTimeout:void 0,yp=typeof clearTimeout=="function"?clearTimeout:void 0,jf=typeof Promise=="function"?Promise:void 0,gp=typeof queueMicrotask=="function"?queueMicrotask:typeof jf<"u"?function(e){return jf.resolve(null).then(e).catch(bp)}:bf;function bp(e){setTimeout(function(){throw e})}function ql(e){return e==="head"}function Sf(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),en(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 c=r.nextSibling,f=r.nodeName;r[an]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=c}}else l==="body"&&qn(e.ownerDocument.body);l=s}while(l);en(t)}function Nf(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 hc(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":hc(l),jr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function jp(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[an])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function Sp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function Ef(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function vc(e){return e.data==="$?"||e.data==="$~"}function yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Np(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gc=null;function Tf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Cf(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 kf(e,t,l){switch(t=Ps(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]);jr(e)}var Gt=new Map,Af=new Set;function er(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gl=z.d;z.d={f:Ep,r:Tp,D:Cp,C:kp,L:Ap,m:_p,X:wp,S:Rp,M:Mp};function Ep(){var e=gl.f(),t=Xs();return e||t}function Tp(e){var t=ga(e);t!==null&&t.tag===5&&t.type==="form"?Qu(t):gl.r(e)}var Fa=typeof document>"u"?null:document;function _f(e,t,l){var a=Fa;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Af.has(s)||(Af.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),st(t,"link",e),Pe(t),a.head.appendChild(t)))}}function Cp(e){gl.D(e),_f("dns-prefetch",e,null)}function kp(e,t){gl.C(e,t),_f("preconnect",e,t)}function Ap(e,t,l){gl.L(e,t,l);var a=Fa;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=Ia(e);break;case"script":r=Pa(e)}Gt.has(r)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Gt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Yn(r))||t==="script"&&a.querySelector(Gn(r))||(t=a.createElement("link"),st(t,"link",e),Pe(t),a.head.appendChild(t)))}}function _p(e,t){gl.m(e,t);var l=Fa;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Pa(e)}if(!Gt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Gt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Gn(r)))return}a=l.createElement("link"),st(a,"link",e),Pe(a),l.head.appendChild(a)}}}function Rp(e,t,l){gl.S(e,t,l);var a=Fa;if(a&&e){var s=ba(a).hoistableStyles,r=Ia(e);t=t||"default";var c=s.get(r);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(Yn(r)))f.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Gt.get(r))&&bc(e,l);var g=c=a.createElement("link");Pe(g),st(g,"link",e),g._p=new Promise(function(_,B){g.onload=_,g.onerror=B}),g.addEventListener("load",function(){f.loading|=1}),g.addEventListener("error",function(){f.loading|=2}),f.loading|=4,tr(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},s.set(r,c)}}}function wp(e,t){gl.X(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Gn(s)),r||(e=b({src:e,async:!0},t),(t=Gt.get(s))&&jc(e,t),r=l.createElement("script"),Pe(r),st(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Mp(e,t){gl.M(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Gn(s)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Gt.get(s))&&jc(e,t),r=l.createElement("script"),Pe(r),st(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Rf(e,t,l,a){var s=(s=V.current)?er(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=Ia(l.href),l=ba(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=Ia(l.href);var r=ba(s).hoistableStyles,c=r.get(e);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,c),(r=s.querySelector(Yn(e)))&&!r._p&&(c.instance=r,c.state.loading=5),Gt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gt.set(e,l),r||zp(s,e,l,c.state))),t&&a===null)throw Error(u(528,""));return c}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=Pa(l),l=ba(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 Ia(e){return'href="'+Ot(e)+'"'}function Yn(e){return'link[rel="stylesheet"]['+e+"]"}function wf(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function zp(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}),st(t,"link",l),Pe(t),e.head.appendChild(t))}function Pa(e){return'[src="'+Ot(e)+'"]'}function Gn(e){return"script[async]"+e}function Mf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,Pe(a),a;var s=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Pe(a),st(a,"style",s),tr(a,l.precedence,e),t.instance=a;case"stylesheet":s=Ia(l.href);var r=e.querySelector(Yn(s));if(r)return t.state.loading|=4,t.instance=r,Pe(r),r;a=wf(l),(s=Gt.get(s))&&bc(a,s),r=(e.ownerDocument||e).createElement("link"),Pe(r);var c=r;return c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),st(r,"link",a),t.state.loading|=4,tr(r,l.precedence,e),t.instance=r;case"script":return r=Pa(l.src),(s=e.querySelector(Gn(r)))?(t.instance=s,Pe(s),s):(a=l,(s=Gt.get(r))&&(a=b({},l),jc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),Pe(s),st(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,tr(a,l.precedence,e));return t.instance}function tr(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,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)r=f;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 bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lr=null;function zf(e,t,l){if(lr===null){var a=new Map,s=lr=new Map;s.set(l,a)}else s=lr,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[an]||r[tt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var c=r.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(r):a.set(c,[r])}}return a}function Of(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Op(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 Df(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dp(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=Ia(a.href),r=t.querySelector(Yn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ar.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,Pe(r);return}r=t.ownerDocument||t,a=wf(a),(s=Gt.get(s))&&bc(a,s),r=r.createElement("link"),Pe(r);var c=r;c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),st(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=ar.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Sc=0;function Lp(e,t){return e.stylesheets&&e.count===0&&sr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&sr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Sc===0&&(Sc=62500*hp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Sc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var nr=null;function sr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,nr=new Map,t.forEach(Bp,e),nr=null,ar.call(e))}function Bp(e,t){if(!(t.state.loading&4)){var l=nr.get(e);if(l)var a=l.get(null);else{l=new Map,nr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var c=s[r];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}s=t.instance,c=s.getAttribute("data-precedence"),r=l.get(c)||a,r===a&&l.set(null,s),l.set(c,s),this.count++,a=ar.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 Vn={$$typeof:ce,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function Up(e,t,l,a,s,r,c,f,g){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vr(0),this.hiddenUpdates=vr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Lf(e,t,l,a,s,r,c,f,g,_,B,q){return e=new Up(e,t,l,c,g,_,B,q,f),t=1,r===!0&&(t|=24),r=Nt(3,null,null,t),e.current=r,r.stateNode=e,t=ti(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},si(r),e}function Bf(e){return e?(e=Ra,e):Ra}function Uf(e,t,l,a,s,r){s=Bf(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&&(yt(l,e,t),jn(l,e,t))}function Hf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Nc(e,t){Hf(e,t),(e=e.alternate)&&Hf(e,t)}function qf(e){if(e.tag===13||e.tag===31){var t=ta(e,67108864);t!==null&&yt(t,e,67108864),Nc(e,67108864)}}function Yf(e){if(e.tag===13||e.tag===31){var t=At();t=yr(t);var l=ta(e,t);l!==null&&yt(l,e,t),Nc(e,t)}}var rr=!0;function Hp(e,t,l,a){var s=C.T;C.T=null;var r=z.p;try{z.p=2,Ec(e,t,l,a)}finally{z.p=r,C.T=s}}function qp(e,t,l,a){var s=C.T;C.T=null;var r=z.p;try{z.p=8,Ec(e,t,l,a)}finally{z.p=r,C.T=s}}function Ec(e,t,l,a){if(rr){var s=Tc(a);if(s===null)uc(e,t,a,ir,l),Vf(e,a);else if(Gp(s,e,t,l,a))a.stopPropagation();else if(Vf(e,a),t&4&&-1<Yp.indexOf(e)){for(;s!==null;){var r=ga(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var c=Wl(r.pendingLanes);if(c!==0){var f=r;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var g=1<<31-jt(c);f.entanglements[1]|=g,c&=~g}Pt(r),(_e&6)===0&&(Vs=Ze()+500,Bn(0))}}break;case 31:case 13:f=ta(r,2),f!==null&&yt(f,r,2),Xs(),Nc(r,2)}if(r=Tc(a),r===null&&uc(e,t,a,ir,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else uc(e,t,a,null,l)}}function Tc(e){return e=kr(e),Cc(e)}var ir=null;function Cc(e){if(ir=null,e=ya(e),e!==null){var t=y(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=x(t),e!==null)return e;e=null}else if(l===31){if(e=j(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 ir=e,null}function Gf(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(it()){case pa:return 2;case ha:return 8;case Qt:case bt:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var kc=!1,Yl=null,Gl=null,Vl=null,Qn=new Map,Xn=new Map,Ql=[],Yp="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 Vf(e,t){switch(e){case"focusin":case"focusout":Yl=null;break;case"dragenter":case"dragleave":Gl=null;break;case"mouseover":case"mouseout":Vl=null;break;case"pointerover":case"pointerout":Qn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xn.delete(t.pointerId)}}function Zn(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=ga(t),t!==null&&qf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Gp(e,t,l,a,s){switch(t){case"focusin":return Yl=Zn(Yl,e,t,l,a,s),!0;case"dragenter":return Gl=Zn(Gl,e,t,l,a,s),!0;case"mouseover":return Vl=Zn(Vl,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return Qn.set(r,Zn(Qn.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Xn.set(r,Zn(Xn.get(r)||null,e,t,l,a,s)),!0}return!1}function Qf(e){var t=ya(e.target);if(t!==null){var l=y(t);if(l!==null){if(t=l.tag,t===13){if(t=x(l),t!==null){e.blockedOn=t,lo(e.priority,function(){Yf(l)});return}}else if(t===31){if(t=j(l),t!==null){e.blockedOn=t,lo(e.priority,function(){Yf(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 cr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Tc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Cr=a,l.target.dispatchEvent(a),Cr=null}else return t=ga(l),t!==null&&qf(t),e.blockedOn=l,!1;t.shift()}return!0}function Xf(e,t,l){cr(e)&&l.delete(t)}function Vp(){kc=!1,Yl!==null&&cr(Yl)&&(Yl=null),Gl!==null&&cr(Gl)&&(Gl=null),Vl!==null&&cr(Vl)&&(Vl=null),Qn.forEach(Xf),Xn.forEach(Xf)}function or(e,t){e.blockedOn===t&&(e.blockedOn=null,kc||(kc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Vp)))}var ur=null;function Zf(e){ur!==e&&(ur=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ur===e&&(ur=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(Cc(a||l)===null)continue;break}var r=ga(l);r!==null&&(e.splice(t,3),t-=3,Ti(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function en(e){function t(g){return or(g,e)}Yl!==null&&or(Yl,e),Gl!==null&&or(Gl,e),Vl!==null&&or(Vl,e),Qn.forEach(t),Xn.forEach(t);for(var l=0;l<Ql.length;l++){var a=Ql[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ql.length&&(l=Ql[0],l.blockedOn===null);)Qf(l),l.blockedOn===null&&Ql.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],c=s[ft]||null;if(typeof r=="function")c||Zf(l);else if(c){var f=null;if(r&&r.hasAttribute("formAction")){if(s=r,c=r[ft]||null)f=c.formAction;else if(Cc(s)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),Zf(l)}}}function Kf(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(c){return s=c})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var 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 Ac(e){this._internalRoot=e}dr.prototype.render=Ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=At();Uf(l,a,e,t,null,null)},dr.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Uf(e.current,2,null,e,null,null),Xs(),t[va]=null}};function dr(e){this._internalRoot=e}dr.prototype.unstable_scheduleHydration=function(e){if(e){var t=to();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ql.length&&t!==0&&t<Ql[l].priority;l++);Ql.splice(l,0,e),l===0&&Qf(e)}};var Jf=o.version;if(Jf!=="19.2.4")throw Error(u(527,Jf,"19.2.4"));z.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=m(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fr.isDisabled&&fr.supportsFiber)try{Jt=fr.inject(Qp),Me=fr}catch{}}return Jn.createRoot=function(e,t){if(!p(e))throw Error(u(299));var l=!1,a="",s=ed,r=td,c=ld;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&&(c=t.onRecoverableError)),t=Lf(e,1,!1,null,null,l,a,null,s,r,c,Kf),e[va]=t.current,oc(e),new Ac(t)},Jn.hydrateRoot=function(e,t,l){if(!p(e))throw Error(u(299));var a=!1,s="",r=ed,c=td,f=ld,g=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&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(g=l.formState)),t=Lf(e,1,!0,t,l??null,a,s,g,r,c,f,Kf),t.context=Bf(null),l=t.current,a=At(),a=yr(a),s=_l(a),s.callback=null,Rl(l,s,a),l=a,t.current.lanes=l,ln(t,l),Pt(t),e[va]=t.current,oc(e),new dr(t)},Jn.version="19.2.4",Jn}var nm;function eh(){if(nm)return wc.exports;nm=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(),wc.exports=Pp(),wc.exports}var th=eh();const jm="";class Sm extends Error{constructor(o,d){super(o),this.name="ApiError",this.status=d}}async function Xe(i,o){const d=await fetch(`${jm}${i}`,o);if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Sm(u.error||`HTTP ${d.status}`,d.status)}return d.json()}const je={getConfig(){return Xe("/api/config")},setConfig(i,o){return Xe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return Xe("/api/skills")},getSkillDetail(i,o){return Xe(`/api/skills/${i}/${o}`)},getEvals(i,o){return Xe(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,d){return Xe(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},generateEvals(i,o){return Xe(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const d=await fetch(`${jm}/api/skills/${i}/${o}/benchmark/latest`);if(d.status===404)return null;if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Sm(u.error||`HTTP ${d.status}`,d.status)}return d.json()},getHistory(i,o,d){const u=new URLSearchParams;d!=null&&d.model&&u.set("model",d.model),d!=null&&d.type&&u.set("type",d.type),d!=null&&d.from&&u.set("from",d.from),d!=null&&d.to&&u.set("to",d.to);const p=u.toString();return Xe(`/api/skills/${i}/${o}/history${p?"?"+p:""}`)},getHistoryEntry(i,o,d){return Xe(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`)},compareRuns(i,o,d,u){return Xe(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(d)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,o,d,u){const p=new URLSearchParams;u&&p.set("model",u);const y=p.toString();return Xe(`/api/skills/${i}/${o}/history/case/${d}${y?"?"+y:""}`)},deleteHistoryEntry(i,o,d){return Xe(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`,{method:"DELETE"})},improveSkill(i,o,d){return Xe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},instructEdit(i,o,d){return Xe(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...d})})},applyImprovement(i,o,d){return Xe(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:d})})},getStats(i,o){return Xe(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return Xe(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return Xe("/api/project-layout")},createSkill(i){return Xe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return Xe("/api/skill-creator-status")},generateSkill(i){return Xe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}};function lh(i){const[o,d]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const u=window.matchMedia(i);d(u.matches);const p=y=>d(y.matches);return u.addEventListener("change",p),()=>u.removeEventListener("change",p)},[i]),o}const ah={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function nh(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 Nm=v.createContext(null);function xa(){const i=v.useContext(Nm);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function sh({children:i}){const[o,d]=v.useReducer(nh,ah),u=lh("(max-width: 767px)");v.useEffect(()=>{d({type:"SET_MOBILE",isMobile:u})},[u]);const p=v.useCallback(()=>{d({type:"SET_SKILLS_LOADING",loading:!0}),je.getSkills().then(b=>d({type:"SET_SKILLS",skills:b})).catch(b=>d({type:"SET_SKILLS_ERROR",error:b.message}))},[]);v.useEffect(()=>{p()},[p]);const y=v.useCallback(b=>{d({type:"SELECT_SKILL",skill:b})},[]),x=v.useCallback(()=>{d({type:"CLEAR_SELECTION"})},[]),j=v.useCallback(b=>{d({type:"SET_MODE",mode:b})},[]),h=v.useCallback(b=>{d({type:"SET_SEARCH",query:b})},[]),m=v.useCallback(b=>{d({type:"SET_MOBILE_VIEW",view:b})},[]),N=v.useMemo(()=>({state:o,selectSkill:y,clearSelection:x,setMode:j,setSearch:h,setMobileView:m,refreshSkills:p}),[o,y,x,j,h,m,p]);return n.jsx(Nm.Provider,{value:N,children:i})}function rh({left:i,right:o}){const{state:d}=xa();return d.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:d.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children: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 ih(){const{state:i,setSearch:o}=xa(),[d,u]=v.useState(i.searchQuery),p=v.useRef(null);v.useEffect(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{o(d)},200),()=>{p.current&&clearTimeout(p.current)}),[d,o]),v.useEffect(()=>{i.searchQuery===""&&d!==""&&u("")},[i.searchQuery]);const y=new Set(i.skills.map(x=>x.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:d,onChange:x=>u(x.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:x=>{x.currentTarget.style.borderColor="var(--accent)"},onBlur:x=>{x.currentTarget.style.borderColor="var(--border-subtle)"}}),d&&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 ",y," plugin",y!==1?"s":""]})]})}const sm={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 rm({skill:i,isSelected:o,onSelect:d}){const u=sm[i.benchmarkStatus]||sm.missing,p=i.origin==="installed";return n.jsxs("button",{onClick:d,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background: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:p?.7:1},onMouseEnter:y=>{o||(y.currentTarget.style.background="var(--surface-2)")},onMouseLeave:y=>{o||(y.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:[p&&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 im(i){var d;const o={};for(const u of i)(o[d=u.plugin]||(o[d]=[])).push(u);return o}function ch(){const{state:i,selectSkill:o}=xa(),{skills:d,searchQuery:u,selectedSkill:p}=i,[y,x]=v.useState(!1),[j,h]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:m,installedGroups:N}=v.useMemo(()=>{const b=u.toLowerCase(),k=b?d.filter(Z=>Z.skill.toLowerCase().includes(b)||Z.plugin.toLowerCase().includes(b)):d,M=k.filter(Z=>Z.origin==="source"),H=k.filter(Z=>Z.origin==="installed");return{sourceGroups:Object.entries(im(M)),installedGroups:Object.entries(im(H))}},[d,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(b=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},b))}):m.length===0&&N.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:[m.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(oh,{title:"Your Skills",count:m.reduce((b,[,k])=>b+k.length,0)}),m.map(([b,k])=>n.jsxs("div",{children:[n.jsx(cm,{plugin:b,count:k.length}),k.map(M=>{const H=(p==null?void 0:p.plugin)===M.plugin&&(p==null?void 0:p.skill)===M.skill;return n.jsx(rm,{skill:M,isSelected:H,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},b))]}),N.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>x(b=>!b),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:y?"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:y?"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:["(",N.reduce((b,[,k])=>b+k.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"})]})]}),y&&n.jsxs(n.Fragment,{children:[!j&&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:()=>{h(!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"})]})})]}),N.map(([b,k])=>n.jsxs("div",{children:[n.jsx(cm,{plugin:b,count:k.length}),k.map(M=>{const H=(p==null?void 0:p.plugin)===M.plugin&&(p==null?void 0:p.skill)===M.skill;return n.jsx(rm,{skill:M,isSelected:H,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},b))]})]})]})}function oh({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 cm({plugin:i,count:o}){const[d,u]=v.useState(!1),p=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[d?n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):n.jsx("img",{src:p,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 uh(){const[i,o]=v.useState(null),[d,u]=v.useState(!1),[p,y]=v.useState(!1),x=v.useRef(null);v.useEffect(()=>{je.getConfig().then(o).catch(()=>{})},[]),v.useEffect(()=>{function N(b){x.current&&!x.current.contains(b.target)&&u(!1)}return d&&document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[d]);async function j(N,b){y(!0);try{const k=await je.setConfig(N.id,b.id);o(k),u(!1)}catch{const k=await je.getConfig();o(k)}finally{y(!1)}}if(!i)return null;const h=fh(i),m=dh(i);return n.jsxs("div",{ref:x,className:"relative",children:[n.jsxs("button",{onClick:()=>u(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:N=>{d||(N.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:N=>{d||(N.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:m!=null&&m.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:h}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&n.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(N=>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:N.available?"var(--green)":"var(--text-tertiary)",opacity:N.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:N.available?1:.5},children:N.label})]}),N.models.map(b=>{const k=Em(i,N.id,b.id),M=!N.available||p;return n.jsxs("button",{onClick:()=>!M&&j(N,b),disabled:M,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:k?"var(--accent-muted)":"transparent",color:M?"var(--text-tertiary)":"var(--text-primary)",opacity:M?.4:1,cursor:M?"not-allowed":"pointer"},onMouseEnter:H=>{!M&&!k&&(H.currentTarget.style.background="var(--surface-3)")},onMouseLeave:H=>{k||(H.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 ${k?"var(--accent)":"var(--border-subtle)"}`},children:k&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:k?600:400},title:b.id,children:b.label})]},`${N.id}-${b.id}`)})]},N.id))})]})]})}function Em(i,o,d){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${d}`:i.model===d}function dh(i){return i.providers.find(o=>o.id===i.provider)}function fh(i){for(const o of i.providers)for(const d of o.models)if(Em(i,o.id,d.id))return d.label;return i.model}function mh(){const{state:i,setMode:o}=xa(),[d,u]=v.useState(null),[p,y]=v.useState(null),[x,j]=v.useState(!1);return v.useEffect(()=>{je.getConfig().then(h=>u(h.projectName)).catch(()=>{}),je.getSkillCreatorStatus().then(y).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:d||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(uh,{})})]}),n.jsx(ih,{}),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:h=>{i.mode!=="create"&&(h.currentTarget.style.background="var(--surface-4)",h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{i.mode!=="create"&&(h.currentTarget.style.background="var(--surface-3)",h.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"]})}),p&&n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:p.installed?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"]}):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(p.installCommand).then(()=>{j(!0),setTimeout(()=>j(!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:h=>{h.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border-subtle)"},children:x?"Copied!":p.installCommand})]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(ch,{})})]})}const xh="modulepreload",ph=function(i){return"/"+i},om={},hh=function(o,d,u){let p=Promise.resolve();if(d&&d.length>0){let x=function(m){return Promise.all(m.map(N=>Promise.resolve(N).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),h=(j==null?void 0:j.nonce)||(j==null?void 0:j.getAttribute("nonce"));p=x(d.map(m=>{if(m=ph(m),m in om)return;om[m]=!0;const N=m.endsWith(".css"),b=N?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${b}`))return;const k=document.createElement("link");if(k.rel=N?"stylesheet":xh,N||(k.as="script"),k.crossOrigin="",k.href=m,h&&k.setAttribute("nonce",h),document.head.appendChild(k),N)return new Promise((M,H)=>{k.addEventListener("load",M),k.addEventListener("error",()=>H(new Error(`Unable to preload CSS for ${m}`)))})}))}function y(x){const j=new Event("vite:preloadError",{cancelable:!0});if(j.payload=x,window.dispatchEvent(j),!j.defaultPrevented)throw x}return p.then(x=>{for(const j of x||[])j.status==="rejected"&&y(j.reason);return o().catch(y)})};function Dc(){const[i,o]=v.useState([]),[d,u]=v.useState(!1),[p,y]=v.useState(!1),[x,j]=v.useState(null),h=v.useRef(null),m=v.useCallback(async(b,k)=>{o([]),u(!0),y(!1),j(null);const M=new AbortController;h.current=M;try{const H=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:k?JSON.stringify(k):void 0,signal:M.signal});if(!H.ok||!H.body)throw new Error(`HTTP ${H.status}`);const Z=H.body.getReader(),$=new TextDecoder;let se="",I="";for(;;){const{done:ce,value:Q}=await Z.read();if(ce)break;se+=$.decode(Q,{stream:!0});const W=se.split(`
50
- `);se=W.pop()||"";for(const ne of W)if(ne.startsWith("event: "))I=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const F=JSON.parse(ne.slice(6)),le={event:I,data:F};I==="done"?(y(!0),o(te=>[...te,le])):o(te=>[...te,le])}catch{}I=""}}}catch(H){H.name!=="AbortError"&&j(H.message)}finally{u(!1),h.current=null}},[]),N=v.useCallback(()=>{var b;(b=h.current)==null||b.abort()},[]);return{events:i,running:d,done:p,error:x,start:m,stop:N}}function vh(i){const o=v.useRef(i);o.current=i;const[d,u]=v.useState(new Set),p=v.useRef(new Map),y=v.useCallback(async(m,N,b)=>{var M;(M=p.current.get(m))==null||M.abort();const k=new AbortController;p.current.set(m,k),u(H=>{const Z=new Set(H);return Z.add(m),Z});try{const H=await fetch(N,{method:"POST",headers:{"Content-Type":"application/json"},body:b?JSON.stringify(b):void 0,signal:k.signal});if(!H.ok||!H.body)throw new Error(`HTTP ${H.status}`);const Z=H.body.getReader(),$=new TextDecoder;let se="",I="";for(;;){const{done:ce,value:Q}=await Z.read();if(ce)break;se+=$.decode(Q,{stream:!0});const W=se.split(`
51
- `);se=W.pop()||"";for(const ne of W)if(ne.startsWith("event: "))I=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const F=JSON.parse(ne.slice(6)),le={event:I,data:F};o.current.onEvent(m,le)}catch{}I=""}}o.current.onDone(m)}catch(H){H.name!=="AbortError"&&o.current.onError(m,H.message)}finally{u(H=>{const Z=new Set(H);return Z.delete(m),Z}),p.current.delete(m)}},[]),x=v.useCallback(m=>{var N;(N=p.current.get(m))==null||N.abort()},[]),j=v.useCallback(()=>{for(const m of p.current.values())m.abort()},[]),h=d.size>0;return{runningSet:d,startCase:y,stopCase:x,stopAll:j,isAnyCaseRunning:h}}const yh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,loading:!0,error:null};function gh(i,o){var d,u;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const p=new Map;if(o.benchmark)for(const x of o.benchmark.cases)p.set(x.eval_id,{status:x.status,passRate:x.pass_rate,errorMessage:x.error_message||void 0,durationMs:x.durationMs,tokens:x.tokens,output:x.output,assertions:x.assertions.map(j=>({assertion_id:j.id,text:j.text,pass:j.pass,reasoning:j.reasoning}))});const y=((u=(d=o.evals)==null?void 0:d.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,latestBenchmark:o.benchmark,inlineResults:p,selectedCaseId:y,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 p=new Map(i.caseRunStates);return p.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:p,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);p.set(o.caseId,{status:"complete",mode:y==null?void 0:y.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,o.result),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_ERROR":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);p.set(o.caseId,{status:"error",mode:y==null?void 0:y.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_CANCEL":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);return p.set(o.caseId,{status:"cancelled",mode:y==null?void 0:y.mode}),{...i,caseRunStates:p}}case"BULK_RUN_START":{const p=new Map(i.caseRunStates);for(const y of o.caseIds)p.set(y,{status:"queued",mode:o.mode});return{...i,caseRunStates:p,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 p=new Map(i.caseRunStates);for(const[y,x]of p)(x.status==="running"||x.status==="queued")&&p.set(y,{status:"cancelled"});return{...i,caseRunStates:p,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const p=new Map(i.inlineResults);return p.set(o.evalId,o.result),{...i,inlineResults:p}}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 p=o.evalChanges??[],y=new Map;for(let x=0;x<p.length;x++)y.set(x,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:p},aiEditEvalChanges:p,aiEditEvalSelections:y}}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 p=new Map(i.aiEditEvalSelections);return p.set(o.index,!p.get(o.index)),{...i,aiEditEvalSelections:p}}case"SELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const y of p.keys())p.set(y,!0);return{...i,aiEditEvalSelections:p}}case"DESELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const y of p.keys())p.set(y,!1);return{...i,aiEditEvalSelections:p}}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};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};default:return i}}const Tm=v.createContext(null);function el(){const i=v.useContext(Tm);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function bh({plugin:i,skill:o,origin:d,children:u}){const p=d==="installed",[y,x]=v.useReducer(gh,{...yh,plugin:i,skill:o}),j=v.useRef(new Set),h=v.useRef(new Set),m=v.useRef(new Map),N=v.useCallback((w,Y)=>{const V=Y.data;let K=m.current.get(w);if(K||(K={assertions:[]},m.current.set(w,K)),Y.event==="output_ready"&&(K.output=V.output,V.durationMs!=null&&(K.durationMs=V.durationMs),V.tokens!=null&&(K.tokens=V.tokens)),Y.event==="assertion_result"){const fe={assertion_id:V.assertion_id,text:V.text,pass:V.pass,reasoning:V.reasoning};K.assertions.find(ye=>ye.assertion_id===fe.assertion_id)||K.assertions.push(fe)}Y.event==="case_complete"&&(K.status=V.status,K.passRate=V.pass_rate,K.errorMessage=V.error_message||void 0,K.classifiedError=V.classified_error||void 0),x({type:"UPDATE_INLINE_RESULT",evalId:w,result:{...K,assertions:[...K.assertions]}})},[]),b=v.useCallback(w=>{if(h.current.has(w))return;h.current.add(w);const Y=m.current.get(w)??{assertions:[]};x({type:"CASE_RUN_COMPLETE",caseId:w,result:{...Y,assertions:[...Y.assertions]}}),j.current.has(w)&&(j.current.delete(w),j.current.size===0&&je.getLatestBenchmark(i,o).then(V=>x({type:"BULK_RUN_COMPLETE",benchmark:V})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),k=v.useCallback((w,Y)=>{h.current.has(w)||(h.current.add(w),x({type:"CASE_RUN_ERROR",caseId:w,error:Y}),j.current.has(w)&&(j.current.delete(w),j.current.size===0&&je.getLatestBenchmark(i,o).then(V=>x({type:"BULK_RUN_COMPLETE",benchmark:V})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:M,stopCase:H,stopAll:Z}=vh({onEvent:N,onDone:b,onError:k});v.useEffect(()=>()=>{Z()},[Z]),v.useEffect(()=>{let w=!1;async function Y(){try{const[V,K,fe]=await Promise.allSettled([je.getSkillDetail(i,o),je.getEvals(i,o),je.getLatestBenchmark(i,o)]);if(w)return;x({type:"INIT_DATA",skillContent:V.status==="fulfilled"?V.value.skillContent:"",evals:K.status==="fulfilled"?K.value:null,benchmark:fe.status==="fulfilled"?fe.value:null})}catch(V){w||x({type:"SET_ERROR",error:V.message})}}return Y(),()=>{w=!0}},[i,o]);const $=v.useCallback(async()=>{if(!p)try{await je.applyImprovement(i,o,y.skillContent),x({type:"CONTENT_SAVED"})}catch(w){x({type:"SET_ERROR",error:w.message})}},[p,i,o,y.skillContent]),se=v.useCallback(async w=>{if(!p)try{const Y=await je.saveEvals(i,o,w);x({type:"SET_EVALS",evals:Y})}catch(Y){x({type:"SET_ERROR",error:Y.message})}},[p,i,o]),I=v.useCallback((w,Y="benchmark")=>{if(p)return;const V=y.caseRunStates.get(w);if((V==null?void 0:V.status)!=="running")if(m.current.delete(w),h.current.delete(w),x({type:"CASE_RUN_START",caseId:w,mode:Y}),Y==="comparison"){const K=`/api/skills/${i}/${o}/compare`;M(w,K,{eval_ids:[w]})}else{const K=`/api/skills/${i}/${o}/benchmark/case/${w}`;M(w,K,Y==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,y.caseRunStates,M]),ce=v.useCallback((w="benchmark")=>{var K;if(p)return;const Y=((K=y.evals)==null?void 0:K.evals)??[];if(Y.length===0)return;const V=Y.map(fe=>fe.id);for(const fe of V)m.current.delete(fe),h.current.delete(fe);x({type:"BULK_RUN_START",caseIds:V,mode:w}),j.current=new Set(V);for(const fe of V)if(w==="comparison")M(fe,`/api/skills/${i}/${o}/compare`,{eval_ids:[fe]});else{const ye=`/api/skills/${i}/${o}/benchmark/case/${fe}`;M(fe,ye,w==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,y.evals,M]),Q=v.useCallback(w=>{H(w),x({type:"CASE_RUN_CANCEL",caseId:w}),j.current.delete(w),h.current.add(w)},[H]),W=v.useCallback(()=>{Z(),x({type:"CANCEL_ALL"}),j.current.clear()},[Z]),ne=v.useCallback(async(w,Y)=>{x({type:"OPEN_IMPROVE",evalId:w})},[]),F=v.useCallback(async(w,Y)=>{try{await je.applyImprovement(i,o,Y),x({type:"SET_CONTENT",content:Y}),x({type:"CONTENT_SAVED"}),x({type:"CLOSE_IMPROVE"}),I(w,"benchmark")}catch(V){x({type:"SET_ERROR",error:V.message})}},[i,o,I]),le=Dc(),te=v.useRef(null);v.useEffect(()=>{if(le.events.length)for(const w of le.events){const Y=w.data;if(w.event==="progress"&&x({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),w.event==="done"){const V=Y.improved,K=Y.reasoning,fe=Y.evalChanges??[];x({type:"AI_EDIT_RESULT",improved:V,reasoning:K,evalChanges:fe})}if(w.event==="error"){const V=Y;x({type:"AI_EDIT_ERROR",message:V.description||"Unknown error",classified:V})}}},[le.events]),v.useEffect(()=>{le.error&&x({type:"AI_EDIT_ERROR",message:le.error})},[le.error]),v.useEffect(()=>()=>{le.stop()},[le.stop]);const pe=v.useCallback(async(w,Y,V)=>{p||(x({type:"AI_EDIT_LOADING"}),te.current=le.stop,le.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:w,content:y.skillContent,evals:y.evals??{skill_name:o,evals:[]},provider:Y,model:V}))},[p,i,o,y.skillContent,y.evals,le]),Ee=v.useCallback(()=>{le.stop(),x({type:"AI_EDIT_ERROR",message:"Cancelled"})},[le]),he=v.useCallback(async()=>{const w=y.aiEditResult;if(w!=null&&w.improved)try{if(await je.applyImprovement(i,o,w.improved),x({type:"SET_CONTENT",content:w.improved}),x({type:"CONTENT_SAVED"}),y.aiEditEvalChanges.length>0&&Array.from(y.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:V}=await hh(async()=>{const{mergeEvalChanges:ye}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ye}},[]),K=y.evals??{skill_name:o,evals:[]},fe=V(K,y.aiEditEvalChanges,y.aiEditEvalSelections);try{const ye=await je.saveEvals(i,o,fe);x({type:"SET_EVALS",evals:ye})}catch(ye){x({type:"SET_EVALS_RETRY",evalsFile:fe}),x({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ye.message}. You can retry from the AI Edit panel.`});return}}x({type:"CLOSE_AI_EDIT"})}catch(Y){x({type:"SET_ERROR",error:Y.message})}},[i,o,y.aiEditResult,y.evals,y.aiEditEvalChanges,y.aiEditEvalSelections]),J=v.useCallback(()=>{x({type:"CLOSE_AI_EDIT"})},[]),oe=v.useCallback(w=>{x({type:"TOGGLE_EVAL_CHANGE",index:w})},[]),Ce=v.useCallback(()=>{x({type:"SELECT_ALL_EVAL_CHANGES"})},[]),C=v.useCallback(()=>{x({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),z=v.useCallback(async()=>{const w=y.aiEditEvalsRetry;if(w)try{const Y=await je.saveEvals(i,o,w);x({type:"SET_EVALS",evals:Y}),x({type:"SET_ERROR",error:null}),x({type:"CLOSE_AI_EDIT"})}catch(Y){x({type:"SET_ERROR",error:`Retry failed: ${Y.message}`})}},[i,o,y.aiEditEvalsRetry]),D=v.useCallback(async()=>{try{const w=await je.getSkillDetail(i,o);x({type:"SET_CONTENT",content:w.skillContent}),x({type:"CONTENT_SAVED"})}catch{}},[i,o]),ee=Dc();v.useEffect(()=>{if(ee.events.length)for(const w of ee.events){const Y=w.data;if(w.event==="progress"&&x({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),w.event==="done"){const V=Y;je.saveEvals(i,o,V).then(K=>x({type:"GENERATE_EVALS_DONE",evals:K})).catch(K=>x({type:"SET_ERROR",error:K.message}))}w.event==="error"&&x({type:"GENERATE_EVALS_ERROR",classified:Y})}},[ee.events,i,o]),v.useEffect(()=>{ee.error&&x({type:"SET_ERROR",error:ee.error})},[ee.error]),v.useEffect(()=>()=>{ee.stop()},[ee.stop]);const de=v.useCallback(async()=>{p||(x({type:"GENERATE_EVALS_START"}),ee.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[p,i,o,ee]),S=Dc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const w of S.events)w.event==="prompt_result"&&x({type:"ACTIVATION_RESULT",result:w.data}),w.event==="done"&&x({type:"ACTIVATION_DONE",summary:w.data})},[S.events]),v.useEffect(()=>{S.error&&x({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const L=v.useCallback(w=>{const V=w.trim().split(`
52
- `).filter(Boolean).map(K=>K.startsWith("!")?{prompt:K.slice(1).trim(),expected:"should_not_activate"}:K.startsWith("+")?{prompt:K.slice(1).trim(),expected:"should_activate"}:{prompt:K.trim(),expected:"auto"});x({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${o}/activation-test`,{prompts:V})},[i,o,S]),X=v.useMemo(()=>({state:y,dispatch:x,isReadOnly:p,saveContent:$,saveEvals:se,runCase:I,runAll:ce,cancelCase:Q,cancelAll:W,improveForCase:ne,applyImproveAndRerun:F,refreshSkillContent:D,generateEvals:de,runActivationTest:L,submitAiEdit:pe,cancelAiEdit:Ee,applyAiEdit:he,discardAiEdit:J,toggleEvalChange:oe,selectAllEvalChanges:Ce,deselectAllEvalChanges:C,retryEvalsSave:z}),[y,p,$,se,I,ce,Q,W,ne,F,D,de,L,pe,Ee,he,J,oe,Ce,C,z]);return n.jsx(Tm.Provider,{value:X,children:u})}function jh({state:i,isReadOnly:o}){const{plugin:d,skill:u,evals:p,latestBenchmark:y,isDirty:x,caseRunStates:j,regressions:h,iterationCount:m}=i,N=Array.from(j.values()).some($=>$.status==="running"||$.status==="queued"),b=y==null?void 0:y.overall_pass_rate,k=(p==null?void 0:p.evals.reduce(($,se)=>$+se.assertions.length,0))??0,M=(p==null?void 0:p.evals.length)??0,H=b!=null?b>=80?"var(--green)":b>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",Z=b!=null?b>=80?"var(--green-muted)":b>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:d}),n.jsx(Sh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:u}),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"]}),x&&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"}),N&&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:[h.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"})]}),h.length," regression",h.length>1?"s":""]}),m>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",m]}),n.jsx("span",{className:"pill",style:{background:Z,color:H},children:b!=null?`${Math.round(b*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[M," case",M!==1?"s":""," / ",k," assert",k!==1?"s":""]})]})]})}function Sh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Nh=[{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 Eh({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 Th({activePanel:i,onPanelChange:o,isDirty:d,isRunning:u,hasRegressions:p,isActivationRunning:y}){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:Nh.map((x,j)=>n.jsxs("div",{className:"flex items-center",children:[j>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),x.tabs.map(h=>{const m=i===h.id,N=h.id==="editor"&&d||h.id==="run"&&u||h.id==="activation"&&y||h.id==="history"&&p,b=h.id==="run"||h.id==="activation"?"var(--accent)":h.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>o(h.id),title:`${h.label} (Ctrl+${h.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:m?"var(--text-primary)":"var(--text-tertiary)",borderBottom:m?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:m?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:k=>{m||(k.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:k=>{m||(k.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(Eh,{id:h.id}),h.label,N&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:b}})]},h.id)})]},x.label))})}function Ch(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const d=o[1],u=o[2].trim(),p={},y=d.split(`
48
+ `+a.stack}}var ot=Object.prototype.hasOwnProperty,tl=i.unstable_scheduleCallback,V=i.unstable_cancelCallback,Be=i.unstable_shouldYield,Nl=i.unstable_requestPaint,Ke=i.unstable_now,tt=i.unstable_getCurrentPriorityLevel,ll=i.unstable_ImmediatePriority,al=i.unstable_UserBlockingPriority,Qt=i.unstable_NormalPriority,jt=i.unstable_LowPriority,Ve=i.unstable_IdlePriority,ut=i.log,Fl=i.unstable_setDisableYieldValue,Jt=null,Me=null;function $t(e){if(typeof ut=="function"&&Fl(e),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Jt,e)}catch{}}var St=Math.clz32?Math.clz32:Mm,Rm=Math.log,wm=Math.LN2;function Mm(e){return e>>>=0,e===0?32:31-(Rm(e)/wm|0)|0}var Fn=256,In=262144,Pn=4194304;function Il(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 es(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~r,a!==0?s=Il(a):(c&=f,c!==0?s=Il(c):l||(l=f&~e,l!==0&&(s=Il(l))))):(f=a&~r,f!==0?s=Il(f):c!==0?s=Il(c):l||(l=a&~e,l!==0&&(s=Il(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 tn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zm(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 Fc(){var e=Pn;return Pn<<=1,(Pn&62914560)===0&&(Pn=4194304),e}function vr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ln(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Om(e,t,l,a,s,r){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,g=e.expirationTimes,_=e.hiddenUpdates;for(l=c&~l;0<l;){var B=31-St(l),q=1<<B;f[B]=0,g[B]=-1;var w=_[B];if(w!==null)for(_[B]=null,B=0;B<w.length;B++){var O=w[B];O!==null&&(O.lane&=-536870913)}l&=~q}a!==0&&Ic(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(c&~t))}function Ic(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-St(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Pc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-St(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function eo(e,t){var l=t&-t;return l=(l&42)!==0?1:yr(l),(l&(e.suspendedLanes|t))!==0?0:l}function yr(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 gr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function to(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Gf(e.type))}function lo(e,t){var l=z.p;try{return z.p=e,t()}finally{z.p=l}}var El=Math.random().toString(36).slice(2),lt="__reactFiber$"+El,mt="__reactProps$"+El,va="__reactContainer$"+El,br="__reactEvents$"+El,Dm="__reactListeners$"+El,Lm="__reactHandles$"+El,ao="__reactResources$"+El,an="__reactMarker$"+El;function jr(e){delete e[lt],delete e[mt],delete e[br],delete e[Dm],delete e[Lm]}function ya(e){var t=e[lt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[va]||l[lt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Cf(e);e!==null;){if(l=e[lt])return l;e=Cf(e)}return t}e=l,l=e.parentNode}return null}function ga(e){if(e=e[lt]||e[va]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ba(e){var t=e[ao];return t||(t=e[ao]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[an]=!0}var no=new Set,so={};function Pl(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(so[e]=t,e=0;e<t.length;e++)no.add(t[e])}var Bm=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]*$"),ro={},io={};function Um(e){return ot.call(io,e)?!0:ot.call(ro,e)?!1:Bm.test(e)?io[e]=!0:(ro[e]=!0,!1)}function ts(e,t,l){if(Um(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 ls(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 nl(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function co(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hm(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(c){l=""+c,r.call(this,c)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sr(e){if(!e._valueTracker){var t=co(e)?"checked":"value";e._valueTracker=Hm(e,t,""+e[t])}}function oo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=co(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function as(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 qm=/[\n"\\]/g;function Ot(e){return e.replace(qm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Nr(e,t,l,a,s,r,c,f){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Er(e,c,zt(t)):l!=null?Er(e,c,zt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+zt(f):e.removeAttribute("name")}function uo(e,t,l,a,s,r,c,f){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)){Sr(e);return}l=l!=null?""+zt(l):"",t=t!=null?""+zt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Sr(e)}function Er(e,t,l){t==="number"&&as(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Sa(e,t,l,a){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&a&&(e[l].defaultSelected=!0)}else{for(l=""+zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fo(e,t,l){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+zt(l):""}function mo(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(u(92));if(Ce(a)){if(1<a.length)throw Error(u(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),Sr(e)}function Na(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Ym=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 xo(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||Ym.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function po(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&&xo(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&xo(e,r,t[r])}function Tr(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 Gm=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"]]),Vm=/^[\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 ns(e){return Vm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function sl(){}var Cr=null;function kr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,Ta=null;function ho(e){var t=ga(e);if(t&&(e=t.stateNode)){var l=e[mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Nr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[mt]||null;if(!s)throw Error(u(90));Nr(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&&oo(a)}break e;case"textarea":fo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Sa(e,!!l.multiple,t,!1)}}}var Ar=!1;function vo(e,t,l){if(Ar)return e(t,l);Ar=!0;try{var a=e(t);return a}finally{if(Ar=!1,(Ea!==null||Ta!==null)&&(Xs(),Ea&&(t=Ea,e=Ta,Ta=Ea=null,ho(t),e)))for(t=0;t<e.length;t++)ho(e[t])}}function sn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[mt]||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 rl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_r=!1;if(rl)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){_r=!0}}),window.addEventListener("test",rn,rn),window.removeEventListener("test",rn,rn)}catch{_r=!1}var Tl=null,Rr=null,ss=null;function yo(){if(ss)return ss;var e,t=Rr,l=t.length,a,s="value"in Tl?Tl.value:Tl.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var c=l-e;for(a=1;a<=c&&t[l-a]===s[r-a];a++);return ss=s.slice(e,1<a?1-a:void 0)}function rs(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 is(){return!0}function go(){return!1}function xt(e){function t(l,a,s,r,c){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(r):r[f]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?is:go,this.isPropagationStopped=go,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=is)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=is)},persist:function(){},isPersistent:is}),t}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cs=xt(ea),cn=b({},ea,{view:0,detail:0}),Qm=xt(cn),wr,Mr,on,os=b({},cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Or,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!==on&&(on&&e.type==="mousemove"?(wr=e.screenX-on.screenX,Mr=e.screenY-on.screenY):Mr=wr=0,on=e),wr)},movementY:function(e){return"movementY"in e?e.movementY:Mr}}),bo=xt(os),Xm=b({},os,{dataTransfer:0}),Zm=xt(Xm),Km=b({},cn,{relatedTarget:0}),zr=xt(Km),Jm=b({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),$m=xt(Jm),Wm=b({},ea,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fm=xt(Wm),Im=b({},ea,{data:0}),jo=xt(Im),Pm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ex={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"},tx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tx[e])?!!t[e]:!1}function Or(){return lx}var ax=b({},cn,{key:function(e){if(e.key){var t=Pm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ex[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Or,charCode:function(e){return e.type==="keypress"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nx=xt(ax),sx=b({},os,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),So=xt(sx),rx=b({},cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Or}),ix=xt(rx),cx=b({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),ox=xt(cx),ux=b({},os,{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}),dx=xt(ux),fx=b({},ea,{newState:0,oldState:0}),mx=xt(fx),xx=[9,13,27,32],Dr=rl&&"CompositionEvent"in window,un=null;rl&&"documentMode"in document&&(un=document.documentMode);var px=rl&&"TextEvent"in window&&!un,No=rl&&(!Dr||un&&8<un&&11>=un),Eo=" ",To=!1;function Co(e,t){switch(e){case"keyup":return xx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ko(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ca=!1;function hx(e,t){switch(e){case"compositionend":return ko(t);case"keypress":return t.which!==32?null:(To=!0,Eo);case"textInput":return e=t.data,e===Eo&&To?null:e;default:return null}}function vx(e,t){if(Ca)return e==="compositionend"||!Dr&&Co(e,t)?(e=yo(),ss=Rr=Tl=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 No&&t.locale!=="ko"?null:t.data;default:return null}}var yx={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 Ao(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!yx[e.type]:t==="textarea"}function _o(e,t,l,a){Ea?Ta?Ta.push(a):Ta=[a]:Ea=a,t=Is(t,"onChange"),0<t.length&&(l=new cs("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var dn=null,fn=null;function gx(e){ff(e,0)}function us(e){var t=nn(e);if(oo(t))return e}function Ro(e,t){if(e==="change")return t}var wo=!1;if(rl){var Lr;if(rl){var Br="oninput"in document;if(!Br){var Mo=document.createElement("div");Mo.setAttribute("oninput","return;"),Br=typeof Mo.oninput=="function"}Lr=Br}else Lr=!1;wo=Lr&&(!document.documentMode||9<document.documentMode)}function zo(){dn&&(dn.detachEvent("onpropertychange",Oo),fn=dn=null)}function Oo(e){if(e.propertyName==="value"&&us(fn)){var t=[];_o(t,fn,e,kr(e)),vo(gx,t)}}function bx(e,t,l){e==="focusin"?(zo(),dn=t,fn=l,dn.attachEvent("onpropertychange",Oo)):e==="focusout"&&zo()}function jx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return us(fn)}function Sx(e,t){if(e==="click")return us(t)}function Nx(e,t){if(e==="input"||e==="change")return us(t)}function Ex(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Ex;function mn(e,t){if(Nt(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(!ot.call(t,s)||!Nt(e[s],t[s]))return!1}return!0}function Do(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lo(e,t){var l=Do(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=Do(l)}}function Bo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=as(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=as(e.document)}return t}function Ur(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 Tx=rl&&"documentMode"in document&&11>=document.documentMode,ka=null,Hr=null,xn=null,qr=!1;function Ho(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;qr||ka==null||ka!==as(a)||(a=ka,"selectionStart"in a&&Ur(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}),xn&&mn(xn,a)||(xn=a,a=Is(Hr,"onSelect"),0<a.length&&(t=new cs("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ka)))}function ta(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Aa={animationend:ta("Animation","AnimationEnd"),animationiteration:ta("Animation","AnimationIteration"),animationstart:ta("Animation","AnimationStart"),transitionrun:ta("Transition","TransitionRun"),transitionstart:ta("Transition","TransitionStart"),transitioncancel:ta("Transition","TransitionCancel"),transitionend:ta("Transition","TransitionEnd")},Yr={},qo={};rl&&(qo=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 la(e){if(Yr[e])return Yr[e];if(!Aa[e])return e;var t=Aa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in qo)return Yr[e]=t[l];return e}var Yo=la("animationend"),Go=la("animationiteration"),Vo=la("animationstart"),Cx=la("transitionrun"),kx=la("transitionstart"),Ax=la("transitioncancel"),Qo=la("transitionend"),Xo=new Map,Gr="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(" ");Gr.push("scrollEnd");function Xt(e,t){Xo.set(e,t),Pl(t,[e])}var ds=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Dt=[],_a=0,Vr=0;function fs(){for(var e=_a,t=Vr=_a=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}r!==0&&Zo(l,s,r)}}function ms(e,t,l,a){Dt[_a++]=e,Dt[_a++]=t,Dt[_a++]=l,Dt[_a++]=a,Vr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Qr(e,t,l,a){return ms(e,t,l,a),xs(e)}function aa(e,t){return ms(e,null,null,t),xs(e)}function Zo(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-St(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function xs(e){if(50<Ln)throw Ln=0,Pi=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 _x(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 Et(e,t,l,a){return new _x(e,t,l,a)}function Xr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function il(e,t){var l=e.alternate;return l===null?(l=Et(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 Ko(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 ps(e,t,l,a,s,r){var c=0;if(a=e,typeof e=="function")Xr(e)&&(c=1);else if(typeof e=="string")c=Op(e,l,R.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Et(31,l,t,s),e.elementType=te,e.lanes=r,e;case Z:return na(l.children,s,r,t);case $:c=8,s|=24;break;case se:return e=Et(12,l,t,s|2),e.elementType=se,e.lanes=r,e;case W:return e=Et(13,l,t,s),e.elementType=W,e.lanes=r,e;case ne:return e=Et(19,l,t,s),e.elementType=ne,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ie:c=10;break e;case I:c=9;break e;case G:c=11;break e;case F:c=14;break e;case le:c=16,a=null;break e}c=29,l=Error(u(130,e===null?"null":typeof e,"")),a=null}return t=Et(c,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function na(e,t,l,a){return e=Et(7,e,a,t),e.lanes=l,e}function Zr(e,t,l){return e=Et(6,e,null,t),e.lanes=l,e}function Jo(e){var t=Et(18,null,null,0);return t.stateNode=e,t}function Kr(e,t,l){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var $o=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var l=$o.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Mt(t)},$o.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var wa=[],Ma=0,hs=null,pn=0,Bt=[],Ut=0,Cl=null,Wt=1,Ft="";function cl(e,t){wa[Ma++]=pn,wa[Ma++]=hs,hs=e,pn=t}function Wo(e,t,l){Bt[Ut++]=Wt,Bt[Ut++]=Ft,Bt[Ut++]=Cl,Cl=e;var a=Wt;e=Ft;var s=32-St(a)-1;a&=~(1<<s),l+=1;var r=32-St(t)+s;if(30<r){var c=s-s%5;r=(a&(1<<c)-1).toString(32),a>>=c,s-=c,Wt=1<<32-St(t)+s|l<<s|a,Ft=r+e}else Wt=1<<r|l<<s|a,Ft=e}function Jr(e){e.return!==null&&(cl(e,1),Wo(e,1,0))}function $r(e){for(;e===hs;)hs=wa[--Ma],wa[Ma]=null,pn=wa[--Ma],wa[Ma]=null;for(;e===Cl;)Cl=Bt[--Ut],Bt[Ut]=null,Ft=Bt[--Ut],Bt[Ut]=null,Wt=Bt[--Ut],Bt[Ut]=null}function Fo(e,t){Bt[Ut++]=Wt,Bt[Ut++]=Ft,Bt[Ut++]=Cl,Wt=t.id,Ft=t.overflow,Cl=e}var at=null,Ue=null,Te=!1,kl=null,Ht=!1,Wr=Error(u(519));function Al(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hn(Lt(t,e)),Wr}function Io(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[lt]=e,t[mt]=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<Un.length;l++)be(Un[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),uo(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),mo(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||hf(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=sl),t=!0):t=!1,t||Al(e,!0)}function Po(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:at=at.return}}function za(e){if(e!==at)return!1;if(!Te)return Po(e),Te=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||xc(e.type,e.memoizedProps)),l=!l),l&&Ue&&Al(e),Po(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Tf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ue=Tf(e)}else t===27?(t=Ue,Gl(e.type)?(e=gc,gc=null,Ue=e):Ue=t):Ue=at?Yt(e.stateNode.nextSibling):null;return!0}function sa(){Ue=at=null,Te=!1}function Fr(){var e=kl;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),kl=null),e}function hn(e){kl===null?kl=[e]:kl.push(e)}var Ir=S(null),ra=null,ol=null;function _l(e,t,l){X(Ir,t._currentValue),t._currentValue=l}function ul(e){e._currentValue=Ir.current,L(Ir)}function Pr(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 ei(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var c=s.child;r=r.firstContext;e:for(;r!==null;){var f=r;r=s;for(var g=0;g<t.length;g++)if(f.context===t[g]){r.lanes|=l,f=r.alternate,f!==null&&(f.lanes|=l),Pr(r.return,l,e),a||(c=null);break e}r=f.next}}else if(s.tag===18){if(c=s.return,c===null)throw Error(u(341));c.lanes|=l,r=c.alternate,r!==null&&(r.lanes|=l),Pr(c,l,e),c=null}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===e){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}}function 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 c=s.alternate;if(c===null)throw Error(u(387));if(c=c.memoizedProps,c!==null){var f=s.type;Nt(s.pendingProps.value,c.value)||(e!==null?e.push(f):e=[f])}}else if(s===K.current){if(c=s.alternate,c===null)throw Error(u(387));c.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Vn):e=[Vn])}s=s.return}e!==null&&ei(t,e,l,a),t.flags|=262144}function vs(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ia(e){ra=e,ol=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nt(e){return eu(ra,e)}function ys(e,t){return ra===null&&ia(e),eu(e,t)}function eu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},ol===null){if(e===null)throw Error(u(308));ol=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ol=ol.next=t;return l}var Rx=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()})}},wx=i.unstable_scheduleCallback,Mx=i.unstable_NormalPriority,Je={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ti(){return{controller:new Rx,data:new Map,refCount:0}}function vn(e){e.refCount--,e.refCount===0&&wx(Mx,function(){e.controller.abort()})}var yn=null,li=0,Da=0,La=null;function zx(e,t){if(yn===null){var l=yn=[];li=0,Da=sc(),La={status:"pending",value:void 0,then:function(a){l.push(a)}}}return li++,t.then(tu,tu),t}function tu(){if(--li===0&&yn!==null){La!==null&&(La.status="fulfilled");var e=yn;yn=null,Da=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ox(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 lu=C.S;C.S=function(e,t){Hd=Ke(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zx(e,t),lu!==null&&lu(e,t)};var ca=S(null);function ai(){var e=ca.current;return e!==null?e:Le.pooledCache}function gs(e,t){t===null?X(ca,ca.current):X(ca,t.pool)}function au(){var e=ai();return e===null?null:{parent:Je._currentValue,pool:e}}var Ba=Error(u(460)),ni=Error(u(474)),bs=Error(u(542)),js={then:function(){}};function nu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function su(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(sl,sl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,iu(e),e;default:if(typeof t.status=="string")t.then(sl,sl);else{if(e=Le,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,iu(e),e}throw ua=t,Ba}}function oa(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ua=l,Ba):l}}var ua=null;function ru(){if(ua===null)throw Error(u(459));var e=ua;return ua=null,e}function iu(e){if(e===Ba||e===bs)throw Error(u(483))}var Ua=null,gn=0;function Ss(e){var t=gn;return gn+=1,Ua===null&&(Ua=[]),su(Ua,e,t)}function bn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ns(e,t){throw t.$$typeof===k?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cu(e){function t(T,E){if(e){var A=T.deletions;A===null?(T.deletions=[E],T.flags|=16):A.push(E)}}function l(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function a(T){for(var E=new Map;T!==null;)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function s(T,E){return T=il(T,E),T.index=0,T.sibling=null,T}function r(T,E,A){return T.index=A,e?(A=T.alternate,A!==null?(A=A.index,A<E?(T.flags|=67108866,E):A):(T.flags|=67108866,E)):(T.flags|=1048576,E)}function c(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function f(T,E,A,U){return E===null||E.tag!==6?(E=Zr(A,T.mode,U),E.return=T,E):(E=s(E,A),E.return=T,E)}function g(T,E,A,U){var ce=A.type;return ce===Z?B(T,E,A.props.children,U,A.key):E!==null&&(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===le&&oa(ce)===E.type)?(E=s(E,A.props),bn(E,A),E.return=T,E):(E=ps(A.type,A.key,A.props,null,T.mode,U),bn(E,A),E.return=T,E)}function _(T,E,A,U){return E===null||E.tag!==4||E.stateNode.containerInfo!==A.containerInfo||E.stateNode.implementation!==A.implementation?(E=Kr(A,T.mode,U),E.return=T,E):(E=s(E,A.children||[]),E.return=T,E)}function B(T,E,A,U,ce){return E===null||E.tag!==7?(E=na(A,T.mode,U,ce),E.return=T,E):(E=s(E,A),E.return=T,E)}function q(T,E,A){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Zr(""+E,T.mode,A),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case M:return A=ps(E.type,E.key,E.props,null,T.mode,A),bn(A,E),A.return=T,A;case H:return E=Kr(E,T.mode,A),E.return=T,E;case le:return E=oa(E),q(T,E,A)}if(Ce(E)||he(E))return E=na(E,T.mode,A,null),E.return=T,E;if(typeof E.then=="function")return q(T,Ss(E),A);if(E.$$typeof===ie)return q(T,ys(T,E),A);Ns(T,E)}return null}function w(T,E,A,U){var ce=E!==null?E.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ce!==null?null:f(T,E,""+A,U);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case M:return A.key===ce?g(T,E,A,U):null;case H:return A.key===ce?_(T,E,A,U):null;case le:return A=oa(A),w(T,E,A,U)}if(Ce(A)||he(A))return ce!==null?null:B(T,E,A,U,null);if(typeof A.then=="function")return w(T,E,Ss(A),U);if(A.$$typeof===ie)return w(T,E,ys(T,A),U);Ns(T,A)}return null}function O(T,E,A,U,ce){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return T=T.get(A)||null,f(E,T,""+U,ce);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case M:return T=T.get(U.key===null?A:U.key)||null,g(E,T,U,ce);case H:return T=T.get(U.key===null?A:U.key)||null,_(E,T,U,ce);case le:return U=oa(U),O(T,E,A,U,ce)}if(Ce(U)||he(U))return T=T.get(A)||null,B(E,T,U,ce,null);if(typeof U.then=="function")return O(T,E,A,Ss(U),ce);if(U.$$typeof===ie)return O(T,E,A,ys(E,U),ce);Ns(E,U)}return null}function ae(T,E,A,U){for(var ce=null,ke=null,re=E,ve=E=0,Ne=null;re!==null&&ve<A.length;ve++){re.index>ve?(Ne=re,re=null):Ne=re.sibling;var Ae=w(T,re,A[ve],U);if(Ae===null){re===null&&(re=Ne);break}e&&re&&Ae.alternate===null&&t(T,re),E=r(Ae,E,ve),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae,re=Ne}if(ve===A.length)return l(T,re),Te&&cl(T,ve),ce;if(re===null){for(;ve<A.length;ve++)re=q(T,A[ve],U),re!==null&&(E=r(re,E,ve),ke===null?ce=re:ke.sibling=re,ke=re);return Te&&cl(T,ve),ce}for(re=a(re);ve<A.length;ve++)Ne=O(re,T,ve,A[ve],U),Ne!==null&&(e&&Ne.alternate!==null&&re.delete(Ne.key===null?ve:Ne.key),E=r(Ne,E,ve),ke===null?ce=Ne:ke.sibling=Ne,ke=Ne);return e&&re.forEach(function(Kl){return t(T,Kl)}),Te&&cl(T,ve),ce}function ue(T,E,A,U){if(A==null)throw Error(u(151));for(var ce=null,ke=null,re=E,ve=E=0,Ne=null,Ae=A.next();re!==null&&!Ae.done;ve++,Ae=A.next()){re.index>ve?(Ne=re,re=null):Ne=re.sibling;var Kl=w(T,re,Ae.value,U);if(Kl===null){re===null&&(re=Ne);break}e&&re&&Kl.alternate===null&&t(T,re),E=r(Kl,E,ve),ke===null?ce=Kl:ke.sibling=Kl,ke=Kl,re=Ne}if(Ae.done)return l(T,re),Te&&cl(T,ve),ce;if(re===null){for(;!Ae.done;ve++,Ae=A.next())Ae=q(T,Ae.value,U),Ae!==null&&(E=r(Ae,E,ve),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae);return Te&&cl(T,ve),ce}for(re=a(re);!Ae.done;ve++,Ae=A.next())Ae=O(re,T,ve,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&re.delete(Ae.key===null?ve:Ae.key),E=r(Ae,E,ve),ke===null?ce=Ae:ke.sibling=Ae,ke=Ae);return e&&re.forEach(function(Xp){return t(T,Xp)}),Te&&cl(T,ve),ce}function De(T,E,A,U){if(typeof A=="object"&&A!==null&&A.type===Z&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case M:e:{for(var ce=A.key;E!==null;){if(E.key===ce){if(ce=A.type,ce===Z){if(E.tag===7){l(T,E.sibling),U=s(E,A.props.children),U.return=T,T=U;break e}}else if(E.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===le&&oa(ce)===E.type){l(T,E.sibling),U=s(E,A.props),bn(U,A),U.return=T,T=U;break e}l(T,E);break}else t(T,E);E=E.sibling}A.type===Z?(U=na(A.props.children,T.mode,U,A.key),U.return=T,T=U):(U=ps(A.type,A.key,A.props,null,T.mode,U),bn(U,A),U.return=T,T=U)}return c(T);case H:e:{for(ce=A.key;E!==null;){if(E.key===ce)if(E.tag===4&&E.stateNode.containerInfo===A.containerInfo&&E.stateNode.implementation===A.implementation){l(T,E.sibling),U=s(E,A.children||[]),U.return=T,T=U;break e}else{l(T,E);break}else t(T,E);E=E.sibling}U=Kr(A,T.mode,U),U.return=T,T=U}return c(T);case le:return A=oa(A),De(T,E,A,U)}if(Ce(A))return ae(T,E,A,U);if(he(A)){if(ce=he(A),typeof ce!="function")throw Error(u(150));return A=ce.call(A),ue(T,E,A,U)}if(typeof A.then=="function")return De(T,E,Ss(A),U);if(A.$$typeof===ie)return De(T,E,ys(T,A),U);Ns(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,E!==null&&E.tag===6?(l(T,E.sibling),U=s(E,A),U.return=T,T=U):(l(T,E),U=Zr(A,T.mode,U),U.return=T,T=U),c(T)):l(T,E)}return function(T,E,A,U){try{gn=0;var ce=De(T,E,A,U);return Ua=null,ce}catch(re){if(re===Ba||re===bs)throw re;var ke=Et(29,re,null,T.mode);return ke.lanes=U,ke.return=T,ke}finally{}}}var da=cu(!0),ou=cu(!1),Rl=!1;function si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ri(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 wl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ml(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(_e&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=xs(e),Zo(e,null,l),t}return ms(e,a,t,l),xs(e)}function jn(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,Pc(e,l)}}function ii(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 c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=c:r=r.next=c,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 ci=!1;function Sn(){if(ci){var e=La;if(e!==null)throw e}}function Nn(e,t,l,a){ci=!1;var s=e.updateQueue;Rl=!1;var r=s.firstBaseUpdate,c=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var g=f,_=g.next;g.next=null,c===null?r=_:c.next=_,c=g;var B=e.alternate;B!==null&&(B=B.updateQueue,f=B.lastBaseUpdate,f!==c&&(f===null?B.firstBaseUpdate=_:f.next=_,B.lastBaseUpdate=g))}if(r!==null){var q=s.baseState;c=0,B=_=g=null,f=r;do{var w=f.lane&-536870913,O=w!==f.lane;if(O?(Se&w)===w:(a&w)===w){w!==0&&w===Da&&(ci=!0),B!==null&&(B=B.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var ae=e,ue=f;w=t;var De=l;switch(ue.tag){case 1:if(ae=ue.payload,typeof ae=="function"){q=ae.call(De,q,w);break e}q=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=ue.payload,w=typeof ae=="function"?ae.call(De,q,w):ae,w==null)break e;q=b({},q,w);break e;case 2:Rl=!0}}w=f.callback,w!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[w]:O.push(w))}else O={lane:w,tag:f.tag,payload:f.payload,callback:f.callback,next:null},B===null?(_=B=O,g=q):B=B.next=O,c|=w;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;O=f,f=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);B===null&&(g=q),s.baseState=g,s.firstBaseUpdate=_,s.lastBaseUpdate=B,r===null&&(s.shared.lanes=0),Bl|=c,e.lanes=c,e.memoizedState=q}}function uu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function du(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)uu(l[e],t)}var Ha=S(null),Es=S(0);function fu(e,t){e=gl,X(Es,e),X(Ha,t),gl=e|t.baseLanes}function oi(){X(Es,gl),X(Ha,Ha.current)}function ui(){gl=Es.current,L(Ha),L(Es)}var Tt=S(null),qt=null;function zl(e){var t=e.alternate;X(Qe,Qe.current&1),X(Tt,e),qt===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(qt=e)}function di(e){X(Qe,Qe.current),X(Tt,e),qt===null&&(qt=e)}function mu(e){e.tag===22?(X(Qe,Qe.current),X(Tt,e),qt===null&&(qt=e)):Ol()}function Ol(){X(Qe,Qe.current),X(Tt,Tt.current)}function Ct(e){L(Tt),qt===e&&(qt=null),L(Qe)}var Qe=S(0);function Ts(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vc(l)||yc(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 dl=0,xe=null,ze=null,$e=null,Cs=!1,qa=!1,fa=!1,ks=0,En=0,Ya=null,Dx=0;function Ye(){throw Error(u(321))}function fi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Nt(e[l],t[l]))return!1;return!0}function mi(e,t,l,a,s,r){return dl=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?Wu:Ai,fa=!1,r=l(a,s),fa=!1,qa&&(r=pu(t,l,a,s)),xu(e),r}function xu(e){C.H=kn;var t=ze!==null&&ze.next!==null;if(dl=0,$e=ze=xe=null,Cs=!1,En=0,Ya=null,t)throw Error(u(300));e===null||We||(e=e.dependencies,e!==null&&vs(e)&&(We=!0))}function pu(e,t,l,a){xe=e;var s=0;do{if(qa&&(Ya=null),En=0,qa=!1,25<=s)throw Error(u(301));if(s+=1,$e=ze=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}C.H=Fu,r=t(l,a)}while(qa);return r}function Lx(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Tn(t):t,e=e.useState()[0],(ze!==null?ze.memoizedState:null)!==e&&(xe.flags|=1024),t}function xi(){var e=ks!==0;return ks=0,e}function pi(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function hi(e){if(Cs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cs=!1}dl=0,$e=ze=xe=null,qa=!1,En=ks=0,Ya=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?xe.memoizedState=$e=e:$e=$e.next=e,$e}function Xe(){if(ze===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=$e===null?xe.memoizedState:$e.next;if(t!==null)$e=t,ze=e;else{if(e===null)throw xe.alternate===null?Error(u(467)):Error(u(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},$e===null?xe.memoizedState=$e=e:$e=$e.next=e}return $e}function As(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tn(e){var t=En;return En+=1,Ya===null&&(Ya=[]),e=su(Ya,e,t),t=xe,($e===null?t.memoizedState:$e.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?Wu:Ai),e}function _s(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tn(e);if(e.$$typeof===ie)return nt(e)}throw Error(u(438,String(e)))}function vi(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=As(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=pe;return t.index++,l}function fl(e,t){return typeof t=="function"?t(e):t}function Rs(e){var t=Xe();return yi(t,ze,e)}function yi(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 c=s.next;s.next=r.next,r.next=c}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var f=c=null,g=null,_=t,B=!1;do{var q=_.lane&-536870913;if(q!==_.lane?(Se&q)===q:(dl&q)===q){var w=_.revertLane;if(w===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),q===Da&&(B=!0);else if((dl&w)===w){_=_.next,w===Da&&(B=!0);continue}else q={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=q,c=r):g=g.next=q,xe.lanes|=w,Bl|=w;q=_.action,fa&&l(r,q),r=_.hasEagerState?_.eagerState:l(r,q)}else w={lane:q,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},g===null?(f=g=w,c=r):g=g.next=w,xe.lanes|=q,Bl|=q;_=_.next}while(_!==null&&_!==t);if(g===null?c=r:g.next=f,!Nt(r,e.memoizedState)&&(We=!0,B&&(l=La,l!==null)))throw l;e.memoizedState=r,e.baseState=c,e.baseQueue=g,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function gi(e){var t=Xe(),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 c=s=s.next;do r=e(r,c.action),c=c.next;while(c!==s);Nt(r,t.memoizedState)||(We=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function hu(e,t,l){var a=xe,s=Xe(),r=Te;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=t();var c=!Nt((ze||s).memoizedState,l);if(c&&(s.memoizedState=l,We=!0),s=s.queue,Si(gu.bind(null,a,s,e),[e]),s.getSnapshot!==t||c||$e!==null&&$e.memoizedState.tag&1){if(a.flags|=2048,Ga(9,{destroy:void 0},yu.bind(null,a,s,l,t),null),Le===null)throw Error(u(349));r||(dl&127)!==0||vu(a,t,l)}return l}function vu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=As(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function yu(e,t,l,a){t.value=l,t.getSnapshot=a,bu(t)&&ju(e)}function gu(e,t,l){return l(function(){bu(t)&&ju(e)})}function bu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Nt(e,l)}catch{return!0}}function ju(e){var t=aa(e,2);t!==null&&gt(t,e,2)}function bi(e){var t=dt();if(typeof e=="function"){var l=e;if(e=l(),fa){$t(!0);try{l()}finally{$t(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:e},t}function Su(e,t,l,a){return e.baseState=l,yi(e,ze,typeof a=="function"?a:fl)}function Bx(e,t,l,a,s){if(zs(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(c){r.listeners.push(c)}};C.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Nu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Nu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=C.T,c={};C.T=c;try{var f=l(s,a),g=C.S;g!==null&&g(c,f),Eu(e,t,f)}catch(_){ji(e,t,_)}finally{r!==null&&c.types!==null&&(r.types=c.types),C.T=r}}else try{r=l(s,a),Eu(e,t,r)}catch(_){ji(e,t,_)}}function Eu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Tu(e,t,a)},function(a){return ji(e,t,a)}):Tu(e,t,l)}function Tu(e,t,l){t.status="fulfilled",t.value=l,Cu(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Nu(e,l)))}function ji(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Cu(t),t=t.next;while(t!==a)}e.action=null}function Cu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ku(e,t){return t}function Au(e,t){if(Te){var l=Le.formState;if(l!==null){e:{var a=xe;if(Te){if(Ue){t:{for(var s=Ue,r=Ht;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ue=Yt(s.nextSibling),a=s.data==="F!";break e}}Al(a)}a=!1}a&&(t=l[0])}}return l=dt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ku,lastRenderedState:t},l.queue=a,l=Ku.bind(null,xe,a),a.dispatch=l,a=bi(!1),r=ki.bind(null,xe,!1,a.queue),a=dt(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Bx.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function _u(e){var t=Xe();return Ru(t,ze,e)}function Ru(e,t,l){if(t=yi(e,t,ku)[0],e=Rs(fl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Tn(t)}catch(c){throw c===Ba?bs:c}else a=t;t=Xe();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Ga(9,{destroy:void 0},Ux.bind(null,s,l),null)),[a,r,e]}function Ux(e,t){e.action=t}function wu(e){var t=Xe(),l=ze;if(l!==null)return Ru(t,l,e);Xe(),t=t.memoizedState,l=Xe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Ga(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=As(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Mu(){return Xe().memoizedState}function ws(e,t,l,a){var s=dt();xe.flags|=e,s.memoizedState=Ga(1|t,{destroy:void 0},l,a===void 0?null:a)}function Ms(e,t,l,a){var s=Xe();a=a===void 0?null:a;var r=s.memoizedState.inst;ze!==null&&a!==null&&fi(a,ze.memoizedState.deps)?s.memoizedState=Ga(t,r,l,a):(xe.flags|=e,s.memoizedState=Ga(1|t,r,l,a))}function zu(e,t){ws(8390656,8,e,t)}function Si(e,t){Ms(2048,8,e,t)}function Hx(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=As(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Ou(e){var t=Xe().memoizedState;return Hx({ref:t,nextImpl:e}),function(){if((_e&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Du(e,t){return Ms(4,2,e,t)}function Lu(e,t){return Ms(4,4,e,t)}function Bu(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 Uu(e,t,l){l=l!=null?l.concat([e]):null,Ms(4,4,Bu.bind(null,t,e),l)}function Ni(){}function Hu(e,t){var l=Xe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&fi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function qu(e,t){var l=Xe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&fi(t,a[1]))return a[0];if(a=e(),fa){$t(!0);try{e()}finally{$t(!1)}}return l.memoizedState=[a,t],a}function Ei(e,t,l){return l===void 0||(dl&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Yd(),xe.lanes|=e,Bl|=e,l)}function Yu(e,t,l,a){return Nt(l,t)?l:Ha.current!==null?(e=Ei(e,l,a),Nt(e,t)||(We=!0),e):(dl&42)===0||(dl&1073741824)!==0&&(Se&261930)===0?(We=!0,e.memoizedState=l):(e=Yd(),xe.lanes|=e,Bl|=e,t)}function Gu(e,t,l,a,s){var r=z.p;z.p=r!==0&&8>r?r:8;var c=C.T,f={};C.T=f,ki(e,!1,t,l);try{var g=s(),_=C.S;if(_!==null&&_(f,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var B=Ox(g,a);Cn(e,t,B,_t(e))}else Cn(e,t,a,_t(e))}catch(q){Cn(e,t,{then:function(){},status:"rejected",reason:q},_t())}finally{z.p=r,c!==null&&f.types!==null&&(c.types=f.types),C.T=c}}function qx(){}function Ti(e,t,l,a){if(e.tag!==5)throw Error(u(476));var s=Vu(e).queue;Gu(e,s,t,D,l===null?qx:function(){return Qu(e),l(a)})}function Vu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:D,baseState:D,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:D},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qu(e){var t=Vu(e);t.next===null&&(t=e.alternate.memoizedState),Cn(e,t.next.queue,{},_t())}function Ci(){return nt(Vn)}function Xu(){return Xe().memoizedState}function Zu(){return Xe().memoizedState}function Yx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=_t();e=wl(l);var a=Ml(t,e,l);a!==null&&(gt(a,t,l),jn(a,t,l)),t={cache:ti()},e.payload=t;return}t=t.return}}function Gx(e,t,l){var a=_t();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zs(e)?Ju(t,l):(l=Qr(e,t,l,a),l!==null&&(gt(l,e,a),$u(l,t,a)))}function Ku(e,t,l){var a=_t();Cn(e,t,l,a)}function Cn(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Ju(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var c=t.lastRenderedState,f=r(c,l);if(s.hasEagerState=!0,s.eagerState=f,Nt(f,c))return ms(e,t,s,0),Le===null&&fs(),!1}catch{}finally{}if(l=Qr(e,t,s,a),l!==null)return gt(l,e,a),$u(l,t,a),!0}return!1}function ki(e,t,l,a){if(a={lane:2,revertLane:sc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(u(479))}else t=Qr(e,l,a,2),t!==null&&gt(t,e,2)}function zs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Ju(e,t){qa=Cs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $u(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Pc(e,l)}}var kn={readContext:nt,use:_s,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};kn.useEffectEvent=Ye;var Wu={readContext:nt,use:_s,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:nt,useEffect:zu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,ws(4194308,4,Bu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return ws(4194308,4,e,t)},useInsertionEffect:function(e,t){ws(4,2,e,t)},useMemo:function(e,t){var l=dt();t=t===void 0?null:t;var a=e();if(fa){$t(!0);try{e()}finally{$t(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=dt();if(l!==void 0){var s=l(t);if(fa){$t(!0);try{l(t)}finally{$t(!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=Gx.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=bi(e);var t=e.queue,l=Ku.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ni,useDeferredValue:function(e,t){var l=dt();return Ei(l,e,t)},useTransition:function(){var e=bi(!1);return e=Gu.bind(null,xe,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=dt();if(Te){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Le===null)throw Error(u(349));(Se&127)!==0||vu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,zu(gu.bind(null,a,r,e),[e]),a.flags|=2048,Ga(9,{destroy:void 0},yu.bind(null,a,r,l,t),null),l},useId:function(){var e=dt(),t=Le.identifierPrefix;if(Te){var l=Ft,a=Wt;l=(a&~(1<<32-St(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ks++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Dx++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ci,useFormState:Au,useActionState:Au,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=ki.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:vi,useCacheRefresh:function(){return dt().memoizedState=Yx.bind(null,xe)},useEffectEvent:function(e){var t=dt(),l={impl:e};return t.memoizedState=l,function(){if((_e&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Ai={readContext:nt,use:_s,useCallback:Hu,useContext:nt,useEffect:Si,useImperativeHandle:Uu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:qu,useReducer:Rs,useRef:Mu,useState:function(){return Rs(fl)},useDebugValue:Ni,useDeferredValue:function(e,t){var l=Xe();return Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=Rs(fl)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:hu,useId:Xu,useHostTransitionStatus:Ci,useFormState:_u,useActionState:_u,useOptimistic:function(e,t){var l=Xe();return Su(l,ze,e,t)},useMemoCache:vi,useCacheRefresh:Zu};Ai.useEffectEvent=Ou;var Fu={readContext:nt,use:_s,useCallback:Hu,useContext:nt,useEffect:Si,useImperativeHandle:Uu,useInsertionEffect:Du,useLayoutEffect:Lu,useMemo:qu,useReducer:gi,useRef:Mu,useState:function(){return gi(fl)},useDebugValue:Ni,useDeferredValue:function(e,t){var l=Xe();return ze===null?Ei(l,e,t):Yu(l,ze.memoizedState,e,t)},useTransition:function(){var e=gi(fl)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Tn(e),t]},useSyncExternalStore:hu,useId:Xu,useHostTransitionStatus:Ci,useFormState:wu,useActionState:wu,useOptimistic:function(e,t){var l=Xe();return ze!==null?Su(l,ze,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:vi,useCacheRefresh:Zu};Fu.useEffectEvent=Ou;function _i(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ri={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=_t(),s=wl(a);s.payload=t,l!=null&&(s.callback=l),t=Ml(e,s,a),t!==null&&(gt(t,e,a),jn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=_t(),s=wl(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Ml(e,s,a),t!==null&&(gt(t,e,a),jn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=_t(),a=wl(l);a.tag=2,t!=null&&(a.callback=t),t=Ml(e,a,l),t!==null&&(gt(t,e,l),jn(t,e,l))}};function Iu(e,t,l,a,s,r,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,c):t.prototype&&t.prototype.isPureReactComponent?!mn(l,a)||!mn(s,r):!0}function Pu(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&&Ri.enqueueReplaceState(t,t.state,null)}function ma(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function ed(e){ds(e)}function td(e){console.error(e)}function ld(e){ds(e)}function Os(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function ad(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 wi(e,t,l){return l=wl(l),l.tag=3,l.payload={element:null},l.callback=function(){Os(e,t)},l}function nd(e){return e=wl(e),e.tag=3,e}function sd(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(){ad(t,l,a)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){ad(t,l,a),typeof s!="function"&&(Ul===null?Ul=new Set([this]):Ul.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function Vx(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=Tt.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Zs():l.alternate===null&&Ge===0&&(Ge=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===js?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),lc(e,a,s)),!1;case 22:return l.flags|=65536,a===js?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)),lc(e,a,s)),!1}throw Error(u(435,l.tag))}return lc(e,a,s),Zs(),!1}if(Te)return t=Tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==Wr&&(e=Error(u(422),{cause:a}),hn(Lt(e,l)))):(a!==Wr&&(t=Error(u(423),{cause:a}),hn(Lt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Lt(a,l),s=wi(e.stateNode,a,s),ii(e,s),Ge!==4&&(Ge=2)),!1;var r=Error(u(520),{cause:a});if(r=Lt(r,l),Dn===null?Dn=[r]:Dn.push(r),Ge!==4&&(Ge=2),t===null)return!0;a=Lt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=wi(l.stateNode,a,e),ii(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"&&(Ul===null||!Ul.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=nd(s),sd(s,e,l,a),ii(l,s),!1}l=l.return}while(l!==null);return!1}var Mi=Error(u(461)),We=!1;function st(e,t,l,a){t.child=e===null?ou(t,null,l,a):da(t,e.child,l,a)}function rd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}else c=a;return ia(t),a=mi(e,t,l,c,r,s),f=xi(),e!==null&&!We?(pi(e,t,s),ml(e,t,s)):(Te&&f&&Jr(t),t.flags|=1,st(e,t,a,s),t.child)}function id(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Xr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,cd(e,t,r,a,s)):(e=ps(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!qi(e,s)){var c=r.memoizedProps;if(l=l.compare,l=l!==null?l:mn,l(c,a)&&e.ref===t.ref)return ml(e,t,s)}return t.flags|=1,e=il(r,a),e.ref=t.ref,e.return=t,t.child=e}function cd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(mn(r,a)&&e.ref===t.ref)if(We=!1,t.pendingProps=a=r,qi(e,s))(e.flags&131072)!==0&&(We=!0);else return t.lanes=e.lanes,ml(e,t,s)}return zi(e,t,l,a,s)}function od(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 ud(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gs(t,r!==null?r.cachePool:null),r!==null?fu(t,r):oi(),mu(t);else return a=t.lanes=536870912,ud(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(gs(t,r.cachePool),fu(t,r),Ol(),t.memoizedState=null):(e!==null&&gs(t,null),oi(),Ol());return st(e,t,s,l),t.child}function An(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ud(e,t,l,a,s){var r=ai();return r=r===null?null:{parent:Je._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&gs(t,null),oi(),mu(t),e!==null&&Oa(e,t,a,!0),t.childLanes=s,null}function Ds(e,t){return t=Bs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dd(e,t,l){return da(t,e.child,null,l),e=Ds(t,t.pendingProps),e.flags|=2,Ct(t),t.memoizedState=null,e}function Qx(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(a.mode==="hidden")return e=Ds(t,a),t.lanes=536870912,An(null,e);if(di(t),(e=Ue)?(e=Ef(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cl!==null?{id:Wt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=Jo(e),l.return=t,t.child=l,at=t,Ue=null)):e=null,e===null)throw Al(t);return t.lanes=536870912,null}return Ds(t,a)}var r=e.memoizedState;if(r!==null){var c=r.dehydrated;if(di(t),s)if(t.flags&256)t.flags&=-257,t=dd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(We||Oa(e,t,l,!1),s=(l&e.childLanes)!==0,We||s){if(a=Le,a!==null&&(c=eo(a,l),c!==0&&c!==r.retryLane))throw r.retryLane=c,aa(e,c),gt(a,e,c),Mi;Zs(),t=dd(e,t,l)}else e=r.treeContext,Ue=Yt(c.nextSibling),at=t,Te=!0,kl=null,Ht=!1,e!==null&&Fo(t,e),t=Ds(t,a),t.flags|=4096;return t}return e=il(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ls(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 zi(e,t,l,a,s){return ia(t),l=mi(e,t,l,a,void 0,s),a=xi(),e!==null&&!We?(pi(e,t,s),ml(e,t,s)):(Te&&a&&Jr(t),t.flags|=1,st(e,t,l,s),t.child)}function fd(e,t,l,a,s,r){return ia(t),t.updateQueue=null,l=pu(t,a,l,s),xu(e),a=xi(),e!==null&&!We?(pi(e,t,r),ml(e,t,r)):(Te&&a&&Jr(t),t.flags|=1,st(e,t,l,r),t.child)}function md(e,t,l,a,s){if(ia(t),t.stateNode===null){var r=Ra,c=l.contextType;typeof c=="object"&&c!==null&&(r=nt(c)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ri,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},si(t),c=l.contextType,r.context=typeof c=="object"&&c!==null?nt(c):Ra,r.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(_i(t,l,c,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(c=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),c!==r.state&&Ri.enqueueReplaceState(r,r.state,null),Nn(t,a,r,s),Sn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var f=t.memoizedProps,g=ma(l,f);r.props=g;var _=r.context,B=l.contextType;c=Ra,typeof B=="object"&&B!==null&&(c=nt(B));var q=l.getDerivedStateFromProps;B=typeof q=="function"||typeof r.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f||_!==c)&&Pu(t,r,a,c),Rl=!1;var w=t.memoizedState;r.state=w,Nn(t,a,r,s),Sn(),_=t.memoizedState,f||w!==_||Rl?(typeof q=="function"&&(_i(t,l,q,a),_=t.memoizedState),(g=Rl||Iu(t,l,g,a,w,_,c))?(B||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),r.props=a,r.state=_,r.context=c,a=g):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,ri(e,t),c=t.memoizedProps,B=ma(l,c),r.props=B,q=t.pendingProps,w=r.context,_=l.contextType,g=Ra,typeof _=="object"&&_!==null&&(g=nt(_)),f=l.getDerivedStateFromProps,(_=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(c!==q||w!==g)&&Pu(t,r,a,g),Rl=!1,w=t.memoizedState,r.state=w,Nn(t,a,r,s),Sn();var O=t.memoizedState;c!==q||w!==O||Rl||e!==null&&e.dependencies!==null&&vs(e.dependencies)?(typeof f=="function"&&(_i(t,l,f,a),O=t.memoizedState),(B=Rl||Iu(t,l,B,a,w,O,g)||e!==null&&e.dependencies!==null&&vs(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,O,g),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,O,g)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),r.props=a,r.state=O,r.context=g,a=B):(typeof r.componentDidUpdate!="function"||c===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Ls(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=da(t,e.child,null,s),t.child=da(t,null,l,s)):st(e,t,l,s),t.memoizedState=r.state,e=t.child):e=ml(e,t,s),e}function xd(e,t,l,a){return sa(),t.flags|=256,st(e,t,l,a),t.child}var Oi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Di(e){return{baseLanes:e,cachePool:au()}}function Li(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=At),e}function pd(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,c;if((c=r)||(c=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),c&&(s=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(s?zl(t):Ol(),(e=Ue)?(e=Ef(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cl!==null?{id:Wt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=Jo(e),l.return=t,t.child=l,at=t,Ue=null)):e=null,e===null)throw Al(t);return yc(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,s?(Ol(),s=t.mode,f=Bs({mode:"hidden",children:f},s),a=na(a,s,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=Di(l),a.childLanes=Li(e,c,l),t.memoizedState=Oi,An(null,a)):(zl(t),Bi(t,f))}var g=e.memoizedState;if(g!==null&&(f=g.dehydrated,f!==null)){if(r)t.flags&256?(zl(t),t.flags&=-257,t=Ui(e,t,l)):t.memoizedState!==null?(Ol(),t.child=e.child,t.flags|=128,t=null):(Ol(),f=a.fallback,s=t.mode,a=Bs({mode:"visible",children:a.children},s),f=na(f,s,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,da(t,e.child,null,l),a=t.child,a.memoizedState=Di(l),a.childLanes=Li(e,c,l),t.memoizedState=Oi,t=An(null,a));else if(zl(t),yc(f)){if(c=f.nextSibling&&f.nextSibling.dataset,c)var _=c.dgst;c=_,a=Error(u(419)),a.stack="",a.digest=c,hn({value:a,source:null,stack:null}),t=Ui(e,t,l)}else if(We||Oa(e,t,l,!1),c=(l&e.childLanes)!==0,We||c){if(c=Le,c!==null&&(a=eo(c,l),a!==0&&a!==g.retryLane))throw g.retryLane=a,aa(e,a),gt(c,e,a),Mi;vc(f)||Zs(),t=Ui(e,t,l)}else vc(f)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,Ue=Yt(f.nextSibling),at=t,Te=!0,kl=null,Ht=!1,e!==null&&Fo(t,e),t=Bi(t,a.children),t.flags|=4096);return t}return s?(Ol(),f=a.fallback,s=t.mode,g=e.child,_=g.sibling,a=il(g,{mode:"hidden",children:a.children}),a.subtreeFlags=g.subtreeFlags&65011712,_!==null?f=il(_,f):(f=na(f,s,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,An(null,a),a=t.child,f=e.child.memoizedState,f===null?f=Di(l):(s=f.cachePool,s!==null?(g=Je._currentValue,s=s.parent!==g?{parent:g,pool:g}:s):s=au(),f={baseLanes:f.baseLanes|l,cachePool:s}),a.memoizedState=f,a.childLanes=Li(e,c,l),t.memoizedState=Oi,An(e.child,a)):(zl(t),l=e.child,e=l.sibling,l=il(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Bi(e,t){return t=Bs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bs(e,t){return e=Et(22,e,null,t),e.lanes=0,e}function Ui(e,t,l){return da(t,e.child,null,l),e=Bi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Pr(e.return,t,l)}function Hi(e,t,l,a,s,r){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=a,c.tail=l,c.tailMode=s,c.treeForkCount=r)}function vd(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var c=Qe.current,f=(c&2)!==0;if(f?(c=c&1|2,t.flags|=128):c&=1,X(Qe,c),st(e,t,a,l),a=Te?pn:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hd(e,l,t);else if(e.tag===19)hd(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&&Ts(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),Hi(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&&Ts(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}Hi(t,!0,l,null,r,a);break;case"together":Hi(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function ml(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Bl|=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=il(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=il(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function qi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vs(e)))}function Xx(e,t,l){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),_l(t,Je,e.memoizedState.cache),sa();break;case 27:case 5:Rt(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:_l(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,di(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(zl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?pd(e,t,l):(zl(t),e=ml(e,t,l),e!==null?e.sibling:null);zl(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 vd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),X(Qe,Qe.current),a)break;return null;case 22:return t.lanes=0,od(e,t,l,t.pendingProps);case 24:_l(t,Je,e.memoizedState.cache)}return ml(e,t,l)}function yd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)We=!0;else{if(!qi(e,l)&&(t.flags&128)===0)return We=!1,Xx(e,t,l);We=(e.flags&131072)!==0}else We=!1,Te&&(t.flags&1048576)!==0&&Wo(t,pn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=oa(t.elementType),t.type=e,typeof e=="function")Xr(e)?(a=ma(e,a),t.tag=1,t=md(null,t,e,a,l)):(t.tag=0,t=zi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===G){t.tag=11,t=rd(null,t,e,a,l);break e}else if(s===F){t.tag=14,t=id(null,t,e,a,l);break e}}throw t=oe(e)||e,Error(u(306,t,""))}}return t;case 0:return zi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=ma(a,t.pendingProps),md(e,t,a,s,l);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(u(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,ri(e,t),Nn(t,a,null,l);var c=t.memoizedState;if(a=c.cache,_l(t,Je,a),a!==r.cache&&ei(t,[Je],l,!0),Sn(),a=c.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=xd(e,t,a,l);break e}else if(a!==s){s=Lt(Error(u(424)),t),hn(s),t=xd(e,t,a,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ue=Yt(e.firstChild),at=t,Te=!0,kl=null,Ht=!0,l=ou(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(sa(),a===s){t=ml(e,t,l);break e}st(e,t,a,l)}t=t.child}return t;case 26:return Ls(e,t),e===null?(l=Rf(t.type,null,t.pendingProps,null))?t.memoizedState=l:Te||(l=t.type,e=t.pendingProps,a=Ps(Q.current).createElement(l),a[lt]=t,a[mt]=e,rt(a,l,e),Pe(a),t.stateNode=a):t.memoizedState=Rf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Rt(t),e===null&&Te&&(a=t.stateNode=kf(t.type,t.pendingProps,Q.current),at=t,Ht=!0,s=Ue,Gl(t.type)?(gc=s,Ue=Yt(a.firstChild)):Ue=s),st(e,t,t.pendingProps.children,l),Ls(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((s=a=Ue)&&(a=jp(a,t.type,t.pendingProps,Ht),a!==null?(t.stateNode=a,at=t,Ue=Yt(a.firstChild),Ht=!1,s=!0):s=!1),s||Al(t)),Rt(t),s=t.type,r=t.pendingProps,c=e!==null?e.memoizedProps:null,a=r.children,xc(s,r)?a=null:c!==null&&xc(s,c)&&(t.flags|=32),t.memoizedState!==null&&(s=mi(e,t,Lx,null,null,l),Vn._currentValue=s),Ls(e,t),st(e,t,a,l),t.child;case 6:return e===null&&Te&&((e=l=Ue)&&(l=Sp(l,t.pendingProps,Ht),l!==null?(t.stateNode=l,at=t,Ue=null,e=!0):e=!1),e||Al(t)),null;case 13:return pd(e,t,l);case 4:return fe(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=da(t,null,a,l):st(e,t,a,l),t.child;case 11:return rd(e,t,t.type,t.pendingProps,l);case 7:return st(e,t,t.pendingProps,l),t.child;case 8:return st(e,t,t.pendingProps.children,l),t.child;case 12:return st(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,_l(t,t.type,a.value),st(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,ia(t),s=nt(s),a=a(s),t.flags|=1,st(e,t,a,l),t.child;case 14:return id(e,t,t.type,t.pendingProps,l);case 15:return cd(e,t,t.type,t.pendingProps,l);case 19:return vd(e,t,l);case 31:return Qx(e,t,l);case 22:return od(e,t,l,t.pendingProps);case 24:return ia(t),a=nt(Je),e===null?(s=ai(),s===null&&(s=Le,r=ti(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},si(t),_l(t,Je,s)):((e.lanes&l)!==0&&(ri(e,t),Nn(t,null,null,l),Sn()),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),_l(t,Je,a)):(a=r.cache,_l(t,Je,a),a!==s.cache&&ei(t,[Je],l,!0))),st(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function xl(e){e.flags|=4}function Yi(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(Xd())e.flags|=8192;else throw ua=js,ni}else e.flags&=-16777217}function gd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Df(t))if(Xd())e.flags|=8192;else throw ua=js,ni}function Us(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fc():536870912,e.lanes|=t,Za|=t)}function _n(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Zx(e,t,l){var a=t.pendingProps;switch($r(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ul(Je),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(za(t)?xl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fr())),He(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(xl(t),r!==null?(He(t),gd(t,r)):(He(t),Yi(t,s,null,a,l))):r?r!==e.memoizedState?(xl(t),He(t),gd(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&xl(t),He(t),Yi(t,s,e,a,l)),null;case 27:if(bt(t),l=Q.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&xl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}e=R.current,za(t)?Io(t):(e=kf(s,a,l),t.stateNode=e,xl(t))}return He(t),null;case 5:if(bt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&xl(t);else{if(!a){if(t.stateNode===null)throw Error(u(166));return He(t),null}if(r=R.current,za(t))Io(t);else{var c=Ps(Q.current);switch(r){case 1:r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=c.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?c.createElement(s,{is:a.is}):c.createElement(s)}}r[lt]=t,r[mt]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)r.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=r;e:switch(rt(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&&xl(t)}}return He(t),Yi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&xl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=Q.current,za(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=at,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[lt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||hf(e.nodeValue,l)),e||Al(t,!0)}else e=Ps(e).createTextNode(a),e[lt]=t,t.stateNode=e}return He(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=za(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[lt]=t}else sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else l=Fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Ct(t),t):(Ct(t),null);if((t.flags&128)!==0)throw Error(u(558))}return He(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=za(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[lt]=t}else sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),s=!1}else s=Fr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Ct(t),t):(Ct(t),null)}return Ct(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),Us(t,t.updateQueue),He(t),null);case 4:return ye(),e===null&&oc(t.stateNode.containerInfo),He(t),null;case 10:return ul(t.type),He(t),null;case 19:if(L(Qe),a=t.memoizedState,a===null)return He(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)_n(a,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Ts(e),r!==null){for(t.flags|=128,_n(a,!1),e=r.updateQueue,t.updateQueue=e,Us(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Ko(l,e),l=l.sibling;return X(Qe,Qe.current&1|2),Te&&cl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Ke()>Vs&&(t.flags|=128,s=!0,_n(a,!1),t.lanes=4194304)}else{if(!s)if(e=Ts(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Us(t,e),_n(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!Te)return He(t),null}else 2*Ke()-a.renderingStartTime>Vs&&l!==536870912&&(t.flags|=128,s=!0,_n(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=Ke(),e.sibling=null,l=Qe.current,X(Qe,s?l&1|2:l&1),Te&&cl(t,a.treeForkCount),e):(He(t),null);case 22:case 23:return Ct(t),ui(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),l=t.updateQueue,l!==null&&Us(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&&L(ca),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ul(Je),He(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Kx(e,t){switch($r(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ul(Je),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return bt(t),null;case 31:if(t.memoizedState!==null){if(Ct(t),t.alternate===null)throw Error(u(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ct(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(Qe),null;case 4:return ye(),null;case 10:return ul(t.type),null;case 22:case 23:return Ct(t),ui(),e!==null&&L(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ul(Je),null;case 25:return null;default:return null}}function bd(e,t){switch($r(t),t.tag){case 3:ul(Je),ye();break;case 26:case 27:case 5:bt(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Ct(t);break;case 13:Ct(t);break;case 19:L(Qe);break;case 10:ul(t.type);break;case 22:case 23:Ct(t),ui(),e!==null&&L(ca);break;case 24:ul(Je)}}function Rn(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,c=l.inst;a=r(),c.destroy=a}l=l.next}while(l!==s)}}catch(f){we(t,t.return,f)}}function Dl(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 c=a.inst,f=c.destroy;if(f!==void 0){c.destroy=void 0,s=t;var g=l,_=f;try{_()}catch(B){we(s,g,B)}}}a=a.next}while(a!==r)}}catch(B){we(t,t.return,B)}}function jd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{du(t,l)}catch(a){we(e,e.return,a)}}}function Sd(e,t,l){l.props=ma(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){we(e,t,a)}}function wn(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){we(e,t,s)}}function It(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){we(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){we(e,t,s)}else l.current=null}function Nd(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){we(e,e.return,s)}}function Gi(e,t,l){try{var a=e.stateNode;pp(a,e.type,l,t),a[mt]=t}catch(s){we(e,e.return,s)}}function Ed(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Gl(e.type)||e.tag===4}function Vi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ed(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 Qi(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=sl));else if(a!==4&&(a===27&&Gl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Qi(e,t,l),e=e.sibling;e!==null;)Qi(e,t,l),e=e.sibling}function Hs(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(Hs(e,t,l),e=e.sibling;e!==null;)Hs(e,t,l),e=e.sibling}function Td(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);rt(t,a,l),t[lt]=e,t[mt]=l}catch(r){we(e,e.return,r)}}var pl=!1,Fe=!1,Xi=!1,Cd=typeof WeakSet=="function"?WeakSet:Set,et=null;function Jx(e,t){if(e=e.containerInfo,fc=rr,e=Uo(e),Ur(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 c=0,f=-1,g=-1,_=0,B=0,q=e,w=null;t:for(;;){for(var O;q!==l||s!==0&&q.nodeType!==3||(f=c+s),q!==r||a!==0&&q.nodeType!==3||(g=c+a),q.nodeType===3&&(c+=q.nodeValue.length),(O=q.firstChild)!==null;)w=q,q=O;for(;;){if(q===e)break t;if(w===l&&++_===s&&(f=c),w===r&&++B===a&&(g=c),(O=q.nextSibling)!==null)break;q=w,w=q.parentNode}q=O}l=f===-1||g===-1?null:{start:f,end:g}}else l=null}l=l||{start:0,end:0}}else l=null;for(mc={focusedElem:e,selectionRange:l},rr=!1,et=t;et!==null;)if(t=et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,et=e;else for(;et!==null;){switch(t=et,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=ma(l.type,s);e=a.getSnapshotBeforeUpdate(ae,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(ue){we(l,l.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)hc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hc(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,et=e;break}et=t.return}}function kd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:vl(e,l),a&4&&Rn(5,l);break;case 1:if(vl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){we(l,l.return,c)}else{var s=ma(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){we(l,l.return,c)}}a&64&&jd(l),a&512&&wn(l,l.return);break;case 3:if(vl(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{du(e,t)}catch(c){we(l,l.return,c)}}break;case 27:t===null&&a&4&&Td(l);case 26:case 5:vl(e,l),t===null&&a&4&&Nd(l),a&512&&wn(l,l.return);break;case 12:vl(e,l);break;case 31:vl(e,l),a&4&&Rd(e,l);break;case 13:vl(e,l),a&4&&wd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=ap.bind(null,l),Np(e,l))));break;case 22:if(a=l.memoizedState!==null||pl,!a){t=t!==null&&t.memoizedState!==null||Fe,s=pl;var r=Fe;pl=a,(Fe=t)&&!r?yl(e,l,(l.subtreeFlags&8772)!==0):vl(e,l),pl=s,Fe=r}break;case 30:break;default:vl(e,l)}}function Ad(e){var t=e.alternate;t!==null&&(e.alternate=null,Ad(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jr(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,pt=!1;function hl(e,t,l){for(l=l.child;l!==null;)_d(e,t,l),l=l.sibling}function _d(e,t,l){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Jt,l)}catch{}switch(l.tag){case 26:Fe||It(l,t),hl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Fe||It(l,t);var a=qe,s=pt;Gl(l.type)&&(qe=l.stateNode,pt=!1),hl(e,t,l),qn(l.stateNode),qe=a,pt=s;break;case 5:Fe||It(l,t);case 6:if(a=qe,s=pt,qe=null,hl(e,t,l),qe=a,pt=s,qe!==null)if(pt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(l.stateNode)}catch(r){we(l,t,r)}else try{qe.removeChild(l.stateNode)}catch(r){we(l,t,r)}break;case 18:qe!==null&&(pt?(e=qe,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),en(e)):Sf(qe,l.stateNode));break;case 4:a=qe,s=pt,qe=l.stateNode.containerInfo,pt=!0,hl(e,t,l),qe=a,pt=s;break;case 0:case 11:case 14:case 15:Dl(2,l,t),Fe||Dl(4,l,t),hl(e,t,l);break;case 1:Fe||(It(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Sd(l,t,a)),hl(e,t,l);break;case 21:hl(e,t,l);break;case 22:Fe=(a=Fe)||l.memoizedState!==null,hl(e,t,l),Fe=a;break;default:hl(e,t,l)}}function Rd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{en(e)}catch(l){we(t,t.return,l)}}}function wd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{en(e)}catch(l){we(t,t.return,l)}}function $x(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cd),t;default:throw Error(u(435,e.tag))}}function qs(e,t){var l=$x(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=np.bind(null,e,a);a.then(s,s)}})}function ht(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 27:if(Gl(f.type)){qe=f.stateNode,pt=!1;break e}break;case 5:qe=f.stateNode,pt=!1;break e;case 3:case 4:qe=f.stateNode.containerInfo,pt=!0;break e}f=f.return}if(qe===null)throw Error(u(160));_d(r,c,s),qe=null,pt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Md(t,e),t=t.sibling}var Zt=null;function Md(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ht(t,e),vt(e),a&4&&(Dl(3,e,e.return),Rn(3,e),Dl(5,e,e.return));break;case 1:ht(t,e),vt(e),a&512&&(Fe||l===null||It(l,l.return)),a&64&&pl&&(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=Zt;if(ht(t,e),vt(e),a&512&&(Fe||l===null||It(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[an]||r[lt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),rt(r,a,l),r[lt]=e,Pe(r),a=r;break e;case"link":var c=zf("link","href",s).get(a+(l.href||""));if(c){for(var f=0;f<c.length;f++)if(r=c[f],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)){c.splice(f,1);break t}}r=s.createElement(a),rt(r,a,l),s.head.appendChild(r);break;case"meta":if(c=zf("meta","content",s).get(a+(l.content||""))){for(f=0;f<c.length;f++)if(r=c[f],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)){c.splice(f,1);break t}}r=s.createElement(a),rt(r,a,l),s.head.appendChild(r);break;default:throw Error(u(468,a))}r[lt]=e,Pe(r),a=r}e.stateNode=a}else Of(s,e.type,e.stateNode);else e.stateNode=Mf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Of(s,e.type,e.stateNode):Mf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Gi(e,e.memoizedProps,l.memoizedProps)}break;case 27:ht(t,e),vt(e),a&512&&(Fe||l===null||It(l,l.return)),l!==null&&a&4&&Gi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ht(t,e),vt(e),a&512&&(Fe||l===null||It(l,l.return)),e.flags&32){s=e.stateNode;try{Na(s,"")}catch(ae){we(e,e.return,ae)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Gi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Xi=!0);break;case 6:if(ht(t,e),vt(e),a&4){if(e.stateNode===null)throw Error(u(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(ae){we(e,e.return,ae)}}break;case 3:if(lr=null,s=Zt,Zt=er(t.containerInfo),ht(t,e),Zt=s,vt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{en(t.containerInfo)}catch(ae){we(e,e.return,ae)}Xi&&(Xi=!1,zd(e));break;case 4:a=Zt,Zt=er(e.stateNode.containerInfo),ht(t,e),vt(e),Zt=a;break;case 12:ht(t,e),vt(e);break;case 31:ht(t,e),vt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 13:ht(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Gs=Ke()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 22:s=e.memoizedState!==null;var g=l!==null&&l.memoizedState!==null,_=pl,B=Fe;if(pl=_||s,Fe=B||g,ht(t,e),Fe=B,pl=_,vt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||g||pl||Fe||xa(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){g=l=t;try{if(r=g.stateNode,s)c=r.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{f=g.stateNode;var q=g.memoizedProps.style,w=q!=null&&q.hasOwnProperty("display")?q.display:null;f.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(ae){we(g,g.return,ae)}}}else if(t.tag===6){if(l===null){g=t;try{g.stateNode.nodeValue=s?"":g.memoizedProps}catch(ae){we(g,g.return,ae)}}}else if(t.tag===18){if(l===null){g=t;try{var O=g.stateNode;s?Nf(O,!0):Nf(g.stateNode,!1)}catch(ae){we(g,g.return,ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,qs(e,l))));break;case 19:ht(t,e),vt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,qs(e,a)));break;case 30:break;case 21:break;default:ht(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Ed(a)){l=a;break}a=a.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=Vi(e);Hs(e,r,s);break;case 5:var c=l.stateNode;l.flags&32&&(Na(c,""),l.flags&=-33);var f=Vi(e);Hs(e,f,c);break;case 3:case 4:var g=l.stateNode.containerInfo,_=Vi(e);Qi(e,_,g);break;default:throw Error(u(161))}}catch(B){we(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)kd(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:Dl(4,t,t.return),xa(t);break;case 1:It(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Sd(t,t.return,l),xa(t);break;case 27:qn(t.stateNode);case 26:case 5:It(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 yl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,c=r.flags;switch(r.tag){case 0:case 11:case 15:yl(s,r,l),Rn(4,r);break;case 1:if(yl(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){we(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var f=a.stateNode;try{var g=s.shared.hiddenCallbacks;if(g!==null)for(s.shared.hiddenCallbacks=null,s=0;s<g.length;s++)uu(g[s],f)}catch(_){we(a,a.return,_)}}l&&c&64&&jd(r),wn(r,r.return);break;case 27:Td(r);case 26:case 5:yl(s,r,l),l&&a===null&&c&4&&Nd(r),wn(r,r.return);break;case 12:yl(s,r,l);break;case 31:yl(s,r,l),l&&c&4&&Rd(s,r);break;case 13:yl(s,r,l),l&&c&4&&wd(s,r);break;case 22:r.memoizedState===null&&yl(s,r,l),wn(r,r.return);break;case 30:break;default:yl(s,r,l)}t=t.sibling}}function Zi(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&&vn(l))}function Ki(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vn(e))}function Kt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Od(e,t,l,a),t=t.sibling}function Od(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Kt(e,t,l,a),s&2048&&Rn(9,t);break;case 1:Kt(e,t,l,a);break;case 3:Kt(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&&vn(e)));break;case 12:if(s&2048){Kt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,c=r.id,f=r.onPostCommit;typeof f=="function"&&f(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){we(t,t.return,g)}}else Kt(e,t,l,a);break;case 31:Kt(e,t,l,a);break;case 13:Kt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,c=t.alternate,t.memoizedState!==null?r._visibility&2?Kt(e,t,l,a):Mn(e,t):r._visibility&2?Kt(e,t,l,a):(r._visibility|=2,Va(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Zi(c,t);break;case 24:Kt(e,t,l,a),s&2048&&Ki(t.alternate,t);break;default:Kt(e,t,l,a)}}function Va(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,c=t,f=l,g=a,_=c.flags;switch(c.tag){case 0:case 11:case 15:Va(r,c,f,g,s),Rn(8,c);break;case 23:break;case 22:var B=c.stateNode;c.memoizedState!==null?B._visibility&2?Va(r,c,f,g,s):Mn(r,c):(B._visibility|=2,Va(r,c,f,g,s)),s&&_&2048&&Zi(c.alternate,c);break;case 24:Va(r,c,f,g,s),s&&_&2048&&Ki(c.alternate,c);break;default:Va(r,c,f,g,s)}t=t.sibling}}function Mn(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:Mn(l,a),s&2048&&Zi(a.alternate,a);break;case 24:Mn(l,a),s&2048&&Ki(a.alternate,a);break;default:Mn(l,a)}t=t.sibling}}var zn=8192;function Qa(e,t,l){if(e.subtreeFlags&zn)for(e=e.child;e!==null;)Dd(e,t,l),e=e.sibling}function Dd(e,t,l){switch(e.tag){case 26:Qa(e,t,l),e.flags&zn&&e.memoizedState!==null&&Dp(l,Zt,e.memoizedState,e.memoizedProps);break;case 5:Qa(e,t,l);break;case 3:case 4:var a=Zt;Zt=er(e.stateNode.containerInfo),Qa(e,t,l),Zt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=zn,zn=16777216,Qa(e,t,l),zn=a):Qa(e,t,l));break;default:Qa(e,t,l)}}function Ld(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 On(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];et=a,Ud(a,e)}Ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bd(e),e=e.sibling}function Bd(e){switch(e.tag){case 0:case 11:case 15:On(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:On(e);break;case 12:On(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ys(e)):On(e);break;default:On(e)}}function Ys(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];et=a,Ud(a,e)}Ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),Ys(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ys(t));break;default:Ys(t)}e=e.sibling}}function Ud(e,t){for(;et!==null;){var l=et;switch(l.tag){case 0:case 11:case 15:Dl(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:vn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,et=a;else e:for(l=e;et!==null;){a=et;var s=a.sibling,r=a.return;if(Ad(a),a===l){et=null;break e}if(s!==null){s.return=r,et=s;break e}et=r}}}var Wx={getCacheForType:function(e){var t=nt(Je),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return nt(Je).controller.signal}},Fx=typeof WeakMap=="function"?WeakMap:Map,_e=0,Le=null,ge=null,Se=0,Re=0,kt=null,Ll=!1,Xa=!1,Ji=!1,gl=0,Ge=0,Bl=0,pa=0,$i=0,At=0,Za=0,Dn=null,yt=null,Wi=!1,Gs=0,Hd=0,Vs=1/0,Qs=null,Ul=null,Ie=0,Hl=null,Ka=null,bl=0,Fi=0,Ii=null,qd=null,Ln=0,Pi=null;function _t(){return(_e&2)!==0&&Se!==0?Se&-Se:C.T!==null?sc():to()}function Yd(){if(At===0)if((Se&536870912)===0||Te){var e=In;In<<=1,(In&3932160)===0&&(In=262144),At=e}else At=536870912;return e=Tt.current,e!==null&&(e.flags|=32),At}function gt(e,t,l){(e===Le&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(Ja(e,0),ql(e,Se,At,!1)),ln(e,l),((_e&2)===0||e!==Le)&&(e===Le&&((_e&2)===0&&(pa|=l),Ge===4&&ql(e,Se,At,!1)),Pt(e))}function Gd(e,t,l){if((_e&6)!==0)throw Error(u(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||tn(e,t),s=a?ep(e,t):tc(e,t,!0),r=a;do{if(s===0){Xa&&!a&&ql(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!Ix(l)){s=tc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var f=e;s=Dn;var g=f.current.memoizedState.isDehydrated;if(g&&(Ja(f,c).flags|=256),c=tc(f,c,!1),c!==2){if(Ji&&!g){f.errorRecoveryDisabledLanes|=r,pa|=r,s=4;break e}r=yt,yt=s,r!==null&&(yt===null?yt=r:yt.push.apply(yt,r))}s=c}if(r=!1,s!==2)continue}}if(s===1){Ja(e,0),ql(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:ql(a,t,At,!Ll);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Gs+300-Ke(),10<s)){if(ql(a,t,At,!Ll),es(a,0,!0)!==0)break e;bl=t,a.timeoutHandle=bf(Vd.bind(null,a,l,yt,Qs,Wi,t,At,pa,Za,Ll,r,"Throttled",-0,0),s);break e}Vd(a,l,yt,Qs,Wi,t,At,pa,Za,Ll,r,null,-0,0)}}break}while(!0);Pt(e)}function Vd(e,t,l,a,s,r,c,f,g,_,B,q,w,O){if(e.timeoutHandle=-1,q=t.subtreeFlags,q&8192||(q&16785408)===16785408){q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sl},Dd(t,r,q);var ae=(r&62914560)===r?Gs-Ke():(r&4194048)===r?Hd-Ke():0;if(ae=Lp(q,ae),ae!==null){bl=r,e.cancelPendingCommit=ae(Fd.bind(null,e,t,r,l,a,s,c,f,g,B,q,null,w,O)),ql(e,r,c,!_);return}}Fd(e,t,r,l,a,s,c,f,g)}function Ix(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(!Nt(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 ql(e,t,l,a){t&=~$i,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-St(s),c=1<<r;a[r]=-1,s&=~c}l!==0&&Ic(e,l,t)}function Xs(){return(_e&6)===0?(Bn(0),!1):!0}function ec(){if(ge!==null){if(Re===0)var e=ge.return;else e=ge,ol=ra=null,hi(e),Ua=null,gn=0,e=ge;for(;e!==null;)bd(e.alternate,e),e=e.return;ge=null}}function Ja(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,yp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),bl=0,ec(),Le=e,ge=l=il(e.current,null),Se=t,Re=0,kt=null,Ll=!1,Xa=tn(e,t),Ji=!1,Za=At=$i=pa=Bl=Ge=0,yt=Dn=null,Wi=!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-St(a),r=1<<s;t|=e[s],a&=~r}return gl=t,fs(),l}function Qd(e,t){xe=null,C.H=kn,t===Ba||t===bs?(t=ru(),Re=3):t===ni?(t=ru(),Re=4):Re=t===Mi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,kt=t,ge===null&&(Ge=1,Os(e,Lt(t,e.current)))}function Xd(){var e=Tt.current;return e===null?!0:(Se&4194048)===Se?qt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===qt:!1}function Zd(){var e=C.H;return C.H=kn,e===null?kn:e}function Kd(){var e=C.A;return C.A=Wx,e}function Zs(){Ge=4,Ll||(Se&4194048)!==Se&&Tt.current!==null||(Xa=!0),(Bl&134217727)===0&&(pa&134217727)===0||Le===null||ql(Le,Se,At,!1)}function tc(e,t,l){var a=_e;_e|=2;var s=Zd(),r=Kd();(Le!==e||Se!==t)&&(Qs=null,Ja(e,t)),t=!1;var c=Ge;e:do try{if(Re!==0&&ge!==null){var f=ge,g=kt;switch(Re){case 8:ec(),c=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(t=!0);var _=Re;if(Re=0,kt=null,$a(e,f,g,_),l&&Xa){c=0;break e}break;default:_=Re,Re=0,kt=null,$a(e,f,g,_)}}Px(),c=Ge;break}catch(B){Qd(e,B)}while(!0);return t&&e.shellSuspendCounter++,ol=ra=null,_e=a,C.H=s,C.A=r,ge===null&&(Le=null,Se=0,fs()),c}function Px(){for(;ge!==null;)Jd(ge)}function ep(e,t){var l=_e;_e|=2;var a=Zd(),s=Kd();Le!==e||Se!==t?(Qs=null,Vs=Ke()+500,Ja(e,t)):Xa=tn(e,t);e:do try{if(Re!==0&&ge!==null){t=ge;var r=kt;t:switch(Re){case 1:Re=0,kt=null,$a(e,t,r,1);break;case 2:case 9:if(nu(r)){Re=0,kt=null,$d(t);break}t=function(){Re!==2&&Re!==9||Le!==e||(Re=7),Pt(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:nu(r)?(Re=0,kt=null,$d(t)):(Re=0,kt=null,$a(e,t,r,7));break;case 5:var c=null;switch(ge.tag){case 26:c=ge.memoizedState;case 5:case 27:var f=ge;if(c?Df(c):f.stateNode.complete){Re=0,kt=null;var g=f.sibling;if(g!==null)ge=g;else{var _=f.return;_!==null?(ge=_,Ks(_)):ge=null}break t}}Re=0,kt=null,$a(e,t,r,5);break;case 6:Re=0,kt=null,$a(e,t,r,6);break;case 8:ec(),Ge=6;break e;default:throw Error(u(462))}}tp();break}catch(B){Qd(e,B)}while(!0);return ol=ra=null,C.H=a,C.A=s,_e=l,ge!==null?0:(Le=null,Se=0,fs(),Ge)}function tp(){for(;ge!==null&&!Be();)Jd(ge)}function Jd(e){var t=yd(e.alternate,e,gl);e.memoizedProps=e.pendingProps,t===null?Ks(e):ge=t}function $d(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=fd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=fd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:hi(t);default:bd(l,t),t=ge=Ko(t,gl),t=yd(l,t,gl)}e.memoizedProps=e.pendingProps,t===null?Ks(e):ge=t}function $a(e,t,l,a){ol=ra=null,hi(t),Ua=null,gn=0;var s=t.return;try{if(Vx(e,s,t,l,Se)){Ge=1,Os(e,Lt(l,e.current)),ge=null;return}}catch(r){if(s!==null)throw ge=s,r;Ge=1,Os(e,Lt(l,e.current)),ge=null;return}t.flags&32768?(Te||a===1?e=!0:Xa||(Se&536870912)!==0?e=!1:(Ll=e=!0,(a===2||a===9||a===3||a===6)&&(a=Tt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Wd(t,e)):Ks(t)}function Ks(e){var t=e;do{if((t.flags&32768)!==0){Wd(t,Ll);return}e=t.return;var l=Zx(t.alternate,t,gl);if(l!==null){ge=l;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);Ge===0&&(Ge=5)}function Wd(e,t){do{var l=Kx(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);Ge=6,ge=null}function Fd(e,t,l,a,s,r,c,f,g){e.cancelPendingCommit=null;do Js();while(Ie!==0);if((_e&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(r=t.lanes|t.childLanes,r|=Vr,Om(e,l,r,c,f,g),e===Le&&(ge=Le=null,Se=0),Ka=t,Hl=e,bl=l,Fi=r,Ii=s,qd=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,sp(Qt,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,s=z.p,z.p=2,c=_e,_e|=4;try{Jx(e,t,l)}finally{_e=c,z.p=s,C.T=a}}Ie=1,Id(),Pd(),ef()}}function Id(){if(Ie===1){Ie=0;var e=Hl,t=Ka,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var a=z.p;z.p=2;var s=_e;_e|=4;try{Md(t,e);var r=mc,c=Uo(e.containerInfo),f=r.focusedElem,g=r.selectionRange;if(c!==f&&f&&f.ownerDocument&&Bo(f.ownerDocument.documentElement,f)){if(g!==null&&Ur(f)){var _=g.start,B=g.end;if(B===void 0&&(B=_),"selectionStart"in f)f.selectionStart=_,f.selectionEnd=Math.min(B,f.value.length);else{var q=f.ownerDocument||document,w=q&&q.defaultView||window;if(w.getSelection){var O=w.getSelection(),ae=f.textContent.length,ue=Math.min(g.start,ae),De=g.end===void 0?ue:Math.min(g.end,ae);!O.extend&&ue>De&&(c=De,De=ue,ue=c);var T=Lo(f,ue),E=Lo(f,De);if(T&&E&&(O.rangeCount!==1||O.anchorNode!==T.node||O.anchorOffset!==T.offset||O.focusNode!==E.node||O.focusOffset!==E.offset)){var A=q.createRange();A.setStart(T.node,T.offset),O.removeAllRanges(),ue>De?(O.addRange(A),O.extend(E.node,E.offset)):(A.setEnd(E.node,E.offset),O.addRange(A))}}}}for(q=[],O=f;O=O.parentNode;)O.nodeType===1&&q.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<q.length;f++){var U=q[f];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}rr=!!fc,mc=fc=null}finally{_e=s,z.p=a,C.T=l}}e.current=t,Ie=2}}function Pd(){if(Ie===2){Ie=0;var e=Hl,t=Ka,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var a=z.p;z.p=2;var s=_e;_e|=4;try{kd(e,t.alternate,t)}finally{_e=s,z.p=a,C.T=l}}Ie=3}}function ef(){if(Ie===4||Ie===3){Ie=0,Nl();var e=Hl,t=Ka,l=bl,a=qd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,Ka=Hl=null,tf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ul=null),gr(l),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=C.T,s=z.p,z.p=2,C.T=null;try{for(var r=e.onRecoverableError,c=0;c<a.length;c++){var f=a[c];r(f.value,{componentStack:f.stack})}}finally{C.T=t,z.p=s}}(bl&3)!==0&&Js(),Pt(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Pi?Ln++:(Ln=0,Pi=e):Ln=0,Bn(0)}}function tf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vn(t)))}function Js(){return Id(),Pd(),ef(),lf()}function lf(){if(Ie!==5)return!1;var e=Hl,t=Fi;Fi=0;var l=gr(bl),a=C.T,s=z.p;try{z.p=32>l?32:l,C.T=null,l=Ii,Ii=null;var r=Hl,c=bl;if(Ie=0,Ka=Hl=null,bl=0,(_e&6)!==0)throw Error(u(331));var f=_e;if(_e|=4,Bd(r.current),Od(r,r.current,c,l),_e=f,Bn(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Jt,r)}catch{}return!0}finally{z.p=s,C.T=a,tf(e,t)}}function af(e,t,l){t=Lt(l,t),t=wi(e.stateNode,t,2),e=Ml(e,t,2),e!==null&&(ln(e,2),Pt(e))}function we(e,t,l){if(e.tag===3)af(e,e,l);else for(;t!==null;){if(t.tag===3){af(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ul===null||!Ul.has(a))){e=Lt(l,e),l=nd(2),a=Ml(t,l,2),a!==null&&(sd(l,a,t,e),ln(a,2),Pt(a));break}}t=t.return}}function lc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Fx;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)||(Ji=!0,s.add(l),e=lp.bind(null,e,t,l),t.then(e,e))}function lp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Le===e&&(Se&l)===l&&(Ge===4||Ge===3&&(Se&62914560)===Se&&300>Ke()-Gs?(_e&2)===0&&Ja(e,0):$i|=l,Za===Se&&(Za=0)),Pt(e)}function nf(e,t){t===0&&(t=Fc()),e=aa(e,t),e!==null&&(ln(e,t),Pt(e))}function ap(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),nf(e,l)}function np(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),nf(e,l)}function sp(e,t){return tl(e,t)}var $s=null,Wa=null,ac=!1,Ws=!1,nc=!1,Yl=0;function Pt(e){e!==Wa&&e.next===null&&(Wa===null?$s=Wa=e:Wa=Wa.next=e),Ws=!0,ac||(ac=!0,ip())}function Bn(e,t){if(!nc&&Ws){nc=!0;do for(var l=!1,a=$s;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var c=a.suspendedLanes,f=a.pingedLanes;r=(1<<31-St(42|e)+1)-1,r&=s&~(c&~f),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,of(a,r))}else r=Se,r=es(a,a===Le?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||tn(a,r)||(l=!0,of(a,r));a=a.next}while(l);nc=!1}}function rp(){sf()}function sf(){Ws=ac=!1;var e=0;Yl!==0&&vp()&&(e=Yl);for(var t=Ke(),l=null,a=$s;a!==null;){var s=a.next,r=rf(a,t);r===0?(a.next=null,l===null?$s=s:l.next=s,s===null&&(Wa=l)):(l=a,(e!==0||(r&3)!==0)&&(Ws=!0)),a=s}Ie!==0&&Ie!==5||Bn(e),Yl!==0&&(Yl=0)}function rf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var c=31-St(r),f=1<<c,g=s[c];g===-1?((f&l)===0||(f&a)!==0)&&(s[c]=zm(f,t)):g<=t&&(e.expiredLanes|=f),r&=~f}if(t=Le,l=Se,l=es(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&V(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||tn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&V(a),gr(l)){case 2:case 8:l=al;break;case 32:l=Qt;break;case 268435456:l=Ve;break;default:l=Qt}return a=cf.bind(null,e),l=tl(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&V(a),e.callbackPriority=2,e.callbackNode=null,2}function cf(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Js()&&e.callbackNode!==l)return null;var a=Se;return a=es(e,e===Le?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Gd(e,a,t),rf(e,Ke()),e.callbackNode!=null&&e.callbackNode===l?cf.bind(null,e):null)}function of(e,t){if(Js())return null;Gd(e,t,!0)}function ip(){gp(function(){(_e&6)!==0?tl(ll,rp):sf()})}function sc(){if(Yl===0){var e=Da;e===0&&(e=Fn,Fn<<=1,(Fn&261888)===0&&(Fn=256)),Yl=e}return Yl}function uf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ns(""+e)}function df(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 cp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=uf((s[mt]||null).action),c=a.submitter;c&&(t=(t=c[mt]||null)?uf(t.formAction):c.getAttribute("formAction"),t!==null&&(r=t,c=null));var f=new cs("action","action",null,a,s);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Yl!==0){var g=c?df(s,c):new FormData(s);Ti(l,{pending:!0,data:g,method:s.method,action:r},null,g)}}else typeof r=="function"&&(f.preventDefault(),g=c?df(s,c):new FormData(s),Ti(l,{pending:!0,data:g,method:s.method,action:r},r,g))},currentTarget:s}]})}}for(var rc=0;rc<Gr.length;rc++){var ic=Gr[rc],op=ic.toLowerCase(),up=ic[0].toUpperCase()+ic.slice(1);Xt(op,"on"+up)}Xt(Yo,"onAnimationEnd"),Xt(Go,"onAnimationIteration"),Xt(Vo,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(Cx,"onTransitionRun"),Xt(kx,"onTransitionStart"),Xt(Ax,"onTransitionCancel"),Xt(Qo,"onTransitionEnd"),ja("onMouseEnter",["mouseout","mouseover"]),ja("onMouseLeave",["mouseout","mouseover"]),ja("onPointerEnter",["pointerout","pointerover"]),ja("onPointerLeave",["pointerout","pointerover"]),Pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Un="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(" "),dp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Un));function ff(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 c=a.length-1;0<=c;c--){var f=a[c],g=f.instance,_=f.currentTarget;if(f=f.listener,g!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=_;try{r(s)}catch(B){ds(B)}s.currentTarget=null,r=g}else for(c=0;c<a.length;c++){if(f=a[c],g=f.instance,_=f.currentTarget,f=f.listener,g!==r&&s.isPropagationStopped())break e;r=f,s.currentTarget=_;try{r(s)}catch(B){ds(B)}s.currentTarget=null,r=g}}}}function be(e,t){var l=t[br];l===void 0&&(l=t[br]=new Set);var a=e+"__bubble";l.has(a)||(mf(t,e,2,!1),l.add(a))}function cc(e,t,l){var a=0;t&&(a|=4),mf(l,e,a,t)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Fs]){e[Fs]=!0,no.forEach(function(l){l!=="selectionchange"&&(dp.has(l)||cc(l,!1,e),cc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fs]||(t[Fs]=!0,cc("selectionchange",!1,t))}}function mf(e,t,l,a){switch(Gf(t)){case 2:var s=Hp;break;case 8:s=qp;break;default:s=Ec}l=s.bind(null,t,l,e),s=void 0,!_r||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function uc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var c=a.tag;if(c===3||c===4){var f=a.stateNode.containerInfo;if(f===s)break;if(c===4)for(c=a.return;c!==null;){var g=c.tag;if((g===3||g===4)&&c.stateNode.containerInfo===s)return;c=c.return}for(;f!==null;){if(c=ya(f),c===null)return;if(g=c.tag,g===5||g===6||g===26||g===27){a=r=c;continue e}f=f.parentNode}}a=a.return}vo(function(){var _=r,B=kr(l),q=[];e:{var w=Xo.get(e);if(w!==void 0){var O=cs,ae=e;switch(e){case"keypress":if(rs(l)===0)break e;case"keydown":case"keyup":O=nx;break;case"focusin":ae="focus",O=zr;break;case"focusout":ae="blur",O=zr;break;case"beforeblur":case"afterblur":O=zr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=bo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Zm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ix;break;case Yo:case Go:case Vo:O=$m;break;case Qo:O=ox;break;case"scroll":case"scrollend":O=Qm;break;case"wheel":O=dx;break;case"copy":case"cut":case"paste":O=Fm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=So;break;case"toggle":case"beforetoggle":O=mx}var ue=(t&4)!==0,De=!ue&&(e==="scroll"||e==="scrollend"),T=ue?w!==null?w+"Capture":null:w;ue=[];for(var E=_,A;E!==null;){var U=E;if(A=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||A===null||T===null||(U=sn(E,T),U!=null&&ue.push(Hn(E,U,A))),De)break;E=E.return}0<ue.length&&(w=new O(w,ae,null,l,B),q.push({event:w,listeners:ue}))}}if((t&7)===0){e:{if(w=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",w&&l!==Cr&&(ae=l.relatedTarget||l.fromElement)&&(ya(ae)||ae[va]))break e;if((O||w)&&(w=B.window===B?B:(w=B.ownerDocument)?w.defaultView||w.parentWindow:window,O?(ae=l.relatedTarget||l.toElement,O=_,ae=ae?ya(ae):null,ae!==null&&(De=y(ae),ue=ae.tag,ae!==De||ue!==5&&ue!==27&&ue!==6)&&(ae=null)):(O=null,ae=_),O!==ae)){if(ue=bo,U="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ue=So,U="onPointerLeave",T="onPointerEnter",E="pointer"),De=O==null?w:nn(O),A=ae==null?w:nn(ae),w=new ue(U,E+"leave",O,l,B),w.target=De,w.relatedTarget=A,U=null,ya(B)===_&&(ue=new ue(T,E+"enter",ae,l,B),ue.target=A,ue.relatedTarget=De,U=ue),De=U,O&&ae)t:{for(ue=fp,T=O,E=ae,A=0,U=T;U;U=ue(U))A++;U=0;for(var ce=E;ce;ce=ue(ce))U++;for(;0<A-U;)T=ue(T),A--;for(;0<U-A;)E=ue(E),U--;for(;A--;){if(T===E||E!==null&&T===E.alternate){ue=T;break t}T=ue(T),E=ue(E)}ue=null}else ue=null;O!==null&&xf(q,w,O,ue,!1),ae!==null&&De!==null&&xf(q,De,ae,ue,!0)}}e:{if(w=_?nn(_):window,O=w.nodeName&&w.nodeName.toLowerCase(),O==="select"||O==="input"&&w.type==="file")var ke=Ro;else if(Ao(w))if(wo)ke=Nx;else{ke=jx;var re=bx}else O=w.nodeName,!O||O.toLowerCase()!=="input"||w.type!=="checkbox"&&w.type!=="radio"?_&&Tr(_.elementType)&&(ke=Ro):ke=Sx;if(ke&&(ke=ke(e,_))){_o(q,ke,l,B);break e}re&&re(e,w,_),e==="focusout"&&_&&w.type==="number"&&_.memoizedProps.value!=null&&Er(w,"number",w.value)}switch(re=_?nn(_):window,e){case"focusin":(Ao(re)||re.contentEditable==="true")&&(ka=re,Hr=_,xn=null);break;case"focusout":xn=Hr=ka=null;break;case"mousedown":qr=!0;break;case"contextmenu":case"mouseup":case"dragend":qr=!1,Ho(q,l,B);break;case"selectionchange":if(Tx)break;case"keydown":case"keyup":Ho(q,l,B)}var ve;if(Dr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Ca?Co(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(No&&l.locale!=="ko"&&(Ca||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Ca&&(ve=yo()):(Tl=B,Rr="value"in Tl?Tl.value:Tl.textContent,Ca=!0)),re=Is(_,Ne),0<re.length&&(Ne=new jo(Ne,e,null,l,B),q.push({event:Ne,listeners:re}),ve?Ne.data=ve:(ve=ko(l),ve!==null&&(Ne.data=ve)))),(ve=px?hx(e,l):vx(e,l))&&(Ne=Is(_,"onBeforeInput"),0<Ne.length&&(re=new jo("onBeforeInput","beforeinput",null,l,B),q.push({event:re,listeners:Ne}),re.data=ve)),cp(q,e,_,l,B)}ff(q,t)})}function Hn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Is(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=sn(e,l),s!=null&&a.unshift(Hn(e,s,r)),s=sn(e,t),s!=null&&a.push(Hn(e,s,r))),e.tag===3)return a;e=e.return}return[]}function fp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xf(e,t,l,a,s){for(var r=t._reactName,c=[];l!==null&&l!==a;){var f=l,g=f.alternate,_=f.stateNode;if(f=f.tag,g!==null&&g===a)break;f!==5&&f!==26&&f!==27||_===null||(g=_,s?(_=sn(l,r),_!=null&&c.unshift(Hn(l,_,g))):s||(_=sn(l,r),_!=null&&c.push(Hn(l,_,g)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var mp=/\r\n?/g,xp=/\u0000|\uFFFD/g;function pf(e){return(typeof e=="string"?e:""+e).replace(mp,`
49
+ `).replace(xp,"")}function hf(e,t){return t=pf(t),pf(e)===t}function Oe(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Na(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Na(e,""+a);break;case"className":ls(e,"class",a);break;case"tabIndex":ls(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ls(e,l,a);break;case"style":po(e,a,r);break;case"data":if(t!=="object"){ls(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=ns(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(l==="formAction"?(t!=="input"&&Oe(e,t,"name",s.name,s,null),Oe(e,t,"formEncType",s.formEncType,s,null),Oe(e,t,"formMethod",s.formMethod,s,null),Oe(e,t,"formTarget",s.formTarget,s,null)):(Oe(e,t,"encType",s.encType,s,null),Oe(e,t,"method",s.method,s,null),Oe(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ns(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=sl);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=ns(""+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),ts(e,"popover",a);break;case"xlinkActuate":nl(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":nl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":nl(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":nl(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":nl(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":nl(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":nl(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":nl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":nl(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ts(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=Gm.get(l)||l,ts(e,l,a))}}function dc(e,t,l,a,s,r){switch(l){case"style":po(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"?Na(e,a):(typeof a=="number"||typeof a=="bigint")&&Na(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=sl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!so.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[mt]||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,""):ts(e,l,a)}}}function rt(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 c=l[r];if(c!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,r,c,l,null)}}s&&Oe(e,t,"srcSet",l.srcSet,l,null),a&&Oe(e,t,"src",l.src,l,null);return;case"input":be("invalid",e);var f=r=c=s=null,g=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var B=l[a];if(B!=null)switch(a){case"name":s=B;break;case"type":c=B;break;case"checked":g=B;break;case"defaultChecked":_=B;break;case"value":r=B;break;case"defaultValue":f=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Oe(e,t,a,B,l,null)}}uo(e,r,f,g,_,c,s,!1);return;case"select":be("invalid",e),a=c=r=null;for(s in l)if(l.hasOwnProperty(s)&&(f=l[s],f!=null))switch(s){case"value":r=f;break;case"defaultValue":c=f;break;case"multiple":a=f;default:Oe(e,t,s,f,l,null)}t=r,l=c,e.multiple=!!a,t!=null?Sa(e,!!a,t,!1):l!=null&&Sa(e,!!a,l,!0);return;case"textarea":be("invalid",e),r=s=a=null;for(c in l)if(l.hasOwnProperty(c)&&(f=l[c],f!=null))switch(c){case"value":a=f;break;case"defaultValue":s=f;break;case"children":r=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(u(91));break;default:Oe(e,t,c,f,l,null)}mo(e,a,s,r);return;case"option":for(g in l)if(l.hasOwnProperty(g)&&(a=l[g],a!=null))switch(g){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Oe(e,t,g,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<Un.length;a++)be(Un[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(_ in l)if(l.hasOwnProperty(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Oe(e,t,_,a,l,null)}return;default:if(Tr(t)){for(B in l)l.hasOwnProperty(B)&&(a=l[B],a!==void 0&&dc(e,t,B,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Oe(e,t,f,a,l,null))}function pp(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,c=null,f=null,g=null,_=null,B=null;for(O in l){var q=l[O];if(l.hasOwnProperty(O)&&q!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":g=q;default:a.hasOwnProperty(O)||Oe(e,t,O,null,a,q)}}for(var w in a){var O=a[w];if(q=l[w],a.hasOwnProperty(w)&&(O!=null||q!=null))switch(w){case"type":r=O;break;case"name":s=O;break;case"checked":_=O;break;case"defaultChecked":B=O;break;case"value":c=O;break;case"defaultValue":f=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:O!==q&&Oe(e,t,w,O,a,q)}}Nr(e,c,f,g,_,B,r,s);return;case"select":O=c=f=w=null;for(r in l)if(g=l[r],l.hasOwnProperty(r)&&g!=null)switch(r){case"value":break;case"multiple":O=g;default:a.hasOwnProperty(r)||Oe(e,t,r,null,a,g)}for(s in a)if(r=a[s],g=l[s],a.hasOwnProperty(s)&&(r!=null||g!=null))switch(s){case"value":w=r;break;case"defaultValue":f=r;break;case"multiple":c=r;default:r!==g&&Oe(e,t,s,r,a,g)}t=f,l=c,a=O,w!=null?Sa(e,!!l,w,!1):!!a!=!!l&&(t!=null?Sa(e,!!l,t,!0):Sa(e,!!l,l?[]:"",!1));return;case"textarea":O=w=null;for(f in l)if(s=l[f],l.hasOwnProperty(f)&&s!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Oe(e,t,f,null,a,s)}for(c in a)if(s=a[c],r=l[c],a.hasOwnProperty(c)&&(s!=null||r!=null))switch(c){case"value":w=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&Oe(e,t,c,s,a,r)}fo(e,w,O);return;case"option":for(var ae in l)if(w=l[ae],l.hasOwnProperty(ae)&&w!=null&&!a.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Oe(e,t,ae,null,a,w)}for(g in a)if(w=a[g],O=l[g],a.hasOwnProperty(g)&&w!==O&&(w!=null||O!=null))switch(g){case"selected":e.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:Oe(e,t,g,w,a,O)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in l)w=l[ue],l.hasOwnProperty(ue)&&w!=null&&!a.hasOwnProperty(ue)&&Oe(e,t,ue,null,a,w);for(_ in a)if(w=a[_],O=l[_],a.hasOwnProperty(_)&&w!==O&&(w!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(u(137,t));break;default:Oe(e,t,_,w,a,O)}return;default:if(Tr(t)){for(var De in l)w=l[De],l.hasOwnProperty(De)&&w!==void 0&&!a.hasOwnProperty(De)&&dc(e,t,De,void 0,a,w);for(B in a)w=a[B],O=l[B],!a.hasOwnProperty(B)||w===O||w===void 0&&O===void 0||dc(e,t,B,w,a,O);return}}for(var T in l)w=l[T],l.hasOwnProperty(T)&&w!=null&&!a.hasOwnProperty(T)&&Oe(e,t,T,null,a,w);for(q in a)w=a[q],O=l[q],!a.hasOwnProperty(q)||w===O||w==null&&O==null||Oe(e,t,q,w,a,O)}function vf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hp(){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,c=s.initiatorType,f=s.duration;if(r&&f&&vf(c)){for(c=0,f=s.responseEnd,a+=1;a<l.length;a++){var g=l[a],_=g.startTime;if(_>f)break;var B=g.transferSize,q=g.initiatorType;B&&vf(q)&&(g=g.responseEnd,c+=B*(g<f?1:(f-_)/(g-_)))}if(--a,t+=8*(r+c)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var fc=null,mc=null;function Ps(e){return e.nodeType===9?e:e.ownerDocument}function yf(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 gf(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 xc(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 pc=null;function vp(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var bf=typeof setTimeout=="function"?setTimeout:void 0,yp=typeof clearTimeout=="function"?clearTimeout:void 0,jf=typeof Promise=="function"?Promise:void 0,gp=typeof queueMicrotask=="function"?queueMicrotask:typeof jf<"u"?function(e){return jf.resolve(null).then(e).catch(bp)}:bf;function bp(e){setTimeout(function(){throw e})}function Gl(e){return e==="head"}function Sf(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),en(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 c=r.nextSibling,f=r.nodeName;r[an]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=c}}else l==="body"&&qn(e.ownerDocument.body);l=s}while(l);en(t)}function Nf(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 hc(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":hc(l),jr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function jp(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[an])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function Sp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function Ef(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function vc(e){return e.data==="$?"||e.data==="$~"}function yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Np(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gc=null;function Tf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Cf(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 kf(e,t,l){switch(t=Ps(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]);jr(e)}var Gt=new Map,Af=new Set;function er(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jl=z.d;z.d={f:Ep,r:Tp,D:Cp,C:kp,L:Ap,m:_p,X:wp,S:Rp,M:Mp};function Ep(){var e=jl.f(),t=Xs();return e||t}function Tp(e){var t=ga(e);t!==null&&t.tag===5&&t.type==="form"?Qu(t):jl.r(e)}var Fa=typeof document>"u"?null:document;function _f(e,t,l){var a=Fa;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Af.has(s)||(Af.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),rt(t,"link",e),Pe(t),a.head.appendChild(t)))}}function Cp(e){jl.D(e),_f("dns-prefetch",e,null)}function kp(e,t){jl.C(e,t),_f("preconnect",e,t)}function Ap(e,t,l){jl.L(e,t,l);var a=Fa;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=Ia(e);break;case"script":r=Pa(e)}Gt.has(r)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Gt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Yn(r))||t==="script"&&a.querySelector(Gn(r))||(t=a.createElement("link"),rt(t,"link",e),Pe(t),a.head.appendChild(t)))}}function _p(e,t){jl.m(e,t);var l=Fa;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Pa(e)}if(!Gt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Gt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Gn(r)))return}a=l.createElement("link"),rt(a,"link",e),Pe(a),l.head.appendChild(a)}}}function Rp(e,t,l){jl.S(e,t,l);var a=Fa;if(a&&e){var s=ba(a).hoistableStyles,r=Ia(e);t=t||"default";var c=s.get(r);if(!c){var f={loading:0,preload:null};if(c=a.querySelector(Yn(r)))f.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Gt.get(r))&&bc(e,l);var g=c=a.createElement("link");Pe(g),rt(g,"link",e),g._p=new Promise(function(_,B){g.onload=_,g.onerror=B}),g.addEventListener("load",function(){f.loading|=1}),g.addEventListener("error",function(){f.loading|=2}),f.loading|=4,tr(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:f},s.set(r,c)}}}function wp(e,t){jl.X(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Gn(s)),r||(e=b({src:e,async:!0},t),(t=Gt.get(s))&&jc(e,t),r=l.createElement("script"),Pe(r),rt(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Mp(e,t){jl.M(e,t);var l=Fa;if(l&&e){var a=ba(l).hoistableScripts,s=Pa(e),r=a.get(s);r||(r=l.querySelector(Gn(s)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Gt.get(s))&&jc(e,t),r=l.createElement("script"),Pe(r),rt(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Rf(e,t,l,a){var s=(s=Q.current)?er(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=Ia(l.href),l=ba(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=Ia(l.href);var r=ba(s).hoistableStyles,c=r.get(e);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,c),(r=s.querySelector(Yn(e)))&&!r._p&&(c.instance=r,c.state.loading=5),Gt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gt.set(e,l),r||zp(s,e,l,c.state))),t&&a===null)throw Error(u(528,""));return c}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=Pa(l),l=ba(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 Ia(e){return'href="'+Ot(e)+'"'}function Yn(e){return'link[rel="stylesheet"]['+e+"]"}function wf(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function zp(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}),rt(t,"link",l),Pe(t),e.head.appendChild(t))}function Pa(e){return'[src="'+Ot(e)+'"]'}function Gn(e){return"script[async]"+e}function Mf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,Pe(a),a;var s=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Pe(a),rt(a,"style",s),tr(a,l.precedence,e),t.instance=a;case"stylesheet":s=Ia(l.href);var r=e.querySelector(Yn(s));if(r)return t.state.loading|=4,t.instance=r,Pe(r),r;a=wf(l),(s=Gt.get(s))&&bc(a,s),r=(e.ownerDocument||e).createElement("link"),Pe(r);var c=r;return c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),rt(r,"link",a),t.state.loading|=4,tr(r,l.precedence,e),t.instance=r;case"script":return r=Pa(l.src),(s=e.querySelector(Gn(r)))?(t.instance=s,Pe(s),s):(a=l,(s=Gt.get(r))&&(a=b({},l),jc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),Pe(s),rt(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,tr(a,l.precedence,e));return t.instance}function tr(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,c=0;c<a.length;c++){var f=a[c];if(f.dataset.precedence===t)r=f;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 bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lr=null;function zf(e,t,l){if(lr===null){var a=new Map,s=lr=new Map;s.set(l,a)}else s=lr,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[an]||r[lt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var c=r.getAttribute(t)||"";c=e+c;var f=a.get(c);f?f.push(r):a.set(c,[r])}}return a}function Of(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Op(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 Df(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Dp(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=Ia(a.href),r=t.querySelector(Yn(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ar.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=r,Pe(r);return}r=t.ownerDocument||t,a=wf(a),(s=Gt.get(s))&&bc(a,s),r=r.createElement("link"),Pe(r);var c=r;c._p=new Promise(function(f,g){c.onload=f,c.onerror=g}),rt(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=ar.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Sc=0;function Lp(e,t){return e.stylesheets&&e.count===0&&sr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&sr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Sc===0&&(Sc=62500*hp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Sc?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var nr=null;function sr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,nr=new Map,t.forEach(Bp,e),nr=null,ar.call(e))}function Bp(e,t){if(!(t.state.loading&4)){var l=nr.get(e);if(l)var a=l.get(null);else{l=new Map,nr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var c=s[r];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),a=c)}a&&l.set(null,a)}s=t.instance,c=s.getAttribute("data-precedence"),r=l.get(c)||a,r===a&&l.set(null,s),l.set(c,s),this.count++,a=ar.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 Vn={$$typeof:ie,Provider:null,Consumer:null,_currentValue:D,_currentValue2:D,_threadCount:0};function Up(e,t,l,a,s,r,c,f,g){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vr(0),this.hiddenUpdates=vr(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Lf(e,t,l,a,s,r,c,f,g,_,B,q){return e=new Up(e,t,l,c,g,_,B,q,f),t=1,r===!0&&(t|=24),r=Et(3,null,null,t),e.current=r,r.stateNode=e,t=ti(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},si(r),e}function Bf(e){return e?(e=Ra,e):Ra}function Uf(e,t,l,a,s,r){s=Bf(s),a.context===null?a.context=s:a.pendingContext=s,a=wl(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Ml(e,a,t),l!==null&&(gt(l,e,t),jn(l,e,t))}function Hf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Nc(e,t){Hf(e,t),(e=e.alternate)&&Hf(e,t)}function qf(e){if(e.tag===13||e.tag===31){var t=aa(e,67108864);t!==null&&gt(t,e,67108864),Nc(e,67108864)}}function Yf(e){if(e.tag===13||e.tag===31){var t=_t();t=yr(t);var l=aa(e,t);l!==null&&gt(l,e,t),Nc(e,t)}}var rr=!0;function Hp(e,t,l,a){var s=C.T;C.T=null;var r=z.p;try{z.p=2,Ec(e,t,l,a)}finally{z.p=r,C.T=s}}function qp(e,t,l,a){var s=C.T;C.T=null;var r=z.p;try{z.p=8,Ec(e,t,l,a)}finally{z.p=r,C.T=s}}function Ec(e,t,l,a){if(rr){var s=Tc(a);if(s===null)uc(e,t,a,ir,l),Vf(e,a);else if(Gp(s,e,t,l,a))a.stopPropagation();else if(Vf(e,a),t&4&&-1<Yp.indexOf(e)){for(;s!==null;){var r=ga(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var c=Il(r.pendingLanes);if(c!==0){var f=r;for(f.pendingLanes|=2,f.entangledLanes|=2;c;){var g=1<<31-St(c);f.entanglements[1]|=g,c&=~g}Pt(r),(_e&6)===0&&(Vs=Ke()+500,Bn(0))}}break;case 31:case 13:f=aa(r,2),f!==null&&gt(f,r,2),Xs(),Nc(r,2)}if(r=Tc(a),r===null&&uc(e,t,a,ir,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else uc(e,t,a,null,l)}}function Tc(e){return e=kr(e),Cc(e)}var ir=null;function Cc(e){if(ir=null,e=ya(e),e!==null){var t=y(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=x(t),e!==null)return e;e=null}else if(l===31){if(e=j(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 ir=e,null}function Gf(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(tt()){case ll:return 2;case al:return 8;case Qt:case jt:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var kc=!1,Vl=null,Ql=null,Xl=null,Qn=new Map,Xn=new Map,Zl=[],Yp="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 Vf(e,t){switch(e){case"focusin":case"focusout":Vl=null;break;case"dragenter":case"dragleave":Ql=null;break;case"mouseover":case"mouseout":Xl=null;break;case"pointerover":case"pointerout":Qn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xn.delete(t.pointerId)}}function Zn(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=ga(t),t!==null&&qf(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Gp(e,t,l,a,s){switch(t){case"focusin":return Vl=Zn(Vl,e,t,l,a,s),!0;case"dragenter":return Ql=Zn(Ql,e,t,l,a,s),!0;case"mouseover":return Xl=Zn(Xl,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return Qn.set(r,Zn(Qn.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,Xn.set(r,Zn(Xn.get(r)||null,e,t,l,a,s)),!0}return!1}function Qf(e){var t=ya(e.target);if(t!==null){var l=y(t);if(l!==null){if(t=l.tag,t===13){if(t=x(l),t!==null){e.blockedOn=t,lo(e.priority,function(){Yf(l)});return}}else if(t===31){if(t=j(l),t!==null){e.blockedOn=t,lo(e.priority,function(){Yf(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 cr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Tc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Cr=a,l.target.dispatchEvent(a),Cr=null}else return t=ga(l),t!==null&&qf(t),e.blockedOn=l,!1;t.shift()}return!0}function Xf(e,t,l){cr(e)&&l.delete(t)}function Vp(){kc=!1,Vl!==null&&cr(Vl)&&(Vl=null),Ql!==null&&cr(Ql)&&(Ql=null),Xl!==null&&cr(Xl)&&(Xl=null),Qn.forEach(Xf),Xn.forEach(Xf)}function or(e,t){e.blockedOn===t&&(e.blockedOn=null,kc||(kc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Vp)))}var ur=null;function Zf(e){ur!==e&&(ur=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ur===e&&(ur=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(Cc(a||l)===null)continue;break}var r=ga(l);r!==null&&(e.splice(t,3),t-=3,Ti(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function en(e){function t(g){return or(g,e)}Vl!==null&&or(Vl,e),Ql!==null&&or(Ql,e),Xl!==null&&or(Xl,e),Qn.forEach(t),Xn.forEach(t);for(var l=0;l<Zl.length;l++){var a=Zl[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Zl.length&&(l=Zl[0],l.blockedOn===null);)Qf(l),l.blockedOn===null&&Zl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],c=s[mt]||null;if(typeof r=="function")c||Zf(l);else if(c){var f=null;if(r&&r.hasAttribute("formAction")){if(s=r,c=r[mt]||null)f=c.formAction;else if(Cc(s)!==null)continue}else f=c.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),Zf(l)}}}function Kf(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(c){return s=c})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var 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 Ac(e){this._internalRoot=e}dr.prototype.render=Ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,a=_t();Uf(l,a,e,t,null,null)},dr.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Uf(e.current,2,null,e,null,null),Xs(),t[va]=null}};function dr(e){this._internalRoot=e}dr.prototype.unstable_scheduleHydration=function(e){if(e){var t=to();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Zl.length&&t!==0&&t<Zl[l].priority;l++);Zl.splice(l,0,e),l===0&&Qf(e)}};var Jf=o.version;if(Jf!=="19.2.4")throw Error(u(527,Jf,"19.2.4"));z.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=m(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fr.isDisabled&&fr.supportsFiber)try{Jt=fr.inject(Qp),Me=fr}catch{}}return Jn.createRoot=function(e,t){if(!p(e))throw Error(u(299));var l=!1,a="",s=ed,r=td,c=ld;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&&(c=t.onRecoverableError)),t=Lf(e,1,!1,null,null,l,a,null,s,r,c,Kf),e[va]=t.current,oc(e),new Ac(t)},Jn.hydrateRoot=function(e,t,l){if(!p(e))throw Error(u(299));var a=!1,s="",r=ed,c=td,f=ld,g=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&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(g=l.formState)),t=Lf(e,1,!0,t,l??null,a,s,g,r,c,f,Kf),t.context=Bf(null),l=t.current,a=_t(),a=yr(a),s=wl(a),s.callback=null,Ml(l,s,a),l=a,t.current.lanes=l,ln(t,l),Pt(t),e[va]=t.current,oc(e),new dr(t)},Jn.version="19.2.4",Jn}var nm;function eh(){if(nm)return wc.exports;nm=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(),wc.exports=Pp(),wc.exports}var th=eh();const jm="";class Sm extends Error{constructor(o,d){super(o),this.name="ApiError",this.status=d}}async function Ze(i,o){const d=await fetch(`${jm}${i}`,o);if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Sm(u.error||`HTTP ${d.status}`,d.status)}return d.json()}const je={getConfig(){return Ze("/api/config")},setConfig(i,o){return Ze("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:o})})},getSkills(){return Ze("/api/skills")},getSkillDetail(i,o){return Ze(`/api/skills/${i}/${o}`)},getEvals(i,o){return Ze(`/api/skills/${i}/${o}/evals`)},saveEvals(i,o,d){return Ze(`/api/skills/${i}/${o}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},generateEvals(i,o){return Ze(`/api/skills/${i}/${o}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,o){const d=await fetch(`${jm}/api/skills/${i}/${o}/benchmark/latest`);if(d.status===404)return null;if(!d.ok){const u=await d.json().catch(()=>({error:d.statusText}));throw new Sm(u.error||`HTTP ${d.status}`,d.status)}return d.json()},getHistory(i,o,d){const u=new URLSearchParams;d!=null&&d.model&&u.set("model",d.model),d!=null&&d.type&&u.set("type",d.type),d!=null&&d.from&&u.set("from",d.from),d!=null&&d.to&&u.set("to",d.to);const p=u.toString();return Ze(`/api/skills/${i}/${o}/history${p?"?"+p:""}`)},getHistoryEntry(i,o,d){return Ze(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`)},compareRuns(i,o,d,u){return Ze(`/api/skills/${i}/${o}/history-compare?a=${encodeURIComponent(d)}&b=${encodeURIComponent(u)}`)},getCaseHistory(i,o,d,u){const p=new URLSearchParams;u&&p.set("model",u);const y=p.toString();return Ze(`/api/skills/${i}/${o}/history/case/${d}${y?"?"+y:""}`)},deleteHistoryEntry(i,o,d){return Ze(`/api/skills/${i}/${o}/history/${encodeURIComponent(d)}`,{method:"DELETE"})},improveSkill(i,o,d){return Ze(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)})},instructEdit(i,o,d){return Ze(`/api/skills/${i}/${o}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...d})})},applyImprovement(i,o,d){return Ze(`/api/skills/${i}/${o}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:d})})},getStats(i,o){return Ze(`/api/skills/${i}/${o}/stats`)},getDependencies(i,o){return Ze(`/api/skills/${i}/${o}/dependencies`)},getProjectLayout(){return Ze("/api/project-layout")},createSkill(i){return Ze("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return Ze("/api/skill-creator-status")},generateSkill(i){return Ze("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}};function lh(i){const[o,d]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const u=window.matchMedia(i);d(u.matches);const p=y=>d(y.matches);return u.addEventListener("change",p),()=>u.removeEventListener("change",p)},[i]),o}const ah={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function nh(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 Nm=v.createContext(null);function ha(){const i=v.useContext(Nm);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function sh({children:i}){const[o,d]=v.useReducer(nh,ah),u=lh("(max-width: 767px)");v.useEffect(()=>{d({type:"SET_MOBILE",isMobile:u})},[u]);const p=v.useCallback(()=>{d({type:"SET_SKILLS_LOADING",loading:!0}),je.getSkills().then(b=>d({type:"SET_SKILLS",skills:b})).catch(b=>d({type:"SET_SKILLS_ERROR",error:b.message}))},[]);v.useEffect(()=>{p()},[p]);const y=v.useCallback(b=>{d({type:"SELECT_SKILL",skill:b})},[]),x=v.useCallback(()=>{d({type:"CLEAR_SELECTION"})},[]),j=v.useCallback(b=>{d({type:"SET_MODE",mode:b})},[]),h=v.useCallback(b=>{d({type:"SET_SEARCH",query:b})},[]),m=v.useCallback(b=>{d({type:"SET_MOBILE_VIEW",view:b})},[]),N=v.useMemo(()=>({state:o,selectSkill:y,clearSelection:x,setMode:j,setSearch:h,setMobileView:m,refreshSkills:p}),[o,y,x,j,h,m,p]);return n.jsx(Nm.Provider,{value:N,children:i})}function rh({left:i,right:o}){const{state:d}=ha();return d.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:d.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children: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 ih(){const{state:i,setSearch:o}=ha(),[d,u]=v.useState(i.searchQuery),p=v.useRef(null);v.useEffect(()=>(p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{o(d)},200),()=>{p.current&&clearTimeout(p.current)}),[d,o]),v.useEffect(()=>{i.searchQuery===""&&d!==""&&u("")},[i.searchQuery]);const y=new Set(i.skills.map(x=>x.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:d,onChange:x=>u(x.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:x=>{x.currentTarget.style.borderColor="var(--accent)"},onBlur:x=>{x.currentTarget.style.borderColor="var(--border-subtle)"}}),d&&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 ",y," plugin",y!==1?"s":""]})]})}const sm={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 rm({skill:i,isSelected:o,onSelect:d}){const u=sm[i.benchmarkStatus]||sm.missing,p=i.origin==="installed";return n.jsxs("button",{onClick:d,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background: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:p?.7:1},onMouseEnter:y=>{o||(y.currentTarget.style.background="var(--surface-2)")},onMouseLeave:y=>{o||(y.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:[p&&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 im(i){var d;const o={};for(const u of i)(o[d=u.plugin]||(o[d]=[])).push(u);return o}function ch(){const{state:i,selectSkill:o}=ha(),{skills:d,searchQuery:u,selectedSkill:p}=i,[y,x]=v.useState(!1),[j,h]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:m,installedGroups:N}=v.useMemo(()=>{const b=u.toLowerCase(),k=b?d.filter(Z=>Z.skill.toLowerCase().includes(b)||Z.plugin.toLowerCase().includes(b)):d,M=k.filter(Z=>Z.origin==="source"),H=k.filter(Z=>Z.origin==="installed");return{sourceGroups:Object.entries(im(M)),installedGroups:Object.entries(im(H))}},[d,u]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(b=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},b))}):m.length===0&&N.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:[m.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(oh,{title:"Your Skills",count:m.reduce((b,[,k])=>b+k.length,0)}),m.map(([b,k])=>n.jsxs("div",{children:[n.jsx(cm,{plugin:b,count:k.length}),k.map(M=>{const H=(p==null?void 0:p.plugin)===M.plugin&&(p==null?void 0:p.skill)===M.skill;return n.jsx(rm,{skill:M,isSelected:H,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},b))]}),N.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>x(b=>!b),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:y?"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:y?"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:["(",N.reduce((b,[,k])=>b+k.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"})]})]}),y&&n.jsxs(n.Fragment,{children:[!j&&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:()=>{h(!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"})]})})]}),N.map(([b,k])=>n.jsxs("div",{children:[n.jsx(cm,{plugin:b,count:k.length}),k.map(M=>{const H=(p==null?void 0:p.plugin)===M.plugin&&(p==null?void 0:p.skill)===M.skill;return n.jsx(rm,{skill:M,isSelected:H,onSelect:()=>o({plugin:M.plugin,skill:M.skill,origin:M.origin})},`${M.plugin}/${M.skill}`)})]},b))]})]})]})}function oh({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 cm({plugin:i,count:o}){const[d,u]=v.useState(!1),p=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[d?n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):n.jsx("img",{src:p,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 uh(){const[i,o]=v.useState(null),[d,u]=v.useState(!1),[p,y]=v.useState(!1),x=v.useRef(null);v.useEffect(()=>{je.getConfig().then(o).catch(()=>{})},[]),v.useEffect(()=>{function N(b){x.current&&!x.current.contains(b.target)&&u(!1)}return d&&document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[d]);async function j(N,b){y(!0);try{const k=await je.setConfig(N.id,b.id);o(k),u(!1)}catch{const k=await je.getConfig();o(k)}finally{y(!1)}}if(!i)return null;const h=fh(i),m=dh(i);return n.jsxs("div",{ref:x,className:"relative",children:[n.jsxs("button",{onClick:()=>u(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:N=>{d||(N.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:N=>{d||(N.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:m!=null&&m.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:h}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&n.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(N=>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:N.available?"var(--green)":"var(--text-tertiary)",opacity:N.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:N.available?1:.5},children:N.label})]}),N.models.map(b=>{const k=Em(i,N.id,b.id),M=!N.available||p;return n.jsxs("button",{onClick:()=>!M&&j(N,b),disabled:M,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:k?"var(--accent-muted)":"transparent",color:M?"var(--text-tertiary)":"var(--text-primary)",opacity:M?.4:1,cursor:M?"not-allowed":"pointer"},onMouseEnter:H=>{!M&&!k&&(H.currentTarget.style.background="var(--surface-3)")},onMouseLeave:H=>{k||(H.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 ${k?"var(--accent)":"var(--border-subtle)"}`},children:k&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:k?600:400},title:b.id,children:b.label})]},`${N.id}-${b.id}`)})]},N.id))})]})]})}function Em(i,o,d){return i.provider!==o?!1:o==="claude-cli"?i.model===`claude-${d}`:i.model===d}function dh(i){return i.providers.find(o=>o.id===i.provider)}function fh(i){for(const o of i.providers)for(const d of o.models)if(Em(i,o.id,d.id))return d.label;return i.model}function mh(){const{state:i,setMode:o}=ha(),[d,u]=v.useState(null),[p,y]=v.useState(null),[x,j]=v.useState(!1);return v.useEffect(()=>{je.getConfig().then(h=>u(h.projectName)).catch(()=>{}),je.getSkillCreatorStatus().then(y).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:d||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(uh,{})})]}),n.jsx(ih,{}),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:h=>{i.mode!=="create"&&(h.currentTarget.style.background="var(--surface-4)",h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{i.mode!=="create"&&(h.currentTarget.style.background="var(--surface-3)",h.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"]})}),p&&n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:p.installed?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"]}):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(p.installCommand).then(()=>{j(!0),setTimeout(()=>j(!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:h=>{h.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border-subtle)"},children:x?"Copied!":p.installCommand})]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(ch,{})})]})}const xh="modulepreload",ph=function(i){return"/"+i},om={},hh=function(o,d,u){let p=Promise.resolve();if(d&&d.length>0){let x=function(m){return Promise.all(m.map(N=>Promise.resolve(N).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),h=(j==null?void 0:j.nonce)||(j==null?void 0:j.getAttribute("nonce"));p=x(d.map(m=>{if(m=ph(m),m in om)return;om[m]=!0;const N=m.endsWith(".css"),b=N?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${b}`))return;const k=document.createElement("link");if(k.rel=N?"stylesheet":xh,N||(k.as="script"),k.crossOrigin="",k.href=m,h&&k.setAttribute("nonce",h),document.head.appendChild(k),N)return new Promise((M,H)=>{k.addEventListener("load",M),k.addEventListener("error",()=>H(new Error(`Unable to preload CSS for ${m}`)))})}))}function y(x){const j=new Event("vite:preloadError",{cancelable:!0});if(j.payload=x,window.dispatchEvent(j),!j.defaultPrevented)throw x}return p.then(x=>{for(const j of x||[])j.status==="rejected"&&y(j.reason);return o().catch(y)})};function Dc(){const[i,o]=v.useState([]),[d,u]=v.useState(!1),[p,y]=v.useState(!1),[x,j]=v.useState(null),h=v.useRef(null),m=v.useCallback(async(b,k)=>{o([]),u(!0),y(!1),j(null);const M=new AbortController;h.current=M;try{const H=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:k?JSON.stringify(k):void 0,signal:M.signal});if(!H.ok||!H.body){let ie=`HTTP ${H.status}`;try{const G=await H.json();G.error&&(ie=G.error)}catch{}throw new Error(ie)}const Z=H.body.getReader(),$=new TextDecoder;let se="",I="";for(;;){const{done:ie,value:G}=await Z.read();if(ie)break;se+=$.decode(G,{stream:!0});const W=se.split(`
50
+ `);se=W.pop()||"";for(const ne of W)if(ne.startsWith("event: "))I=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const F=JSON.parse(ne.slice(6)),le={event:I,data:F};I==="done"?(y(!0),o(te=>[...te,le])):o(te=>[...te,le])}catch{}I=""}}}catch(H){H.name!=="AbortError"&&j(H.message)}finally{u(!1),h.current=null}},[]),N=v.useCallback(()=>{var b;(b=h.current)==null||b.abort()},[]);return{events:i,running:d,done:p,error:x,start:m,stop:N}}function vh(i){const o=v.useRef(i);o.current=i;const[d,u]=v.useState(new Set),p=v.useRef(new Map),y=v.useCallback(async(m,N,b)=>{var M;(M=p.current.get(m))==null||M.abort();const k=new AbortController;p.current.set(m,k),u(H=>{const Z=new Set(H);return Z.add(m),Z});try{const H=await fetch(N,{method:"POST",headers:{"Content-Type":"application/json"},body:b?JSON.stringify(b):void 0,signal:k.signal});if(!H.ok||!H.body){let ie=`HTTP ${H.status}`;try{const G=await H.json();G.error&&(ie=G.error)}catch{}throw new Error(ie)}const Z=H.body.getReader(),$=new TextDecoder;let se="",I="";for(;;){const{done:ie,value:G}=await Z.read();if(ie)break;se+=$.decode(G,{stream:!0});const W=se.split(`
51
+ `);se=W.pop()||"";for(const ne of W)if(ne.startsWith("event: "))I=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const F=JSON.parse(ne.slice(6)),le={event:I,data:F};o.current.onEvent(m,le)}catch{}I=""}}o.current.onDone(m)}catch(H){H.name!=="AbortError"&&o.current.onError(m,H.message)}finally{u(H=>{const Z=new Set(H);return Z.delete(m),Z}),p.current.delete(m)}},[]),x=v.useCallback(m=>{var N;(N=p.current.get(m))==null||N.abort()},[]),j=v.useCallback(()=>{for(const m of p.current.values())m.abort()},[]),h=d.size>0;return{runningSet:d,startCase:y,stopCase:x,stopAll:j,isAnyCaseRunning:h}}const yh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,loading:!0,error:null};function gh(i,o){var d,u;switch(o.type){case"SET_LOADING":return{...i,loading:o.loading};case"SET_ERROR":return{...i,error:o.error};case"INIT_DATA":{const p=new Map;if(o.benchmark)for(const x of o.benchmark.cases)p.set(x.eval_id,{status:x.status,passRate:x.pass_rate,errorMessage:x.error_message||void 0,durationMs:x.durationMs,tokens:x.tokens,output:x.output,assertions:x.assertions.map(j=>({assertion_id:j.id,text:j.text,pass:j.pass,reasoning:j.reasoning}))});const y=((u=(d=o.evals)==null?void 0:d.evals[0])==null?void 0:u.id)??null;return{...i,skillContent:o.skillContent,savedContent:o.skillContent,isDirty:!1,evals:o.evals,latestBenchmark:o.benchmark,inlineResults:p,selectedCaseId:y,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 p=new Map(i.caseRunStates);return p.set(o.caseId,{status:"running",startedAt:Date.now(),mode:o.mode}),{...i,caseRunStates:p,runMode:o.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);p.set(o.caseId,{status:"complete",mode:y==null?void 0:y.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,o.result),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_ERROR":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);p.set(o.caseId,{status:"error",mode:y==null?void 0:y.mode});const x=new Map(i.inlineResults);return x.set(o.caseId,{status:"error",errorMessage:o.error,assertions:[]}),{...i,caseRunStates:p,inlineResults:x}}case"CASE_RUN_CANCEL":{const p=new Map(i.caseRunStates),y=p.get(o.caseId);return p.set(o.caseId,{status:"cancelled",mode:y==null?void 0:y.mode}),{...i,caseRunStates:p}}case"BULK_RUN_START":{const p=new Map(i.caseRunStates);for(const y of o.caseIds)p.set(y,{status:"queued",mode:o.mode});return{...i,caseRunStates:p,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 p=new Map(i.caseRunStates);for(const[y,x]of p)(x.status==="running"||x.status==="queued")&&p.set(y,{status:"cancelled"});return{...i,caseRunStates:p,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const p=new Map(i.inlineResults);return p.set(o.evalId,o.result),{...i,inlineResults:p}}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 p=o.evalChanges??[],y=new Map;for(let x=0;x<p.length;x++)y.set(x,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:o.improved,reasoning:o.reasoning,evalChanges:p},aiEditEvalChanges:p,aiEditEvalSelections:y}}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 p=new Map(i.aiEditEvalSelections);return p.set(o.index,!p.get(o.index)),{...i,aiEditEvalSelections:p}}case"SELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const y of p.keys())p.set(y,!0);return{...i,aiEditEvalSelections:p}}case"DESELECT_ALL_EVAL_CHANGES":{const p=new Map(i.aiEditEvalSelections);for(const y of p.keys())p.set(y,!1);return{...i,aiEditEvalSelections:p}}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};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};default:return i}}const Tm=v.createContext(null);function el(){const i=v.useContext(Tm);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function bh({plugin:i,skill:o,origin:d,children:u}){const p=d==="installed",[y,x]=v.useReducer(gh,{...yh,plugin:i,skill:o}),j=v.useRef(new Set),h=v.useRef(new Set),m=v.useRef(new Map),N=v.useCallback((R,Y)=>{const Q=Y.data;let K=m.current.get(R);if(K||(K={assertions:[]},m.current.set(R,K)),Y.event==="output_ready"&&(K.output=Q.output,Q.durationMs!=null&&(K.durationMs=Q.durationMs),Q.tokens!=null&&(K.tokens=Q.tokens)),Y.event==="assertion_result"){const fe={assertion_id:Q.assertion_id,text:Q.text,pass:Q.pass,reasoning:Q.reasoning};K.assertions.find(ye=>ye.assertion_id===fe.assertion_id)||K.assertions.push(fe)}Y.event==="case_complete"&&(K.status=Q.status,K.passRate=Q.pass_rate,K.errorMessage=Q.error_message||void 0,K.classifiedError=Q.classified_error||void 0),x({type:"UPDATE_INLINE_RESULT",evalId:R,result:{...K,assertions:[...K.assertions]}})},[]),b=v.useCallback(R=>{if(h.current.has(R))return;h.current.add(R);const Y=m.current.get(R)??{assertions:[]};x({type:"CASE_RUN_COMPLETE",caseId:R,result:{...Y,assertions:[...Y.assertions]}}),j.current.has(R)&&(j.current.delete(R),j.current.size===0&&je.getLatestBenchmark(i,o).then(Q=>x({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,o]),k=v.useCallback((R,Y)=>{h.current.has(R)||(h.current.add(R),x({type:"CASE_RUN_ERROR",caseId:R,error:Y}),j.current.has(R)&&(j.current.delete(R),j.current.size===0&&je.getLatestBenchmark(i,o).then(Q=>x({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>x({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,o]),{startCase:M,stopCase:H,stopAll:Z}=vh({onEvent:N,onDone:b,onError:k});v.useEffect(()=>()=>{Z()},[Z]),v.useEffect(()=>{let R=!1;async function Y(){try{const[Q,K,fe]=await Promise.allSettled([je.getSkillDetail(i,o),je.getEvals(i,o),je.getLatestBenchmark(i,o)]);if(R)return;x({type:"INIT_DATA",skillContent:Q.status==="fulfilled"?Q.value.skillContent:"",evals:K.status==="fulfilled"?K.value:null,benchmark:fe.status==="fulfilled"?fe.value:null})}catch(Q){R||x({type:"SET_ERROR",error:Q.message})}}return Y(),()=>{R=!0}},[i,o]);const $=v.useCallback(async()=>{if(!p)try{await je.applyImprovement(i,o,y.skillContent),x({type:"CONTENT_SAVED"})}catch(R){x({type:"SET_ERROR",error:R.message})}},[p,i,o,y.skillContent]),se=v.useCallback(async R=>{if(!p)try{const Y=await je.saveEvals(i,o,R);x({type:"SET_EVALS",evals:Y})}catch(Y){x({type:"SET_ERROR",error:Y.message})}},[p,i,o]),I=v.useCallback((R,Y="benchmark")=>{if(p)return;const Q=y.caseRunStates.get(R);if((Q==null?void 0:Q.status)!=="running")if(m.current.delete(R),h.current.delete(R),x({type:"CASE_RUN_START",caseId:R,mode:Y}),Y==="comparison"){const K=`/api/skills/${i}/${o}/compare`;M(R,K,{eval_ids:[R]})}else{const K=`/api/skills/${i}/${o}/benchmark/case/${R}`;M(R,K,Y==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,y.caseRunStates,M]),ie=v.useCallback((R="benchmark")=>{var K;if(p)return;const Y=((K=y.evals)==null?void 0:K.evals)??[];if(Y.length===0)return;const Q=Y.map(fe=>fe.id);for(const fe of Q)m.current.delete(fe),h.current.delete(fe);x({type:"BULK_RUN_START",caseIds:Q,mode:R}),j.current=new Set(Q);for(const fe of Q)if(R==="comparison")M(fe,`/api/skills/${i}/${o}/compare`,{eval_ids:[fe]});else{const ye=`/api/skills/${i}/${o}/benchmark/case/${fe}`;M(fe,ye,R==="baseline"?{baseline_only:!0}:void 0)}},[p,i,o,y.evals,M]),G=v.useCallback(R=>{H(R),x({type:"CASE_RUN_CANCEL",caseId:R}),j.current.delete(R),h.current.add(R)},[H]),W=v.useCallback(()=>{Z(),x({type:"CANCEL_ALL"}),j.current.clear()},[Z]),ne=v.useCallback(async(R,Y)=>{x({type:"OPEN_IMPROVE",evalId:R})},[]),F=v.useCallback(async(R,Y)=>{try{await je.applyImprovement(i,o,Y),x({type:"SET_CONTENT",content:Y}),x({type:"CONTENT_SAVED"}),x({type:"CLOSE_IMPROVE"}),I(R,"benchmark")}catch(Q){x({type:"SET_ERROR",error:Q.message})}},[i,o,I]),le=Dc(),te=v.useRef(null);v.useEffect(()=>{if(le.events.length)for(const R of le.events){const Y=R.data;if(R.event==="progress"&&x({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),R.event==="done"){const Q=Y.improved,K=Y.reasoning,fe=Y.evalChanges??[];x({type:"AI_EDIT_RESULT",improved:Q,reasoning:K,evalChanges:fe})}if(R.event==="error"){const Q=Y;x({type:"AI_EDIT_ERROR",message:Q.description||"Unknown error",classified:Q})}}},[le.events]),v.useEffect(()=>{le.error&&x({type:"AI_EDIT_ERROR",message:le.error})},[le.error]),v.useEffect(()=>()=>{le.stop()},[le.stop]);const pe=v.useCallback(async(R,Y,Q)=>{p||(x({type:"AI_EDIT_LOADING"}),te.current=le.stop,le.start(`/api/skills/${i}/${o}/improve?sse`,{mode:"instruct",instruction:R,content:y.skillContent,evals:y.evals??{skill_name:o,evals:[]},provider:Y,model:Q}))},[p,i,o,y.skillContent,y.evals,le]),Ee=v.useCallback(()=>{le.stop(),x({type:"AI_EDIT_ERROR",message:"Cancelled"})},[le]),he=v.useCallback(async()=>{const R=y.aiEditResult;if(R!=null&&R.improved)try{if(await je.applyImprovement(i,o,R.improved),x({type:"SET_CONTENT",content:R.improved}),x({type:"CONTENT_SAVED"}),y.aiEditEvalChanges.length>0&&Array.from(y.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:Q}=await hh(async()=>{const{mergeEvalChanges:ye}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ye}},[]),K=y.evals??{skill_name:o,evals:[]},fe=Q(K,y.aiEditEvalChanges,y.aiEditEvalSelections);try{const ye=await je.saveEvals(i,o,fe);x({type:"SET_EVALS",evals:ye})}catch(ye){x({type:"SET_EVALS_RETRY",evalsFile:fe}),x({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ye.message}. You can retry from the AI Edit panel.`});return}}x({type:"CLOSE_AI_EDIT"})}catch(Y){x({type:"SET_ERROR",error:Y.message})}},[i,o,y.aiEditResult,y.evals,y.aiEditEvalChanges,y.aiEditEvalSelections]),J=v.useCallback(()=>{x({type:"CLOSE_AI_EDIT"})},[]),oe=v.useCallback(R=>{x({type:"TOGGLE_EVAL_CHANGE",index:R})},[]),Ce=v.useCallback(()=>{x({type:"SELECT_ALL_EVAL_CHANGES"})},[]),C=v.useCallback(()=>{x({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),z=v.useCallback(async()=>{const R=y.aiEditEvalsRetry;if(R)try{const Y=await je.saveEvals(i,o,R);x({type:"SET_EVALS",evals:Y}),x({type:"SET_ERROR",error:null}),x({type:"CLOSE_AI_EDIT"})}catch(Y){x({type:"SET_ERROR",error:`Retry failed: ${Y.message}`})}},[i,o,y.aiEditEvalsRetry]),D=v.useCallback(async()=>{try{const R=await je.getSkillDetail(i,o);x({type:"SET_CONTENT",content:R.skillContent}),x({type:"CONTENT_SAVED"})}catch{}},[i,o]),ee=Dc();v.useEffect(()=>{if(ee.events.length)for(const R of ee.events){const Y=R.data;if(R.event==="progress"&&x({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:Y.phase,message:Y.message}}),R.event==="done"){const Q=Y;je.saveEvals(i,o,Q).then(K=>x({type:"GENERATE_EVALS_DONE",evals:K})).catch(K=>x({type:"SET_ERROR",error:K.message}))}R.event==="error"&&x({type:"GENERATE_EVALS_ERROR",classified:Y})}},[ee.events,i,o]),v.useEffect(()=>{ee.error&&x({type:"SET_ERROR",error:ee.error})},[ee.error]),v.useEffect(()=>()=>{ee.stop()},[ee.stop]);const de=v.useCallback(async()=>{p||(x({type:"GENERATE_EVALS_START"}),ee.start(`/api/skills/${i}/${o}/generate-evals?sse`))},[p,i,o,ee]),S=Dc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const R of S.events)R.event==="prompt_result"&&x({type:"ACTIVATION_RESULT",result:R.data}),R.event==="done"&&x({type:"ACTIVATION_DONE",summary:R.data})},[S.events]),v.useEffect(()=>{S.error&&x({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const L=v.useCallback(R=>{const Q=R.trim().split(`
52
+ `).filter(Boolean).map(K=>K.startsWith("!")?{prompt:K.slice(1).trim(),expected:"should_not_activate"}:K.startsWith("+")?{prompt:K.slice(1).trim(),expected:"should_activate"}:{prompt:K.trim(),expected:"auto"});x({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${o}/activation-test`,{prompts:Q})},[i,o,S]),X=v.useMemo(()=>({state:y,dispatch:x,isReadOnly:p,saveContent:$,saveEvals:se,runCase:I,runAll:ie,cancelCase:G,cancelAll:W,improveForCase:ne,applyImproveAndRerun:F,refreshSkillContent:D,generateEvals:de,runActivationTest:L,submitAiEdit:pe,cancelAiEdit:Ee,applyAiEdit:he,discardAiEdit:J,toggleEvalChange:oe,selectAllEvalChanges:Ce,deselectAllEvalChanges:C,retryEvalsSave:z}),[y,p,$,se,I,ie,G,W,ne,F,D,de,L,pe,Ee,he,J,oe,Ce,C,z]);return n.jsx(Tm.Provider,{value:X,children:u})}function jh({state:i,isReadOnly:o}){const{plugin:d,skill:u,evals:p,latestBenchmark:y,isDirty:x,caseRunStates:j,regressions:h,iterationCount:m}=i,N=Array.from(j.values()).some($=>$.status==="running"||$.status==="queued"),b=y==null?void 0:y.overall_pass_rate,k=(p==null?void 0:p.evals.reduce(($,se)=>$+se.assertions.length,0))??0,M=(p==null?void 0:p.evals.length)??0,H=b!=null?b>=80?"var(--green)":b>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",Z=b!=null?b>=80?"var(--green-muted)":b>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:d}),n.jsx(Sh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:u}),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"]}),x&&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"}),N&&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:[h.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"})]}),h.length," regression",h.length>1?"s":""]}),m>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",m]}),n.jsx("span",{className:"pill",style:{background:Z,color:H},children:b!=null?`${Math.round(b*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[M," case",M!==1?"s":""," / ",k," assert",k!==1?"s":""]})]})]})}function Sh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Nh=[{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 Eh({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 Th({activePanel:i,onPanelChange:o,isDirty:d,isRunning:u,hasRegressions:p,isActivationRunning:y}){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:Nh.map((x,j)=>n.jsxs("div",{className:"flex items-center",children:[j>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),x.tabs.map(h=>{const m=i===h.id,N=h.id==="editor"&&d||h.id==="run"&&u||h.id==="activation"&&y||h.id==="history"&&p,b=h.id==="run"||h.id==="activation"?"var(--accent)":h.id==="history"?"var(--red)":"var(--yellow)";return n.jsxs("button",{onClick:()=>o(h.id),title:`${h.label} (Ctrl+${h.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:m?"var(--text-primary)":"var(--text-tertiary)",borderBottom:m?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:m?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:k=>{m||(k.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:k=>{m||(k.currentTarget.style.color="var(--text-tertiary)")},children:[n.jsx(Eh,{id:h.id}),h.label,N&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:b}})]},h.id)})]},x.label))})}function Ch(i){const o=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!o)return{metadata:{},body:i};const d=o[1],u=o[2].trim(),p={},y=d.split(`
53
53
  `);let x="",j=!1;for(const h of y){const m=h.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(m&&x&&j){const k=m[1],M=m[2].trim();let H=p[x];if((typeof H!="object"||Array.isArray(H))&&(H={},p[x]=H),!M)H[k]=[];else{const Z=M.match(/^\[(.+)\]$/);Z?H[k]=Z[1].split(",").map($=>$.trim().replace(/^["']|["']$/g,"")).filter(Boolean):H[k]=M.replace(/^["']|["']$/g,"")}continue}const N=h.match(/^\s+-\s+(.+)$/);if(N&&x){j=!1;const k=p[x];Array.isArray(k)?k.push(N[1].trim().replace(/^["']|["']$/g,"")):p[x]=[N[1].trim().replace(/^["']|["']$/g,"")];continue}const b=h.match(/^([\w-]+):\s*(.*)$/);if(b){x=b[1];const k=b[2].trim();if(j=!1,!k){p[x]={},j=!0;continue}const M=k.match(/^\[(.+)\]$/);if(M){p[x]=M[1].split(",").map(H=>H.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}p[x]=k.replace(/^["']|["']$/g,"")}}return{metadata:p,body:u}}function Wc(i){if(!i)return"";let o=kh(i);return o=o.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>'),o=o.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),o=o.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),o=o.replace(/\*([^*]+)\*/g,"<em>$1</em>"),o=o.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),o=o.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),o=o.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),o=o.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),o=o.replace(/\n/g,"<br/>"),o}function kh(i){const o=i.split(`
54
54
  `),d=[];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 p=um(o[u]);u+=2;const y=[];for(;u<o.length&&o[u].trim().startsWith("|");)y.push(um(o[u])),u++;const x='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)"',j='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let h='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';h+="<thead><tr>";for(const m of p)h+=`<th ${x}>${m}</th>`;h+="</tr></thead><tbody>";for(const m of y){h+="<tr>";for(const N of m)h+=`<td ${j}>${N}</td>`;h+="</tr>"}h+="</tbody></table>",d.push(h)}else d.push(o[u]),u++;return d.join(`
55
55
  `)}function um(i){return i.split("|").map(o=>o.trim()).filter(o=>o.length>0)}function pr(i,o){const d=i.split(`
56
56
  `),u=o.split(`
57
- `);if(d.length>1e3||u.length>1e3)return[...d.map(N=>({type:"unchanged",content:N}))];const p=d.length,y=u.length,x=Array.from({length:p+1},()=>new Array(y+1).fill(0));for(let N=1;N<=p;N++)for(let b=1;b<=y;b++)d[N-1]===u[b-1]?x[N][b]=x[N-1][b-1]+1:x[N][b]=Math.max(x[N-1][b],x[N][b-1]);const j=[];let h=p,m=y;for(;h>0||m>0;)h>0&&m>0&&d[h-1]===u[m-1]?(j.push({type:"unchanged",content:d[h-1]}),h--,m--):m>0&&(h===0||x[h][m-1]>=x[h-1][m])?(j.push({type:"added",content:u[m-1]}),m--):(j.push({type:"removed",content:d[h-1]}),h--);return j.reverse()}function Ah(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 Wn({entries:i,isRunning:o}){const[d,u]=v.useState(!1),p=v.useRef(null);return v.useEffect(()=>{p.current&&!d&&(p.current.scrollTop=p.current.scrollHeight)},[i,d]),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(!d),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:y=>{y.currentTarget.style.color="var(--text-primary)"},onMouseLeave:y=>{y.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:d?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!d&&n.jsx("div",{ref:p,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((y,x)=>{const j=x===i.length-1&&o,h=x===0?"0s":`+${((y.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:j?1:.7},children:[Ah(y.phase,j),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:h}),n.jsx("span",{style:{color:j?"var(--text-primary)":"var(--text-secondary)"},children:y.message}),y.current!=null&&y.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",y.current,"/",y.total,"]"]})]},x)})})]})}const dm={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 hr({error:i,onRetry:o,onDismiss:d}){const[u,p]=v.useState(null),y=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?p(Math.ceil(i.retryAfterMs/1e3)):p(null),()=>{y.current&&clearInterval(y.current)}),[i]),v.useEffect(()=>{if(!(u==null||u<=0))return y.current=setInterval(()=>{p(h=>h==null||h<=1?(y.current&&clearInterval(y.current),0):h-1)},1e3),()=>{y.current&&clearInterval(y.current)}},[u!=null&&u>0]);const x=dm[i.category]||dm.unknown,j=u!=null&&u>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${x.color} 30%, transparent)`,background:`color-mix(in srgb, ${x.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:x.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:x.color},children:i.title})]}),d&&n.jsx("button",{onClick:d,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(o||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:o&&n.jsx("button",{onClick:o,disabled:j,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:j?.5:1},children:j?`Retry in ${u}s`:"Retry"})})]})]})}function _h({plugin:i,skill:o,skillContent:d,onApplied:u}){const[p,y]=v.useState("closed"),[x,j]=v.useState(null),[h,m]=v.useState("claude-cli"),[N,b]=v.useState("opus"),[k,M]=v.useState([]),[H,Z]=v.useState(""),[$,se]=v.useState(""),[I,ce]=v.useState(null),[Q,W]=v.useState(null),[ne,F]=v.useState([]),[le,te]=v.useState(!1),pe=v.useRef(null);v.useEffect(()=>{je.getConfig().then(z=>{j(z),z.providers.find(ee=>ee.id==="claude-cli"&&ee.available)&&(m("claude-cli"),b("opus"))}).catch(()=>{})},[]),v.useEffect(()=>()=>{var z;(z=pe.current)==null||z.abort()},[]);function Ee(){return x==null?void 0:x.providers.find(z=>z.id===h&&z.available)}const he=v.useCallback(()=>{var z;(z=pe.current)==null||z.abort(),y("open")},[]);async function J(){y("loading"),ce(null),W(null),F([]);const z=new AbortController;pe.current=z;try{const D=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:h,model:N}),signal:z.signal});if(!D.ok||!D.body)throw new Error(`HTTP ${D.status}`);const ee=D.body.getReader(),de=new TextDecoder;let S="",L="";for(;;){const{done:X,value:w}=await ee.read();if(X)break;S+=de.decode(w,{stream:!0});const Y=S.split(`
58
- `);S=Y.pop()||"";for(const V of Y)if(V.startsWith("event: "))L=V.slice(7).trim();else if(V.startsWith("data: ")){try{const K=JSON.parse(V.slice(6));L==="progress"?F(fe=>[...fe,{phase:K.phase,message:K.message,timestamp:Date.now()}]):L==="done"||L==="complete"?(Z(K.improved),se(K.reasoning||""),M(pr(K.original||d,K.improved)),y("diff_shown")):L==="error"&&(ce(K.message||K.description||"Unknown error"),K.category&&W(K),y("open"))}catch{}L=""}}}catch(D){D.name!=="AbortError"&&(ce(D.message),y("open"))}finally{pe.current=null}}async function oe(){te(!0);try{await je.applyImprovement(i,o,H),u(H),y("closed")}catch(z){ce(z.message)}finally{te(!1)}}function Ce(){y("closed"),M([]),Z(""),se(""),ce(null)}if(p==="closed")return n.jsxs("button",{onClick:()=>y("open"),className:"btn btn-secondary mb-5",disabled:!d,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const C=Ee();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:Ce,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:z=>{z.currentTarget.style.background="var(--surface-3)"},onMouseLeave:z=>{z.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:[(p==="open"||p==="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:h,onChange:z=>{m(z.target.value);const D=x==null?void 0:x.providers.find(ee=>ee.id===z.target.value);D!=null&&D.models[0]&&b(D.models[0].id)},disabled:p==="loading",children:x==null?void 0:x.providers.filter(z=>z.available).map(z=>n.jsx("option",{value:z.id,children:z.label},z.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:N,onChange:z=>b(z.target.value),disabled:p==="loading",children:C==null?void 0:C.models.map(z=>n.jsx("option",{value:z.id,children:z.label},z.id))})]}),p==="loading"?n.jsx("button",{onClick:he,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:J,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),p==="loading"&&ne.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(Wn,{entries:ne,isRunning:!0})})]}),I&&n.jsx("div",{className:"mb-4",children:Q?n.jsx(hr,{error:Q,onRetry:J,onDismiss:()=>{ce(null),W(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:I})}),p==="diff_shown"&&n.jsxs(n.Fragment,{children:[$&&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: "}),$]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:k.map((z,D)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:z.type==="added"?"rgba(34,197,94,0.1)":z.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:z.type==="added"?"var(--green)":z.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:z.type==="added"?"3px solid var(--green)":z.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:z.type==="added"?"+":z.type==="removed"?"-":" "}),z.content]},D))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:oe,disabled:le,className:"btn btn-primary",children:le?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:Ce,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const fm={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"}},Rh={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function wh({change:i,index:o,selected:d,onToggle:u,originalEval:p}){var b;const[y,x]=v.useState(!1),j=fm[i.action]??fm.add,h=Rh[i.action]??"var(--border-subtle)",m=i.action==="remove"?(p==null?void 0:p.name)??`Eval #${i.evalId}`:((b=i.eval)==null?void 0:b.name)??"Unnamed",N=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 ${h}`,opacity:d?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:d,onChange:N,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:j.bg,color:j.color,padding:"1px 6px"},children:j.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:m}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>x(!y),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded 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.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:y?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),y&&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(Mh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&p&&n.jsx(zh,{original:p,proposed:i.eval}),i.action==="remove"&&p&&n.jsx(Oh,{evalCase:p})]})]})}function Mh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Qc,{label:"Prompt",value:i.prompt}),n.jsx(Qc,{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(d=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",d.text]},d.id))})]})]})}function zh({original:i,proposed:o}){const d=[];i.name!==o.name&&d.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&d.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&d.push({label:"Expected",old:i.expected_output,new:o.expected_output});const u=i.assertions??[],p=o.assertions??[],y=new Set(u.map(m=>m.text)),x=new Set(p.map(m=>m.text)),j=p.filter(m=>!y.has(m.text)),h=u.filter(m=>!x.has(m.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[d.map(m=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:m.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:["- ",Xc(m.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",Xc(m.new,120)]})]})]},m.label)),(j.length>0||h.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:[h.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",m.text]},m.id)),j.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",m.text]},m.id))]})]}),d.length===0&&j.length===0&&h.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Oh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Qc,{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(d=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:d.text},d.id))})]})]})}function Qc({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:Xc(o,300)})]})}function Xc(i,o){return i.length>o?i.slice(0,o)+"...":i}const mm={remove:0,modify:1,add:2};function Dh({changes:i,selections:o,currentEvals:d,onToggle:u,onSelectAll:p,onDeselectAll:y}){if(i.length===0)return null;const x=i.map((h,m)=>({change:h,originalIndex:m}));x.sort((h,m)=>(mm[h.change.action]??2)-(mm[m.change.action]??2));const j=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:["(",j,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:p,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Select All"}),n.jsx("button",{onClick:y,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--surface-3)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:x.map(({change:h,originalIndex:m})=>n.jsx(wh,{change:h,index:m,selected:o.get(m)??!1,onToggle:u,originalEval:h.evalId!=null?d.find(N=>N.id===h.evalId):void 0},m))})]})}function Lh(){var z;const{state:i,dispatch:o,submitAiEdit:d,applyAiEdit:u,discardAiEdit:p,cancelAiEdit:y,toggleEvalChange:x,selectAllEvalChanges:j,deselectAllEvalChanges:h,retryEvalsSave:m}=el(),{aiEditLoading:N,aiEditResult:b,aiEditError:k,aiEditClassifiedError:M,aiEditProgress:H,aiEditEvalChanges:Z,aiEditEvalSelections:$,aiEditEvalsRetry:se}=i,[I,ce]=v.useState(""),[Q,W]=v.useState(null),[ne,F]=v.useState("claude-cli"),[le,te]=v.useState("opus"),pe=v.useRef(null);v.useEffect(()=>{var D;(D=pe.current)==null||D.focus()},[]),v.useEffect(()=>{je.getConfig().then(D=>{W(D),D.providers.find(de=>de.id==="claude-cli"&&de.available)&&(F("claude-cli"),te("opus"))}).catch(()=>{})},[]);const Ee=Q==null?void 0:Q.providers.find(D=>D.id===ne&&D.available),he=v.useCallback(()=>{const D=I.trim();!D||N||d(D,ne,le)},[I,N,d,ne,le]),J=v.useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),he()),D.key==="Escape"&&(D.preventDefault(),N?y():p())},[he,N,y,p]),oe=v.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),Ce=b?pr(i.skillContent,b.improved):[],C=((z=i.evals)==null?void 0:z.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:p,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:D=>{D.currentTarget.style.background="var(--surface-3)"},onMouseLeave:D=>{D.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:pe,value:I,onChange:D=>ce(D.target.value),onKeyDown:J,placeholder:"e.g., Add an error handling section...",disabled:N,rows:1,className:"w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"8px 12px",fontSize:12.5,lineHeight:1.5,fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",minHeight:36,maxHeight:96},onInput:D=>{const ee=D.currentTarget;ee.style.height="auto",ee.style.height=Math.min(ee.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:ne,onChange:D=>{F(D.target.value);const ee=Q==null?void 0:Q.providers.find(de=>de.id===D.target.value);ee!=null&&ee.models[0]&&te(ee.models[0].id)},disabled:N,style:{width:"100%"},children:Q==null?void 0:Q.providers.filter(D=>D.available).map(D=>n.jsx("option",{value:D.id,children:D.label},D.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:le,onChange:D=>te(D.target.value),disabled:N,style:{width:"100%"},children:Ee==null?void 0:Ee.models.map(D=>n.jsx("option",{value:D.id,children:D.label},D.id))})]}),N?n.jsx("button",{onClick:y,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:he,disabled:!I.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),N&&H.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(Wn,{entries:H,isRunning:!0})})]}),k&&n.jsx("div",{className:"mt-3",children:M?n.jsx(hr,{error:M,onRetry:oe,onDismiss:p}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:k})}),b&&n.jsxs("div",{className:"animate-fade-in",children:[b.reasoning&&n.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),b.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:Ce.map((D,ee)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:D.type==="added"?"rgba(34,197,94,0.1)":D.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:D.type==="added"?"var(--green)":D.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:D.type==="added"?"3px solid var(--green)":D.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:D.type==="added"?"+":D.type==="removed"?"-":" "}),D.content]},ee))}),n.jsx(Dh,{changes:Z,selections:$,currentEvals:C,onToggle:x,onSelectAll:j,onDeselectAll:h}),se&&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:m,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:p,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:oe,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function Bh({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 Uh({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 Hh({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 qh({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 Lc({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 Yh(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=el(),{plugin:p,skill:y,skillContent:x,isDirty:j,improveTarget:h,aiEditOpen:m}=i,[N,b]=v.useState("split"),[k,M]=v.useState(!1),H=v.useRef(null),[Z,$]=v.useState(!1),[se,I]=v.useState(""),[ce,Q]=v.useState(!1),[W,ne]=v.useState(null),[F,le]=v.useState([]),[te,pe]=v.useState([]),[Ee,he]=v.useState(null),J=v.useRef(null),[oe,Ce]=v.useState(null);v.useEffect(()=>{je.getConfig().then(Ce).catch(()=>{})},[]),v.useEffect(()=>()=>{var P;(P=J.current)==null||P.abort()},[]);const{metadata:C,body:z}=Ch(x),D=C["allowed-tools"],ee=Array.isArray(D)?D:typeof D=="string"?[D]:[],de=C.name,S=C.description,L=C.metadata,X=typeof L=="object"&&!Array.isArray(L)?L:null,w=C.version||(X==null?void 0:X.version),Y=C.tags||(X==null?void 0:X.tags),V=Array.isArray(Y)?Y:typeof Y=="string"?Y.split(",").map(P=>P.trim()).filter(Boolean):[],K=new Set(["name","description","metadata","allowed-tools","version","tags"]),fe=Object.entries(C).filter(([P])=>!K.has(P)),ye=v.useCallback(async()=>{M(!0),await d(),M(!1)},[d]),_t=v.useCallback(P=>{(P.ctrlKey||P.metaKey)&&P.key==="s"&&(P.preventDefault(),P.stopPropagation(),j&&ye()),(P.ctrlKey||P.metaKey)&&P.key==="k"&&(P.preventDefault(),P.stopPropagation(),o({type:m?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[j,ye,m,o]),gt=v.useCallback(async()=>{var rt,wt;if(!se.trim())return;(rt=J.current)==null||rt.abort();const P=new AbortController;J.current=P,Q(!0),he(null),pe([]),ne(null),le([]);try{const ot=(oe==null?void 0:oe.provider)||"claude-cli",tl=(oe==null?void 0:oe.model)||"sonnet",G=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:se,provider:ot,model:tl}),signal:P.signal});if(!G.ok||!G.body)throw new Error(`HTTP ${G.status}`);const Be=G.body.getReader(),jl=new TextDecoder;let Ze="",it="";for(;;){const{done:pa,value:ha}=await Be.read();if(pa)break;Ze+=jl.decode(ha,{stream:!0});const Qt=Ze.split(`
59
- `);Ze=Qt.pop()||"";for(const bt of Qt)if(bt.startsWith("event: "))it=bt.slice(7).trim();else if(bt.startsWith("data: ")){try{const Ie=JSON.parse(bt.slice(6));if(it==="progress")pe(Mt=>[...Mt,{phase:Ie.phase,message:Ie.message,timestamp:Date.now()}]);else if(it==="done"||it==="complete"){const Mt=["---"];Ie.name&&Mt.push(`name: ${Ie.name}`),Ie.description&&Mt.push(`description: "${Ie.description.replace(/"/g,'\\"')}"`),Ie.model&&Mt.push(`model: ${Ie.model}`),(wt=Ie.allowedTools)!=null&&wt.trim()&&Mt.push(`allowed-tools: ${Ie.allowedTools.trim()}`),Mt.push("---","",Ie.body||"");const $l=Mt.join(`
60
- `);ne($l),le(pr(x,$l)),Q(!1)}else it==="error"&&(he(Ie.message||Ie.description||"Generation failed"),Q(!1))}catch{}it=""}}}catch(ot){ot.name!=="AbortError"&&he(ot.message)}finally{Q(!1),J.current=null}},[se,oe,x]),Jl=v.useCallback(()=>{W&&o({type:"SET_CONTENT",content:W}),$(!1),ne(null),le([]),I(""),pe([])},[W,o]),Rt=v.useCallback(()=>{$(!1),ne(null),le([]),I(""),pe([]),he(null)},[]),Vt=v.useCallback(()=>{var P;Z?((P=J.current)==null||P.abort(),Rt()):(m&&o({type:"CLOSE_AI_EDIT"}),$(!0))},[Z,m,o,Rt]),bl=[{mode:"raw",icon:n.jsx(Bh,{}),label:"Editor"},{mode:"split",icon:n.jsx(Uh,{}),label:"Split"},{mode:"preview",icon:n.jsx(Hh,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:_t,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:bl.map(({mode:P,icon:rt,label:wt})=>n.jsxs("button",{onClick:()=>b(P),title:wt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:N===P?"var(--surface-4)":"transparent",color:N===P?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:N===P?600:400,border:"none",cursor:"pointer"},children:[rt,n.jsx("span",{style:{letterSpacing:"0.01em"},children:wt})]},P))}),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:()=>{m?o({type:"CLOSE_AI_EDIT"}):(Z&&Rt(),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:m?600:400,border:"none",cursor:"pointer",color:m?"#a855f7":"var(--text-tertiary)",background:m?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(qh,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Vt,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:Z?600:400,border:"none",cursor:"pointer",color:Z?"#a855f7":"var(--text-tertiary)",background:Z?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Lc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),j&&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:ye,disabled:!j||k,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:k?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]})]}),n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:N==="raw"||N==="preview"?"1fr":"1fr 1fr"},children:[N!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:N==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:H,value:x,onChange:P=>{u||o({type:"SET_CONTENT",content:P.target.value})},onKeyDown:_t,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}})}),N!=="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:[(de||w||S)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[de&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:de}),w&&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",w]})]}),S&&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:S})]}),V.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:V.map(P=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:P},P))}),ee.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"}),ee.map(P=>n.jsx("span",{style:{fontSize:10.5,fontFamily:"var(--font-mono, ui-monospace, monospace)",color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4},children:P},P))]})}),fe.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:fe.map(([P,rt],wt)=>{const ot=Array.isArray(rt)?rt.join(", "):typeof rt=="object"?Object.entries(rt).map(([tl,G])=>`${tl}: ${Array.isArray(G)?G.join(", "):G}`).join(" | "):rt;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:wt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:P}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:ot})]},P)})}),(de||S||V.length>0||ee.length>0||fe.length>0)&&z&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),z&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Wc(z)}})]})})]}),m&&n.jsx(Lh,{}),Z&&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:[!W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Lc,{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:se,onChange:P=>I(P.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ce,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:ce?.5:1},onKeyDown:P=>{P.key==="Enter"&&(P.ctrlKey||P.metaKey)&&se.trim()&&!ce&&(P.preventDefault(),gt())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[ce?n.jsx("button",{onClick:()=>{var P;(P=J.current)==null||P.abort(),Q(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:gt,disabled:!se.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Rt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ce&&te.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(Wn,{entries:te,isRunning:!0})}),Ee&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[Ee,n.jsx("button",{onClick:gt,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Lc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:F.map((P,rt)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:P.type==="added"?"rgba(34,197,94,0.1)":P.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:P.type==="added"?"var(--green)":P.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:P.type==="added"?"3px solid var(--green)":P.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:P.type==="added"?"+":P.type==="removed"?"-":" "}),P.content]},rt))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Jl,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:Rt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),h!==null&&p&&y&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(_h,{plugin:p,skill:y,skillContent:x,onApplied:P=>{o({type:"SET_CONTENT",content:P}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function Zc(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Cm(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 km(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}function Am({entries:i}){if(i.length<2)return null;const o=80,d=24,u=2,p=i.slice().reverse(),y=p.length,x=p.map((j,h)=>{const m=u+h/(y-1)*(o-u*2),N=u+(d-u*2)-j.pass_rate*(d-u*2);return`${m},${N}`});return n.jsxs("svg",{width:o,height:d,style:{display:"block",flexShrink:0},children:[n.jsx("polyline",{points:x.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),x.length>0&&n.jsx("circle",{cx:parseFloat(x[x.length-1].split(",")[0]),cy:parseFloat(x[x.length-1].split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Gh(i,o,d){const[u,p]=v.useState(null),[y,x]=v.useState(!1),j=v.useRef("");v.useEffect(()=>{const m=`${i}/${o}/${d}`;j.current!==m&&(j.current=m,x(!0),je.getCaseHistory(i,o,d).then(N=>p(N)).catch(()=>p([])).finally(()=>x(!1)))},[i,o,d]);const h=v.useCallback(()=>{x(!0),j.current="",je.getCaseHistory(i,o,d).then(m=>p(m)).catch(()=>p([])).finally(()=>x(!1))},[i,o,d]);return{entries:u,loading:y,refetch:h}}function Vh(i,o,d){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!d||d.length===0)return u;const y=d.slice(0,10).map(h=>h.assertions.find(m=>m.id===i)).filter(Boolean);if(y.length>=2){const m=y.filter(N=>N.pass).length/y.length;m>=.3&&m<=.7&&(u.flaky=!0)}const x=d.find(h=>h.type==="benchmark"),j=d.find(h=>h.type==="baseline");if(x&&j){const h=x.assertions.find(N=>N.id===i),m=j.assertions.find(N=>N.id===i);h!=null&&h.pass&&(m!=null&&m.pass)&&(u.nonDiscriminating=!0)}if(o&&!o.pass&&d.length>=1){const m=d[0].assertions.find(N=>N.id===i);m!=null&&m.pass&&(u.regression=!0)}return u}function Qh(){var le;const{state:i,dispatch:o,saveEvals:d,runCase:u,runAll:p,cancelCase:y,cancelAll:x,generateEvals:j,isReadOnly:h}=el(),{evals:m,selectedCaseId:N,inlineResults:b,caseRunStates:k,generateEvalsLoading:M,generateEvalsProgress:H,generateEvalsError:Z}=i,$=v.useMemo(()=>{for(const te of k.values())if(te.status==="running"||te.status==="queued")return!0;return!1},[k]),[se,I]=v.useState(!1),ce={skill_name:i.skill,evals:[]},Q=m??ce,W=Q.evals,ne=W.find(te=>te.id===N)??null,F=v.useCallback(()=>{j()},[j]);return!m||W.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>I(!0),disabled:h,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:F,disabled:M||h,className:"btn btn-secondary text-[12px]",children:M?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),M&&H.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Wn,{entries:H,isRunning:!0})}),Z&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(hr,{error:Z,onRetry:F})}),se&&n.jsx(xm,{evals:Q,onSave:te=>{d(te),I(!1)},onCancel:()=>I(!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 (",W.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:$?n.jsx("button",{onClick:x,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:()=>p("benchmark"),disabled:W.length===0||h,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>p("comparison"),disabled:W.length===0||h,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:W.map(te=>{const pe=b.get(te.id),Ee=N===te.id;return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:te.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:Ee?"var(--accent-muted)":"transparent",borderLeft:Ee?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:he=>{Ee||(he.currentTarget.style.background="var(--surface-2)")},onMouseLeave:he=>{Ee||(he.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:Ee?"var(--text-primary)":"var(--text-secondary)"},children:["#",te.id," ",te.name]}),n.jsx(_m,{result:pe})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[te.assertions.length," assertion",te.assertions.length!==1?"s":"",(pe==null?void 0:pe.passRate)!=null&&n.jsx(Kh,{passRate:pe.passRate})]})]},te.id)})}),n.jsx("div",{className:"px-3 py-2",children:!h&&n.jsx("button",{onClick:()=>I(!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:te=>{te.currentTarget.style.borderColor="var(--accent)",te.currentTarget.style.color="var(--accent)"},onMouseLeave:te=>{te.currentTarget.style.borderColor="var(--border-default)",te.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:ne?n.jsx(Xh,{evalCase:ne,result:b.get(ne.id),evals:m,caseStatus:((le=k.get(ne.id))==null?void 0:le.status)??"idle",onSaveEvals:d,onRun:te=>u(te,"benchmark"),onCompare:te=>u(te,"comparison"),onCancel:te=>y(te),onImprove:te=>o({type:"OPEN_IMPROVE",evalId:te})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),se&&n.jsx(xm,{evals:Q,onSave:te=>{d(te),I(!1)},onCancel:()=>I(!1)})]})}function Xh({evalCase:i,result:o,evals:d,caseStatus:u,onSaveEvals:p,onRun:y,onCompare:x,onCancel:j,onImprove:h}){const{state:m,isReadOnly:N}=el(),{plugin:b,skill:k}=m,{entries:M,loading:H}=Gh(b,k,i.id),[Z,$]=v.useState(!1),[se,I]=v.useState(i.prompt),[ce,Q]=v.useState(!1),[W,ne]=v.useState(i.expected_output);v.useState(()=>{I(i.prompt),ne(i.expected_output)});const F=v.useCallback(C=>{p({...d,evals:d.evals.map(z=>z.id===C.id?C:z)})},[d,p]),le=v.useCallback(()=>{F({...i,prompt:se}),$(!1)},[i,se,F]),te=v.useCallback(()=>{F({...i,expected_output:W}),Q(!1)},[i,W,F]),pe=v.useCallback(()=>{F({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,F]),Ee=v.useCallback((C,z)=>{F({...i,assertions:i.assertions.map(D=>D.id===C?{...D,text:z}:D)})},[i,F]),he=v.useCallback(C=>{F({...i,assertions:i.assertions.filter(z=>z.id!==C)})},[i,F]),J=v.useCallback(()=>{confirm("Delete this test case?")&&p({...d,evals:d.evals.filter(C=>C.id!==i.id)})},[d,i.id,p]),oe=o&&o.assertions.length>0&&o.assertions.every(C=>C.pass),Ce=o&&o.assertions.some(C=>!C.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(_m,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>j(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:()=>y(i.id),disabled:N,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>x(i.id),disabled:N,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),Ce&&!N&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>h(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!N&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:J,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"})]})})]})]}),oe&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Bc,{title:"Prompt",children:Z?n.jsxs("div",{children:[n.jsx("textarea",{value:se,onChange:C=>I(C.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:le,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{I(i.prompt),$(!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:N?"default":"pointer"},onClick:()=>{N||$(!0)},onMouseEnter:C=>{N||(C.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:C=>{C.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:N?"No prompt":"Click to edit prompt..."})})}),n.jsx(Bc,{title:"Expected Output",children:ce?n.jsxs("div",{children:[n.jsx("textarea",{value:W,onChange:C=>ne(C.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:te,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ne(i.expected_output),Q(!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:N?"default":"pointer"},onClick:()=>{N||Q(!0)},onMouseEnter:C=>{N||(C.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:C=>{C.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:N?"No expected output":"Click to edit expected output..."})})}),n.jsx(Bc,{title:`Assertions (${i.assertions.length})`,action:N?void 0:n.jsx("button",{onClick:pe,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(C=>{const z=o==null?void 0:o.assertions.find(ee=>ee.assertion_id===C.id),D=Vh(C.id,z,M);return n.jsx(Zh,{assertion:C,result:z,badges:D,isReadOnly:N,onUpdate:ee=>Ee(C.id,ee),onDelete:()=>he(C.id)},C.id)})})}),(o==null?void 0:o.output)&&n.jsx(Jh,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),n.jsx($h,{evalId:i.id,sharedEntries:M,sharedLoading:H})]},i.id)}function Zh({assertion:i,result:o,badges:d,isReadOnly:u,onUpdate:p,onDelete:y}){const[x,j]=v.useState(!1),[h,m]=v.useState(i.text),[N,b]=v.useState(!1),k=()=>{p(h),j(!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"}),(d==null?void 0:d.regression)&&n.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(d==null?void 0:d.flaky)&&n.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(d==null?void 0:d.nonDiscriminating)&&n.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),x?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:h,onChange:M=>m(M.target.value),onKeyDown:M=>{M.key==="Enter"&&k(),M.key==="Escape"&&j(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:k,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||(m(i.text),j(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>b(!N),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:N?"Hide reasoning":"Show reasoning"}),N&&(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:y,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:M=>{M.currentTarget.style.color="var(--red)",M.currentTarget.style.opacity="1"},onMouseLeave:M=>{M.currentTarget.style.color="var(--text-tertiary)",M.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Bc({title:i,action:o,children:d}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),o]}),d]})}function _m({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const o=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:o?"var(--green-muted)":"var(--red-muted)",color:o?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function Kh({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 Jh({output:i,durationMs:o,tokens:d}){const[u,p]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>p(!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)"]}),d!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",d," tokens)"]})]}),u&&n.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})]})}function $h({evalId:i,sharedEntries:o,sharedLoading:d}){const{state:u,dispatch:p}=el(),{plugin:y,skill:x}=u,[j,h]=v.useState(!0),m=o??null,N=d??!1,b=v.useCallback(()=>{h(!j)},[j]),k=m?m.slice(0,10):[];return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:b,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:j?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",m&&m.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",m.length," run",m.length!==1?"s":"",")"]})]}),j&&n.jsx("div",{className:"animate-fade-in",children:N?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..."})]}):!m||m.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:[k.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Am,{entries:k})}),n.jsx("div",{className:"space-y-2",children:k.map((M,H)=>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:Cm(M.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:M.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:M.type==="benchmark"?"rgba(99,131,255,0.15)":M.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:M.type==="benchmark"?"#6383ff":M.type==="comparison"?"var(--purple)":"#fb923c"},children:M.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Zc(M.pass_rate)},children:[Math.round(M.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:[M.durationMs!=null&&n.jsx("span",{children:km(M.durationMs)}),M.tokens!=null&&n.jsxs("span",{children:[M.tokens>=1e3?`${(M.tokens/1e3).toFixed(1)}k`:M.tokens," tok"]})]}),n.jsx("div",{className:"space-y-0.5",children:M.assertions.map(Z=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:Z.pass?"var(--green-muted)":"var(--red-muted)"},children:Z.pass?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Z.text})]},Z.id))})]},H))}),n.jsx("button",{onClick:()=>p({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:M=>{M.currentTarget.style.textDecoration="underline"},onMouseLeave:M=>{M.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function xm({evals:i,onSave:o,onCancel:d}){const[u,p]=v.useState(""),[y,x]=v.useState(""),[j,h]=v.useState(""),[m,N]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),b=Math.max(0,...i.evals.map(M=>M.id))+1,k=()=>{if(!u.trim()||!y.trim())return;const M={id:b,name:u.trim(),prompt:y.trim(),expected_output:j.trim(),files:[],assertions:m.filter(H=>H.text.trim())};o({...i,evals:[...i.evals,M]})};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:n.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:u,onChange:M=>p(M.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:y,onChange:M=>x(M.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:j,onChange:M=>h(M.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),m.map((M,H)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:M.text,onChange:Z=>N(m.map(($,se)=>se===H?{...$,text:Z.target.value}:$)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),m.length>1&&n.jsx("button",{onClick:()=>N(m.filter((Z,$)=>$!==H)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M.id)),n.jsx("button",{onClick:()=>N([...m,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:d,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:k,disabled:!u.trim()||!y.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Wh(i,o){const d=i+o,u=d*10,p=d*25,y=x=>x>=60?`${Math.round(x/60)}m`:`${x}s`;return`${y(u)}–${y(p)}`}function Fh(){const{state:i,runCase:o,runAll:d,cancelCase:u,cancelAll:p,isReadOnly:y}=el(),{evals:x,caseRunStates:j,bulkRunActive:h,latestBenchmark:m,inlineResults:N}=i,b=(x==null?void 0:x.evals)??[],k=v.useMemo(()=>{for(const Q of j.values())if(Q.status==="running"||Q.status==="queued")return!0;return!1},[j]),M=b.filter(Q=>{const W=j.get(Q.id);return W&&(W.status==="complete"||W.status==="error"||W.status==="cancelled")}).length,H=b.filter(Q=>{const W=j.get(Q.id);return W&&(W.status==="running"||W.status==="queued")}).length,Z=v.useRef(null),[$,se]=v.useState(0);v.useEffect(()=>{if(k&&!Z.current&&(Z.current=Date.now()),!k){Z.current=null,se(0);return}const Q=setInterval(()=>{Z.current&&se(Math.round((Date.now()-Z.current)/1e3))},1e3);return()=>clearInterval(Q)},[k]);const I=b.reduce((Q,W)=>Q+W.assertions.length,0),ce=v.useMemo(()=>Wh(b.length,I),[b.length,I]);return n.jsxs("div",{className:"p-5",children:[y&&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"}),k&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[H," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[k&&n.jsxs("button",{onClick:p,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||k||y,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>d("benchmark"),disabled:b.length===0||k||y,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>d("baseline"),disabled:b.length===0||k||y,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),k&&b.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",M,"/",b.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(M/b.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${M/b.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",$>=60?`${Math.floor($/60)}m ${$%60}s`:`${$}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ce]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:b.map(Q=>{const W=N.get(Q.id),ne=j.get(Q.id),F=(ne==null?void 0:ne.status)??"idle";return n.jsx(Ph,{name:Q.name,evalId:Q.id,result:W,caseStatus:F,runMode:(ne==null?void 0:ne.mode)??null,isReadOnly:y,onRun:le=>o(le,"benchmark"),onBaseline:le=>o(le,"baseline"),onCompare:le=>o(le,"comparison"),onCancel:le=>u(le)},Q.id)})}),!k&&m&&m.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:(m.overall_pass_rate??0)>=.8?"var(--green)":(m.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:m.overall_pass_rate!=null?`${Math.round(m.overall_pass_rate*100)}%`:"--"})]}),m.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(m.totalDurationMs/1e3).toFixed(1),"s",m.model&&` | Model: ${m.model}`]}),m.overall_pass_rate===1&&!m.comparison&&n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||y,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:b.length===0?.5:1},children:"Run Final A/B Comparison"})]}),m.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(pm,{label:"Skill",value:m.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(pm,{label:"Baseline",value:m.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:m.comparison.delta>0?"var(--green)":m.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",m.comparison.delta>0?"+":"",(m.comparison.delta*100).toFixed(1),"%",m.verdict&&` | ${m.verdict}`]})]})]})]})}const Ih={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 Ph({name:i,evalId:o,result:d,caseStatus:u,runMode:p,isReadOnly:y,onRun:x,onBaseline:j,onCompare:h,onCancel:m}){const[N,b]=v.useState(!1),k=u==="running"||u==="queued",M=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:k?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:k?"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]}),p&&(k||M)&&(()=>{const H=Ih[p];return H?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:H.bg,color:H.color,padding:"1px 6px"},children:H.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[k?n.jsx("button",{onClick:()=>m(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:()=>h(o),disabled:y,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>x(o),disabled:y,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>j(o),disabled:y,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),d&&d.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:d.status==="pass"?"var(--green-muted)":(d.status==="error","var(--red-muted)"),color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.passRate!=null?`${Math.round(d.passRate*100)}%`:d.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),d&&d.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:d.assertions.map(H=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:H.pass?"var(--green)":"var(--red)"},children:H.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:H.text})]},H.assertion_id))}),d.output&&n.jsx("button",{onClick:()=>b(!N),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:N?"Hide output":"Show output"}),N&&d.output&&n.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:d.output})]}),d&&d.errorMessage&&n.jsx(ev,{errorMessage:d.errorMessage,classifiedError:d.classifiedError})]})}const Uc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function ev({errorMessage:i,classifiedError:o}){const[d,u]=v.useState(!1),p=(o==null?void 0:o.title)??"Error",y=o==null?void 0:o.hint,x=o?Uc[o.category]??Uc.unknown:Uc.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:x}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:p}),n.jsx("button",{onClick:()=>u(!d),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:d?"Hide details":"Details"})]}),y&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:y}),d&&n.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:i})]})})}function pm({label:i,value:o,color:d}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:d},children:[Math.round(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:d}})})]})}const hm={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)"}},tv=[{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 lv(){const{state:i,dispatch:o,runActivationTest:d}=el(),{plugin:u,skill:p,activationPrompts:y,activationResults:x,activationSummary:j,activationRunning:h,activationError:m}=i,[N,b]=v.useState(y),[k,M]=v.useState(null),[H,Z]=v.useState(!1);v.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:N})},[N,o]),v.useEffect(()=>{fetch(`/api/skills/${u}/${p}/description`).then(Q=>Q.json()).then(Q=>M(Q.rawContent||Q.description||null)).catch(()=>M(null))},[u,p]);function $(){d(N)}function se(Q){const W=N.trim(),ne=W?`${W}
61
- ${Q.join(`
62
- `)}`:Q.join(`
63
- `);b(ne)}const I=x.filter(Q=>Q.classification==="TP"||Q.classification==="TN"),ce=x.filter(Q=>Q.classification==="FP"||Q.classification==="FN");return n.jsxs("div",{className:"p-5",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-1",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-5 gap-4 mb-5",children:[n.jsxs("div",{className:"col-span-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("label",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:tv.map(Q=>n.jsxs("button",{onClick:()=>se(Q.prompts),className:"text-[10px] px-2 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},onMouseEnter:W=>{W.currentTarget.style.color="var(--text-primary)",W.currentTarget.style.background="var(--surface-3)"},onMouseLeave:W=>{W.currentTarget.style.color="var(--text-tertiary)",W.currentTarget.style.background="var(--surface-2)"},children:["+ ",Q.label]},Q.label))})]}),n.jsx("textarea",{className:"input-field h-32 resize-y font-mono text-[12px]",value:N,onChange:Q=>b(Q.target.value),placeholder:`How do I write a unit test?
57
+ `);if(d.length>1e3||u.length>1e3)return[...d.map(N=>({type:"unchanged",content:N}))];const p=d.length,y=u.length,x=Array.from({length:p+1},()=>new Array(y+1).fill(0));for(let N=1;N<=p;N++)for(let b=1;b<=y;b++)d[N-1]===u[b-1]?x[N][b]=x[N-1][b-1]+1:x[N][b]=Math.max(x[N-1][b],x[N][b-1]);const j=[];let h=p,m=y;for(;h>0||m>0;)h>0&&m>0&&d[h-1]===u[m-1]?(j.push({type:"unchanged",content:d[h-1]}),h--,m--):m>0&&(h===0||x[h][m-1]>=x[h-1][m])?(j.push({type:"added",content:u[m-1]}),m--):(j.push({type:"removed",content:d[h-1]}),h--);return j.reverse()}function Ah(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 Wn({entries:i,isRunning:o}){const[d,u]=v.useState(!1),p=v.useRef(null);return v.useEffect(()=>{p.current&&!d&&(p.current.scrollTop=p.current.scrollHeight)},[i,d]),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(!d),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:y=>{y.currentTarget.style.color="var(--text-primary)"},onMouseLeave:y=>{y.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:d?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!d&&n.jsx("div",{ref:p,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((y,x)=>{const j=x===i.length-1&&o,h=x===0?"0s":`+${((y.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:j?1:.7},children:[Ah(y.phase,j),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:h}),n.jsx("span",{style:{color:j?"var(--text-primary)":"var(--text-secondary)"},children:y.message}),y.current!=null&&y.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",y.current,"/",y.total,"]"]})]},x)})})]})}const dm={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 hr({error:i,onRetry:o,onDismiss:d}){const[u,p]=v.useState(null),y=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?p(Math.ceil(i.retryAfterMs/1e3)):p(null),()=>{y.current&&clearInterval(y.current)}),[i]),v.useEffect(()=>{if(!(u==null||u<=0))return y.current=setInterval(()=>{p(h=>h==null||h<=1?(y.current&&clearInterval(y.current),0):h-1)},1e3),()=>{y.current&&clearInterval(y.current)}},[u!=null&&u>0]);const x=dm[i.category]||dm.unknown,j=u!=null&&u>0;return n.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${x.color} 30%, transparent)`,background:`color-mix(in srgb, ${x.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:x.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:x.color},children:i.title})]}),d&&n.jsx("button",{onClick:d,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(o||u!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:o&&n.jsx("button",{onClick:o,disabled:j,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:j?.5:1},children:j?`Retry in ${u}s`:"Retry"})})]})]})}function _h({plugin:i,skill:o,skillContent:d,onApplied:u}){const[p,y]=v.useState("closed"),[x,j]=v.useState(null),[h,m]=v.useState("claude-cli"),[N,b]=v.useState("opus"),[k,M]=v.useState([]),[H,Z]=v.useState(""),[$,se]=v.useState(""),[I,ie]=v.useState(null),[G,W]=v.useState(null),[ne,F]=v.useState([]),[le,te]=v.useState(!1),pe=v.useRef(null);v.useEffect(()=>{je.getConfig().then(z=>{j(z),z.providers.find(ee=>ee.id==="claude-cli"&&ee.available)&&(m("claude-cli"),b("opus"))}).catch(()=>{})},[]),v.useEffect(()=>()=>{var z;(z=pe.current)==null||z.abort()},[]);function Ee(){return x==null?void 0:x.providers.find(z=>z.id===h&&z.available)}const he=v.useCallback(()=>{var z;(z=pe.current)==null||z.abort(),y("open")},[]);async function J(){y("loading"),ie(null),W(null),F([]);const z=new AbortController;pe.current=z;try{const D=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(o)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:h,model:N}),signal:z.signal});if(!D.ok||!D.body){let X=`HTTP ${D.status}`;try{const R=await D.json();R.error&&(X=R.error)}catch{}throw new Error(X)}const ee=D.body.getReader(),de=new TextDecoder;let S="",L="";for(;;){const{done:X,value:R}=await ee.read();if(X)break;S+=de.decode(R,{stream:!0});const Y=S.split(`
58
+ `);S=Y.pop()||"";for(const Q of Y)if(Q.startsWith("event: "))L=Q.slice(7).trim();else if(Q.startsWith("data: ")){try{const K=JSON.parse(Q.slice(6));L==="progress"?F(fe=>[...fe,{phase:K.phase,message:K.message,timestamp:Date.now()}]):L==="done"||L==="complete"?(Z(K.improved),se(K.reasoning||""),M(pr(K.original||d,K.improved)),y("diff_shown")):L==="error"&&(ie(K.message||K.description||"Unknown error"),K.category&&W(K),y("open"))}catch{}L=""}}}catch(D){D.name!=="AbortError"&&(ie(D.message),y("open"))}finally{pe.current=null}}async function oe(){te(!0);try{await je.applyImprovement(i,o,H),u(H),y("closed")}catch(z){ie(z.message)}finally{te(!1)}}function Ce(){y("closed"),M([]),Z(""),se(""),ie(null)}if(p==="closed")return n.jsxs("button",{onClick:()=>y("open"),className:"btn btn-secondary mb-5",disabled:!d,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const C=Ee();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:Ce,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:z=>{z.currentTarget.style.background="var(--surface-3)"},onMouseLeave:z=>{z.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:[(p==="open"||p==="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:h,onChange:z=>{m(z.target.value);const D=x==null?void 0:x.providers.find(ee=>ee.id===z.target.value);D!=null&&D.models[0]&&b(D.models[0].id)},disabled:p==="loading",children:x==null?void 0:x.providers.filter(z=>z.available).map(z=>n.jsx("option",{value:z.id,children:z.label},z.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:N,onChange:z=>b(z.target.value),disabled:p==="loading",children:C==null?void 0:C.models.map(z=>n.jsx("option",{value:z.id,children:z.label},z.id))})]}),p==="loading"?n.jsx("button",{onClick:he,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:J,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),p==="loading"&&ne.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(Wn,{entries:ne,isRunning:!0})})]}),I&&n.jsx("div",{className:"mb-4",children:G?n.jsx(hr,{error:G,onRetry:J,onDismiss:()=>{ie(null),W(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:I})}),p==="diff_shown"&&n.jsxs(n.Fragment,{children:[$&&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: "}),$]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:k.map((z,D)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:z.type==="added"?"rgba(34,197,94,0.1)":z.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:z.type==="added"?"var(--green)":z.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:z.type==="added"?"3px solid var(--green)":z.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:z.type==="added"?"+":z.type==="removed"?"-":" "}),z.content]},D))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:oe,disabled:le,className:"btn btn-primary",children:le?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:Ce,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const fm={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"}},Rh={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function wh({change:i,index:o,selected:d,onToggle:u,originalEval:p}){var b;const[y,x]=v.useState(!1),j=fm[i.action]??fm.add,h=Rh[i.action]??"var(--border-subtle)",m=i.action==="remove"?(p==null?void 0:p.name)??`Eval #${i.evalId}`:((b=i.eval)==null?void 0:b.name)??"Unnamed",N=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 ${h}`,opacity:d?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:d,onChange:N,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:j.bg,color:j.color,padding:"1px 6px"},children:j.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:m}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>x(!y),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded 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.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:y?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),y&&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(Mh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&p&&n.jsx(zh,{original:p,proposed:i.eval}),i.action==="remove"&&p&&n.jsx(Oh,{evalCase:p})]})]})}function Mh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(Qc,{label:"Prompt",value:i.prompt}),n.jsx(Qc,{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(d=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",d.text]},d.id))})]})]})}function zh({original:i,proposed:o}){const d=[];i.name!==o.name&&d.push({label:"Name",old:i.name,new:o.name}),i.prompt!==o.prompt&&d.push({label:"Prompt",old:i.prompt,new:o.prompt}),i.expected_output!==o.expected_output&&d.push({label:"Expected",old:i.expected_output,new:o.expected_output});const u=i.assertions??[],p=o.assertions??[],y=new Set(u.map(m=>m.text)),x=new Set(p.map(m=>m.text)),j=p.filter(m=>!y.has(m.text)),h=u.filter(m=>!x.has(m.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[d.map(m=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:m.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:["- ",Xc(m.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",Xc(m.new,120)]})]})]},m.label)),(j.length>0||h.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:[h.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",m.text]},m.id)),j.map(m=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",m.text]},m.id))]})]}),d.length===0&&j.length===0&&h.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Oh({evalCase:i}){var o;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(Qc,{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(d=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:d.text},d.id))})]})]})}function Qc({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:Xc(o,300)})]})}function Xc(i,o){return i.length>o?i.slice(0,o)+"...":i}const mm={remove:0,modify:1,add:2};function Dh({changes:i,selections:o,currentEvals:d,onToggle:u,onSelectAll:p,onDeselectAll:y}){if(i.length===0)return null;const x=i.map((h,m)=>({change:h,originalIndex:m}));x.sort((h,m)=>(mm[h.change.action]??2)-(mm[m.change.action]??2));const j=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:["(",j,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:p,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Select All"}),n.jsx("button",{onClick:y,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:h=>{h.currentTarget.style.background="var(--surface-3)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:x.map(({change:h,originalIndex:m})=>n.jsx(wh,{change:h,index:m,selected:o.get(m)??!1,onToggle:u,originalEval:h.evalId!=null?d.find(N=>N.id===h.evalId):void 0},m))})]})}function Lh(){var z;const{state:i,dispatch:o,submitAiEdit:d,applyAiEdit:u,discardAiEdit:p,cancelAiEdit:y,toggleEvalChange:x,selectAllEvalChanges:j,deselectAllEvalChanges:h,retryEvalsSave:m}=el(),{aiEditLoading:N,aiEditResult:b,aiEditError:k,aiEditClassifiedError:M,aiEditProgress:H,aiEditEvalChanges:Z,aiEditEvalSelections:$,aiEditEvalsRetry:se}=i,[I,ie]=v.useState(""),[G,W]=v.useState(null),[ne,F]=v.useState("claude-cli"),[le,te]=v.useState("opus"),pe=v.useRef(null);v.useEffect(()=>{var D;(D=pe.current)==null||D.focus()},[]),v.useEffect(()=>{je.getConfig().then(D=>{W(D),D.providers.find(de=>de.id==="claude-cli"&&de.available)&&(F("claude-cli"),te("opus"))}).catch(()=>{})},[]);const Ee=G==null?void 0:G.providers.find(D=>D.id===ne&&D.available),he=v.useCallback(()=>{const D=I.trim();!D||N||d(D,ne,le)},[I,N,d,ne,le]),J=v.useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),he()),D.key==="Escape"&&(D.preventDefault(),N?y():p())},[he,N,y,p]),oe=v.useCallback(()=>{o({type:"CLOSE_AI_EDIT"}),o({type:"OPEN_AI_EDIT"})},[o]),Ce=b?pr(i.skillContent,b.improved):[],C=((z=i.evals)==null?void 0:z.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:p,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:D=>{D.currentTarget.style.background="var(--surface-3)"},onMouseLeave:D=>{D.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:pe,value:I,onChange:D=>ie(D.target.value),onKeyDown:J,placeholder:"e.g., Add an error handling section...",disabled:N,rows:1,className:"w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"8px 12px",fontSize:12.5,lineHeight:1.5,fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",minHeight:36,maxHeight:96},onInput:D=>{const ee=D.currentTarget;ee.style.height="auto",ee.style.height=Math.min(ee.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:ne,onChange:D=>{F(D.target.value);const ee=G==null?void 0:G.providers.find(de=>de.id===D.target.value);ee!=null&&ee.models[0]&&te(ee.models[0].id)},disabled:N,style:{width:"100%"},children:G==null?void 0:G.providers.filter(D=>D.available).map(D=>n.jsx("option",{value:D.id,children:D.label},D.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:le,onChange:D=>te(D.target.value),disabled:N,style:{width:"100%"},children:Ee==null?void 0:Ee.models.map(D=>n.jsx("option",{value:D.id,children:D.label},D.id))})]}),N?n.jsx("button",{onClick:y,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:he,disabled:!I.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),N&&H.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(Wn,{entries:H,isRunning:!0})})]}),k&&n.jsx("div",{className:"mt-3",children:M?n.jsx(hr,{error:M,onRetry:oe,onDismiss:p}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:k})}),b&&n.jsxs("div",{className:"animate-fade-in",children:[b.reasoning&&n.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),b.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:Ce.map((D,ee)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:D.type==="added"?"rgba(34,197,94,0.1)":D.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:D.type==="added"?"var(--green)":D.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:D.type==="added"?"3px solid var(--green)":D.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:D.type==="added"?"+":D.type==="removed"?"-":" "}),D.content]},ee))}),n.jsx(Dh,{changes:Z,selections:$,currentEvals:C,onToggle:x,onSelectAll:j,onDeselectAll:h}),se&&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:m,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:p,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:oe,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function Bh({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 Uh({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 Hh({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 qh({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 Lc({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 Yh(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=el(),{plugin:p,skill:y,skillContent:x,isDirty:j,improveTarget:h,aiEditOpen:m}=i,[N,b]=v.useState("split"),[k,M]=v.useState(!1),H=v.useRef(null),[Z,$]=v.useState(!1),[se,I]=v.useState(""),[ie,G]=v.useState(!1),[W,ne]=v.useState(null),[F,le]=v.useState([]),[te,pe]=v.useState([]),[Ee,he]=v.useState(null),J=v.useRef(null),[oe,Ce]=v.useState(null);v.useEffect(()=>{je.getConfig().then(Ce).catch(()=>{})},[]),v.useEffect(()=>()=>{var P;(P=J.current)==null||P.abort()},[]);const{metadata:C,body:z}=Ch(x),D=C["allowed-tools"],ee=Array.isArray(D)?D:typeof D=="string"?[D]:[],de=C.name,S=C.description,L=C.metadata,X=typeof L=="object"&&!Array.isArray(L)?L:null,R=C.version||(X==null?void 0:X.version),Y=C.tags||(X==null?void 0:X.tags),Q=Array.isArray(Y)?Y:typeof Y=="string"?Y.split(",").map(P=>P.trim()).filter(Boolean):[],K=new Set(["name","description","metadata","allowed-tools","version","tags"]),fe=Object.entries(C).filter(([P])=>!K.has(P)),ye=v.useCallback(async()=>{M(!0),await d(),M(!1)},[d]),Rt=v.useCallback(P=>{(P.ctrlKey||P.metaKey)&&P.key==="s"&&(P.preventDefault(),P.stopPropagation(),j&&ye()),(P.ctrlKey||P.metaKey)&&P.key==="k"&&(P.preventDefault(),P.stopPropagation(),o({type:m?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[j,ye,m,o]),bt=v.useCallback(async()=>{var it,Mt;if(!se.trim())return;(it=J.current)==null||it.abort();const P=new AbortController;J.current=P,G(!0),he(null),pe([]),ne(null),le([]);try{const ot=(oe==null?void 0:oe.provider)||"claude-cli",tl=(oe==null?void 0:oe.model)||"sonnet",V=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:se,provider:ot,model:tl}),signal:P.signal});if(!V.ok||!V.body){let ll=`HTTP ${V.status}`;try{const al=await V.json();al.error&&(ll=al.error)}catch{}throw new Error(ll)}const Be=V.body.getReader(),Nl=new TextDecoder;let Ke="",tt="";for(;;){const{done:ll,value:al}=await Be.read();if(ll)break;Ke+=Nl.decode(al,{stream:!0});const Qt=Ke.split(`
59
+ `);Ke=Qt.pop()||"";for(const jt of Qt)if(jt.startsWith("event: "))tt=jt.slice(7).trim();else if(jt.startsWith("data: ")){try{const Ve=JSON.parse(jt.slice(6));if(tt==="progress")pe(ut=>[...ut,{phase:Ve.phase,message:Ve.message,timestamp:Date.now()}]);else if(tt==="done"||tt==="complete"){const ut=["---"];Ve.name&&ut.push(`name: ${Ve.name}`),Ve.description&&ut.push(`description: "${Ve.description.replace(/"/g,'\\"')}"`),Ve.model&&ut.push(`model: ${Ve.model}`),(Mt=Ve.allowedTools)!=null&&Mt.trim()&&ut.push(`allowed-tools: ${Ve.allowedTools.trim()}`),ut.push("---","",Ve.body||"");const Fl=ut.join(`
60
+ `);ne(Fl),le(pr(x,Fl)),G(!1)}else tt==="error"&&(he(Ve.message||Ve.description||"Generation failed"),G(!1))}catch{}tt=""}}}catch(ot){ot.name!=="AbortError"&&he(ot.message)}finally{G(!1),J.current=null}},[se,oe,x]),Wl=v.useCallback(()=>{W&&o({type:"SET_CONTENT",content:W}),$(!1),ne(null),le([]),I(""),pe([])},[W,o]),wt=v.useCallback(()=>{$(!1),ne(null),le([]),I(""),pe([]),he(null)},[]),Vt=v.useCallback(()=>{var P;Z?((P=J.current)==null||P.abort(),wt()):(m&&o({type:"CLOSE_AI_EDIT"}),$(!0))},[Z,m,o,wt]),Sl=[{mode:"raw",icon:n.jsx(Bh,{}),label:"Editor"},{mode:"split",icon:n.jsx(Uh,{}),label:"Split"},{mode:"preview",icon:n.jsx(Hh,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:Rt,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:Sl.map(({mode:P,icon:it,label:Mt})=>n.jsxs("button",{onClick:()=>b(P),title:Mt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:N===P?"var(--surface-4)":"transparent",color:N===P?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:N===P?600:400,border:"none",cursor:"pointer"},children:[it,n.jsx("span",{style:{letterSpacing:"0.01em"},children:Mt})]},P))}),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:()=>{m?o({type:"CLOSE_AI_EDIT"}):(Z&&wt(),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:m?600:400,border:"none",cursor:"pointer",color:m?"#a855f7":"var(--text-tertiary)",background:m?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(qh,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Vt,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:Z?600:400,border:"none",cursor:"pointer",color:Z?"#a855f7":"var(--text-tertiary)",background:Z?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Lc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),j&&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:ye,disabled:!j||k,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:k?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]})]}),n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:N==="raw"||N==="preview"?"1fr":"1fr 1fr"},children:[N!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:N==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:H,value:x,onChange:P=>{u||o({type:"SET_CONTENT",content:P.target.value})},onKeyDown:Rt,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}})}),N!=="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:[(de||R||S)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[de&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:de}),R&&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",R]})]}),S&&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:S})]}),Q.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:Q.map(P=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:P},P))}),ee.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"}),ee.map(P=>n.jsx("span",{style:{fontSize:10.5,fontFamily:"var(--font-mono, ui-monospace, monospace)",color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4},children:P},P))]})}),fe.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:fe.map(([P,it],Mt)=>{const ot=Array.isArray(it)?it.join(", "):typeof it=="object"?Object.entries(it).map(([tl,V])=>`${tl}: ${Array.isArray(V)?V.join(", "):V}`).join(" | "):it;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:Mt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:P}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:ot})]},P)})}),(de||S||Q.length>0||ee.length>0||fe.length>0)&&z&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),z&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Wc(z)}})]})})]}),m&&n.jsx(Lh,{}),Z&&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:[!W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Lc,{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:se,onChange:P=>I(P.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ie,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:ie?.5:1},onKeyDown:P=>{P.key==="Enter"&&(P.ctrlKey||P.metaKey)&&se.trim()&&!ie&&(P.preventDefault(),bt())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[ie?n.jsx("button",{onClick:()=>{var P;(P=J.current)==null||P.abort(),G(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:bt,disabled:!se.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:wt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ie&&te.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(Wn,{entries:te,isRunning:!0})}),Ee&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[Ee,n.jsx("button",{onClick:bt,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Lc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:F.map((P,it)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:P.type==="added"?"rgba(34,197,94,0.1)":P.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:P.type==="added"?"var(--green)":P.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:P.type==="added"?"3px solid var(--green)":P.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:P.type==="added"?"+":P.type==="removed"?"-":" "}),P.content]},it))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Wl,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:wt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),h!==null&&p&&y&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(_h,{plugin:p,skill:y,skillContent:x,onApplied:P=>{o({type:"SET_CONTENT",content:P}),o({type:"CONTENT_SAVED"}),o({type:"CLOSE_IMPROVE"})}})})]})}function Zc(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Cm(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 km(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}function Am({entries:i}){if(i.length<2)return null;const o=80,d=24,u=2,p=i.slice().reverse(),y=p.length,x=p.map((j,h)=>{const m=u+h/(y-1)*(o-u*2),N=u+(d-u*2)-j.pass_rate*(d-u*2);return`${m},${N}`});return n.jsxs("svg",{width:o,height:d,style:{display:"block",flexShrink:0},children:[n.jsx("polyline",{points:x.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),x.length>0&&n.jsx("circle",{cx:parseFloat(x[x.length-1].split(",")[0]),cy:parseFloat(x[x.length-1].split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Gh(i,o,d){const[u,p]=v.useState(null),[y,x]=v.useState(!1),j=v.useRef("");v.useEffect(()=>{const m=`${i}/${o}/${d}`;j.current!==m&&(j.current=m,x(!0),je.getCaseHistory(i,o,d).then(N=>p(N)).catch(()=>p([])).finally(()=>x(!1)))},[i,o,d]);const h=v.useCallback(()=>{x(!0),j.current="",je.getCaseHistory(i,o,d).then(m=>p(m)).catch(()=>p([])).finally(()=>x(!1))},[i,o,d]);return{entries:u,loading:y,refetch:h}}function Vh(i,o,d){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!d||d.length===0)return u;const y=d.slice(0,10).map(h=>h.assertions.find(m=>m.id===i)).filter(Boolean);if(y.length>=2){const m=y.filter(N=>N.pass).length/y.length;m>=.3&&m<=.7&&(u.flaky=!0)}const x=d.find(h=>h.type==="benchmark"),j=d.find(h=>h.type==="baseline");if(x&&j){const h=x.assertions.find(N=>N.id===i),m=j.assertions.find(N=>N.id===i);h!=null&&h.pass&&(m!=null&&m.pass)&&(u.nonDiscriminating=!0)}if(o&&!o.pass&&d.length>=1){const m=d[0].assertions.find(N=>N.id===i);m!=null&&m.pass&&(u.regression=!0)}return u}function Qh(){var le;const{state:i,dispatch:o,saveEvals:d,runCase:u,runAll:p,cancelCase:y,cancelAll:x,generateEvals:j,isReadOnly:h}=el(),{evals:m,selectedCaseId:N,inlineResults:b,caseRunStates:k,generateEvalsLoading:M,generateEvalsProgress:H,generateEvalsError:Z}=i,$=v.useMemo(()=>{for(const te of k.values())if(te.status==="running"||te.status==="queued")return!0;return!1},[k]),[se,I]=v.useState(!1),ie={skill_name:i.skill,evals:[]},G=m??ie,W=G.evals,ne=W.find(te=>te.id===N)??null,F=v.useCallback(()=>{j()},[j]);return!m||W.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>I(!0),disabled:h,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:F,disabled:M||h,className:"btn btn-secondary text-[12px]",children:M?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),M&&H.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(Wn,{entries:H,isRunning:!0})}),Z&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(hr,{error:Z,onRetry:F})}),se&&n.jsx(xm,{evals:G,onSave:te=>{d(te),I(!1)},onCancel:()=>I(!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 (",W.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:$?n.jsx("button",{onClick:x,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:()=>p("benchmark"),disabled:W.length===0||h,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>p("comparison"),disabled:W.length===0||h,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:W.map(te=>{const pe=b.get(te.id),Ee=N===te.id;return n.jsxs("button",{onClick:()=>o({type:"SELECT_CASE",caseId:te.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:Ee?"var(--accent-muted)":"transparent",borderLeft:Ee?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:he=>{Ee||(he.currentTarget.style.background="var(--surface-2)")},onMouseLeave:he=>{Ee||(he.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:Ee?"var(--text-primary)":"var(--text-secondary)"},children:["#",te.id," ",te.name]}),n.jsx(_m,{result:pe})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[te.assertions.length," assertion",te.assertions.length!==1?"s":"",(pe==null?void 0:pe.passRate)!=null&&n.jsx(Kh,{passRate:pe.passRate})]})]},te.id)})}),n.jsx("div",{className:"px-3 py-2",children:!h&&n.jsx("button",{onClick:()=>I(!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:te=>{te.currentTarget.style.borderColor="var(--accent)",te.currentTarget.style.color="var(--accent)"},onMouseLeave:te=>{te.currentTarget.style.borderColor="var(--border-default)",te.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:ne?n.jsx(Xh,{evalCase:ne,result:b.get(ne.id),evals:m,caseStatus:((le=k.get(ne.id))==null?void 0:le.status)??"idle",onSaveEvals:d,onRun:te=>u(te,"benchmark"),onCompare:te=>u(te,"comparison"),onCancel:te=>y(te),onImprove:te=>o({type:"OPEN_IMPROVE",evalId:te})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),se&&n.jsx(xm,{evals:G,onSave:te=>{d(te),I(!1)},onCancel:()=>I(!1)})]})}function Xh({evalCase:i,result:o,evals:d,caseStatus:u,onSaveEvals:p,onRun:y,onCompare:x,onCancel:j,onImprove:h}){const{state:m,isReadOnly:N}=el(),{plugin:b,skill:k}=m,{entries:M,loading:H}=Gh(b,k,i.id),[Z,$]=v.useState(!1),[se,I]=v.useState(i.prompt),[ie,G]=v.useState(!1),[W,ne]=v.useState(i.expected_output);v.useState(()=>{I(i.prompt),ne(i.expected_output)});const F=v.useCallback(C=>{p({...d,evals:d.evals.map(z=>z.id===C.id?C:z)})},[d,p]),le=v.useCallback(()=>{F({...i,prompt:se}),$(!1)},[i,se,F]),te=v.useCallback(()=>{F({...i,expected_output:W}),G(!1)},[i,W,F]),pe=v.useCallback(()=>{F({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,F]),Ee=v.useCallback((C,z)=>{F({...i,assertions:i.assertions.map(D=>D.id===C?{...D,text:z}:D)})},[i,F]),he=v.useCallback(C=>{F({...i,assertions:i.assertions.filter(z=>z.id!==C)})},[i,F]),J=v.useCallback(()=>{confirm("Delete this test case?")&&p({...d,evals:d.evals.filter(C=>C.id!==i.id)})},[d,i.id,p]),oe=o&&o.assertions.length>0&&o.assertions.every(C=>C.pass),Ce=o&&o.assertions.some(C=>!C.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(_m,{result:o})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?n.jsxs("button",{onClick:()=>j(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:()=>y(i.id),disabled:N,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>x(i.id),disabled:N,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),Ce&&!N&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:()=>h(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!N&&u!=="running"&&u!=="queued"&&n.jsx("button",{onClick:J,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"})]})})]})]}),oe&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Bc,{title:"Prompt",children:Z?n.jsxs("div",{children:[n.jsx("textarea",{value:se,onChange:C=>I(C.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:le,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{I(i.prompt),$(!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:N?"default":"pointer"},onClick:()=>{N||$(!0)},onMouseEnter:C=>{N||(C.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:C=>{C.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:N?"No prompt":"Click to edit prompt..."})})}),n.jsx(Bc,{title:"Expected Output",children:ie?n.jsxs("div",{children:[n.jsx("textarea",{value:W,onChange:C=>ne(C.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:te,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{ne(i.expected_output),G(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:N?"default":"pointer"},onClick:()=>{N||G(!0)},onMouseEnter:C=>{N||(C.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:C=>{C.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:N?"No expected output":"Click to edit expected output..."})})}),n.jsx(Bc,{title:`Assertions (${i.assertions.length})`,action:N?void 0:n.jsx("button",{onClick:pe,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(C=>{const z=o==null?void 0:o.assertions.find(ee=>ee.assertion_id===C.id),D=Vh(C.id,z,M);return n.jsx(Zh,{assertion:C,result:z,badges:D,isReadOnly:N,onUpdate:ee=>Ee(C.id,ee),onDelete:()=>he(C.id)},C.id)})})}),(o==null?void 0:o.output)&&n.jsx(Jh,{output:o.output,durationMs:o.durationMs,tokens:o.tokens}),n.jsx($h,{evalId:i.id,sharedEntries:M,sharedLoading:H})]},i.id)}function Zh({assertion:i,result:o,badges:d,isReadOnly:u,onUpdate:p,onDelete:y}){const[x,j]=v.useState(!1),[h,m]=v.useState(i.text),[N,b]=v.useState(!1),k=()=>{p(h),j(!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"}),(d==null?void 0:d.regression)&&n.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(d==null?void 0:d.flaky)&&n.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(d==null?void 0:d.nonDiscriminating)&&n.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),x?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:h,onChange:M=>m(M.target.value),onKeyDown:M=>{M.key==="Enter"&&k(),M.key==="Escape"&&j(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:k,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||(m(i.text),j(!0))},children:i.text}),(o==null?void 0:o.reasoning)&&n.jsx("button",{onClick:()=>b(!N),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:N?"Hide reasoning":"Show reasoning"}),N&&(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:y,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:M=>{M.currentTarget.style.color="var(--red)",M.currentTarget.style.opacity="1"},onMouseLeave:M=>{M.currentTarget.style.color="var(--text-tertiary)",M.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Bc({title:i,action:o,children:d}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),o]}),d]})}function _m({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const o=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:o?"var(--green-muted)":"var(--red-muted)",color:o?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function Kh({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 Jh({output:i,durationMs:o,tokens:d}){const[u,p]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>p(!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)"]}),d!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",d," tokens)"]})]}),u&&n.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i})]})}function $h({evalId:i,sharedEntries:o,sharedLoading:d}){const{state:u,dispatch:p}=el(),{plugin:y,skill:x}=u,[j,h]=v.useState(!0),m=o??null,N=d??!1,b=v.useCallback(()=>{h(!j)},[j]),k=m?m.slice(0,10):[];return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:b,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:j?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",m&&m.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",m.length," run",m.length!==1?"s":"",")"]})]}),j&&n.jsx("div",{className:"animate-fade-in",children:N?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..."})]}):!m||m.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:[k.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Am,{entries:k})}),n.jsx("div",{className:"space-y-2",children:k.map((M,H)=>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:Cm(M.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:M.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:M.type==="benchmark"?"rgba(99,131,255,0.15)":M.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:M.type==="benchmark"?"#6383ff":M.type==="comparison"?"var(--purple)":"#fb923c"},children:M.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Zc(M.pass_rate)},children:[Math.round(M.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:[M.durationMs!=null&&n.jsx("span",{children:km(M.durationMs)}),M.tokens!=null&&n.jsxs("span",{children:[M.tokens>=1e3?`${(M.tokens/1e3).toFixed(1)}k`:M.tokens," tok"]})]}),n.jsx("div",{className:"space-y-0.5",children:M.assertions.map(Z=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:Z.pass?"var(--green-muted)":"var(--red-muted)"},children:Z.pass?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Z.text})]},Z.id))})]},H))}),n.jsx("button",{onClick:()=>p({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:M=>{M.currentTarget.style.textDecoration="underline"},onMouseLeave:M=>{M.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function xm({evals:i,onSave:o,onCancel:d}){const[u,p]=v.useState(""),[y,x]=v.useState(""),[j,h]=v.useState(""),[m,N]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),b=Math.max(0,...i.evals.map(M=>M.id))+1,k=()=>{if(!u.trim()||!y.trim())return;const M={id:b,name:u.trim(),prompt:y.trim(),expected_output:j.trim(),files:[],assertions:m.filter(H=>H.text.trim())};o({...i,evals:[...i.evals,M]})};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:n.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:u,onChange:M=>p(M.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:y,onChange:M=>x(M.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:j,onChange:M=>h(M.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),m.map((M,H)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:M.text,onChange:Z=>N(m.map(($,se)=>se===H?{...$,text:Z.target.value}:$)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),m.length>1&&n.jsx("button",{onClick:()=>N(m.filter((Z,$)=>$!==H)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M.id)),n.jsx("button",{onClick:()=>N([...m,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:d,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:k,disabled:!u.trim()||!y.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Wh(i,o){const d=i+o,u=d*10,p=d*25,y=x=>x>=60?`${Math.round(x/60)}m`:`${x}s`;return`${y(u)}–${y(p)}`}function Fh(){const{state:i,runCase:o,runAll:d,cancelCase:u,cancelAll:p,isReadOnly:y}=el(),{evals:x,caseRunStates:j,bulkRunActive:h,latestBenchmark:m,inlineResults:N}=i,b=(x==null?void 0:x.evals)??[],k=v.useMemo(()=>{for(const G of j.values())if(G.status==="running"||G.status==="queued")return!0;return!1},[j]),M=b.filter(G=>{const W=j.get(G.id);return W&&(W.status==="complete"||W.status==="error"||W.status==="cancelled")}).length,H=b.filter(G=>{const W=j.get(G.id);return W&&(W.status==="running"||W.status==="queued")}).length,Z=v.useRef(null),[$,se]=v.useState(0);v.useEffect(()=>{if(k&&!Z.current&&(Z.current=Date.now()),!k){Z.current=null,se(0);return}const G=setInterval(()=>{Z.current&&se(Math.round((Date.now()-Z.current)/1e3))},1e3);return()=>clearInterval(G)},[k]);const I=b.reduce((G,W)=>G+W.assertions.length,0),ie=v.useMemo(()=>Wh(b.length,I),[b.length,I]);return n.jsxs("div",{className:"p-5",children:[y&&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"}),k&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[H," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[k&&n.jsxs("button",{onClick:p,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||k||y,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>d("benchmark"),disabled:b.length===0||k||y,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>d("baseline"),disabled:b.length===0||k||y,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),k&&b.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",M,"/",b.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(M/b.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${M/b.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",$>=60?`${Math.floor($/60)}m ${$%60}s`:`${$}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ie]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:b.map(G=>{const W=N.get(G.id),ne=j.get(G.id),F=(ne==null?void 0:ne.status)??"idle";return n.jsx(Ph,{name:G.name,evalId:G.id,result:W,caseStatus:F,runMode:(ne==null?void 0:ne.mode)??null,isReadOnly:y,onRun:le=>o(le,"benchmark"),onBaseline:le=>o(le,"baseline"),onCompare:le=>o(le,"comparison"),onCancel:le=>u(le)},G.id)})}),!k&&m&&m.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:(m.overall_pass_rate??0)>=.8?"var(--green)":(m.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:m.overall_pass_rate!=null?`${Math.round(m.overall_pass_rate*100)}%`:"--"})]}),m.totalDurationMs!=null&&n.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(m.totalDurationMs/1e3).toFixed(1),"s",m.model&&` | Model: ${m.model}`]}),m.overall_pass_rate===1&&!m.comparison&&n.jsx("button",{onClick:()=>d("comparison"),disabled:b.length===0||y,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:b.length===0?.5:1},children:"Run Final A/B Comparison"})]}),m.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(pm,{label:"Skill",value:m.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(pm,{label:"Baseline",value:m.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:m.comparison.delta>0?"var(--green)":m.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",m.comparison.delta>0?"+":"",(m.comparison.delta*100).toFixed(1),"%",m.verdict&&` | ${m.verdict}`]})]})]})]})}const Ih={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 Ph({name:i,evalId:o,result:d,caseStatus:u,runMode:p,isReadOnly:y,onRun:x,onBaseline:j,onCompare:h,onCancel:m}){const[N,b]=v.useState(!1),k=u==="running"||u==="queued",M=u==="complete"||u==="error";return n.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:k?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:k?"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]}),p&&(k||M)&&(()=>{const H=Ih[p];return H?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:H.bg,color:H.color,padding:"1px 6px"},children:H.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[k?n.jsx("button",{onClick:()=>m(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:()=>h(o),disabled:y,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>x(o),disabled:y,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>j(o),disabled:y,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),d&&d.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:d.status==="pass"?"var(--green-muted)":(d.status==="error","var(--red-muted)"),color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.passRate!=null?`${Math.round(d.passRate*100)}%`:d.status}),u==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),d&&d.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:d.assertions.map(H=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:H.pass?"var(--green)":"var(--red)"},children:H.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:H.text})]},H.assertion_id))}),d.output&&n.jsx("button",{onClick:()=>b(!N),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:N?"Hide output":"Show output"}),N&&d.output&&n.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:d.output})]}),d&&d.errorMessage&&n.jsx(ev,{errorMessage:d.errorMessage,classifiedError:d.classifiedError})]})}const Uc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function ev({errorMessage:i,classifiedError:o}){const[d,u]=v.useState(!1),p=(o==null?void 0:o.title)??"Error",y=o==null?void 0:o.hint,x=o?Uc[o.category]??Uc.unknown:Uc.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:x}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:p}),n.jsx("button",{onClick:()=>u(!d),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:d?"Hide details":"Details"})]}),y&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:y}),d&&n.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:i})]})})}function pm({label:i,value:o,color:d}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:d},children:[Math.round(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:d}})})]})}const hm={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)"}},tv=[{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 lv(){const{state:i,dispatch:o,runActivationTest:d}=el(),{plugin:u,skill:p,activationPrompts:y,activationResults:x,activationSummary:j,activationRunning:h,activationError:m}=i,[N,b]=v.useState(y),[k,M]=v.useState(null),[H,Z]=v.useState(!1);v.useEffect(()=>{o({type:"SET_ACTIVATION_PROMPTS",prompts:N})},[N,o]),v.useEffect(()=>{fetch(`/api/skills/${u}/${p}/description`).then(G=>G.json()).then(G=>M(G.rawContent||G.description||null)).catch(()=>M(null))},[u,p]);function $(){d(N)}function se(G){const W=N.trim(),ne=W?`${W}
61
+ ${G.join(`
62
+ `)}`:G.join(`
63
+ `);b(ne)}const I=x.filter(G=>G.classification==="TP"||G.classification==="TN"),ie=x.filter(G=>G.classification==="FP"||G.classification==="FN");return n.jsxs("div",{className:"p-5",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.jsx("div",{className:"text-[12px] mt-1",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),n.jsxs("div",{className:"grid grid-cols-5 gap-4 mb-5",children:[n.jsxs("div",{className:"col-span-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("label",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:tv.map(G=>n.jsxs("button",{onClick:()=>se(G.prompts),className:"text-[10px] px-2 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},onMouseEnter:W=>{W.currentTarget.style.color="var(--text-primary)",W.currentTarget.style.background="var(--surface-3)"},onMouseLeave:W=>{W.currentTarget.style.color="var(--text-tertiary)",W.currentTarget.style.background="var(--surface-2)"},children:["+ ",G.label]},G.label))})]}),n.jsx("textarea",{className:"input-field h-32 resize-y font-mono text-[12px]",value:N,onChange:G=>b(G.target.value),placeholder:`How do I write a unit test?
64
64
  What edge cases should I test?
65
65
  +Deploy this to production
66
66
  !What's the weather like today?
67
67
  !Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center gap-4 mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"})," = must activate"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"})," = must NOT activate"]}),n.jsxs("span",{children:[N.trim().split(`
68
68
  `).filter(Boolean).length," prompt",N.trim().split(`
69
- `).filter(Boolean).length!==1?"s":""]})]})]}),n.jsx("div",{className:"col-span-2 flex flex-col",children:n.jsxs("div",{className:`glass-card flex flex-col ${H?"flex-1":""}`,children:[n.jsxs("button",{onClick:()=>Z(!H),className:"w-full p-3 flex items-center justify-between text-left flex-shrink-0",style:{borderBottom:H?"1px solid var(--border-subtle)":void 0},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:H?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),H&&k&&n.jsx("div",{className:"p-3 flex-1 overflow-auto animate-fade-in",style:{maxHeight:320},children:n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Wc(k)}})}),!H&&k&&n.jsx("div",{className:"px-3 pb-3 pt-1",children:n.jsx("div",{className:"text-[11px] line-clamp-2 leading-relaxed",style:{color:"var(--text-tertiary)"},children:k.replace(/^---[\s\S]*?---\s*/,"").trim().slice(0,150)})})]})})]}),n.jsx("button",{onClick:$,disabled:h||!N.trim(),className:"btn btn-primary mb-5",children:h?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"]})}),m&&n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:m}),x.length>0&&n.jsxs("div",{className:"space-y-5 mb-5",children:[ce.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 (",ce.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:ce.map((Q,W)=>n.jsx(vm,{result:Q},`incorrect-${W}`))})]}),I.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 (",I.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:I.map((Q,W)=>n.jsx(vm,{result:Q},`correct-${W}`))})]})]}),j&&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"}),j.autoClassifiedCount!=null&&j.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[j.autoClassifiedCount," of ",j.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(Hc,{label:"Precision",value:j.precision,description:"Of all activations, how many were correct?",detail:`${j.tp} true / ${j.tp+j.fp} total activations`}),n.jsx(Hc,{label:"Recall",value:j.recall,description:"Of expected activations, how many fired?",detail:`${j.tp} activated / ${j.tp+j.fn} expected`}),n.jsx(Hc,{label:"Reliability",value:j.reliability,description:"Overall correct classification rate",detail:`${j.tp+j.tn} correct / ${j.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(mr,{label:"True Positive",abbr:"TP",count:j.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(mr,{label:"False Positive",abbr:"FP",count:j.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(mr,{label:"False Negative",abbr:"FN",count:j.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(mr,{label:"True Negative",abbr:"TN",count:j.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),h&&x.length===0&&n.jsxs("div",{className:"text-center py-16 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]})]})}function vm({result:i}){const o=hm[i.classification]||hm.FN,d=i.classification==="TP"||i.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background: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:d?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 Hc({label:i,value:o,description:d,detail:u}){const p=Math.round(o*100),y=p>=80?"var(--green)":p>=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:y},children:[p,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:d}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function mr({abbr:i,count:o,bg:d,color:u,description:p}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:d},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children: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:p})]})}const qc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},ym={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},Kc=600,Jc=180,dt=40,Yc=Kc-dt*2,Zl=Jc-dt*2,av=[25,50,75,100];function gm(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function nv({entries:i}){const[o,d]=v.useState(null);if(i.length<2)return null;const u=i.length,p=i.map((j,h)=>{const m=dt+h/(u-1)*Yc,N=j.passRate*100,b=dt+Zl-N/100*Zl;return{x:m,y:b,pct:N,entry:j}}),y=p.map(j=>`${j.x},${j.y}`).join(" "),x=Array.from(new Set(i.map(j=>j.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:x.map(j=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:qc[j]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:ym[j]??j})]},j))}),n.jsxs("svg",{width:Kc,height:Jc,viewBox:`0 0 ${Kc} ${Jc}`,style:{display:"block",overflow:"visible"},children:[av.map(j=>{const h=dt+Zl-j/100*Zl;return n.jsxs("g",{children:[n.jsx("line",{x1:dt,y1:h,x2:dt+Yc,y2:h,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:dt-8,y:h+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[j,"%"]})]},j)}),n.jsx("line",{x1:dt,y1:dt+Zl,x2:dt+Yc,y2:dt+Zl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:dt-8,y:dt+Zl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:y,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((j,h)=>n.jsx("circle",{cx:j.x,cy:j.y,r:5,fill:qc[j.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:m=>{m.currentTarget.setAttribute("r","7"),d({x:j.x,y:j.y,entry:j.entry})},onMouseLeave:m=>{m.currentTarget.setAttribute("r","5"),d(null)}},h)),sv(u).map(j=>n.jsx("text",{x:p[j].x,y:dt+Zl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:gm(i[j].timestamp)},j))]}),o&&n.jsxs("div",{style:{position:"absolute",left:o.x,top:o.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:gm(o.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:o.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:qc[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:ym[o.entry.type]??o.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(o.entry.passRate*100),"%"]})]})]})]})}function sv(i){return i<=3?Array.from({length:i},(o,d)=>d):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function xr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function rv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function iv({rate:i,label:o}){const d=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:o}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:xr(i)},children:[d,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${d}%`,background:xr(i)}})})]})})}function cv({points:i}){if(i.length<2)return null;const o=200,d=48,u=4,p=i.length,y=i.map((h,m)=>{const N=u+m/(p-1)*(o-u*2),b=u+(d-u*2)-h.passRate*(d-u*2);return{x:N,y:b}}),x=`M ${y[0].x},${d-u} `+y.map(h=>`L ${h.x},${h.y}`).join(" ")+` L ${y[y.length-1].x},${d-u} Z`,j=y.map((h,m)=>`${m===0?"M":"L"} ${h.x},${h.y}`).join(" ");return n.jsxs("svg",{width:o,height:d,style:{display:"block"},children:[n.jsx("path",{d:x,fill:"var(--accent-muted)"}),n.jsx("path",{d:j,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:y[y.length-1].x,cy:y[y.length-1].y,r:3,fill:"var(--accent)"})]})}function ov({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,y]=v.useState(!0);if(v.useEffect(()=>{y(!0),je.getStats(i,o).then(u).catch(()=>u(null)).finally(()=>y(!1))},[i,o]),p)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!d||d.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const x=d.trendPoints.length>0?d.trendPoints[d.trendPoints.length-1].passRate:0,j=d.trendPoints.length>0?d.trendPoints[0].passRate:0,h=x-j,m=d.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:xr(x)},children:[Math.round(x*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:h>=0?"var(--green)":"var(--red)"},children:[h>=0?"+":"",Math.round(h*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.modelStats.length})]})]}),d.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(cv,{points:d.trendPoints})]}),d.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:d.modelStats.map(N=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:N.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:N.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:xr(N.avgPassRate)},children:[Math.round(N.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:rv(N.avgDurationMs)})]},N.model))})]})]}),m.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:m.map(N=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--surface-2)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",N.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:N.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[N.totalRuns," runs"]})]}),n.jsx(iv,{rate:N.passRate,label:N.text})]},`${N.evalId}:${N.id}`))})]})]})}function uv({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,y]=v.useState(null),[x,j]=v.useState({}),[h,m]=v.useState({});v.useEffect(()=>{je.getEvals(i,o).then(u).catch(()=>u(null))},[i,o]);async function N(b){if(p===b){y(null);return}if(y(b),!x[b]){m(k=>({...k,[b]:!0}));try{const k=await je.getCaseHistory(i,o,b);j(M=>({...M,[b]:k}))}catch{j(k=>({...k,[b]:[]}))}finally{m(k=>({...k,[b]:!1}))}}}return d?n.jsx("div",{className:"space-y-2 stagger-children",children:d.evals.map(b=>{const k=x[b.id]||[],M=p===b.id,H=h[b.id],Z=k.length>0?k[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>N(b.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:M?"var(--surface-2)":"transparent"},onMouseEnter:$=>{M||($.currentTarget.style.background="var(--surface-2)")},onMouseLeave:$=>{M||($.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:M?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",b.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:b.name}),k.length>=2&&n.jsx(Am,{entries:k}),Z!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:Zc(Z)},children:[Math.round(Z*100),"%"]}),k.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[k.length," runs"]})]}),M&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:H?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..."})]}):k.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:k.map(($,se)=>n.jsxs("div",{className:"p-4",style:{background:se===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:Cm($.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:$.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:$.type==="benchmark"?"rgba(99,131,255,0.15)":$.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:$.type==="benchmark"?"#6383ff":$.type==="comparison"?"var(--purple)":"#fb923c"},children:$.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Zc($.pass_rate)},children:[Math.round($.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:[$.durationMs!=null&&n.jsx("span",{children:km($.durationMs)}),$.tokens!=null&&n.jsxs("span",{children:[$.tokens>=1e3?`${($.tokens/1e3).toFixed(1)}k`:$.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:$.assertions.map(I=>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:I.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:I.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:I.text}),I.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:I.reasoning})]})]},I.id))})]},se))})})]},b.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function dv(){const{state:i,dispatch:o}=el(),{plugin:d,skill:u}=i,[p,y]=v.useState("timeline"),[x,j]=v.useState([]),[h,m]=v.useState(!0),[N,b]=v.useState(""),[k,M]=v.useState(""),[H,Z]=v.useState(!1),[$,se]=v.useState([]),[I,ce]=v.useState(null),[Q,W]=v.useState(!1),[ne,F]=v.useState(null),[le,te]=v.useState(!1);v.useEffect(()=>{m(!0),je.getHistory(d,u,{model:N||void 0,type:k||void 0}).then(J=>{j(J),J.length>=2&&je.compareRuns(d,u,J[0].timestamp,J[1].timestamp).then(oe=>{const Ce=oe.regressions.filter(C=>C.change==="regression");o({type:"SET_REGRESSIONS",regressions:Ce})}).catch(()=>{})}).catch(()=>{}).finally(()=>m(!1))},[d,u,N,k]);const pe=v.useCallback(async J=>{if(H){se(oe=>oe.includes(J)?oe.filter(Ce=>Ce!==J):oe.length>=2?[oe[1],J]:[...oe,J]);return}te(!0);try{const oe=await je.getHistoryEntry(d,u,J);F(oe)}catch{}finally{te(!1)}},[d,u,H]),Ee=v.useCallback(async()=>{if($.length===2){W(!0);try{const J=await je.compareRuns(d,u,$[0],$[1]);ce(J)}catch{}finally{W(!1)}}},[d,u,$]),he=[...new Set(x.map(J=>J.model))];return 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-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(J=>n.jsx("button",{onClick:()=>y(J),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:p===J?"var(--accent-muted)":"transparent",color:p===J?"var(--accent)":"var(--text-tertiary)"},children:J==="timeline"?"Timeline":J==="per-eval"?"Per Eval":"Statistics"},J))}),p==="timeline"&&n.jsxs("div",{children:[x.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(nv,{entries:x})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:N,onChange:J=>b(J.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),he.map(J=>n.jsx("option",{value:J,children:J},J))]}),n.jsxs("select",{value:k,onChange:J=>M(J.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:()=>{Z(!H),se([]),ce(null)},className:`btn text-[12px] ${H?"btn-primary":"btn-secondary"}`,children:H?"Exit Compare":"Compare Runs"}),H&&$.length===2&&n.jsx("button",{onClick:Ee,disabled:Q,className:"btn btn-primary text-[12px]",children:Q?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:x.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):x.map(J=>{const oe=$.includes(J.timestamp);return n.jsx("button",{onClick:()=>pe(J.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:oe?"var(--accent-muted)":"var(--surface-1)",border:oe?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:Ce=>{oe||(Ce.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Ce=>{oe||(Ce.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:[H&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:oe?"var(--accent)":"var(--border-default)",background:oe?"var(--accent)":"transparent"},children:oe&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(J.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:J.type==="comparison"?"var(--purple-muted)":J.type==="baseline"?"var(--surface-3)":J.type==="model-compare"?"rgba(56,189,248,0.15)":J.type==="improve"||J.type==="instruct"?"rgba(168,85,247,0.15)":J.type==="ai-generate"?"rgba(34,197,94,0.15)":J.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:J.type==="comparison"?"var(--purple)":J.type==="baseline"?"var(--text-tertiary)":J.type==="model-compare"?"#38bdf8":J.type==="improve"||J.type==="instruct"?"#a855f7":J.type==="ai-generate"?"#22c55e":J.type==="eval-generate"?"#fb923c":"var(--accent)"},children:J.type==="model-compare"?"model compare":J.type==="improve"?"ai improve":J.type==="instruct"?"ai edit":J.type==="ai-generate"?"ai generate":J.type==="eval-generate"?"eval generate":J.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:J.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:J.passRate>=.8?"var(--green)":J.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(J.passRate*100),"%"]})]})]})},J.timestamp)})}),I&&n.jsx(fv,{result:I}),ne&&!H&&n.jsx(mv,{run:ne,onClose:()=>F(null)})]}),p==="per-eval"&&n.jsx(uv,{plugin:d,skill:u}),p==="statistics"&&n.jsx(ov,{plugin:d,skill:u})]})}function fv({result:i}){const o=i.regressions.filter(u=>u.change==="regression"),d=i.regressions.filter(u=>u.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),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}`))]}),d.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",d.length,")"]}),d.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(u=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function mv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(xv,{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(d=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.pass_rate!=null?`${Math.round(d.pass_rate*100)}%`:d.status})]})},d.eval_id))})]})}function xv({run:i,onClose:o}){var y;const d=v.useMemo(()=>i.improve?pr(i.improve.original,i.improve.improved):[],[i.improve]),u=v.useMemo(()=>{const x=d.filter(h=>h.type==="added").length,j=d.filter(h=>h.type==="removed").length;return{added:x,removed:j}},[d]),p=v.useMemo(()=>{let x=0,j=0;return d.map(h=>h.type==="removed"?(x++,{...h,origNum:x,newNum:null}):h.type==="added"?(j++,{...h,origNum:null,newNum:j}):(x++,j++,{...h,origNum:x,newNum:j}))},[d]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),n.jsx("button",{onClick:o,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--surface-3)"},onMouseLeave:x=>{x.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"})]})})]})]}),((y=i.improve)==null?void 0:y.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:p.map((x,j)=>n.jsxs("tr",{style:{background:x.type==="added"?"rgba(34,197,94,0.08)":x.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:x.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:x.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:x.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:x.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"transparent",borderRight:x.type==="added"?"2px solid var(--green)":x.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:x.type==="added"?"+":x.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"var(--text-secondary)"},children:x.content||"​"})]},j))})})})]})}function pv({plugin:i,skill:o}){const[d,u]=v.useState([]),[p,y]=v.useState([]),[x,j]=v.useState(!0),[h,m]=v.useState(null);v.useEffect(()=>{je.getDependencies(i,o).then(b=>{u(b.mcpDependencies),y(b.skillDependencies)}).catch(()=>{}).finally(()=>j(!1))},[i,o]);async function N(b,k){try{await navigator.clipboard.writeText(k),m(b),setTimeout(()=>m(null),2e3)}catch{}}return x?null:d.length===0&&p.length===0?n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:d.length+p.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[d.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),d.map(b=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:b.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.transport})]}),n.jsx("button",{onClick:()=>N(b.server,b.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:h===b.server?"var(--green)":"var(--accent)"},children:h===b.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:b.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.matchedTools.map(k=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:k},k))})]},b.server))]}),p.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:p.map(b=>n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.source==="frontmatter"?"frontmatter":"referenced"})]},b.name))})]})]})]})}function hv(){const{state:i}=el(),{plugin:o,skill:d}=i,[u,p]=v.useState(null),[y,x]=v.useState(!0);return v.useEffect(()=>{je.getDependencies(o,d).then(p).catch(()=>{}).finally(()=>x(!1))},[o,d]),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-32 rounded-xl"})]}):u?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(pv,{plugin:o,skill:d})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const vv=["editor","tests","run","activation","history","deps"];function yv(i){return i!=null&&vv.includes(i)}function gv(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=el();v.useEffect(()=>{const j=new URLSearchParams(window.location.search).get("panel");yv(j)&&j!==i.activePanel&&o({type:"SET_PANEL",panel:j})},[]),v.useEffect(()=>{const x=new URLSearchParams(window.location.search);x.set("panel",i.activePanel);const j=`${window.location.pathname}?${x.toString()}${window.location.hash}`;history.replaceState(null,"",j)},[i.activePanel]);const p=v.useCallback(x=>{const j=x.ctrlKey||x.metaKey;if(j&&x.key>="1"&&x.key<="6"){x.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(x.key)-1]});return}if(j&&x.key==="s"&&!x.shiftKey){x.preventDefault(),i.isDirty&&d();return}},[i.isDirty,d,o]);if(v.useEffect(()=>(window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)),[p]),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(x=>x.status==="running"||x.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(jh,{state:i,isReadOnly:u}),n.jsx(Th,{activePanel:i.activePanel,onPanelChange:x=>o({type:"SET_PANEL",panel:x}),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(Yh,{}),i.activePanel==="tests"&&n.jsx(Qh,{}),i.activePanel==="run"&&n.jsx(Fh,{}),i.activePanel==="activation"&&n.jsx(lv,{}),i.activePanel==="history"&&n.jsx(dv,{}),i.activePanel==="deps"&&n.jsx(hv,{})]},i.activePanel)})]})}function Gc(i,o=!0){let d=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(d=d.replace(/^-+|-+$/g,"")),d}function bv(i,o,d,u){const y=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${y}/${d}/skills/${u}/SKILL.md`;case 2:return`${y}/plugins/${d}/skills/${u}/SKILL.md`;case 3:return`${y}/skills/${u}/SKILL.md`}}const Kl={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function $n({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 jv({onCreated:i,onCancel:o}){const[d,u]=v.useState("manual"),[p,y]=v.useState(null),[x,j]=v.useState(!0),[h,m]=v.useState(null),[N,b]=v.useState(""),[k,M]=v.useState(3),[H,Z]=v.useState(""),[$,se]=v.useState(""),[I,ce]=v.useState(""),[Q,W]=v.useState(""),[ne,F]=v.useState(""),[le,te]=v.useState(""),[pe,Ee]=v.useState(null),[he,J]=v.useState("write"),[oe,Ce]=v.useState(!1),[C,z]=v.useState(null),[D,ee]=v.useState(""),[de,S]=v.useState(!1),[L,X]=v.useState(null),[w,Y]=v.useState(null),[V,K]=v.useState(null),[fe,ye]=v.useState([]),_t=v.useRef(null),gt=v.useRef(null);v.useEffect(()=>{je.getProjectLayout().then(G=>{y(G),M(G.suggestedLayout);const Be=G.detectedLayouts.find(jl=>jl.layout===G.suggestedLayout);Be!=null&&Be.existingPlugins.length&&Z(Be.existingPlugins[0])}).catch(()=>{}).finally(()=>j(!1)),je.getConfig().then(m).catch(()=>{})},[]),v.useEffect(()=>{var G;d==="ai"&&((G=_t.current)==null||G.focus())},[d]),v.useEffect(()=>()=>{var G;(G=gt.current)==null||G.abort()},[]);const Jl=v.useMemo(()=>{var G;return p?((G=p.detectedLayouts.find(Be=>Be.layout===k))==null?void 0:G.existingPlugins)||[]:[]},[p,k]),Rt=H==="__new__"?$:H,Vt=p?bv(p.root,k,Rt||"{plugin}",N||"{skill}"):"",bl=v.useMemo(()=>p?p.detectedLayouts.filter(G=>G.layout!==4):[],[p]),P=v.useMemo(()=>{if(!h)return null;for(const G of h.providers)for(const Be of G.models)if(G.id===h.provider&&(G.id==="claude-cli"?h.model===`claude-${Be.id}`:h.model===Be.id))return Be.label;return h.model||null},[h]),rt=v.useCallback(()=>{if(!h)return{provider:"claude-cli",model:"sonnet"};const G=h.provider||"claude-cli";let Be=h.model||"sonnet";return G==="claude-cli"&&Be.startsWith("claude-")&&(Be=Be.replace("claude-","")),{provider:G,model:Be}},[h]),wt=v.useCallback(()=>{var G;(G=gt.current)==null||G.abort(),S(!1)},[]);async function ot(){var Ze;if(Y(null),K(null),X(null),ye([]),!D.trim()){Y("Describe what your skill should do");return}S(!0);const G=new AbortController;gt.current=G;const{provider:Be,model:jl}=rt();try{const it=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D.trim(),provider:Be,model:jl}),signal:G.signal});if(!it.ok||!it.body)throw new Error(`HTTP ${it.status}`);const pa=it.body.getReader(),ha=new TextDecoder;let Qt="",bt="";for(;;){const{done:Ie,value:Mt}=await pa.read();if(Ie)break;Qt+=ha.decode(Mt,{stream:!0});const $l=Qt.split(`
70
- `);Qt=$l.pop()||"";for(const Jt of $l)if(Jt.startsWith("event: "))bt=Jt.slice(7).trim();else if(Jt.startsWith("data: ")){try{const Me=JSON.parse(Jt.slice(6));bt==="progress"?ye($t=>[...$t,{phase:Me.phase,message:Me.message,timestamp:Date.now()}]):bt==="done"||bt==="complete"?(b(Me.name),ce(Me.description),W(Me.model||""),F(Me.allowedTools||""),te(Me.body),Ee((Ze=Me.evals)!=null&&Ze.length?Me.evals:null),X(Me.reasoning),u("manual")):bt==="error"&&(Y(Me.message||Me.description||"Unknown error"),Me.category&&K(Me))}catch{}bt=""}}}catch(it){it.name!=="AbortError"&&Y(it.message)}finally{S(!1),gt.current=null}}async function tl(){if(z(null),!N.trim()){z("Skill name is required");return}if(!I.trim()){z("Description is required");return}if(k!==3&&!Rt.trim()){z("Plugin name is required");return}Ce(!0);try{const G=await je.createSkill({name:Gc(N),plugin:Rt||"",layout:k,description:I,model:Q||void 0,allowedTools:ne||void 0,body:le,evals:pe||void 0});i(G.plugin,G.skill)}catch(G){z(G.message)}finally{Ce(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>u("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:d==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:d==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>u("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="ai"?"rgba(168,85,247,0.15)":"transparent",color:d==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:d==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx($n,{size:12}),"AI-Assisted"]})})]})})]}),x&&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"})]}),!x&&p&&d==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx($n,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:_t,value:D,onChange:G=>ee(G.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
69
+ `).filter(Boolean).length!==1?"s":""]})]})]}),n.jsx("div",{className:"col-span-2 flex flex-col",children:n.jsxs("div",{className:`glass-card flex flex-col ${H?"flex-1":""}`,children:[n.jsxs("button",{onClick:()=>Z(!H),className:"w-full p-3 flex items-center justify-between text-left flex-shrink-0",style:{borderBottom:H?"1px solid var(--border-subtle)":void 0},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"}),n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:H?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),H&&k&&n.jsx("div",{className:"p-3 flex-1 overflow-auto animate-fade-in",style:{maxHeight:320},children:n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Wc(k)}})}),!H&&k&&n.jsx("div",{className:"px-3 pb-3 pt-1",children:n.jsx("div",{className:"text-[11px] line-clamp-2 leading-relaxed",style:{color:"var(--text-tertiary)"},children:k.replace(/^---[\s\S]*?---\s*/,"").trim().slice(0,150)})})]})})]}),n.jsx("button",{onClick:$,disabled:h||!N.trim(),className:"btn btn-primary mb-5",children:h?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"]})}),m&&n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:m}),x.length>0&&n.jsxs("div",{className:"space-y-5 mb-5",children:[ie.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 (",ie.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:ie.map((G,W)=>n.jsx(vm,{result:G},`incorrect-${W}`))})]}),I.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 (",I.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:I.map((G,W)=>n.jsx(vm,{result:G},`correct-${W}`))})]})]}),j&&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"}),j.autoClassifiedCount!=null&&j.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[j.autoClassifiedCount," of ",j.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx(Hc,{label:"Precision",value:j.precision,description:"Of all activations, how many were correct?",detail:`${j.tp} true / ${j.tp+j.fp} total activations`}),n.jsx(Hc,{label:"Recall",value:j.recall,description:"Of expected activations, how many fired?",detail:`${j.tp} activated / ${j.tp+j.fn} expected`}),n.jsx(Hc,{label:"Reliability",value:j.reliability,description:"Overall correct classification rate",detail:`${j.tp+j.tn} correct / ${j.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(mr,{label:"True Positive",abbr:"TP",count:j.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(mr,{label:"False Positive",abbr:"FP",count:j.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(mr,{label:"False Negative",abbr:"FN",count:j.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(mr,{label:"True Negative",abbr:"TN",count:j.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),h&&x.length===0&&n.jsxs("div",{className:"text-center py-16 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]})]})}function vm({result:i}){const o=hm[i.classification]||hm.FN,d=i.classification==="TP"||i.classification==="TN";return n.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background: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:d?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 Hc({label:i,value:o,description:d,detail:u}){const p=Math.round(o*100),y=p>=80?"var(--green)":p>=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:y},children:[p,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:d}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function mr({abbr:i,count:o,bg:d,color:u,description:p}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:d},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children: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:p})]})}const qc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},ym={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},Kc=600,Jc=180,ft=40,Yc=Kc-ft*2,Jl=Jc-ft*2,av=[25,50,75,100];function gm(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function nv({entries:i}){const[o,d]=v.useState(null);if(i.length<2)return null;const u=i.length,p=i.map((j,h)=>{const m=ft+h/(u-1)*Yc,N=j.passRate*100,b=ft+Jl-N/100*Jl;return{x:m,y:b,pct:N,entry:j}}),y=p.map(j=>`${j.x},${j.y}`).join(" "),x=Array.from(new Set(i.map(j=>j.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:x.map(j=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:qc[j]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:ym[j]??j})]},j))}),n.jsxs("svg",{width:Kc,height:Jc,viewBox:`0 0 ${Kc} ${Jc}`,style:{display:"block",overflow:"visible"},children:[av.map(j=>{const h=ft+Jl-j/100*Jl;return n.jsxs("g",{children:[n.jsx("line",{x1:ft,y1:h,x2:ft+Yc,y2:h,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:ft-8,y:h+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[j,"%"]})]},j)}),n.jsx("line",{x1:ft,y1:ft+Jl,x2:ft+Yc,y2:ft+Jl,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:ft-8,y:ft+Jl+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:y,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((j,h)=>n.jsx("circle",{cx:j.x,cy:j.y,r:5,fill:qc[j.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:m=>{m.currentTarget.setAttribute("r","7"),d({x:j.x,y:j.y,entry:j.entry})},onMouseLeave:m=>{m.currentTarget.setAttribute("r","5"),d(null)}},h)),sv(u).map(j=>n.jsx("text",{x:p[j].x,y:ft+Jl+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:gm(i[j].timestamp)},j))]}),o&&n.jsxs("div",{style:{position:"absolute",left:o.x,top:o.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:gm(o.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:o.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:qc[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:ym[o.entry.type]??o.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(o.entry.passRate*100),"%"]})]})]})]})}function sv(i){return i<=3?Array.from({length:i},(o,d)=>d):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function xr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function rv(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function iv({rate:i,label:o}){const d=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:o}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:xr(i)},children:[d,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${d}%`,background:xr(i)}})})]})})}function cv({points:i}){if(i.length<2)return null;const o=200,d=48,u=4,p=i.length,y=i.map((h,m)=>{const N=u+m/(p-1)*(o-u*2),b=u+(d-u*2)-h.passRate*(d-u*2);return{x:N,y:b}}),x=`M ${y[0].x},${d-u} `+y.map(h=>`L ${h.x},${h.y}`).join(" ")+` L ${y[y.length-1].x},${d-u} Z`,j=y.map((h,m)=>`${m===0?"M":"L"} ${h.x},${h.y}`).join(" ");return n.jsxs("svg",{width:o,height:d,style:{display:"block"},children:[n.jsx("path",{d:x,fill:"var(--accent-muted)"}),n.jsx("path",{d:j,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:y[y.length-1].x,cy:y[y.length-1].y,r:3,fill:"var(--accent)"})]})}function ov({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,y]=v.useState(!0);if(v.useEffect(()=>{y(!0),je.getStats(i,o).then(u).catch(()=>u(null)).finally(()=>y(!1))},[i,o]),p)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!d||d.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const x=d.trendPoints.length>0?d.trendPoints[d.trendPoints.length-1].passRate:0,j=d.trendPoints.length>0?d.trendPoints[0].passRate:0,h=x-j,m=d.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:xr(x)},children:[Math.round(x*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:h>=0?"var(--green)":"var(--red)"},children:[h>=0?"+":"",Math.round(h*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:d.modelStats.length})]})]}),d.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(cv,{points:d.trendPoints})]}),d.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:d.modelStats.map(N=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:N.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:N.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:xr(N.avgPassRate)},children:[Math.round(N.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:rv(N.avgDurationMs)})]},N.model))})]})]}),m.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:m.map(N=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--surface-2)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",N.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:N.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[N.totalRuns," runs"]})]}),n.jsx(iv,{rate:N.passRate,label:N.text})]},`${N.evalId}:${N.id}`))})]})]})}function uv({plugin:i,skill:o}){const[d,u]=v.useState(null),[p,y]=v.useState(null),[x,j]=v.useState({}),[h,m]=v.useState({});v.useEffect(()=>{je.getEvals(i,o).then(u).catch(()=>u(null))},[i,o]);async function N(b){if(p===b){y(null);return}if(y(b),!x[b]){m(k=>({...k,[b]:!0}));try{const k=await je.getCaseHistory(i,o,b);j(M=>({...M,[b]:k}))}catch{j(k=>({...k,[b]:[]}))}finally{m(k=>({...k,[b]:!1}))}}}return d?n.jsx("div",{className:"space-y-2 stagger-children",children:d.evals.map(b=>{const k=x[b.id]||[],M=p===b.id,H=h[b.id],Z=k.length>0?k[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>N(b.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:M?"var(--surface-2)":"transparent"},onMouseEnter:$=>{M||($.currentTarget.style.background="var(--surface-2)")},onMouseLeave:$=>{M||($.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:M?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",b.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:b.name}),k.length>=2&&n.jsx(Am,{entries:k}),Z!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:Zc(Z)},children:[Math.round(Z*100),"%"]}),k.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[k.length," runs"]})]}),M&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:H?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..."})]}):k.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:k.map(($,se)=>n.jsxs("div",{className:"p-4",style:{background:se===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:Cm($.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:$.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:$.type==="benchmark"?"rgba(99,131,255,0.15)":$.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:$.type==="benchmark"?"#6383ff":$.type==="comparison"?"var(--purple)":"#fb923c"},children:$.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:Zc($.pass_rate)},children:[Math.round($.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:[$.durationMs!=null&&n.jsx("span",{children:km($.durationMs)}),$.tokens!=null&&n.jsxs("span",{children:[$.tokens>=1e3?`${($.tokens/1e3).toFixed(1)}k`:$.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:$.assertions.map(I=>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:I.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:I.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:I.text}),I.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:I.reasoning})]})]},I.id))})]},se))})})]},b.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function dv(){const{state:i,dispatch:o}=el(),{plugin:d,skill:u}=i,[p,y]=v.useState("timeline"),[x,j]=v.useState([]),[h,m]=v.useState(!0),[N,b]=v.useState(""),[k,M]=v.useState(""),[H,Z]=v.useState(!1),[$,se]=v.useState([]),[I,ie]=v.useState(null),[G,W]=v.useState(!1),[ne,F]=v.useState(null),[le,te]=v.useState(!1);v.useEffect(()=>{m(!0),je.getHistory(d,u,{model:N||void 0,type:k||void 0}).then(J=>{j(J),J.length>=2&&je.compareRuns(d,u,J[0].timestamp,J[1].timestamp).then(oe=>{const Ce=oe.regressions.filter(C=>C.change==="regression");o({type:"SET_REGRESSIONS",regressions:Ce})}).catch(()=>{})}).catch(()=>{}).finally(()=>m(!1))},[d,u,N,k]);const pe=v.useCallback(async J=>{if(H){se(oe=>oe.includes(J)?oe.filter(Ce=>Ce!==J):oe.length>=2?[oe[1],J]:[...oe,J]);return}te(!0);try{const oe=await je.getHistoryEntry(d,u,J);F(oe)}catch{}finally{te(!1)}},[d,u,H]),Ee=v.useCallback(async()=>{if($.length===2){W(!0);try{const J=await je.compareRuns(d,u,$[0],$[1]);ie(J)}catch{}finally{W(!1)}}},[d,u,$]),he=[...new Set(x.map(J=>J.model))];return 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-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(J=>n.jsx("button",{onClick:()=>y(J),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:p===J?"var(--accent-muted)":"transparent",color:p===J?"var(--accent)":"var(--text-tertiary)"},children:J==="timeline"?"Timeline":J==="per-eval"?"Per Eval":"Statistics"},J))}),p==="timeline"&&n.jsxs("div",{children:[x.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(nv,{entries:x})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:N,onChange:J=>b(J.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),he.map(J=>n.jsx("option",{value:J,children:J},J))]}),n.jsxs("select",{value:k,onChange:J=>M(J.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:()=>{Z(!H),se([]),ie(null)},className:`btn text-[12px] ${H?"btn-primary":"btn-secondary"}`,children:H?"Exit Compare":"Compare Runs"}),H&&$.length===2&&n.jsx("button",{onClick:Ee,disabled:G,className:"btn btn-primary text-[12px]",children:G?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:x.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):x.map(J=>{const oe=$.includes(J.timestamp);return n.jsx("button",{onClick:()=>pe(J.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:oe?"var(--accent-muted)":"var(--surface-1)",border:oe?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:Ce=>{oe||(Ce.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Ce=>{oe||(Ce.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:[H&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:oe?"var(--accent)":"var(--border-default)",background:oe?"var(--accent)":"transparent"},children:oe&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(J.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:J.type==="comparison"?"var(--purple-muted)":J.type==="baseline"?"var(--surface-3)":J.type==="model-compare"?"rgba(56,189,248,0.15)":J.type==="improve"||J.type==="instruct"?"rgba(168,85,247,0.15)":J.type==="ai-generate"?"rgba(34,197,94,0.15)":J.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:J.type==="comparison"?"var(--purple)":J.type==="baseline"?"var(--text-tertiary)":J.type==="model-compare"?"#38bdf8":J.type==="improve"||J.type==="instruct"?"#a855f7":J.type==="ai-generate"?"#22c55e":J.type==="eval-generate"?"#fb923c":"var(--accent)"},children:J.type==="model-compare"?"model compare":J.type==="improve"?"ai improve":J.type==="instruct"?"ai edit":J.type==="ai-generate"?"ai generate":J.type==="eval-generate"?"eval generate":J.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:J.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:J.passRate>=.8?"var(--green)":J.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(J.passRate*100),"%"]})]})]})},J.timestamp)})}),I&&n.jsx(fv,{result:I}),ne&&!H&&n.jsx(mv,{run:ne,onClose:()=>F(null)})]}),p==="per-eval"&&n.jsx(uv,{plugin:d,skill:u}),p==="statistics"&&n.jsx(ov,{plugin:d,skill:u})]})}function fv({result:i}){const o=i.regressions.filter(u=>u.change==="regression"),d=i.regressions.filter(u=>u.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),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}`))]}),d.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",d.length,")"]}),d.map(u=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(u=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function mv({run:i,onClose:o}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(xv,{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(d=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:d.status==="pass"?"var(--green)":"var(--red)"},children:d.pass_rate!=null?`${Math.round(d.pass_rate*100)}%`:d.status})]})},d.eval_id))})]})}function xv({run:i,onClose:o}){var y;const d=v.useMemo(()=>i.improve?pr(i.improve.original,i.improve.improved):[],[i.improve]),u=v.useMemo(()=>{const x=d.filter(h=>h.type==="added").length,j=d.filter(h=>h.type==="removed").length;return{added:x,removed:j}},[d]),p=v.useMemo(()=>{let x=0,j=0;return d.map(h=>h.type==="removed"?(x++,{...h,origNum:x,newNum:null}):h.type==="added"?(j++,{...h,origNum:null,newNum:j}):(x++,j++,{...h,origNum:x,newNum:j}))},[d]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),n.jsx("button",{onClick:o,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--surface-3)"},onMouseLeave:x=>{x.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"})]})})]})]}),((y=i.improve)==null?void 0:y.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:p.map((x,j)=>n.jsxs("tr",{style:{background:x.type==="added"?"rgba(34,197,94,0.08)":x.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:x.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:x.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.origNum??""}),n.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:x.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:x.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:x.newNum??""}),n.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"transparent",borderRight:x.type==="added"?"2px solid var(--green)":x.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:x.type==="added"?"+":x.type==="removed"?"-":" "}),n.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:x.type==="added"?"var(--green)":x.type==="removed"?"var(--red)":"var(--text-secondary)"},children:x.content||"​"})]},j))})})})]})}function pv({plugin:i,skill:o}){const[d,u]=v.useState([]),[p,y]=v.useState([]),[x,j]=v.useState(!0),[h,m]=v.useState(null);v.useEffect(()=>{je.getDependencies(i,o).then(b=>{u(b.mcpDependencies),y(b.skillDependencies)}).catch(()=>{}).finally(()=>j(!1))},[i,o]);async function N(b,k){try{await navigator.clipboard.writeText(k),m(b),setTimeout(()=>m(null),2e3)}catch{}}return x?null:d.length===0&&p.length===0?n.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),n.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:d.length+p.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[d.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),d.map(b=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:b.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.transport})]}),n.jsx("button",{onClick:()=>N(b.server,b.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:h===b.server?"var(--green)":"var(--accent)"},children:h===b.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:b.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.matchedTools.map(k=>n.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:k},k))})]},b.server))]}),p.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:p.map(b=>n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.source==="frontmatter"?"frontmatter":"referenced"})]},b.name))})]})]})]})}function hv(){const{state:i}=el(),{plugin:o,skill:d}=i,[u,p]=v.useState(null),[y,x]=v.useState(!0);return v.useEffect(()=>{je.getDependencies(o,d).then(p).catch(()=>{}).finally(()=>x(!1))},[o,d]),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-32 rounded-xl"})]}):u?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(pv,{plugin:o,skill:d})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const vv=["editor","tests","run","activation","history","deps"];function yv(i){return i!=null&&vv.includes(i)}function gv(){const{state:i,dispatch:o,saveContent:d,isReadOnly:u}=el();v.useEffect(()=>{const j=new URLSearchParams(window.location.search).get("panel");yv(j)&&j!==i.activePanel&&o({type:"SET_PANEL",panel:j})},[]),v.useEffect(()=>{const x=new URLSearchParams(window.location.search);x.set("panel",i.activePanel);const j=`${window.location.pathname}?${x.toString()}${window.location.hash}`;history.replaceState(null,"",j)},[i.activePanel]);const p=v.useCallback(x=>{const j=x.ctrlKey||x.metaKey;if(j&&x.key>="1"&&x.key<="6"){x.preventDefault(),o({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(x.key)-1]});return}if(j&&x.key==="s"&&!x.shiftKey){x.preventDefault(),i.isDirty&&d();return}},[i.isDirty,d,o]);if(v.useEffect(()=>(window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)),[p]),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(x=>x.status==="running"||x.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(jh,{state:i,isReadOnly:u}),n.jsx(Th,{activePanel:i.activePanel,onPanelChange:x=>o({type:"SET_PANEL",panel:x}),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(Yh,{}),i.activePanel==="tests"&&n.jsx(Qh,{}),i.activePanel==="run"&&n.jsx(Fh,{}),i.activePanel==="activation"&&n.jsx(lv,{}),i.activePanel==="history"&&n.jsx(dv,{}),i.activePanel==="deps"&&n.jsx(hv,{})]},i.activePanel)})]})}function Gc(i,o=!0){let d=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return o&&(d=d.replace(/^-+|-+$/g,"")),d}function bv(i,o,d,u){const y=`.../${i.split("/").slice(-2).join("/")}`;switch(o){case 1:return`${y}/${d}/skills/${u}/SKILL.md`;case 2:return`${y}/plugins/${d}/skills/${u}/SKILL.md`;case 3:return`${y}/skills/${u}/SKILL.md`}}const $l={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function $n({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 jv({onCreated:i,onCancel:o}){const[d,u]=v.useState("manual"),[p,y]=v.useState(null),[x,j]=v.useState(!0),[h,m]=v.useState(null),[N,b]=v.useState(""),[k,M]=v.useState(3),[H,Z]=v.useState(""),[$,se]=v.useState(""),[I,ie]=v.useState(""),[G,W]=v.useState(""),[ne,F]=v.useState(""),[le,te]=v.useState(""),[pe,Ee]=v.useState(null),[he,J]=v.useState("write"),[oe,Ce]=v.useState(!1),[C,z]=v.useState(null),[D,ee]=v.useState(""),[de,S]=v.useState(!1),[L,X]=v.useState(null),[R,Y]=v.useState(null),[Q,K]=v.useState(null),[fe,ye]=v.useState([]),Rt=v.useRef(null),bt=v.useRef(null);v.useEffect(()=>{je.getProjectLayout().then(V=>{y(V),M(V.suggestedLayout);const Be=V.detectedLayouts.find(Nl=>Nl.layout===V.suggestedLayout);Be!=null&&Be.existingPlugins.length&&Z(Be.existingPlugins[0])}).catch(()=>{}).finally(()=>j(!1)),je.getConfig().then(m).catch(()=>{})},[]),v.useEffect(()=>{var V;d==="ai"&&((V=Rt.current)==null||V.focus())},[d]),v.useEffect(()=>()=>{var V;(V=bt.current)==null||V.abort()},[]);const Wl=v.useMemo(()=>{var V;return p?((V=p.detectedLayouts.find(Be=>Be.layout===k))==null?void 0:V.existingPlugins)||[]:[]},[p,k]),wt=H==="__new__"?$:H,Vt=p?bv(p.root,k,wt||"{plugin}",N||"{skill}"):"",Sl=v.useMemo(()=>p?p.detectedLayouts.filter(V=>V.layout!==4):[],[p]),P=v.useMemo(()=>{if(!h)return null;for(const V of h.providers)for(const Be of V.models)if(V.id===h.provider&&(V.id==="claude-cli"?h.model===`claude-${Be.id}`:h.model===Be.id))return Be.label;return h.model||null},[h]),it=v.useCallback(()=>{if(!h)return{provider:"claude-cli",model:"sonnet"};const V=h.provider||"claude-cli";let Be=h.model||"sonnet";return V==="claude-cli"&&Be.startsWith("claude-")&&(Be=Be.replace("claude-","")),{provider:V,model:Be}},[h]),Mt=v.useCallback(()=>{var V;(V=bt.current)==null||V.abort(),S(!1)},[]);async function ot(){var Ke;if(Y(null),K(null),X(null),ye([]),!D.trim()){Y("Describe what your skill should do");return}S(!0);const V=new AbortController;bt.current=V;const{provider:Be,model:Nl}=it();try{const tt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D.trim(),provider:Be,model:Nl}),signal:V.signal});if(!tt.ok||!tt.body){let Ve=`HTTP ${tt.status}`;try{const ut=await tt.json();ut.error&&(Ve=ut.error)}catch{}throw new Error(Ve)}const ll=tt.body.getReader(),al=new TextDecoder;let Qt="",jt="";for(;;){const{done:Ve,value:ut}=await ll.read();if(Ve)break;Qt+=al.decode(ut,{stream:!0});const Fl=Qt.split(`
70
+ `);Qt=Fl.pop()||"";for(const Jt of Fl)if(Jt.startsWith("event: "))jt=Jt.slice(7).trim();else if(Jt.startsWith("data: ")){try{const Me=JSON.parse(Jt.slice(6));jt==="progress"?ye($t=>[...$t,{phase:Me.phase,message:Me.message,timestamp:Date.now()}]):jt==="done"||jt==="complete"?(b(Me.name),ie(Me.description),W(Me.model||""),F(Me.allowedTools||""),te(Me.body),Ee((Ke=Me.evals)!=null&&Ke.length?Me.evals:null),X(Me.reasoning),u("manual")):jt==="error"&&(Y(Me.message||Me.description||"Unknown error"),Me.category&&K(Me))}catch{}jt=""}}}catch(tt){tt.name!=="AbortError"&&Y(tt.message)}finally{S(!1),bt.current=null}}async function tl(){if(z(null),!N.trim()){z("Skill name is required");return}if(!I.trim()){z("Description is required");return}if(k!==3&&!wt.trim()){z("Plugin name is required");return}Ce(!0);try{const V=await je.createSkill({name:Gc(N),plugin:wt||"",layout:k,description:I,model:G||void 0,allowedTools:ne||void 0,body:le,evals:pe||void 0});i(V.plugin,V.skill)}catch(V){z(V.message)}finally{Ce(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>u("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:d==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:d==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>u("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:d==="ai"?"rgba(168,85,247,0.15)":"transparent",color:d==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:d==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx($n,{size:12}),"AI-Assisted"]})})]})})]}),x&&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"})]}),!x&&p&&d==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx($n,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:Rt,value:D,onChange:V=>ee(V.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
71
71
 
72
- Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:de,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...Kl,minHeight:"120px"},onKeyDown:G=>{G.key==="Enter"&&(G.metaKey||G.ctrlKey)&&(G.preventDefault(),ot())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),de&&fe.length>0&&n.jsx(Wn,{entries:fe,isRunning:!0}),w&&n.jsx("div",{children:V?n.jsx(hr,{error:V,onRetry:ot,onDismiss:()=>{Y(null),K(null)}}):n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:w}),n.jsx("button",{onClick:ot,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:[de?n.jsx("button",{onClick:wt,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:ot,disabled:!D.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:D.trim()?"#a855f7":"var(--surface-3)",color:D.trim()?"#fff":"var(--text-tertiary)",cursor:D.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx($n,{size:14}),P?`Generate with ${P}`:"Generate 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"}),!de&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>u("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!x&&p&&d==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[L&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx($n,{size:11,color:"#a855f7"})}),n.jsxs("div",{children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Generated"}),n.jsx("span",{className:"mx-1.5",style:{color:"var(--text-tertiary)"},children:"—"}),n.jsx("span",{children:L}),pe&&pe.length>0&&n.jsxs("span",{className:"ml-2 px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"rgba(168,85,247,0.12)",color:"#a855f7"},children:["+",pe.length," test cases"]})]})]}),n.jsx("button",{onClick:()=>{X(null),Ee(null)},className:"flex-shrink-0 w-5 h-5 rounded flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:G=>{G.currentTarget.style.background="var(--surface-3)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),bl.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:bl.map(G=>n.jsx("button",{onClick:()=>{M(G.layout),Z(G.existingPlugins[0]||""),se("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:k===G.layout?"var(--accent)":"var(--surface-3)",color:k===G.layout?"#fff":"var(--text-secondary)",border:`1px solid ${k===G.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:G.label},G.layout))})]}),k!==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:H,onChange:G=>{Z(G.target.value),se("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Kl,children:[Jl.map(G=>n.jsx("option",{value:G,children:G},G)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),H==="__new__"&&n.jsx("input",{type:"text",value:$,onChange:G=>se(Gc(G.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:Kl})]}),n.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:Vt})]}),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:N,onChange:G=>b(Gc(G.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Kl})]}),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:I,onChange:G=>ce(G.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...Kl,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:Q,onChange:G=>W(G.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Kl,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:ne,onChange:G=>F(G.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:Kl})]})]})]}),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(G=>n.jsxs("button",{onClick:()=>J(G),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:he===G?"var(--surface-4)":"transparent",color:he===G?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:he===G?600:400,border:"none",cursor:"pointer"},children:[G==="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:G==="write"?"Write":"Preview"})]},G))})]}),he==="write"?n.jsx("textarea",{value:le,onChange:G=>te(G.target.value),placeholder:`# /my-skill
72
+ Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:de,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...$l,minHeight:"120px"},onKeyDown:V=>{V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),ot())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),de&&fe.length>0&&n.jsx(Wn,{entries:fe,isRunning:!0}),R&&n.jsx("div",{children:Q?n.jsx(hr,{error:Q,onRetry:ot,onDismiss:()=>{Y(null),K(null)}}):n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:R}),n.jsx("button",{onClick:ot,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:[de?n.jsx("button",{onClick:Mt,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:ot,disabled:!D.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:D.trim()?"#a855f7":"var(--surface-3)",color:D.trim()?"#fff":"var(--text-tertiary)",cursor:D.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx($n,{size:14}),P?`Generate with ${P}`:"Generate 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"}),!de&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>u("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!x&&p&&d==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[L&&n.jsx("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx("div",{className:"w-5 h-5 rounded flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx($n,{size:11,color:"#a855f7"})}),n.jsxs("div",{children:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Generated"}),n.jsx("span",{className:"mx-1.5",style:{color:"var(--text-tertiary)"},children:"—"}),n.jsx("span",{children:L}),pe&&pe.length>0&&n.jsxs("span",{className:"ml-2 px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"rgba(168,85,247,0.12)",color:"#a855f7"},children:["+",pe.length," test cases"]})]})]}),n.jsx("button",{onClick:()=>{X(null),Ee(null)},className:"flex-shrink-0 w-5 h-5 rounded flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:V=>{V.currentTarget.style.background="var(--surface-3)"},onMouseLeave:V=>{V.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),Sl.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:Sl.map(V=>n.jsx("button",{onClick:()=>{M(V.layout),Z(V.existingPlugins[0]||""),se("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:k===V.layout?"var(--accent)":"var(--surface-3)",color:k===V.layout?"#fff":"var(--text-secondary)",border:`1px solid ${k===V.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:V.label},V.layout))})]}),k!==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:H,onChange:V=>{Z(V.target.value),se("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:$l,children:[Wl.map(V=>n.jsx("option",{value:V,children:V},V)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),H==="__new__"&&n.jsx("input",{type:"text",value:$,onChange:V=>se(Gc(V.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:Vt})]}),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:N,onChange:V=>b(Gc(V.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:I,onChange:V=>ie(V.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:G,onChange:V=>W(V.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:ne,onChange:V=>F(V.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(V=>n.jsxs("button",{onClick:()=>J(V),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:he===V?"var(--surface-4)":"transparent",color:he===V?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:he===V?600:400,border:"none",cursor:"pointer"},children:[V==="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:V==="write"?"Write":"Preview"})]},V))})]}),he==="write"?n.jsx("textarea",{value:le,onChange:V=>te(V.target.value),placeholder:`# /my-skill
73
73
 
74
74
  You are an expert at...
75
- `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...Kl,minHeight:"150px"}}):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:le.trim()?{__html:Wc(le)}:void 0,children:!le.trim()&&n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),pe&&pe.length>0&&n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx($n,{size:13,color:"#a855f7"}),"Generated Test Cases",n.jsxs("span",{className:"text-[11px] font-normal",style:{color:"var(--text-tertiary)"},children:["(",pe.length," evals will be saved with the skill)"]})]}),n.jsx("div",{className:"space-y-2",children:pe.map(G=>n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"font-medium mb-1",style:{color:"var(--text-primary)"},children:G.name}),n.jsxs("div",{className:"text-[11px] mb-1",style:{color:"var(--text-tertiary)"},children:["Prompt: ",G.prompt.length>120?G.prompt.slice(0,120)+"...":G.prompt]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:G.assertions.map(Be=>n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(168,85,247,0.1)",color:"#a855f7"},children:Be.text.length>50?Be.text.slice(0,50)+"...":Be.text},Be.id))})]},G.id))})]}),C&&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}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:tl,disabled:oe||!N||!I,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:oe||!N||!I?"var(--surface-3)":"var(--accent)",color:oe||!N||!I?"var(--text-tertiary)":"#fff",cursor:oe||!N||!I?"not-allowed":"pointer",border:"none"},children:oe?"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 Sv(){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 Vc({variant:i,message:o,onRetry:d}){const{setMode:u,setSearch:p}=xa(),[y,x]=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:y?n.jsx(Sv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>x(!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:j=>{j.currentTarget.style.opacity="0.9"},onMouseLeave:j=>{j.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"}),d&&n.jsx("button",{onClick:d,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>p(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function bm(){const{state:i,setMobileView:o}=xa();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 Nv(){const{state:i,selectSkill:o,setMode:d,refreshSkills:u}=xa();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(bm,{}),n.jsx(jv,{onCreated:(j,h)=>{d("browse"),u(),o({plugin:j,skill:h,origin:"source"})},onCancel:()=>d("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Vc,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Vc,{variant:"no-skills"}):n.jsx(Vc,{variant:"no-selection"});const{plugin:p,skill:y,origin:x}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(bm,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(bh,{plugin:p,skill:y,origin:x,children:n.jsx(gv,{})},`${p}/${y}`)})]})}function Ev(){return n.jsx(sh,{children:n.jsx(rh,{left:n.jsx(mh,{}),right:n.jsx(Nv,{})})})}th.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(Ev,{})}));
75
+ `,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...$l,minHeight:"150px"}}):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:le.trim()?{__html:Wc(le)}:void 0,children:!le.trim()&&n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),pe&&pe.length>0&&n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx($n,{size:13,color:"#a855f7"}),"Generated Test Cases",n.jsxs("span",{className:"text-[11px] font-normal",style:{color:"var(--text-tertiary)"},children:["(",pe.length," evals will be saved with the skill)"]})]}),n.jsx("div",{className:"space-y-2",children:pe.map(V=>n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"font-medium mb-1",style:{color:"var(--text-primary)"},children:V.name}),n.jsxs("div",{className:"text-[11px] mb-1",style:{color:"var(--text-tertiary)"},children:["Prompt: ",V.prompt.length>120?V.prompt.slice(0,120)+"...":V.prompt]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:V.assertions.map(Be=>n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"rgba(168,85,247,0.1)",color:"#a855f7"},children:Be.text.length>50?Be.text.slice(0,50)+"...":Be.text},Be.id))})]},V.id))})]}),C&&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}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:tl,disabled:oe||!N||!I,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:oe||!N||!I?"var(--surface-3)":"var(--accent)",color:oe||!N||!I?"var(--text-tertiary)":"#fff",cursor:oe||!N||!I?"not-allowed":"pointer",border:"none"},children:oe?"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 Sv(){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 Vc({variant:i,message:o,onRetry:d}){const{setMode:u,setSearch:p}=ha(),[y,x]=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:y?n.jsx(Sv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>x(!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:j=>{j.currentTarget.style.opacity="0.9"},onMouseLeave:j=>{j.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"}),d&&n.jsx("button",{onClick:d,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>p(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function bm(){const{state:i,setMobileView:o}=ha();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 Nv(){const{state:i,selectSkill:o,setMode:d,refreshSkills:u}=ha();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(bm,{}),n.jsx(jv,{onCreated:(j,h)=>{d("browse"),u(),o({plugin:j,skill:h,origin:"source"})},onCancel:()=>d("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(Vc,{variant:"error",message:i.skillsError,onRetry:u}):!i.skillsLoading&&i.skills.length===0?n.jsx(Vc,{variant:"no-skills"}):n.jsx(Vc,{variant:"no-selection"});const{plugin:p,skill:y,origin:x}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(bm,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(bh,{plugin:p,skill:y,origin:x,children:n.jsx(gv,{})},`${p}/${y}`)})]})}function Ev(){return n.jsx(sh,{children:n.jsx(rh,{left:n.jsx(mh,{}),right:n.jsx(Nv,{})})})}th.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(Ev,{})}));