sandboxy 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl

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.
@@ -1,347 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(l){if(l.ep)return;l.ep=!0;const a=n(l);fetch(l.href,a)}})();function Zp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jc={exports:{}},ys={},Nc={exports:{}},U={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var el=Symbol.for("react.element"),em=Symbol.for("react.portal"),tm=Symbol.for("react.fragment"),nm=Symbol.for("react.strict_mode"),rm=Symbol.for("react.profiler"),lm=Symbol.for("react.provider"),sm=Symbol.for("react.context"),am=Symbol.for("react.forward_ref"),im=Symbol.for("react.suspense"),om=Symbol.for("react.memo"),um=Symbol.for("react.lazy"),Fo=Symbol.iterator;function cm(e){return e===null||typeof e!="object"?null:(e=Fo&&e[Fo]||e["@@iterator"],typeof e=="function"?e:null)}var wc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kc=Object.assign,bc={};function tr(e,t,n){this.props=e,this.context=t,this.refs=bc,this.updater=n||wc}tr.prototype.isReactComponent={};tr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};tr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sc(){}Sc.prototype=tr.prototype;function gi(e,t,n){this.props=e,this.context=t,this.refs=bc,this.updater=n||wc}var vi=gi.prototype=new Sc;vi.constructor=gi;kc(vi,tr.prototype);vi.isPureReactComponent=!0;var Oo=Array.isArray,Cc=Object.prototype.hasOwnProperty,yi={current:null},Ec={key:!0,ref:!0,__self:!0,__source:!0};function _c(e,t,n){var r,l={},a=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)Cc.call(t,r)&&!Ec.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:el,type:e,key:a,ref:i,props:l,_owner:yi.current}}function dm(e,t){return{$$typeof:el,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ji(e){return typeof e=="object"&&e!==null&&e.$$typeof===el}function fm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zo=/\/+/g;function Ds(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fm(""+e.key):t.toString(36)}function El(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case el:case em:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+Ds(i,0):r,Oo(l)?(n="",e!=null&&(n=e.replace(zo,"$&/")+"/"),El(l,t,n,"",function(c){return c})):l!=null&&(ji(l)&&(l=dm(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(zo,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",Oo(e))for(var o=0;o<e.length;o++){a=e[o];var u=r+Ds(a,o);i+=El(a,t,n,u,l)}else if(u=cm(e),typeof u=="function")for(e=u.call(e),o=0;!(a=e.next()).done;)a=a.value,u=r+Ds(a,o++),i+=El(a,t,n,u,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ol(e,t,n){if(e==null)return e;var r=[],l=0;return El(e,r,"","",function(a){return t.call(n,a,l++)}),r}function pm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Te={current:null},_l={transition:null},mm={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:_l,ReactCurrentOwner:yi};function Rc(){throw Error("act(...) is not supported in production builds of React.")}U.Children={map:ol,forEach:function(e,t,n){ol(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ol(e,function(){t++}),t},toArray:function(e){return ol(e,function(t){return t})||[]},only:function(e){if(!ji(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};U.Component=tr;U.Fragment=tm;U.Profiler=rm;U.PureComponent=gi;U.StrictMode=nm;U.Suspense=im;U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mm;U.act=Rc;U.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=kc({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=yi.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Cc.call(t,u)&&!Ec.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:el,type:e.type,key:l,ref:a,props:r,_owner:i}};U.createContext=function(e){return e={$$typeof:sm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lm,_context:e},e.Consumer=e};U.createElement=_c;U.createFactory=function(e){var t=_c.bind(null,e);return t.type=e,t};U.createRef=function(){return{current:null}};U.forwardRef=function(e){return{$$typeof:am,render:e}};U.isValidElement=ji;U.lazy=function(e){return{$$typeof:um,_payload:{_status:-1,_result:e},_init:pm}};U.memo=function(e,t){return{$$typeof:om,type:e,compare:t===void 0?null:t}};U.startTransition=function(e){var t=_l.transition;_l.transition={};try{e()}finally{_l.transition=t}};U.unstable_act=Rc;U.useCallback=function(e,t){return Te.current.useCallback(e,t)};U.useContext=function(e){return Te.current.useContext(e)};U.useDebugValue=function(){};U.useDeferredValue=function(e){return Te.current.useDeferredValue(e)};U.useEffect=function(e,t){return Te.current.useEffect(e,t)};U.useId=function(){return Te.current.useId()};U.useImperativeHandle=function(e,t,n){return Te.current.useImperativeHandle(e,t,n)};U.useInsertionEffect=function(e,t){return Te.current.useInsertionEffect(e,t)};U.useLayoutEffect=function(e,t){return Te.current.useLayoutEffect(e,t)};U.useMemo=function(e,t){return Te.current.useMemo(e,t)};U.useReducer=function(e,t,n){return Te.current.useReducer(e,t,n)};U.useRef=function(e){return Te.current.useRef(e)};U.useState=function(e){return Te.current.useState(e)};U.useSyncExternalStore=function(e,t,n){return Te.current.useSyncExternalStore(e,t,n)};U.useTransition=function(){return Te.current.useTransition()};U.version="18.3.1";Nc.exports=U;var h=Nc.exports;const hm=Zp(h);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var xm=h,gm=Symbol.for("react.element"),vm=Symbol.for("react.fragment"),ym=Object.prototype.hasOwnProperty,jm=xm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Nm={key:!0,ref:!0,__self:!0,__source:!0};function Tc(e,t,n){var r,l={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)ym.call(t,r)&&!Nm.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:gm,type:e,key:a,ref:i,props:l,_owner:jm.current}}ys.Fragment=vm;ys.jsx=Tc;ys.jsxs=Tc;jc.exports=ys;var s=jc.exports,xa={},Ac={exports:{}},Ve={},Pc={exports:{}},Lc={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(w,b){var C=w.length;w.push(b);e:for(;0<C;){var M=C-1>>>1,I=w[M];if(0<l(I,b))w[M]=b,w[C]=I,C=M;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var b=w[0],C=w.pop();if(C!==b){w[0]=C;e:for(var M=0,I=w.length,J=I>>>1;M<J;){var Z=2*(M+1)-1,nt=w[Z],Qe=Z+1,rt=w[Qe];if(0>l(nt,C))Qe<I&&0>l(rt,nt)?(w[M]=rt,w[Qe]=C,M=Qe):(w[M]=nt,w[Z]=C,M=Z);else if(Qe<I&&0>l(rt,C))w[M]=rt,w[Qe]=C,M=Qe;else break e}}return b}function l(w,b){var C=w.sortIndex-b.sortIndex;return C!==0?C:w.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var u=[],c=[],p=1,f=null,x=3,v=!1,N=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(w){for(var b=n(c);b!==null;){if(b.callback===null)r(c);else if(b.startTime<=w)r(c),b.sortIndex=b.expirationTime,t(u,b);else break;b=n(c)}}function S(w){if(y=!1,g(w),!N)if(n(u)!==null)N=!0,R(k);else{var b=n(c);b!==null&&E(S,b.startTime-w)}}function k(w,b){N=!1,y&&(y=!1,m(L),L=-1),v=!0;var C=x;try{for(g(b),f=n(u);f!==null&&(!(f.expirationTime>b)||w&&!B());){var M=f.callback;if(typeof M=="function"){f.callback=null,x=f.priorityLevel;var I=M(f.expirationTime<=b);b=e.unstable_now(),typeof I=="function"?f.callback=I:f===n(u)&&r(u),g(b)}else r(u);f=n(u)}if(f!==null)var J=!0;else{var Z=n(c);Z!==null&&E(S,Z.startTime-b),J=!1}return J}finally{f=null,x=C,v=!1}}var T=!1,A=null,L=-1,O=5,F=-1;function B(){return!(e.unstable_now()-F<O)}function Y(){if(A!==null){var w=e.unstable_now();F=w;var b=!0;try{b=A(!0,w)}finally{b?le():(T=!1,A=null)}}else T=!1}var le;if(typeof d=="function")le=function(){d(Y)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,_=se.port2;se.port1.onmessage=Y,le=function(){_.postMessage(null)}}else le=function(){j(Y,0)};function R(w){A=w,T||(T=!0,le())}function E(w,b){L=j(function(){w(e.unstable_now())},b)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(w){w.callback=null},e.unstable_continueExecution=function(){N||v||(N=!0,R(k))},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(w){switch(x){case 1:case 2:case 3:var b=3;break;default:b=x}var C=x;x=b;try{return w()}finally{x=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,b){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var C=x;x=w;try{return b()}finally{x=C}},e.unstable_scheduleCallback=function(w,b,C){var M=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?M+C:M):C=M,w){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=C+I,w={id:p++,callback:b,priorityLevel:w,startTime:C,expirationTime:I,sortIndex:-1},C>M?(w.sortIndex=C,t(c,w),n(u)===null&&w===n(c)&&(y?(m(L),L=-1):y=!0,E(S,C-M))):(w.sortIndex=I,t(u,w),N||v||(N=!0,R(k))),w},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(w){var b=x;return function(){var C=x;x=b;try{return w.apply(this,arguments)}finally{x=C}}}})(Lc);Pc.exports=Lc;var wm=Pc.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var km=h,He=wm;function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var Mc=new Set,Rr={};function jn(e,t){Yn(e,t),Yn(e+"Capture",t)}function Yn(e,t){for(Rr[e]=t,e=0;e<t.length;e++)Mc.add(t[e])}var Et=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ga=Object.prototype.hasOwnProperty,bm=/^[: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]*$/,Do={},Io={};function Sm(e){return ga.call(Io,e)?!0:ga.call(Do,e)?!1:bm.test(e)?Io[e]=!0:(Do[e]=!0,!1)}function Cm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Em(e,t,n,r){if(t===null||typeof t>"u"||Cm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ae(e,t,n,r,l,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Ae(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ni=/[\-:]([a-z])/g;function wi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ni,wi);ye[t]=new Ae(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ni,wi);ye[t]=new Ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ni,wi);ye[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function ki(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Em(t,n,l,r)&&(n=null),r||l===null?Sm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Lt=km.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ul=Symbol.for("react.element"),Cn=Symbol.for("react.portal"),En=Symbol.for("react.fragment"),bi=Symbol.for("react.strict_mode"),va=Symbol.for("react.profiler"),Fc=Symbol.for("react.provider"),Oc=Symbol.for("react.context"),Si=Symbol.for("react.forward_ref"),ya=Symbol.for("react.suspense"),ja=Symbol.for("react.suspense_list"),Ci=Symbol.for("react.memo"),Ot=Symbol.for("react.lazy"),zc=Symbol.for("react.offscreen"),$o=Symbol.iterator;function ar(e){return e===null||typeof e!="object"?null:(e=$o&&e[$o]||e["@@iterator"],typeof e=="function"?e:null)}var re=Object.assign,Is;function hr(e){if(Is===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Is=t&&t[1]||""}return`
34
- `+Is+e}var $s=!1;function Bs(e,t){if(!e||$s)return"";$s=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
35
- `),a=r.stack.split(`
36
- `),i=l.length-1,o=a.length-1;1<=i&&0<=o&&l[i]!==a[o];)o--;for(;1<=i&&0<=o;i--,o--)if(l[i]!==a[o]){if(i!==1||o!==1)do if(i--,o--,0>o||l[i]!==a[o]){var u=`
37
- `+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=o);break}}}finally{$s=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hr(e):""}function _m(e){switch(e.tag){case 5:return hr(e.type);case 16:return hr("Lazy");case 13:return hr("Suspense");case 19:return hr("SuspenseList");case 0:case 2:case 15:return e=Bs(e.type,!1),e;case 11:return e=Bs(e.type.render,!1),e;case 1:return e=Bs(e.type,!0),e;default:return""}}function Na(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case En:return"Fragment";case Cn:return"Portal";case va:return"Profiler";case bi:return"StrictMode";case ya:return"Suspense";case ja:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oc:return(e.displayName||"Context")+".Consumer";case Fc:return(e._context.displayName||"Context")+".Provider";case Si:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ci:return t=e.displayName||null,t!==null?t:Na(e.type)||"Memo";case Ot:t=e._payload,e=e._init;try{return Na(e(t))}catch{}}return null}function Rm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Na(t);case 8:return t===bi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tm(e){var t=Dc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cl(e){e._valueTracker||(e._valueTracker=Tm(e))}function Ic(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bl(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}}function wa(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Gt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $c(e,t){t=t.checked,t!=null&&ki(e,"checked",t,!1)}function ka(e,t){$c(e,t);var n=Gt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ba(e,t.type,n):t.hasOwnProperty("defaultValue")&&ba(e,t.type,Gt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Uo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ba(e,t,n){(t!=="number"||Bl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var xr=Array.isArray;function $n(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Gt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Sa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ho(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(xr(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Gt(n)}}function Bc(e,t){var n=Gt(t.value),r=Gt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Vo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Uc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ca(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Uc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dl,Hc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(dl=dl||document.createElement("div"),dl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Am=["Webkit","ms","Moz","O"];Object.keys(jr).forEach(function(e){Am.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),jr[t]=jr[e]})});function Vc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||jr.hasOwnProperty(e)&&jr[e]?(""+t).trim():t+"px"}function Wc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Vc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Pm=re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ea(e,t){if(t){if(Pm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function _a(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ra=null;function Ei(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ta=null,Bn=null,Un=null;function Wo(e){if(e=rl(e)){if(typeof Ta!="function")throw Error(P(280));var t=e.stateNode;t&&(t=bs(t),Ta(e.stateNode,e.type,t))}}function Yc(e){Bn?Un?Un.push(e):Un=[e]:Bn=e}function Qc(){if(Bn){var e=Bn,t=Un;if(Un=Bn=null,Wo(e),t)for(e=0;e<t.length;e++)Wo(t[e])}}function Kc(e,t){return e(t)}function qc(){}var Us=!1;function Jc(e,t,n){if(Us)return e(t,n);Us=!0;try{return Kc(e,t,n)}finally{Us=!1,(Bn!==null||Un!==null)&&(qc(),Qc())}}function Ar(e,t){var n=e.stateNode;if(n===null)return null;var r=bs(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var Aa=!1;if(Et)try{var ir={};Object.defineProperty(ir,"passive",{get:function(){Aa=!0}}),window.addEventListener("test",ir,ir),window.removeEventListener("test",ir,ir)}catch{Aa=!1}function Lm(e,t,n,r,l,a,i,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var Nr=!1,Ul=null,Hl=!1,Pa=null,Mm={onError:function(e){Nr=!0,Ul=e}};function Fm(e,t,n,r,l,a,i,o,u){Nr=!1,Ul=null,Lm.apply(Mm,arguments)}function Om(e,t,n,r,l,a,i,o,u){if(Fm.apply(this,arguments),Nr){if(Nr){var c=Ul;Nr=!1,Ul=null}else throw Error(P(198));Hl||(Hl=!0,Pa=c)}}function Nn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gc(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 Yo(e){if(Nn(e)!==e)throw Error(P(188))}function zm(e){var t=e.alternate;if(!t){if(t=Nn(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var a=l.alternate;if(a===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===n)return Yo(l),e;if(a===r)return Yo(l),t;a=a.sibling}throw Error(P(188))}if(n.return!==r.return)n=l,r=a;else{for(var i=!1,o=l.child;o;){if(o===n){i=!0,n=l,r=a;break}if(o===r){i=!0,r=l,n=a;break}o=o.sibling}if(!i){for(o=a.child;o;){if(o===n){i=!0,n=a,r=l;break}if(o===r){i=!0,r=a,n=l;break}o=o.sibling}if(!i)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function Xc(e){return e=zm(e),e!==null?Zc(e):null}function Zc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zc(e);if(t!==null)return t;e=e.sibling}return null}var ed=He.unstable_scheduleCallback,Qo=He.unstable_cancelCallback,Dm=He.unstable_shouldYield,Im=He.unstable_requestPaint,ie=He.unstable_now,$m=He.unstable_getCurrentPriorityLevel,_i=He.unstable_ImmediatePriority,td=He.unstable_UserBlockingPriority,Vl=He.unstable_NormalPriority,Bm=He.unstable_LowPriority,nd=He.unstable_IdlePriority,js=null,xt=null;function Um(e){if(xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(js,e,void 0,(e.current.flags&128)===128)}catch{}}var ot=Math.clz32?Math.clz32:Wm,Hm=Math.log,Vm=Math.LN2;function Wm(e){return e>>>=0,e===0?32:31-(Hm(e)/Vm|0)|0}var fl=64,pl=4194304;function gr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=gr(o):(a&=i,a!==0&&(r=gr(a)))}else i=n&~l,i!==0?r=gr(i):a!==0&&(r=gr(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,a=t&-t,l>=a||l===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ot(t),l=1<<n,r|=e[n],t&=~l;return r}function Ym(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-ot(a),o=1<<i,u=l[i];u===-1?(!(o&n)||o&r)&&(l[i]=Ym(o,t)):u<=t&&(e.expiredLanes|=o),a&=~o}}function La(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function rd(){var e=fl;return fl<<=1,!(fl&4194240)&&(fl=64),e}function Hs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ot(t),e[t]=n}function Km(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-ot(n),a=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~a}}function Ri(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var W=0;function ld(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var sd,Ti,ad,id,od,Ma=!1,ml=[],Ut=null,Ht=null,Vt=null,Pr=new Map,Lr=new Map,Dt=[],qm="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 submit".split(" ");function Ko(e,t){switch(e){case"focusin":case"focusout":Ut=null;break;case"dragenter":case"dragleave":Ht=null;break;case"mouseover":case"mouseout":Vt=null;break;case"pointerover":case"pointerout":Pr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lr.delete(t.pointerId)}}function or(e,t,n,r,l,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},t!==null&&(t=rl(t),t!==null&&Ti(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Jm(e,t,n,r,l){switch(t){case"focusin":return Ut=or(Ut,e,t,n,r,l),!0;case"dragenter":return Ht=or(Ht,e,t,n,r,l),!0;case"mouseover":return Vt=or(Vt,e,t,n,r,l),!0;case"pointerover":var a=l.pointerId;return Pr.set(a,or(Pr.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,Lr.set(a,or(Lr.get(a)||null,e,t,n,r,l)),!0}return!1}function ud(e){var t=an(e.target);if(t!==null){var n=Nn(t);if(n!==null){if(t=n.tag,t===13){if(t=Gc(n),t!==null){e.blockedOn=t,od(e.priority,function(){ad(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ra=r,n.target.dispatchEvent(r),Ra=null}else return t=rl(n),t!==null&&Ti(t),e.blockedOn=n,!1;t.shift()}return!0}function qo(e,t,n){Rl(e)&&n.delete(t)}function Gm(){Ma=!1,Ut!==null&&Rl(Ut)&&(Ut=null),Ht!==null&&Rl(Ht)&&(Ht=null),Vt!==null&&Rl(Vt)&&(Vt=null),Pr.forEach(qo),Lr.forEach(qo)}function ur(e,t){e.blockedOn===t&&(e.blockedOn=null,Ma||(Ma=!0,He.unstable_scheduleCallback(He.unstable_NormalPriority,Gm)))}function Mr(e){function t(l){return ur(l,e)}if(0<ml.length){ur(ml[0],e);for(var n=1;n<ml.length;n++){var r=ml[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ut!==null&&ur(Ut,e),Ht!==null&&ur(Ht,e),Vt!==null&&ur(Vt,e),Pr.forEach(t),Lr.forEach(t),n=0;n<Dt.length;n++)r=Dt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Dt.length&&(n=Dt[0],n.blockedOn===null);)ud(n),n.blockedOn===null&&Dt.shift()}var Hn=Lt.ReactCurrentBatchConfig,Yl=!0;function Xm(e,t,n,r){var l=W,a=Hn.transition;Hn.transition=null;try{W=1,Ai(e,t,n,r)}finally{W=l,Hn.transition=a}}function Zm(e,t,n,r){var l=W,a=Hn.transition;Hn.transition=null;try{W=4,Ai(e,t,n,r)}finally{W=l,Hn.transition=a}}function Ai(e,t,n,r){if(Yl){var l=Fa(e,t,n,r);if(l===null)Zs(e,t,r,Ql,n),Ko(e,r);else if(Jm(l,e,t,n,r))r.stopPropagation();else if(Ko(e,r),t&4&&-1<qm.indexOf(e)){for(;l!==null;){var a=rl(l);if(a!==null&&sd(a),a=Fa(e,t,n,r),a===null&&Zs(e,t,r,Ql,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else Zs(e,t,r,null,n)}}var Ql=null;function Fa(e,t,n,r){if(Ql=null,e=Ei(r),e=an(e),e!==null)if(t=Nn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ql=e,null}function cd(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch($m()){case _i:return 1;case td:return 4;case Vl:case Bm:return 16;case nd:return 536870912;default:return 16}default:return 16}}var $t=null,Pi=null,Tl=null;function dd(){if(Tl)return Tl;var e,t=Pi,n=t.length,r,l="value"in $t?$t.value:$t.textContent,a=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[a-r];r++);return Tl=l.slice(e,1<r?1-r:void 0)}function Al(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 hl(){return!0}function Jo(){return!1}function We(e){function t(n,r,l,a,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?hl:Jo,this.isPropagationStopped=Jo,this}return re(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),t}var nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Li=We(nr),nl=re({},nr,{view:0,detail:0}),e0=We(nl),Vs,Ws,cr,Ns=re({},nl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mi,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!==cr&&(cr&&e.type==="mousemove"?(Vs=e.screenX-cr.screenX,Ws=e.screenY-cr.screenY):Ws=Vs=0,cr=e),Vs)},movementY:function(e){return"movementY"in e?e.movementY:Ws}}),Go=We(Ns),t0=re({},Ns,{dataTransfer:0}),n0=We(t0),r0=re({},nl,{relatedTarget:0}),Ys=We(r0),l0=re({},nr,{animationName:0,elapsedTime:0,pseudoElement:0}),s0=We(l0),a0=re({},nr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),i0=We(a0),o0=re({},nr,{data:0}),Xo=We(o0),u0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},c0={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"},d0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function f0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=d0[e])?!!t[e]:!1}function Mi(){return f0}var p0=re({},nl,{key:function(e){if(e.key){var t=u0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?c0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mi,charCode:function(e){return e.type==="keypress"?Al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),m0=We(p0),h0=re({},Ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zo=We(h0),x0=re({},nl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mi}),g0=We(x0),v0=re({},nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),y0=We(v0),j0=re({},Ns,{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}),N0=We(j0),w0=[9,13,27,32],Fi=Et&&"CompositionEvent"in window,wr=null;Et&&"documentMode"in document&&(wr=document.documentMode);var k0=Et&&"TextEvent"in window&&!wr,fd=Et&&(!Fi||wr&&8<wr&&11>=wr),eu=" ",tu=!1;function pd(e,t){switch(e){case"keyup":return w0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function md(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _n=!1;function b0(e,t){switch(e){case"compositionend":return md(t);case"keypress":return t.which!==32?null:(tu=!0,eu);case"textInput":return e=t.data,e===eu&&tu?null:e;default:return null}}function S0(e,t){if(_n)return e==="compositionend"||!Fi&&pd(e,t)?(e=dd(),Tl=Pi=$t=null,_n=!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 fd&&t.locale!=="ko"?null:t.data;default:return null}}var C0={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 nu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!C0[e.type]:t==="textarea"}function hd(e,t,n,r){Yc(r),t=Kl(t,"onChange"),0<t.length&&(n=new Li("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var kr=null,Fr=null;function E0(e){Cd(e,0)}function ws(e){var t=An(e);if(Ic(t))return e}function _0(e,t){if(e==="change")return t}var xd=!1;if(Et){var Qs;if(Et){var Ks="oninput"in document;if(!Ks){var ru=document.createElement("div");ru.setAttribute("oninput","return;"),Ks=typeof ru.oninput=="function"}Qs=Ks}else Qs=!1;xd=Qs&&(!document.documentMode||9<document.documentMode)}function lu(){kr&&(kr.detachEvent("onpropertychange",gd),Fr=kr=null)}function gd(e){if(e.propertyName==="value"&&ws(Fr)){var t=[];hd(t,Fr,e,Ei(e)),Jc(E0,t)}}function R0(e,t,n){e==="focusin"?(lu(),kr=t,Fr=n,kr.attachEvent("onpropertychange",gd)):e==="focusout"&&lu()}function T0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ws(Fr)}function A0(e,t){if(e==="click")return ws(t)}function P0(e,t){if(e==="input"||e==="change")return ws(t)}function L0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ct=typeof Object.is=="function"?Object.is:L0;function Or(e,t){if(ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!ga.call(t,l)||!ct(e[l],t[l]))return!1}return!0}function su(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function au(e,t){var n=su(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=su(n)}}function vd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yd(){for(var e=window,t=Bl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bl(e.document)}return t}function Oi(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")}function M0(e){var t=yd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vd(n.ownerDocument.documentElement,n)){if(r!==null&&Oi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,a=Math.min(r.start,l);r=r.end===void 0?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=au(n,a);var i=au(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var F0=Et&&"documentMode"in document&&11>=document.documentMode,Rn=null,Oa=null,br=null,za=!1;function iu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;za||Rn==null||Rn!==Bl(r)||(r=Rn,"selectionStart"in r&&Oi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),br&&Or(br,r)||(br=r,r=Kl(Oa,"onSelect"),0<r.length&&(t=new Li("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rn)))}function xl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tn={animationend:xl("Animation","AnimationEnd"),animationiteration:xl("Animation","AnimationIteration"),animationstart:xl("Animation","AnimationStart"),transitionend:xl("Transition","TransitionEnd")},qs={},jd={};Et&&(jd=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);function ks(e){if(qs[e])return qs[e];if(!Tn[e])return e;var t=Tn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jd)return qs[e]=t[n];return e}var Nd=ks("animationend"),wd=ks("animationiteration"),kd=ks("animationstart"),bd=ks("transitionend"),Sd=new Map,ou="abort auxClick 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(" ");function tn(e,t){Sd.set(e,t),jn(t,[e])}for(var Js=0;Js<ou.length;Js++){var Gs=ou[Js],O0=Gs.toLowerCase(),z0=Gs[0].toUpperCase()+Gs.slice(1);tn(O0,"on"+z0)}tn(Nd,"onAnimationEnd");tn(wd,"onAnimationIteration");tn(kd,"onAnimationStart");tn("dblclick","onDoubleClick");tn("focusin","onFocus");tn("focusout","onBlur");tn(bd,"onTransitionEnd");Yn("onMouseEnter",["mouseout","mouseover"]);Yn("onMouseLeave",["mouseout","mouseover"]);Yn("onPointerEnter",["pointerout","pointerover"]);Yn("onPointerLeave",["pointerout","pointerover"]);jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));jn("onBeforeInput",["compositionend","keypress","textInput","paste"]);jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vr="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(" "),D0=new Set("cancel close invalid load scroll toggle".split(" ").concat(vr));function uu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Om(r,t,void 0,e),e.currentTarget=null}function Cd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==a&&l.isPropagationStopped())break e;uu(l,o,c),a=u}else for(i=0;i<r.length;i++){if(o=r[i],u=o.instance,c=o.currentTarget,o=o.listener,u!==a&&l.isPropagationStopped())break e;uu(l,o,c),a=u}}}if(Hl)throw e=Pa,Hl=!1,Pa=null,e}function K(e,t){var n=t[Ua];n===void 0&&(n=t[Ua]=new Set);var r=e+"__bubble";n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Xs(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var gl="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[gl]){e[gl]=!0,Mc.forEach(function(n){n!=="selectionchange"&&(D0.has(n)||Xs(n,!1,e),Xs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gl]||(t[gl]=!0,Xs("selectionchange",!1,t))}}function Ed(e,t,n,r){switch(cd(t)){case 1:var l=Xm;break;case 4:l=Zm;break;default:l=Ai}n=l.bind(null,t,n,e),l=void 0,!Aa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function Zs(e,t,n,r,l){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;i=i.return}for(;o!==null;){if(i=an(o),i===null)return;if(u=i.tag,u===5||u===6){r=a=i;continue e}o=o.parentNode}}r=r.return}Jc(function(){var c=a,p=Ei(n),f=[];e:{var x=Sd.get(e);if(x!==void 0){var v=Li,N=e;switch(e){case"keypress":if(Al(n)===0)break e;case"keydown":case"keyup":v=m0;break;case"focusin":N="focus",v=Ys;break;case"focusout":N="blur",v=Ys;break;case"beforeblur":case"afterblur":v=Ys;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=Go;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=n0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=g0;break;case Nd:case wd:case kd:v=s0;break;case bd:v=y0;break;case"scroll":v=e0;break;case"wheel":v=N0;break;case"copy":case"cut":case"paste":v=i0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Zo}var y=(t&4)!==0,j=!y&&e==="scroll",m=y?x!==null?x+"Capture":null:x;y=[];for(var d=c,g;d!==null;){g=d;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,m!==null&&(S=Ar(d,m),S!=null&&y.push(Dr(d,S,g)))),j)break;d=d.return}0<y.length&&(x=new v(x,N,null,n,p),f.push({event:x,listeners:y}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",x&&n!==Ra&&(N=n.relatedTarget||n.fromElement)&&(an(N)||N[_t]))break e;if((v||x)&&(x=p.window===p?p:(x=p.ownerDocument)?x.defaultView||x.parentWindow:window,v?(N=n.relatedTarget||n.toElement,v=c,N=N?an(N):null,N!==null&&(j=Nn(N),N!==j||N.tag!==5&&N.tag!==6)&&(N=null)):(v=null,N=c),v!==N)){if(y=Go,S="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(y=Zo,S="onPointerLeave",m="onPointerEnter",d="pointer"),j=v==null?x:An(v),g=N==null?x:An(N),x=new y(S,d+"leave",v,n,p),x.target=j,x.relatedTarget=g,S=null,an(p)===c&&(y=new y(m,d+"enter",N,n,p),y.target=g,y.relatedTarget=j,S=y),j=S,v&&N)t:{for(y=v,m=N,d=0,g=y;g;g=kn(g))d++;for(g=0,S=m;S;S=kn(S))g++;for(;0<d-g;)y=kn(y),d--;for(;0<g-d;)m=kn(m),g--;for(;d--;){if(y===m||m!==null&&y===m.alternate)break t;y=kn(y),m=kn(m)}y=null}else y=null;v!==null&&cu(f,x,v,y,!1),N!==null&&j!==null&&cu(f,j,N,y,!0)}}e:{if(x=c?An(c):window,v=x.nodeName&&x.nodeName.toLowerCase(),v==="select"||v==="input"&&x.type==="file")var k=_0;else if(nu(x))if(xd)k=P0;else{k=T0;var T=R0}else(v=x.nodeName)&&v.toLowerCase()==="input"&&(x.type==="checkbox"||x.type==="radio")&&(k=A0);if(k&&(k=k(e,c))){hd(f,k,n,p);break e}T&&T(e,x,c),e==="focusout"&&(T=x._wrapperState)&&T.controlled&&x.type==="number"&&ba(x,"number",x.value)}switch(T=c?An(c):window,e){case"focusin":(nu(T)||T.contentEditable==="true")&&(Rn=T,Oa=c,br=null);break;case"focusout":br=Oa=Rn=null;break;case"mousedown":za=!0;break;case"contextmenu":case"mouseup":case"dragend":za=!1,iu(f,n,p);break;case"selectionchange":if(F0)break;case"keydown":case"keyup":iu(f,n,p)}var A;if(Fi)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else _n?pd(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(fd&&n.locale!=="ko"&&(_n||L!=="onCompositionStart"?L==="onCompositionEnd"&&_n&&(A=dd()):($t=p,Pi="value"in $t?$t.value:$t.textContent,_n=!0)),T=Kl(c,L),0<T.length&&(L=new Xo(L,e,null,n,p),f.push({event:L,listeners:T}),A?L.data=A:(A=md(n),A!==null&&(L.data=A)))),(A=k0?b0(e,n):S0(e,n))&&(c=Kl(c,"onBeforeInput"),0<c.length&&(p=new Xo("onBeforeInput","beforeinput",null,n,p),f.push({event:p,listeners:c}),p.data=A))}Cd(f,t)})}function Dr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=Ar(e,n),a!=null&&r.unshift(Dr(e,a,l)),a=Ar(e,t),a!=null&&r.push(Dr(e,a,l))),e=e.return}return r}function kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function cu(e,t,n,r,l){for(var a=t._reactName,i=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,l?(u=Ar(n,a),u!=null&&i.unshift(Dr(n,u,o))):l||(u=Ar(n,a),u!=null&&i.push(Dr(n,u,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var I0=/\r\n?/g,$0=/\u0000|\uFFFD/g;function du(e){return(typeof e=="string"?e:""+e).replace(I0,`
38
- `).replace($0,"")}function vl(e,t,n){if(t=du(t),du(e)!==t&&n)throw Error(P(425))}function ql(){}var Da=null,Ia=null;function $a(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ba=typeof setTimeout=="function"?setTimeout:void 0,B0=typeof clearTimeout=="function"?clearTimeout:void 0,fu=typeof Promise=="function"?Promise:void 0,U0=typeof queueMicrotask=="function"?queueMicrotask:typeof fu<"u"?function(e){return fu.resolve(null).then(e).catch(H0)}:Ba;function H0(e){setTimeout(function(){throw e})}function ea(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Mr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Mr(t)}function Wt(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==="$?")break;if(t==="/$")return null}}return e}function pu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var rr=Math.random().toString(36).slice(2),ht="__reactFiber$"+rr,Ir="__reactProps$"+rr,_t="__reactContainer$"+rr,Ua="__reactEvents$"+rr,V0="__reactListeners$"+rr,W0="__reactHandles$"+rr;function an(e){var t=e[ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pu(e);e!==null;){if(n=e[ht])return n;e=pu(e)}return t}e=n,n=e.parentNode}return null}function rl(e){return e=e[ht]||e[_t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function An(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function bs(e){return e[Ir]||null}var Ha=[],Pn=-1;function nn(e){return{current:e}}function q(e){0>Pn||(e.current=Ha[Pn],Ha[Pn]=null,Pn--)}function Q(e,t){Pn++,Ha[Pn]=e.current,e.current=t}var Xt={},be=nn(Xt),Oe=nn(!1),mn=Xt;function Qn(e,t){var n=e.type.contextTypes;if(!n)return Xt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ze(e){return e=e.childContextTypes,e!=null}function Jl(){q(Oe),q(be)}function mu(e,t,n){if(be.current!==Xt)throw Error(P(168));Q(be,t),Q(Oe,n)}function _d(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(P(108,Rm(e)||"Unknown",l));return re({},n,r)}function Gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xt,mn=be.current,Q(be,e),Q(Oe,Oe.current),!0}function hu(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=_d(e,t,mn),r.__reactInternalMemoizedMergedChildContext=e,q(Oe),q(be),Q(be,e)):q(Oe),Q(Oe,n)}var wt=null,Ss=!1,ta=!1;function Rd(e){wt===null?wt=[e]:wt.push(e)}function Y0(e){Ss=!0,Rd(e)}function rn(){if(!ta&&wt!==null){ta=!0;var e=0,t=W;try{var n=wt;for(W=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wt=null,Ss=!1}catch(l){throw wt!==null&&(wt=wt.slice(e+1)),ed(_i,rn),l}finally{W=t,ta=!1}}return null}var Ln=[],Mn=0,Xl=null,Zl=0,Ke=[],qe=0,hn=null,kt=1,bt="";function ln(e,t){Ln[Mn++]=Zl,Ln[Mn++]=Xl,Xl=e,Zl=t}function Td(e,t,n){Ke[qe++]=kt,Ke[qe++]=bt,Ke[qe++]=hn,hn=e;var r=kt;e=bt;var l=32-ot(r)-1;r&=~(1<<l),n+=1;var a=32-ot(t)+l;if(30<a){var i=l-l%5;a=(r&(1<<i)-1).toString(32),r>>=i,l-=i,kt=1<<32-ot(t)+l|n<<l|r,bt=a+e}else kt=1<<a|n<<l|r,bt=e}function zi(e){e.return!==null&&(ln(e,1),Td(e,1,0))}function Di(e){for(;e===Xl;)Xl=Ln[--Mn],Ln[Mn]=null,Zl=Ln[--Mn],Ln[Mn]=null;for(;e===hn;)hn=Ke[--qe],Ke[qe]=null,bt=Ke[--qe],Ke[qe]=null,kt=Ke[--qe],Ke[qe]=null}var Ue=null,Be=null,X=!1,it=null;function Ad(e,t){var n=Je(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function xu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ue=e,Be=Wt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ue=e,Be=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hn!==null?{id:kt,overflow:bt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Je(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ue=e,Be=null,!0):!1;default:return!1}}function Va(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wa(e){if(X){var t=Be;if(t){var n=t;if(!xu(e,t)){if(Va(e))throw Error(P(418));t=Wt(n.nextSibling);var r=Ue;t&&xu(e,t)?Ad(r,n):(e.flags=e.flags&-4097|2,X=!1,Ue=e)}}else{if(Va(e))throw Error(P(418));e.flags=e.flags&-4097|2,X=!1,Ue=e}}}function gu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ue=e}function yl(e){if(e!==Ue)return!1;if(!X)return gu(e),X=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$a(e.type,e.memoizedProps)),t&&(t=Be)){if(Va(e))throw Pd(),Error(P(418));for(;t;)Ad(e,t),t=Wt(t.nextSibling)}if(gu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Be=Wt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Be=null}}else Be=Ue?Wt(e.stateNode.nextSibling):null;return!0}function Pd(){for(var e=Be;e;)e=Wt(e.nextSibling)}function Kn(){Be=Ue=null,X=!1}function Ii(e){it===null?it=[e]:it.push(e)}var Q0=Lt.ReactCurrentBatchConfig;function dr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var l=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var o=l.refs;i===null?delete o[a]:o[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function jl(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vu(e){var t=e._init;return t(e._payload)}function Ld(e){function t(m,d){if(e){var g=m.deletions;g===null?(m.deletions=[d],m.flags|=16):g.push(d)}}function n(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function r(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function l(m,d){return m=qt(m,d),m.index=0,m.sibling=null,m}function a(m,d,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<d?(m.flags|=2,d):g):(m.flags|=2,d)):(m.flags|=1048576,d)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function o(m,d,g,S){return d===null||d.tag!==6?(d=oa(g,m.mode,S),d.return=m,d):(d=l(d,g),d.return=m,d)}function u(m,d,g,S){var k=g.type;return k===En?p(m,d,g.props.children,S,g.key):d!==null&&(d.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ot&&vu(k)===d.type)?(S=l(d,g.props),S.ref=dr(m,d,g),S.return=m,S):(S=Dl(g.type,g.key,g.props,null,m.mode,S),S.ref=dr(m,d,g),S.return=m,S)}function c(m,d,g,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=ua(g,m.mode,S),d.return=m,d):(d=l(d,g.children||[]),d.return=m,d)}function p(m,d,g,S,k){return d===null||d.tag!==7?(d=dn(g,m.mode,S,k),d.return=m,d):(d=l(d,g),d.return=m,d)}function f(m,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=oa(""+d,m.mode,g),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ul:return g=Dl(d.type,d.key,d.props,null,m.mode,g),g.ref=dr(m,null,d),g.return=m,g;case Cn:return d=ua(d,m.mode,g),d.return=m,d;case Ot:var S=d._init;return f(m,S(d._payload),g)}if(xr(d)||ar(d))return d=dn(d,m.mode,g,null),d.return=m,d;jl(m,d)}return null}function x(m,d,g,S){var k=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:o(m,d,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ul:return g.key===k?u(m,d,g,S):null;case Cn:return g.key===k?c(m,d,g,S):null;case Ot:return k=g._init,x(m,d,k(g._payload),S)}if(xr(g)||ar(g))return k!==null?null:p(m,d,g,S,null);jl(m,g)}return null}function v(m,d,g,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return m=m.get(g)||null,o(d,m,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ul:return m=m.get(S.key===null?g:S.key)||null,u(d,m,S,k);case Cn:return m=m.get(S.key===null?g:S.key)||null,c(d,m,S,k);case Ot:var T=S._init;return v(m,d,g,T(S._payload),k)}if(xr(S)||ar(S))return m=m.get(g)||null,p(d,m,S,k,null);jl(d,S)}return null}function N(m,d,g,S){for(var k=null,T=null,A=d,L=d=0,O=null;A!==null&&L<g.length;L++){A.index>L?(O=A,A=null):O=A.sibling;var F=x(m,A,g[L],S);if(F===null){A===null&&(A=O);break}e&&A&&F.alternate===null&&t(m,A),d=a(F,d,L),T===null?k=F:T.sibling=F,T=F,A=O}if(L===g.length)return n(m,A),X&&ln(m,L),k;if(A===null){for(;L<g.length;L++)A=f(m,g[L],S),A!==null&&(d=a(A,d,L),T===null?k=A:T.sibling=A,T=A);return X&&ln(m,L),k}for(A=r(m,A);L<g.length;L++)O=v(A,m,L,g[L],S),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?L:O.key),d=a(O,d,L),T===null?k=O:T.sibling=O,T=O);return e&&A.forEach(function(B){return t(m,B)}),X&&ln(m,L),k}function y(m,d,g,S){var k=ar(g);if(typeof k!="function")throw Error(P(150));if(g=k.call(g),g==null)throw Error(P(151));for(var T=k=null,A=d,L=d=0,O=null,F=g.next();A!==null&&!F.done;L++,F=g.next()){A.index>L?(O=A,A=null):O=A.sibling;var B=x(m,A,F.value,S);if(B===null){A===null&&(A=O);break}e&&A&&B.alternate===null&&t(m,A),d=a(B,d,L),T===null?k=B:T.sibling=B,T=B,A=O}if(F.done)return n(m,A),X&&ln(m,L),k;if(A===null){for(;!F.done;L++,F=g.next())F=f(m,F.value,S),F!==null&&(d=a(F,d,L),T===null?k=F:T.sibling=F,T=F);return X&&ln(m,L),k}for(A=r(m,A);!F.done;L++,F=g.next())F=v(A,m,L,F.value,S),F!==null&&(e&&F.alternate!==null&&A.delete(F.key===null?L:F.key),d=a(F,d,L),T===null?k=F:T.sibling=F,T=F);return e&&A.forEach(function(Y){return t(m,Y)}),X&&ln(m,L),k}function j(m,d,g,S){if(typeof g=="object"&&g!==null&&g.type===En&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ul:e:{for(var k=g.key,T=d;T!==null;){if(T.key===k){if(k=g.type,k===En){if(T.tag===7){n(m,T.sibling),d=l(T,g.props.children),d.return=m,m=d;break e}}else if(T.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ot&&vu(k)===T.type){n(m,T.sibling),d=l(T,g.props),d.ref=dr(m,T,g),d.return=m,m=d;break e}n(m,T);break}else t(m,T);T=T.sibling}g.type===En?(d=dn(g.props.children,m.mode,S,g.key),d.return=m,m=d):(S=Dl(g.type,g.key,g.props,null,m.mode,S),S.ref=dr(m,d,g),S.return=m,m=S)}return i(m);case Cn:e:{for(T=g.key;d!==null;){if(d.key===T)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){n(m,d.sibling),d=l(d,g.children||[]),d.return=m,m=d;break e}else{n(m,d);break}else t(m,d);d=d.sibling}d=ua(g,m.mode,S),d.return=m,m=d}return i(m);case Ot:return T=g._init,j(m,d,T(g._payload),S)}if(xr(g))return N(m,d,g,S);if(ar(g))return y(m,d,g,S);jl(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(n(m,d.sibling),d=l(d,g),d.return=m,m=d):(n(m,d),d=oa(g,m.mode,S),d.return=m,m=d),i(m)):n(m,d)}return j}var qn=Ld(!0),Md=Ld(!1),es=nn(null),ts=null,Fn=null,$i=null;function Bi(){$i=Fn=ts=null}function Ui(e){var t=es.current;q(es),e._currentValue=t}function Ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vn(e,t){ts=e,$i=Fn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Me=!0),e.firstContext=null)}function Xe(e){var t=e._currentValue;if($i!==e)if(e={context:e,memoizedValue:t,next:null},Fn===null){if(ts===null)throw Error(P(308));Fn=e,ts.dependencies={lanes:0,firstContext:e}}else Fn=Fn.next=e;return t}var on=null;function Hi(e){on===null?on=[e]:on.push(e)}function Fd(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Hi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Rt(e,r)}function Rt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var zt=!1;function Vi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Od(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function St(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Rt(e,n)}return l=r.interleaved,l===null?(t.next=t,Hi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Rt(e,n)}function Pl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ri(e,n)}}function yu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?l=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ns(e,t,n,r){var l=e.updateQueue;zt=!1;var a=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,c=u.next;u.next=null,i===null?a=c:i.next=c,i=u;var p=e.alternate;p!==null&&(p=p.updateQueue,o=p.lastBaseUpdate,o!==i&&(o===null?p.firstBaseUpdate=c:o.next=c,p.lastBaseUpdate=u))}if(a!==null){var f=l.baseState;i=0,p=c=u=null,o=a;do{var x=o.lane,v=o.eventTime;if((r&x)===x){p!==null&&(p=p.next={eventTime:v,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var N=e,y=o;switch(x=t,v=n,y.tag){case 1:if(N=y.payload,typeof N=="function"){f=N.call(v,f,x);break e}f=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=y.payload,x=typeof N=="function"?N.call(v,f,x):N,x==null)break e;f=re({},f,x);break e;case 2:zt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,x=l.effects,x===null?l.effects=[o]:x.push(o))}else v={eventTime:v,lane:x,tag:o.tag,payload:o.payload,callback:o.callback,next:null},p===null?(c=p=v,u=f):p=p.next=v,i|=x;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;x=o,o=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);if(p===null&&(u=f),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else a===null&&(l.shared.lanes=0);gn|=i,e.lanes=i,e.memoizedState=f}}function ju(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(P(191,l));l.call(r)}}}var ll={},gt=nn(ll),$r=nn(ll),Br=nn(ll);function un(e){if(e===ll)throw Error(P(174));return e}function Wi(e,t){switch(Q(Br,t),Q($r,e),Q(gt,ll),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ca(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ca(t,e)}q(gt),Q(gt,t)}function Jn(){q(gt),q($r),q(Br)}function zd(e){un(Br.current);var t=un(gt.current),n=Ca(t,e.type);t!==n&&(Q($r,e),Q(gt,n))}function Yi(e){$r.current===e&&(q(gt),q($r))}var ee=nn(0);function rs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 na=[];function Qi(){for(var e=0;e<na.length;e++)na[e]._workInProgressVersionPrimary=null;na.length=0}var Ll=Lt.ReactCurrentDispatcher,ra=Lt.ReactCurrentBatchConfig,xn=0,te=null,ce=null,pe=null,ls=!1,Sr=!1,Ur=0,K0=0;function je(){throw Error(P(321))}function Ki(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ct(e[n],t[n]))return!1;return!0}function qi(e,t,n,r,l,a){if(xn=a,te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ll.current=e===null||e.memoizedState===null?X0:Z0,e=n(r,l),Sr){a=0;do{if(Sr=!1,Ur=0,25<=a)throw Error(P(301));a+=1,pe=ce=null,t.updateQueue=null,Ll.current=eh,e=n(r,l)}while(Sr)}if(Ll.current=ss,t=ce!==null&&ce.next!==null,xn=0,pe=ce=te=null,ls=!1,t)throw Error(P(300));return e}function Ji(){var e=Ur!==0;return Ur=0,e}function mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pe===null?te.memoizedState=pe=e:pe=pe.next=e,pe}function Ze(){if(ce===null){var e=te.alternate;e=e!==null?e.memoizedState:null}else e=ce.next;var t=pe===null?te.memoizedState:pe.next;if(t!==null)pe=t,ce=e;else{if(e===null)throw Error(P(310));ce=e,e={memoizedState:ce.memoizedState,baseState:ce.baseState,baseQueue:ce.baseQueue,queue:ce.queue,next:null},pe===null?te.memoizedState=pe=e:pe=pe.next=e}return pe}function Hr(e,t){return typeof t=="function"?t(e):t}function la(e){var t=Ze(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=ce,l=r.baseQueue,a=n.pending;if(a!==null){if(l!==null){var i=l.next;l.next=a.next,a.next=i}r.baseQueue=l=a,n.pending=null}if(l!==null){a=l.next,r=r.baseState;var o=i=null,u=null,c=a;do{var p=c.lane;if((xn&p)===p)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=f,i=r):u=u.next=f,te.lanes|=p,gn|=p}c=c.next}while(c!==null&&c!==a);u===null?i=r:u.next=o,ct(r,t.memoizedState)||(Me=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do a=l.lane,te.lanes|=a,gn|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sa(e){var t=Ze(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,a=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do a=e(a,i.action),i=i.next;while(i!==l);ct(a,t.memoizedState)||(Me=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Dd(){}function Id(e,t){var n=te,r=Ze(),l=t(),a=!ct(r.memoizedState,l);if(a&&(r.memoizedState=l,Me=!0),r=r.queue,Gi(Ud.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||pe!==null&&pe.memoizedState.tag&1){if(n.flags|=2048,Vr(9,Bd.bind(null,n,r,l,t),void 0,null),me===null)throw Error(P(349));xn&30||$d(n,t,l)}return l}function $d(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bd(e,t,n,r){t.value=n,t.getSnapshot=r,Hd(t)&&Vd(e)}function Ud(e,t,n){return n(function(){Hd(t)&&Vd(e)})}function Hd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ct(e,n)}catch{return!0}}function Vd(e){var t=Rt(e,1);t!==null&&ut(t,e,1,-1)}function Nu(e){var t=mt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:e},t.queue=e,e=e.dispatch=G0.bind(null,te,e),[t.memoizedState,e]}function Vr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=te.updateQueue,t===null?(t={lastEffect:null,stores:null},te.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Wd(){return Ze().memoizedState}function Ml(e,t,n,r){var l=mt();te.flags|=e,l.memoizedState=Vr(1|t,n,void 0,r===void 0?null:r)}function Cs(e,t,n,r){var l=Ze();r=r===void 0?null:r;var a=void 0;if(ce!==null){var i=ce.memoizedState;if(a=i.destroy,r!==null&&Ki(r,i.deps)){l.memoizedState=Vr(t,n,a,r);return}}te.flags|=e,l.memoizedState=Vr(1|t,n,a,r)}function wu(e,t){return Ml(8390656,8,e,t)}function Gi(e,t){return Cs(2048,8,e,t)}function Yd(e,t){return Cs(4,2,e,t)}function Qd(e,t){return Cs(4,4,e,t)}function Kd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qd(e,t,n){return n=n!=null?n.concat([e]):null,Cs(4,4,Kd.bind(null,t,e),n)}function Xi(){}function Jd(e,t){var n=Ze();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ki(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Gd(e,t){var n=Ze();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ki(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xd(e,t,n){return xn&21?(ct(n,t)||(n=rd(),te.lanes|=n,gn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Me=!0),e.memoizedState=n)}function q0(e,t){var n=W;W=n!==0&&4>n?n:4,e(!0);var r=ra.transition;ra.transition={};try{e(!1),t()}finally{W=n,ra.transition=r}}function Zd(){return Ze().memoizedState}function J0(e,t,n){var r=Kt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ef(e))tf(t,n);else if(n=Fd(e,t,n,r),n!==null){var l=_e();ut(n,e,r,l),nf(n,t,r)}}function G0(e,t,n){var r=Kt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ef(e))tf(t,l);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,o=a(i,n);if(l.hasEagerState=!0,l.eagerState=o,ct(o,i)){var u=t.interleaved;u===null?(l.next=l,Hi(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Fd(e,t,l,r),n!==null&&(l=_e(),ut(n,e,r,l),nf(n,t,r))}}function ef(e){var t=e.alternate;return e===te||t!==null&&t===te}function tf(e,t){Sr=ls=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function nf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ri(e,n)}}var ss={readContext:Xe,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},X0={readContext:Xe,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:Xe,useEffect:wu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ml(4194308,4,Kd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ml(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ml(4,2,e,t)},useMemo:function(e,t){var n=mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=J0.bind(null,te,e),[r.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:Nu,useDebugValue:Xi,useDeferredValue:function(e){return mt().memoizedState=e},useTransition:function(){var e=Nu(!1),t=e[0];return e=q0.bind(null,e[1]),mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=te,l=mt();if(X){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),me===null)throw Error(P(349));xn&30||$d(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,wu(Ud.bind(null,r,a,e),[e]),r.flags|=2048,Vr(9,Bd.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=mt(),t=me.identifierPrefix;if(X){var n=bt,r=kt;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ur++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=K0++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Z0={readContext:Xe,useCallback:Jd,useContext:Xe,useEffect:Gi,useImperativeHandle:qd,useInsertionEffect:Yd,useLayoutEffect:Qd,useMemo:Gd,useReducer:la,useRef:Wd,useState:function(){return la(Hr)},useDebugValue:Xi,useDeferredValue:function(e){var t=Ze();return Xd(t,ce.memoizedState,e)},useTransition:function(){var e=la(Hr)[0],t=Ze().memoizedState;return[e,t]},useMutableSource:Dd,useSyncExternalStore:Id,useId:Zd,unstable_isNewReconciler:!1},eh={readContext:Xe,useCallback:Jd,useContext:Xe,useEffect:Gi,useImperativeHandle:qd,useInsertionEffect:Yd,useLayoutEffect:Qd,useMemo:Gd,useReducer:sa,useRef:Wd,useState:function(){return sa(Hr)},useDebugValue:Xi,useDeferredValue:function(e){var t=Ze();return ce===null?t.memoizedState=e:Xd(t,ce.memoizedState,e)},useTransition:function(){var e=sa(Hr)[0],t=Ze().memoizedState;return[e,t]},useMutableSource:Dd,useSyncExternalStore:Id,useId:Zd,unstable_isNewReconciler:!1};function st(e,t){if(e&&e.defaultProps){t=re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Es={isMounted:function(e){return(e=e._reactInternals)?Nn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Kt(e),a=St(r,l);a.payload=t,n!=null&&(a.callback=n),t=Yt(e,a,l),t!==null&&(ut(t,e,l,r),Pl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Kt(e),a=St(r,l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Yt(e,a,l),t!==null&&(ut(t,e,l,r),Pl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_e(),r=Kt(e),l=St(n,r);l.tag=2,t!=null&&(l.callback=t),t=Yt(e,l,r),t!==null&&(ut(t,e,r,n),Pl(t,e,r))}};function ku(e,t,n,r,l,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!Or(n,r)||!Or(l,a):!0}function rf(e,t,n){var r=!1,l=Xt,a=t.contextType;return typeof a=="object"&&a!==null?a=Xe(a):(l=ze(t)?mn:be.current,r=t.contextTypes,a=(r=r!=null)?Qn(e,l):Xt),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Es,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function bu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Es.enqueueReplaceState(t,t.state,null)}function Ka(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Vi(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Xe(a):(a=ze(t)?mn:be.current,l.context=Qn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Qa(e,t,a,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Es.enqueueReplaceState(l,l.state,null),ns(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Gn(e,t){try{var n="",r=t;do n+=_m(r),r=r.return;while(r);var l=n}catch(a){l=`
39
- Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:l,digest:null}}function aa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function qa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var th=typeof WeakMap=="function"?WeakMap:Map;function lf(e,t,n){n=St(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){is||(is=!0,si=r),qa(e,t)},n}function sf(e,t,n){n=St(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){qa(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){qa(e,t),typeof r!="function"&&(Qt===null?Qt=new Set([this]):Qt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Su(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new th;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=hh.bind(null,e,t,n),t.then(e,e))}function Cu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Eu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=St(-1,1),t.tag=2,Yt(n,t,1))),n.lanes|=1),e)}var nh=Lt.ReactCurrentOwner,Me=!1;function Ce(e,t,n,r){t.child=e===null?Md(t,null,n,r):qn(t,e.child,n,r)}function _u(e,t,n,r,l){n=n.render;var a=t.ref;return Vn(t,l),r=qi(e,t,n,r,a,l),n=Ji(),e!==null&&!Me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Tt(e,t,l)):(X&&n&&zi(t),t.flags|=1,Ce(e,t,r,l),t.child)}function Ru(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!ao(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,af(e,t,a,r,l)):(e=Dl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&l)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:Or,n(i,r)&&e.ref===t.ref)return Tt(e,t,l)}return t.flags|=1,e=qt(a,r),e.ref=t.ref,e.return=t,t.child=e}function af(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(Or(a,r)&&e.ref===t.ref)if(Me=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(Me=!0);else return t.lanes=e.lanes,Tt(e,t,l)}return Ja(e,t,n,r,l)}function of(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Q(zn,$e),$e|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Q(zn,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Q(zn,$e),$e|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Q(zn,$e),$e|=r;return Ce(e,t,l,n),t.child}function uf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ja(e,t,n,r,l){var a=ze(n)?mn:be.current;return a=Qn(t,a),Vn(t,l),n=qi(e,t,n,r,a,l),r=Ji(),e!==null&&!Me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Tt(e,t,l)):(X&&r&&zi(t),t.flags|=1,Ce(e,t,n,l),t.child)}function Tu(e,t,n,r,l){if(ze(n)){var a=!0;Gl(t)}else a=!1;if(Vn(t,l),t.stateNode===null)Fl(e,t),rf(t,n,r),Ka(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Xe(c):(c=ze(n)?mn:be.current,c=Qn(t,c));var p=n.getDerivedStateFromProps,f=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||u!==c)&&bu(t,i,r,c),zt=!1;var x=t.memoizedState;i.state=x,ns(t,r,i,l),u=t.memoizedState,o!==r||x!==u||Oe.current||zt?(typeof p=="function"&&(Qa(t,n,p,r),u=t.memoizedState),(o=zt||ku(t,n,o,r,x,u,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Od(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:st(t.type,o),i.props=c,f=t.pendingProps,x=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Xe(u):(u=ze(n)?mn:be.current,u=Qn(t,u));var v=n.getDerivedStateFromProps;(p=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||x!==u)&&bu(t,i,r,u),zt=!1,x=t.memoizedState,i.state=x,ns(t,r,i,l);var N=t.memoizedState;o!==f||x!==N||Oe.current||zt?(typeof v=="function"&&(Qa(t,n,v,r),N=t.memoizedState),(c=zt||ku(t,n,c,r,x,N,u)||!1)?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,N,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,N,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=N),i.props=r,i.state=N,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return Ga(e,t,n,r,a,l)}function Ga(e,t,n,r,l,a){uf(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&hu(t,n,!1),Tt(e,t,a);r=t.stateNode,nh.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=qn(t,e.child,null,a),t.child=qn(t,null,o,a)):Ce(e,t,o,a),t.memoizedState=r.state,l&&hu(t,n,!0),t.child}function cf(e){var t=e.stateNode;t.pendingContext?mu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&mu(e,t.context,!1),Wi(e,t.containerInfo)}function Au(e,t,n,r,l){return Kn(),Ii(l),t.flags|=256,Ce(e,t,n,r),t.child}var Xa={dehydrated:null,treeContext:null,retryLane:0};function Za(e){return{baseLanes:e,cachePool:null,transitions:null}}function df(e,t,n){var r=t.pendingProps,l=ee.current,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Q(ee,l&1),e===null)return Wa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,a?(r=t.mode,a=t.child,i={mode:"hidden",children:i},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Ts(i,r,0,null),e=dn(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Za(n),t.memoizedState=Xa,e):Zi(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return rh(e,t,i,r,o,l,n);if(a){a=r.fallback,i=t.mode,l=e.child,o=l.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=qt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?a=qt(o,a):(a=dn(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,i=e.child.memoizedState,i=i===null?Za(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=Xa,r}return a=e.child,e=a.sibling,r=qt(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zi(e,t){return t=Ts({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Nl(e,t,n,r){return r!==null&&Ii(r),qn(t,e.child,null,n),e=Zi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rh(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=aa(Error(P(422))),Nl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=Ts({mode:"visible",children:r.children},l,0,null),a=dn(a,l,i,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&qn(t,e.child,null,i),t.child.memoizedState=Za(i),t.memoizedState=Xa,a);if(!(t.mode&1))return Nl(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(P(419)),r=aa(a,r,void 0),Nl(e,t,i,r)}if(o=(i&e.childLanes)!==0,Me||o){if(r=me,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==a.retryLane&&(a.retryLane=l,Rt(e,l),ut(r,e,l,-1))}return so(),r=aa(Error(P(421))),Nl(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=xh.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Be=Wt(l.nextSibling),Ue=t,X=!0,it=null,e!==null&&(Ke[qe++]=kt,Ke[qe++]=bt,Ke[qe++]=hn,kt=e.id,bt=e.overflow,hn=t),t=Zi(t,r.children),t.flags|=4096,t)}function Pu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ya(e.return,t,n)}function ia(e,t,n,r,l){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function ff(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(Ce(e,t,r.children,n),r=ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pu(e,n,t);else if(e.tag===19)Pu(e,n,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}r&=1}if(Q(ee,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&rs(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ia(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&rs(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ia(t,!0,n,null,a);break;case"together":ia(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lh(e,t,n){switch(t.tag){case 3:cf(t),Kn();break;case 5:zd(t);break;case 1:ze(t.type)&&Gl(t);break;case 4:Wi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Q(es,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Q(ee,ee.current&1),t.flags|=128,null):n&t.child.childLanes?df(e,t,n):(Q(ee,ee.current&1),e=Tt(e,t,n),e!==null?e.sibling:null);Q(ee,ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ff(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(ee,ee.current),r)break;return null;case 22:case 23:return t.lanes=0,of(e,t,n)}return Tt(e,t,n)}var pf,ei,mf,hf;pf=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ei=function(){};mf=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,un(gt.current);var a=null;switch(n){case"input":l=wa(e,l),r=wa(e,r),a=[];break;case"select":l=re({},l,{value:void 0}),r=re({},r,{value:void 0}),a=[];break;case"textarea":l=Sa(e,l),r=Sa(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ql)}Ea(n,r);var i;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var o=l[c];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Rr.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var u=r[c];if(o=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(i in o)!o.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&o[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(a=a||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Rr.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&K("scroll",e),a||o===u||(a=[])):(a=a||[]).push(c,u))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};hf=function(e,t,n,r){n!==r&&(t.flags|=4)};function fr(e,t){if(!X)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function sh(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return ze(t.type)&&Jl(),Ne(t),null;case 3:return r=t.stateNode,Jn(),q(Oe),q(be),Qi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(yl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,it!==null&&(oi(it),it=null))),ei(e,t),Ne(t),null;case 5:Yi(t);var l=un(Br.current);if(n=t.type,e!==null&&t.stateNode!=null)mf(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return Ne(t),null}if(e=un(gt.current),yl(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ht]=t,r[Ir]=a,e=(t.mode&1)!==0,n){case"dialog":K("cancel",r),K("close",r);break;case"iframe":case"object":case"embed":K("load",r);break;case"video":case"audio":for(l=0;l<vr.length;l++)K(vr[l],r);break;case"source":K("error",r);break;case"img":case"image":case"link":K("error",r),K("load",r);break;case"details":K("toggle",r);break;case"input":Bo(r,a),K("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},K("invalid",r);break;case"textarea":Ho(r,a),K("invalid",r)}Ea(n,a),l=null;for(var i in a)if(a.hasOwnProperty(i)){var o=a[i];i==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&vl(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&vl(r.textContent,o,e),l=["children",""+o]):Rr.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&K("scroll",r)}switch(n){case"input":cl(r),Uo(r,a,!0);break;case"textarea":cl(r),Vo(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=ql)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Uc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[ht]=t,e[Ir]=r,pf(e,t,!1,!1),t.stateNode=e;e:{switch(i=_a(n,r),n){case"dialog":K("cancel",e),K("close",e),l=r;break;case"iframe":case"object":case"embed":K("load",e),l=r;break;case"video":case"audio":for(l=0;l<vr.length;l++)K(vr[l],e);l=r;break;case"source":K("error",e),l=r;break;case"img":case"image":case"link":K("error",e),K("load",e),l=r;break;case"details":K("toggle",e),l=r;break;case"input":Bo(e,r),l=wa(e,r),K("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=re({},r,{value:void 0}),K("invalid",e);break;case"textarea":Ho(e,r),l=Sa(e,r),K("invalid",e);break;default:l=r}Ea(n,l),o=l;for(a in o)if(o.hasOwnProperty(a)){var u=o[a];a==="style"?Wc(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Hc(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Tr(e,u):typeof u=="number"&&Tr(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Rr.hasOwnProperty(a)?u!=null&&a==="onScroll"&&K("scroll",e):u!=null&&ki(e,a,u,i))}switch(n){case"input":cl(e),Uo(e,r,!1);break;case"textarea":cl(e),Vo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Gt(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?$n(e,!!r.multiple,a,!1):r.defaultValue!=null&&$n(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=ql)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ne(t),null;case 6:if(e&&t.stateNode!=null)hf(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=un(Br.current),un(gt.current),yl(t)){if(r=t.stateNode,n=t.memoizedProps,r[ht]=t,(a=r.nodeValue!==n)&&(e=Ue,e!==null))switch(e.tag){case 3:vl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vl(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ht]=t,t.stateNode=r}return Ne(t),null;case 13:if(q(ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(X&&Be!==null&&t.mode&1&&!(t.flags&128))Pd(),Kn(),t.flags|=98560,a=!1;else if(a=yl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(P(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(P(317));a[ht]=t}else Kn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),a=!1}else it!==null&&(oi(it),it=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ee.current&1?fe===0&&(fe=3):so())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return Jn(),ei(e,t),e===null&&zr(t.stateNode.containerInfo),Ne(t),null;case 10:return Ui(t.type._context),Ne(t),null;case 17:return ze(t.type)&&Jl(),Ne(t),null;case 19:if(q(ee),a=t.memoizedState,a===null)return Ne(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)fr(a,!1);else{if(fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=rs(e),i!==null){for(t.flags|=128,fr(a,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Q(ee,ee.current&1|2),t.child}e=e.sibling}a.tail!==null&&ie()>Xn&&(t.flags|=128,r=!0,fr(a,!1),t.lanes=4194304)}else{if(!r)if(e=rs(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fr(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!X)return Ne(t),null}else 2*ie()-a.renderingStartTime>Xn&&n!==1073741824&&(t.flags|=128,r=!0,fr(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ie(),t.sibling=null,n=ee.current,Q(ee,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return lo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$e&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function ah(e,t){switch(Di(t),t.tag){case 1:return ze(t.type)&&Jl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),q(Oe),q(be),Qi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Yi(t),null;case 13:if(q(ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(ee),null;case 4:return Jn(),null;case 10:return Ui(t.type._context),null;case 22:case 23:return lo(),null;case 24:return null;default:return null}}var wl=!1,we=!1,ih=typeof WeakSet=="function"?WeakSet:Set,z=null;function On(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function ti(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Lu=!1;function oh(e,t){if(Da=Yl,e=yd(),Oi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,o=-1,u=-1,c=0,p=0,f=e,x=null;t:for(;;){for(var v;f!==n||l!==0&&f.nodeType!==3||(o=i+l),f!==a||r!==0&&f.nodeType!==3||(u=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(v=f.firstChild)!==null;)x=f,f=v;for(;;){if(f===e)break t;if(x===n&&++c===l&&(o=i),x===a&&++p===r&&(u=i),(v=f.nextSibling)!==null)break;f=x,x=f.parentNode}f=v}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ia={focusedElem:e,selectionRange:n},Yl=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var y=N.memoizedProps,j=N.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:st(t.type,y),j);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(S){ae(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return N=Lu,Lu=!1,N}function Cr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,a!==void 0&&ti(t,n,a)}l=l.next}while(l!==r)}}function _s(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ni(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function xf(e){var t=e.alternate;t!==null&&(e.alternate=null,xf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ht],delete t[Ir],delete t[Ua],delete t[V0],delete t[W0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gf(e){return e.tag===5||e.tag===3||e.tag===4}function Mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gf(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.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 ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ql));else if(r!==4&&(e=e.child,e!==null))for(ri(e,t,n),e=e.sibling;e!==null;)ri(e,t,n),e=e.sibling}function li(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(li(e,t,n),e=e.sibling;e!==null;)li(e,t,n),e=e.sibling}var he=null,at=!1;function Ft(e,t,n){for(n=n.child;n!==null;)vf(e,t,n),n=n.sibling}function vf(e,t,n){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(js,n)}catch{}switch(n.tag){case 5:we||On(n,t);case 6:var r=he,l=at;he=null,Ft(e,t,n),he=r,at=l,he!==null&&(at?(e=he,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):he.removeChild(n.stateNode));break;case 18:he!==null&&(at?(e=he,n=n.stateNode,e.nodeType===8?ea(e.parentNode,n):e.nodeType===1&&ea(e,n),Mr(e)):ea(he,n.stateNode));break;case 4:r=he,l=at,he=n.stateNode.containerInfo,at=!0,Ft(e,t,n),he=r,at=l;break;case 0:case 11:case 14:case 15:if(!we&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var a=l,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&ti(n,t,i),l=l.next}while(l!==r)}Ft(e,t,n);break;case 1:if(!we&&(On(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ae(n,t,o)}Ft(e,t,n);break;case 21:Ft(e,t,n);break;case 22:n.mode&1?(we=(r=we)||n.memoizedState!==null,Ft(e,t,n),we=r):Ft(e,t,n);break;default:Ft(e,t,n)}}function Fu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ih),t.forEach(function(r){var l=gh.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function lt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var a=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:he=o.stateNode,at=!1;break e;case 3:he=o.stateNode.containerInfo,at=!0;break e;case 4:he=o.stateNode.containerInfo,at=!0;break e}o=o.return}if(he===null)throw Error(P(160));vf(a,i,l),he=null,at=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){ae(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yf(t,e),t=t.sibling}function yf(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lt(t,e),pt(e),r&4){try{Cr(3,e,e.return),_s(3,e)}catch(y){ae(e,e.return,y)}try{Cr(5,e,e.return)}catch(y){ae(e,e.return,y)}}break;case 1:lt(t,e),pt(e),r&512&&n!==null&&On(n,n.return);break;case 5:if(lt(t,e),pt(e),r&512&&n!==null&&On(n,n.return),e.flags&32){var l=e.stateNode;try{Tr(l,"")}catch(y){ae(e,e.return,y)}}if(r&4&&(l=e.stateNode,l!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&$c(l,a),_a(o,i);var c=_a(o,a);for(i=0;i<u.length;i+=2){var p=u[i],f=u[i+1];p==="style"?Wc(l,f):p==="dangerouslySetInnerHTML"?Hc(l,f):p==="children"?Tr(l,f):ki(l,p,f,c)}switch(o){case"input":ka(l,a);break;case"textarea":Bc(l,a);break;case"select":var x=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var v=a.value;v!=null?$n(l,!!a.multiple,v,!1):x!==!!a.multiple&&(a.defaultValue!=null?$n(l,!!a.multiple,a.defaultValue,!0):$n(l,!!a.multiple,a.multiple?[]:"",!1))}l[Ir]=a}catch(y){ae(e,e.return,y)}}break;case 6:if(lt(t,e),pt(e),r&4){if(e.stateNode===null)throw Error(P(162));l=e.stateNode,a=e.memoizedProps;try{l.nodeValue=a}catch(y){ae(e,e.return,y)}}break;case 3:if(lt(t,e),pt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Mr(t.containerInfo)}catch(y){ae(e,e.return,y)}break;case 4:lt(t,e),pt(e);break;case 13:lt(t,e),pt(e),l=e.child,l.flags&8192&&(a=l.memoizedState!==null,l.stateNode.isHidden=a,!a||l.alternate!==null&&l.alternate.memoizedState!==null||(no=ie())),r&4&&Fu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(we=(c=we)||p,lt(t,e),we=c):lt(t,e),pt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(z=e,p=e.child;p!==null;){for(f=z=p;z!==null;){switch(x=z,v=x.child,x.tag){case 0:case 11:case 14:case 15:Cr(4,x,x.return);break;case 1:On(x,x.return);var N=x.stateNode;if(typeof N.componentWillUnmount=="function"){r=x,n=x.return;try{t=r,N.props=t.memoizedProps,N.state=t.memoizedState,N.componentWillUnmount()}catch(y){ae(r,n,y)}}break;case 5:On(x,x.return);break;case 22:if(x.memoizedState!==null){zu(f);continue}}v!==null?(v.return=x,z=v):zu(f)}p=p.sibling}e:for(p=null,f=e;;){if(f.tag===5){if(p===null){p=f;try{l=f.stateNode,c?(a=l.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=f.stateNode,u=f.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Vc("display",i))}catch(y){ae(e,e.return,y)}}}else if(f.tag===6){if(p===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(y){ae(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:lt(t,e),pt(e),r&4&&Fu(e);break;case 21:break;default:lt(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(gf(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Tr(l,""),r.flags&=-33);var a=Mu(e);li(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,o=Mu(e);ri(e,o,i);break;default:throw Error(P(161))}}catch(u){ae(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uh(e,t,n){z=e,jf(e)}function jf(e,t,n){for(var r=(e.mode&1)!==0;z!==null;){var l=z,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||wl;if(!i){var o=l.alternate,u=o!==null&&o.memoizedState!==null||we;o=wl;var c=we;if(wl=i,(we=u)&&!c)for(z=l;z!==null;)i=z,u=i.child,i.tag===22&&i.memoizedState!==null?Du(l):u!==null?(u.return=i,z=u):Du(l);for(;a!==null;)z=a,jf(a),a=a.sibling;z=l,wl=o,we=c}Ou(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,z=a):Ou(e)}}function Ou(e){for(;z!==null;){var t=z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:we||_s(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!we)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:st(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&ju(t,a,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ju(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var f=p.dehydrated;f!==null&&Mr(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}we||t.flags&512&&ni(t)}catch(x){ae(t,t.return,x)}}if(t===e){z=null;break}if(n=t.sibling,n!==null){n.return=t.return,z=n;break}z=t.return}}function zu(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,z=n;break}z=t.return}}function Du(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{_s(4,t)}catch(u){ae(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){ae(t,l,u)}}var a=t.return;try{ni(t)}catch(u){ae(t,a,u)}break;case 5:var i=t.return;try{ni(t)}catch(u){ae(t,i,u)}}}catch(u){ae(t,t.return,u)}if(t===e){z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,z=o;break}z=t.return}}var ch=Math.ceil,as=Lt.ReactCurrentDispatcher,eo=Lt.ReactCurrentOwner,Ge=Lt.ReactCurrentBatchConfig,V=0,me=null,oe=null,ge=0,$e=0,zn=nn(0),fe=0,Wr=null,gn=0,Rs=0,to=0,Er=null,Le=null,no=0,Xn=1/0,Nt=null,is=!1,si=null,Qt=null,kl=!1,Bt=null,os=0,_r=0,ai=null,Ol=-1,zl=0;function _e(){return V&6?ie():Ol!==-1?Ol:Ol=ie()}function Kt(e){return e.mode&1?V&2&&ge!==0?ge&-ge:Q0.transition!==null?(zl===0&&(zl=rd()),zl):(e=W,e!==0||(e=window.event,e=e===void 0?16:cd(e.type)),e):1}function ut(e,t,n,r){if(50<_r)throw _r=0,ai=null,Error(P(185));tl(e,n,r),(!(V&2)||e!==me)&&(e===me&&(!(V&2)&&(Rs|=n),fe===4&&It(e,ge)),De(e,r),n===1&&V===0&&!(t.mode&1)&&(Xn=ie()+500,Ss&&rn()))}function De(e,t){var n=e.callbackNode;Qm(e,t);var r=Wl(e,e===me?ge:0);if(r===0)n!==null&&Qo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qo(n),t===1)e.tag===0?Y0(Iu.bind(null,e)):Rd(Iu.bind(null,e)),U0(function(){!(V&6)&&rn()}),n=null;else{switch(ld(r)){case 1:n=_i;break;case 4:n=td;break;case 16:n=Vl;break;case 536870912:n=nd;break;default:n=Vl}n=_f(n,Nf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Nf(e,t){if(Ol=-1,zl=0,V&6)throw Error(P(327));var n=e.callbackNode;if(Wn()&&e.callbackNode!==n)return null;var r=Wl(e,e===me?ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=us(e,r);else{t=r;var l=V;V|=2;var a=kf();(me!==e||ge!==t)&&(Nt=null,Xn=ie()+500,cn(e,t));do try{ph();break}catch(o){wf(e,o)}while(!0);Bi(),as.current=a,V=l,oe!==null?t=0:(me=null,ge=0,t=fe)}if(t!==0){if(t===2&&(l=La(e),l!==0&&(r=l,t=ii(e,l))),t===1)throw n=Wr,cn(e,0),It(e,r),De(e,ie()),n;if(t===6)It(e,r);else{if(l=e.current.alternate,!(r&30)&&!dh(l)&&(t=us(e,r),t===2&&(a=La(e),a!==0&&(r=a,t=ii(e,a))),t===1))throw n=Wr,cn(e,0),It(e,r),De(e,ie()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:sn(e,Le,Nt);break;case 3:if(It(e,r),(r&130023424)===r&&(t=no+500-ie(),10<t)){if(Wl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Ba(sn.bind(null,e,Le,Nt),t);break}sn(e,Le,Nt);break;case 4:if(It(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-ot(r);a=1<<i,i=t[i],i>l&&(l=i),r&=~a}if(r=l,r=ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ch(r/1960))-r,10<r){e.timeoutHandle=Ba(sn.bind(null,e,Le,Nt),r);break}sn(e,Le,Nt);break;case 5:sn(e,Le,Nt);break;default:throw Error(P(329))}}}return De(e,ie()),e.callbackNode===n?Nf.bind(null,e):null}function ii(e,t){var n=Er;return e.current.memoizedState.isDehydrated&&(cn(e,t).flags|=256),e=us(e,t),e!==2&&(t=Le,Le=n,t!==null&&oi(t)),e}function oi(e){Le===null?Le=e:Le.push.apply(Le,e)}function dh(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],a=l.getSnapshot;l=l.value;try{if(!ct(a(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 It(e,t){for(t&=~to,t&=~Rs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),r=1<<n;e[n]=-1,t&=~r}}function Iu(e){if(V&6)throw Error(P(327));Wn();var t=Wl(e,0);if(!(t&1))return De(e,ie()),null;var n=us(e,t);if(e.tag!==0&&n===2){var r=La(e);r!==0&&(t=r,n=ii(e,r))}if(n===1)throw n=Wr,cn(e,0),It(e,t),De(e,ie()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,sn(e,Le,Nt),De(e,ie()),null}function ro(e,t){var n=V;V|=1;try{return e(t)}finally{V=n,V===0&&(Xn=ie()+500,Ss&&rn())}}function vn(e){Bt!==null&&Bt.tag===0&&!(V&6)&&Wn();var t=V;V|=1;var n=Ge.transition,r=W;try{if(Ge.transition=null,W=1,e)return e()}finally{W=r,Ge.transition=n,V=t,!(V&6)&&rn()}}function lo(){$e=zn.current,q(zn)}function cn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,B0(n)),oe!==null)for(n=oe.return;n!==null;){var r=n;switch(Di(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jl();break;case 3:Jn(),q(Oe),q(be),Qi();break;case 5:Yi(r);break;case 4:Jn();break;case 13:q(ee);break;case 19:q(ee);break;case 10:Ui(r.type._context);break;case 22:case 23:lo()}n=n.return}if(me=e,oe=e=qt(e.current,null),ge=$e=t,fe=0,Wr=null,to=Rs=gn=0,Le=Er=null,on!==null){for(t=0;t<on.length;t++)if(n=on[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,a=n.pending;if(a!==null){var i=a.next;a.next=l,r.next=i}n.pending=r}on=null}return e}function wf(e,t){do{var n=oe;try{if(Bi(),Ll.current=ss,ls){for(var r=te.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}ls=!1}if(xn=0,pe=ce=te=null,Sr=!1,Ur=0,eo.current=null,n===null||n.return===null){fe=1,Wr=t,oe=null;break}e:{var a=e,i=n.return,o=n,u=t;if(t=ge,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,p=o,f=p.tag;if(!(p.mode&1)&&(f===0||f===11||f===15)){var x=p.alternate;x?(p.updateQueue=x.updateQueue,p.memoizedState=x.memoizedState,p.lanes=x.lanes):(p.updateQueue=null,p.memoizedState=null)}var v=Cu(i);if(v!==null){v.flags&=-257,Eu(v,i,o,a,t),v.mode&1&&Su(a,c,t),t=v,u=c;var N=t.updateQueue;if(N===null){var y=new Set;y.add(u),t.updateQueue=y}else N.add(u);break e}else{if(!(t&1)){Su(a,c,t),so();break e}u=Error(P(426))}}else if(X&&o.mode&1){var j=Cu(i);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Eu(j,i,o,a,t),Ii(Gn(u,o));break e}}a=u=Gn(u,o),fe!==4&&(fe=2),Er===null?Er=[a]:Er.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=lf(a,u,t);yu(a,m);break e;case 1:o=u;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Qt===null||!Qt.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=sf(a,o,t);yu(a,S);break e}}a=a.return}while(a!==null)}Sf(n)}catch(k){t=k,oe===n&&n!==null&&(oe=n=n.return);continue}break}while(!0)}function kf(){var e=as.current;return as.current=ss,e===null?ss:e}function so(){(fe===0||fe===3||fe===2)&&(fe=4),me===null||!(gn&268435455)&&!(Rs&268435455)||It(me,ge)}function us(e,t){var n=V;V|=2;var r=kf();(me!==e||ge!==t)&&(Nt=null,cn(e,t));do try{fh();break}catch(l){wf(e,l)}while(!0);if(Bi(),V=n,as.current=r,oe!==null)throw Error(P(261));return me=null,ge=0,fe}function fh(){for(;oe!==null;)bf(oe)}function ph(){for(;oe!==null&&!Dm();)bf(oe)}function bf(e){var t=Ef(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?Sf(e):oe=t,eo.current=null}function Sf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ah(n,t),n!==null){n.flags&=32767,oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fe=6,oe=null;return}}else if(n=sh(n,t,$e),n!==null){oe=n;return}if(t=t.sibling,t!==null){oe=t;return}oe=t=e}while(t!==null);fe===0&&(fe=5)}function sn(e,t,n){var r=W,l=Ge.transition;try{Ge.transition=null,W=1,mh(e,t,n,r)}finally{Ge.transition=l,W=r}return null}function mh(e,t,n,r){do Wn();while(Bt!==null);if(V&6)throw Error(P(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Km(e,a),e===me&&(oe=me=null,ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||kl||(kl=!0,_f(Vl,function(){return Wn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ge.transition,Ge.transition=null;var i=W;W=1;var o=V;V|=4,eo.current=null,oh(e,n),yf(n,e),M0(Ia),Yl=!!Da,Ia=Da=null,e.current=n,uh(n),Im(),V=o,W=i,Ge.transition=a}else e.current=n;if(kl&&(kl=!1,Bt=e,os=l),a=e.pendingLanes,a===0&&(Qt=null),Um(n.stateNode),De(e,ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(is)throw is=!1,e=si,si=null,e;return os&1&&e.tag!==0&&Wn(),a=e.pendingLanes,a&1?e===ai?_r++:(_r=0,ai=e):_r=0,rn(),null}function Wn(){if(Bt!==null){var e=ld(os),t=Ge.transition,n=W;try{if(Ge.transition=null,W=16>e?16:e,Bt===null)var r=!1;else{if(e=Bt,Bt=null,os=0,V&6)throw Error(P(331));var l=V;for(V|=4,z=e.current;z!==null;){var a=z,i=a.child;if(z.flags&16){var o=a.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(z=c;z!==null;){var p=z;switch(p.tag){case 0:case 11:case 15:Cr(8,p,a)}var f=p.child;if(f!==null)f.return=p,z=f;else for(;z!==null;){p=z;var x=p.sibling,v=p.return;if(xf(p),p===c){z=null;break}if(x!==null){x.return=v,z=x;break}z=v}}}var N=a.alternate;if(N!==null){var y=N.child;if(y!==null){N.child=null;do{var j=y.sibling;y.sibling=null,y=j}while(y!==null)}}z=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,z=i;else e:for(;z!==null;){if(a=z,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Cr(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,z=m;break e}z=a.return}}var d=e.current;for(z=d;z!==null;){i=z;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,z=g;else e:for(i=d;z!==null;){if(o=z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:_s(9,o)}}catch(k){ae(o,o.return,k)}if(o===i){z=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,z=S;break e}z=o.return}}if(V=l,rn(),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(js,e)}catch{}r=!0}return r}finally{W=n,Ge.transition=t}}return!1}function $u(e,t,n){t=Gn(n,t),t=lf(e,t,1),e=Yt(e,t,1),t=_e(),e!==null&&(tl(e,1,t),De(e,t))}function ae(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qt===null||!Qt.has(r))){e=Gn(n,e),e=sf(t,e,1),t=Yt(t,e,1),e=_e(),t!==null&&(tl(t,1,e),De(t,e));break}}t=t.return}}function hh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,me===e&&(ge&n)===n&&(fe===4||fe===3&&(ge&130023424)===ge&&500>ie()-no?cn(e,0):to|=n),De(e,t)}function Cf(e,t){t===0&&(e.mode&1?(t=pl,pl<<=1,!(pl&130023424)&&(pl=4194304)):t=1);var n=_e();e=Rt(e,t),e!==null&&(tl(e,t,n),De(e,n))}function xh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cf(e,n)}function gh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),Cf(e,n)}var Ef;Ef=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Me=!1,lh(e,t,n);Me=!!(e.flags&131072)}else Me=!1,X&&t.flags&1048576&&Td(t,Zl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var l=Qn(t,be.current);Vn(t,n),l=qi(null,t,r,e,l,n);var a=Ji();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ze(r)?(a=!0,Gl(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Vi(t),l.updater=Es,t.stateNode=l,l._reactInternals=t,Ka(t,r,e,n),t=Ga(null,t,r,!0,a,n)):(t.tag=0,X&&a&&zi(t),Ce(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=yh(r),e=st(r,e),l){case 0:t=Ja(null,t,r,e,n);break e;case 1:t=Tu(null,t,r,e,n);break e;case 11:t=_u(null,t,r,e,n);break e;case 14:t=Ru(null,t,r,st(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Ja(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Tu(e,t,r,l,n);case 3:e:{if(cf(t),e===null)throw Error(P(387));r=t.pendingProps,a=t.memoizedState,l=a.element,Od(e,t),ns(t,r,null,n);var i=t.memoizedState;if(r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){l=Gn(Error(P(423)),t),t=Au(e,t,r,n,l);break e}else if(r!==l){l=Gn(Error(P(424)),t),t=Au(e,t,r,n,l);break e}else for(Be=Wt(t.stateNode.containerInfo.firstChild),Ue=t,X=!0,it=null,n=Md(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Kn(),r===l){t=Tt(e,t,n);break e}Ce(e,t,r,n)}t=t.child}return t;case 5:return zd(t),e===null&&Wa(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,$a(r,l)?i=null:a!==null&&$a(r,a)&&(t.flags|=32),uf(e,t),Ce(e,t,i,n),t.child;case 6:return e===null&&Wa(t),null;case 13:return df(e,t,n);case 4:return Wi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qn(t,null,r,n):Ce(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),_u(e,t,r,l,n);case 7:return Ce(e,t,t.pendingProps,n),t.child;case 8:return Ce(e,t,t.pendingProps.children,n),t.child;case 12:return Ce(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,i=l.value,Q(es,r._currentValue),r._currentValue=i,a!==null)if(ct(a.value,i)){if(a.children===l.children&&!Oe.current){t=Tt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){i=a.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=St(-1,n&-n),u.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ya(a.return,n,t),o.lanes|=n;break}u=u.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(P(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Ya(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Ce(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Vn(t,n),l=Xe(l),r=r(l),t.flags|=1,Ce(e,t,r,n),t.child;case 14:return r=t.type,l=st(r,t.pendingProps),l=st(r.type,l),Ru(e,t,r,l,n);case 15:return af(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Fl(e,t),t.tag=1,ze(r)?(e=!0,Gl(t)):e=!1,Vn(t,n),rf(t,r,l),Ka(t,r,l,n),Ga(null,t,r,!0,e,n);case 19:return ff(e,t,n);case 22:return of(e,t,n)}throw Error(P(156,t.tag))};function _f(e,t){return ed(e,t)}function vh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Je(e,t,n,r){return new vh(e,t,n,r)}function ao(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yh(e){if(typeof e=="function")return ao(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Si)return 11;if(e===Ci)return 14}return 2}function qt(e,t){var n=e.alternate;return n===null?(n=Je(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dl(e,t,n,r,l,a){var i=2;if(r=e,typeof e=="function")ao(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case En:return dn(n.children,l,a,t);case bi:i=8,l|=8;break;case va:return e=Je(12,n,t,l|2),e.elementType=va,e.lanes=a,e;case ya:return e=Je(13,n,t,l),e.elementType=ya,e.lanes=a,e;case ja:return e=Je(19,n,t,l),e.elementType=ja,e.lanes=a,e;case zc:return Ts(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fc:i=10;break e;case Oc:i=9;break e;case Si:i=11;break e;case Ci:i=14;break e;case Ot:i=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=Je(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function dn(e,t,n,r){return e=Je(7,e,r,t),e.lanes=n,e}function Ts(e,t,n,r){return e=Je(22,e,r,t),e.elementType=zc,e.lanes=n,e.stateNode={isHidden:!1},e}function oa(e,t,n){return e=Je(6,e,null,t),e.lanes=n,e}function ua(e,t,n){return t=Je(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jh(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hs(0),this.expirationTimes=Hs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hs(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function io(e,t,n,r,l,a,i,o,u){return e=new jh(e,t,n,o,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Je(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vi(a),e}function Nh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Cn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Rf(e){if(!e)return Xt;e=e._reactInternals;e:{if(Nn(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(ze(n))return _d(e,n,t)}return t}function Tf(e,t,n,r,l,a,i,o,u){return e=io(n,r,!0,e,l,a,i,o,u),e.context=Rf(null),n=e.current,r=_e(),l=Kt(n),a=St(r,l),a.callback=t??null,Yt(n,a,l),e.current.lanes=l,tl(e,l,r),De(e,r),e}function As(e,t,n,r){var l=t.current,a=_e(),i=Kt(l);return n=Rf(n),t.context===null?t.context=n:t.pendingContext=n,t=St(a,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Yt(l,t,i),e!==null&&(ut(e,l,i,a),Pl(e,l,i)),i}function cs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Bu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function oo(e,t){Bu(e,t),(e=e.alternate)&&Bu(e,t)}function wh(){return null}var Af=typeof reportError=="function"?reportError:function(e){console.error(e)};function uo(e){this._internalRoot=e}Ps.prototype.render=uo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));As(e,t,null,null)};Ps.prototype.unmount=uo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){As(null,e,null,null)}),t[_t]=null}};function Ps(e){this._internalRoot=e}Ps.prototype.unstable_scheduleHydration=function(e){if(e){var t=id();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&t!==0&&t<Dt[n].priority;n++);Dt.splice(n,0,e),n===0&&ud(e)}};function co(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ls(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uu(){}function kh(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var c=cs(i);a.call(c)}}var i=Tf(t,r,e,0,null,!1,!1,"",Uu);return e._reactRootContainer=i,e[_t]=i.current,zr(e.nodeType===8?e.parentNode:e),vn(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var c=cs(u);o.call(c)}}var u=io(e,0,!1,null,null,!1,!1,"",Uu);return e._reactRootContainer=u,e[_t]=u.current,zr(e.nodeType===8?e.parentNode:e),vn(function(){As(t,u,n,r)}),u}function Ms(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a;if(typeof l=="function"){var o=l;l=function(){var u=cs(i);o.call(u)}}As(t,i,e,l)}else i=kh(n,t,e,l,r);return cs(i)}sd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=gr(t.pendingLanes);n!==0&&(Ri(t,n|1),De(t,ie()),!(V&6)&&(Xn=ie()+500,rn()))}break;case 13:vn(function(){var r=Rt(e,1);if(r!==null){var l=_e();ut(r,e,1,l)}}),oo(e,1)}};Ti=function(e){if(e.tag===13){var t=Rt(e,134217728);if(t!==null){var n=_e();ut(t,e,134217728,n)}oo(e,134217728)}};ad=function(e){if(e.tag===13){var t=Kt(e),n=Rt(e,t);if(n!==null){var r=_e();ut(n,e,t,r)}oo(e,t)}};id=function(){return W};od=function(e,t){var n=W;try{return W=e,t()}finally{W=n}};Ta=function(e,t,n){switch(t){case"input":if(ka(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=bs(r);if(!l)throw Error(P(90));Ic(r),ka(r,l)}}}break;case"textarea":Bc(e,n);break;case"select":t=n.value,t!=null&&$n(e,!!n.multiple,t,!1)}};Kc=ro;qc=vn;var bh={usingClientEntryPoint:!1,Events:[rl,An,bs,Yc,Qc,ro]},pr={findFiberByHostInstance:an,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Sh={bundleType:pr.bundleType,version:pr.version,rendererPackageName:pr.rendererPackageName,rendererConfig:pr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xc(e),e===null?null:e.stateNode},findFiberByHostInstance:pr.findFiberByHostInstance||wh,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{js=bl.inject(Sh),xt=bl}catch{}}Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bh;Ve.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!co(t))throw Error(P(200));return Nh(e,t,null,n)};Ve.createRoot=function(e,t){if(!co(e))throw Error(P(299));var n=!1,r="",l=Af;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=io(e,1,!1,null,null,n,!1,r,l),e[_t]=t.current,zr(e.nodeType===8?e.parentNode:e),new uo(t)};Ve.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=Xc(t),e=e===null?null:e.stateNode,e};Ve.flushSync=function(e){return vn(e)};Ve.hydrate=function(e,t,n){if(!Ls(t))throw Error(P(200));return Ms(null,e,t,!0,n)};Ve.hydrateRoot=function(e,t,n){if(!co(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=Af;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Tf(t,null,e,1,n??null,l,!1,a,i),e[_t]=t.current,zr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Ps(t)};Ve.render=function(e,t,n){if(!Ls(t))throw Error(P(200));return Ms(null,e,t,!1,n)};Ve.unmountComponentAtNode=function(e){if(!Ls(e))throw Error(P(40));return e._reactRootContainer?(vn(function(){Ms(null,null,e,!1,function(){e._reactRootContainer=null,e[_t]=null})}),!0):!1};Ve.unstable_batchedUpdates=ro;Ve.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ls(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return Ms(e,t,n,!1,r)};Ve.version="18.3.1-next-f1338f8080-20240426";function Pf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pf)}catch(e){console.error(e)}}Pf(),Ac.exports=Ve;var Ch=Ac.exports,Hu=Ch;xa.createRoot=Hu.createRoot,xa.hydrateRoot=Hu.hydrateRoot;/**
41
- * react-router v7.12.0
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var Vu="popstate";function Eh(e={}){function t(r,l){let{pathname:a,search:i,hash:o}=r.location;return ui("",{pathname:a,search:i,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Yr(l)}return Rh(t,n,null,e)}function ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _h(){return Math.random().toString(36).substring(2,10)}function Wu(e,t){return{usr:e.state,key:e.key,idx:t}}function ui(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?lr(t):t,state:n,key:t&&t.key||r||_h()}}function Yr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function lr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Rh(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,o="POP",u=null,c=p();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function p(){return(i.state||{idx:null}).idx}function f(){o="POP";let j=p(),m=j==null?null:j-c;c=j,u&&u({action:o,location:y.location,delta:m})}function x(j,m){o="PUSH";let d=ui(y.location,j,m);c=p()+1;let g=Wu(d,c),S=y.createHref(d);try{i.pushState(g,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;l.location.assign(S)}a&&u&&u({action:o,location:y.location,delta:1})}function v(j,m){o="REPLACE";let d=ui(y.location,j,m);c=p();let g=Wu(d,c),S=y.createHref(d);i.replaceState(g,"",S),a&&u&&u({action:o,location:y.location,delta:0})}function N(j){return Th(j)}let y={get action(){return o},get location(){return e(l,i)},listen(j){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Vu,f),u=j,()=>{l.removeEventListener(Vu,f),u=null}},createHref(j){return t(l,j)},createURL:N,encodeLocation(j){let m=N(j);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:x,replace:v,go(j){return i.go(j)}};return y}function Th(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ne(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Yr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Lf(e,t,n="/"){return Ah(e,t,n,!1)}function Ah(e,t,n,r){let l=typeof t=="string"?lr(t):t,a=At(l.pathname||"/",n);if(a==null)return null;let i=Mf(e);Ph(i);let o=null;for(let u=0;o==null&&u<i.length;++u){let c=Hh(a);o=Bh(i[u],c,r)}return o}function Mf(e,t=[],n=[],r="",l=!1){let a=(i,o,u=l,c)=>{let p={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&u)return;ne(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let f=Ct([r,p.relativePath]),x=n.concat(p);i.children&&i.children.length>0&&(ne(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Mf(i.children,t,x,f,u)),!(i.path==null&&!i.index)&&t.push({path:f,score:Ih(f,i.index),routesMeta:x})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))a(i,o);else for(let c of Ff(i.path))a(i,o,!0,c)}),t}function Ff(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return l?[a,""]:[a];let i=Ff(r.join("/")),o=[];return o.push(...i.map(u=>u===""?a:[a,u].join("/"))),l&&o.push(...i),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function Ph(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$h(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Lh=/^:[\w-]+$/,Mh=3,Fh=2,Oh=1,zh=10,Dh=-2,Yu=e=>e==="*";function Ih(e,t){let n=e.split("/"),r=n.length;return n.some(Yu)&&(r+=Dh),t&&(r+=Fh),n.filter(l=>!Yu(l)).reduce((l,a)=>l+(Lh.test(a)?Mh:a===""?Oh:zh),r)}function $h(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Bh(e,t,n=!1){let{routesMeta:r}=e,l={},a="/",i=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",f=ds({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},p),x=u.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=ds({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(l,f.params),i.push({params:l,pathname:Ct([a,f.pathname]),pathnameBase:Qh(Ct([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=Ct([a,f.pathnameBase]))}return i}function ds(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Uh(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let a=l[0],i=a.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((c,{paramName:p,isOptional:f},x)=>{if(p==="*"){let N=o[x]||"";i=a.slice(0,a.length-N.length).replace(/(.)\/+$/,"$1")}const v=o[x];return f&&!v?c[p]=void 0:c[p]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:e}}function Uh(e,t=!1,n=!0){et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Hh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function At(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Of=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vh=e=>Of.test(e);function Wh(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?lr(e):e,a;if(n)if(Vh(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),et(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=Qu(n.substring(1),"/"):a=Qu(n,t)}else a=t;return{pathname:a,search:Kh(r),hash:qh(l)}}function Qu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function ca(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function zf(e){let t=Yh(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Df(e,t,n,r=!1){let l;typeof e=="string"?l=lr(e):(l={...e},ne(!l.pathname||!l.pathname.includes("?"),ca("?","pathname","search",l)),ne(!l.pathname||!l.pathname.includes("#"),ca("#","pathname","hash",l)),ne(!l.search||!l.search.includes("#"),ca("#","search","hash",l)));let a=e===""||l.pathname==="",i=a?"/":l.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),f-=1;l.pathname=x.join("/")}o=f>=0?t[f]:"/"}let u=Wh(l,o),c=i&&i!=="/"&&i.endsWith("/"),p=(a||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}var Ct=e=>e.join("/").replace(/\/\/+/g,"/"),Qh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Kh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Jh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Gh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Xh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var If=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $f(e,t){let n=e;if(typeof n!="string"||!Of.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(If)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),o=At(i.pathname,t);i.origin===a.origin&&o!=null?n=o+i.search+i.hash:l=!0}catch{et(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Bf=["POST","PUT","PATCH","DELETE"];new Set(Bf);var Zh=["GET",...Bf];new Set(Zh);var sr=h.createContext(null);sr.displayName="DataRouter";var Fs=h.createContext(null);Fs.displayName="DataRouterState";var ex=h.createContext(!1),Uf=h.createContext({isTransitioning:!1});Uf.displayName="ViewTransition";var tx=h.createContext(new Map);tx.displayName="Fetchers";var nx=h.createContext(null);nx.displayName="Await";var tt=h.createContext(null);tt.displayName="Navigation";var sl=h.createContext(null);sl.displayName="Location";var dt=h.createContext({outlet:null,matches:[],isDataRoute:!1});dt.displayName="Route";var fo=h.createContext(null);fo.displayName="RouteError";var Hf="REACT_ROUTER_ERROR",rx="REDIRECT",lx="ROUTE_ERROR_RESPONSE";function sx(e){if(e.startsWith(`${Hf}:${rx}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ax(e){if(e.startsWith(`${Hf}:${lx}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Jh(t.status,t.statusText,t.data)}catch{}}function ix(e,{relative:t}={}){ne(al(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(tt),{hash:l,pathname:a,search:i}=il(e,{relative:t}),o=a;return n!=="/"&&(o=a==="/"?n:Ct([n,a])),r.createHref({pathname:o,search:i,hash:l})}function al(){return h.useContext(sl)!=null}function Mt(){return ne(al(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(sl).location}var Vf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Wf(e){h.useContext(tt).static||h.useLayoutEffect(e)}function po(){let{isDataRoute:e}=h.useContext(dt);return e?kx():ox()}function ox(){ne(al(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(sr),{basename:t,navigator:n}=h.useContext(tt),{matches:r}=h.useContext(dt),{pathname:l}=Mt(),a=JSON.stringify(zf(r)),i=h.useRef(!1);return Wf(()=>{i.current=!0}),h.useCallback((u,c={})=>{if(et(i.current,Vf),!i.current)return;if(typeof u=="number"){n.go(u);return}let p=Df(u,JSON.parse(a),l,c.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ct([t,p.pathname])),(c.replace?n.replace:n.push)(p,c.state,c)},[t,n,a,l,e])}var ux=h.createContext(null);function cx(e){let t=h.useContext(dt).outlet;return h.useMemo(()=>t&&h.createElement(ux.Provider,{value:e},t),[t,e])}function dx(){let{matches:e}=h.useContext(dt),t=e[e.length-1];return t?t.params:{}}function il(e,{relative:t}={}){let{matches:n}=h.useContext(dt),{pathname:r}=Mt(),l=JSON.stringify(zf(n));return h.useMemo(()=>Df(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function fx(e,t){return Yf(e,t)}function Yf(e,t,n,r,l){var d;ne(al(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=h.useContext(tt),{matches:i}=h.useContext(dt),o=i[i.length-1],u=o?o.params:{},c=o?o.pathname:"/",p=o?o.pathnameBase:"/",f=o&&o.route;{let g=f&&f.path||"";Kf(c,!f||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let x=Mt(),v;if(t){let g=typeof t=="string"?lr(t):t;ne(p==="/"||((d=g.pathname)==null?void 0:d.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${g.pathname}" was given in the \`location\` prop.`),v=g}else v=x;let N=v.pathname||"/",y=N;if(p!=="/"){let g=p.replace(/^\//,"").split("/");y="/"+N.replace(/^\//,"").split("/").slice(g.length).join("/")}let j=Lf(e,{pathname:y});et(f||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),et(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let m=gx(j&&j.map(g=>Object.assign({},g,{params:Object.assign({},u,g.params),pathname:Ct([p,a.encodeLocation?a.encodeLocation(g.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?p:Ct([p,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),i,n,r,l);return t&&m?h.createElement(sl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},m):m}function px(){let e=wx(),t=Gh(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:a},"ErrorBoundary")," or"," ",h.createElement("code",{style:a},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:l},n):null,i)}var mx=h.createElement(px,null),Qf=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=ax(e.digest);n&&(e=n)}let t=e!==void 0?h.createElement(dt.Provider,{value:this.props.routeContext},h.createElement(fo.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(hx,{error:e},t):t}};Qf.contextType=ex;var da=new WeakMap;function hx({children:e,error:t}){let{basename:n}=h.useContext(tt);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=sx(t.digest);if(r){let l=da.get(t);if(l)throw l;let a=$f(r.location,n);if(If&&!da.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw da.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function xx({routeContext:e,match:t,children:n}){let r=h.useContext(sr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(dt.Provider,{value:e},n)}function gx(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n==null?void 0:n.errors;if(i!=null){let p=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);ne(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let o=!1,u=-1;if(n)for(let p=0;p<a.length;p++){let f=a[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=p),f.route.id){let{loaderData:x,errors:v}=n,N=f.route.loader&&!x.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||N){o=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}let c=n&&r?(p,f)=>{var x,v;r(p,{location:n.location,params:((v=(x=n.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:Xh(n.matches),errorInfo:f})}:void 0;return a.reduceRight((p,f,x)=>{let v,N=!1,y=null,j=null;n&&(v=i&&f.route.id?i[f.route.id]:void 0,y=f.route.errorElement||mx,o&&(u<0&&x===0?(Kf("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,j=null):u===x&&(N=!0,j=f.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,x+1)),d=()=>{let g;return v?g=y:N?g=j:f.route.Component?g=h.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=p,h.createElement(xx,{match:f,routeContext:{outlet:p,matches:m,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?h.createElement(Qf,{location:n.location,revalidation:n.revalidation,component:y,error:v,children:d(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:c}):d()},null)}function mo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vx(e){let t=h.useContext(sr);return ne(t,mo(e)),t}function yx(e){let t=h.useContext(Fs);return ne(t,mo(e)),t}function jx(e){let t=h.useContext(dt);return ne(t,mo(e)),t}function ho(e){let t=jx(e),n=t.matches[t.matches.length-1];return ne(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Nx(){return ho("useRouteId")}function wx(){var r;let e=h.useContext(fo),t=yx("useRouteError"),n=ho("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function kx(){let{router:e}=vx("useNavigate"),t=ho("useNavigate"),n=h.useRef(!1);return Wf(()=>{n.current=!0}),h.useCallback(async(l,a={})=>{et(n.current,Vf),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...a}))},[e,t])}var Ku={};function Kf(e,t,n){!t&&!Ku[e]&&(Ku[e]=!0,et(!1,n))}h.memo(bx);function bx({routes:e,future:t,state:n,onError:r}){return Yf(e,void 0,n,r,t)}function Sx(e){return cx(e.context)}function jt(e){ne(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Cx({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:a=!1,unstable_useTransitions:i}){ne(!al(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:o,navigator:l,static:a,unstable_useTransitions:i,future:{}}),[o,l,a,i]);typeof n=="string"&&(n=lr(n));let{pathname:c="/",search:p="",hash:f="",state:x=null,key:v="default"}=n,N=h.useMemo(()=>{let y=At(c,o);return y==null?null:{location:{pathname:y,search:p,hash:f,state:x,key:v},navigationType:r}},[o,c,p,f,x,v,r]);return et(N!=null,`<Router basename="${o}"> is not able to match the URL "${c}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:h.createElement(tt.Provider,{value:u},h.createElement(sl.Provider,{children:t,value:N}))}function Ex({children:e,location:t}){return fx(ci(e),t)}function ci(e,t=[]){let n=[];return h.Children.forEach(e,(r,l)=>{if(!h.isValidElement(r))return;let a=[...t,l];if(r.type===h.Fragment){n.push.apply(n,ci(r.props.children,a));return}ne(r.type===jt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ne(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=ci(r.props.children,a)),n.push(i)}),n}var Il="get",$l="application/x-www-form-urlencoded";function Os(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function _x(e){return Os(e)&&e.tagName.toLowerCase()==="button"}function Rx(e){return Os(e)&&e.tagName.toLowerCase()==="form"}function Tx(e){return Os(e)&&e.tagName.toLowerCase()==="input"}function Ax(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Px(e,t){return e.button===0&&(!t||t==="_self")&&!Ax(e)}function di(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Lx(e,t){let n=di(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(a=>{n.append(l,a)})}),n}var Sl=null;function Mx(){if(Sl===null)try{new FormData(document.createElement("form"),0),Sl=!1}catch{Sl=!0}return Sl}var Fx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fa(e){return e!=null&&!Fx.has(e)?(et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$l}"`),null):e}function Ox(e,t){let n,r,l,a,i;if(Rx(e)){let o=e.getAttribute("action");r=o?At(o,t):null,n=e.getAttribute("method")||Il,l=fa(e.getAttribute("enctype"))||$l,a=new FormData(e)}else if(_x(e)||Tx(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||o.getAttribute("action");if(r=u?At(u,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Il,l=fa(e.getAttribute("formenctype"))||fa(o.getAttribute("enctype"))||$l,a=new FormData(o,e),!Mx()){let{name:c,type:p,value:f}=e;if(p==="image"){let x=c?`${c}.`:"";a.append(`${x}x`,"0"),a.append(`${x}y`,"0")}else c&&a.append(c,f)}}else{if(Os(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Il,r=null,l=$l,i=e}return a&&l==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:l,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zx(e,t,n,r){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${r}`:l.pathname=`${l.pathname}.${r}`:l.pathname==="/"?l.pathname=`_root.${r}`:t&&At(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${r}`,l}async function Dx(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ix(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $x(e,t,n){let r=await Promise.all(e.map(async l=>{let a=t.routes[l.route.id];if(a){let i=await Dx(a,n);return i.links?i.links():[]}return[]}));return Vx(r.flat(1).filter(Ix).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function qu(e,t,n,r,l,a){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,o=(u,c)=>{var p;return n[c].pathname!==u.pathname||((p=n[c].route.path)==null?void 0:p.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return a==="assets"?t.filter((u,c)=>i(u,c)||o(u,c)):a==="data"?t.filter((u,c)=>{var f;let p=r.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(i(u,c)||o(u,c))return!0;if(u.route.shouldRevalidate){let x=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Bx(e,t,{includeHydrateFallback:n}={}){return Ux(e.map(r=>{let l=t.routes[r.route.id];if(!l)return[];let a=[l.module];return l.clientActionModule&&(a=a.concat(l.clientActionModule)),l.clientLoaderModule&&(a=a.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(a=a.concat(l.hydrateFallbackModule)),l.imports&&(a=a.concat(l.imports)),a}).flat(1))}function Ux(e){return[...new Set(e)]}function Hx(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Vx(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let a=JSON.stringify(Hx(l));return n.has(a)||(n.add(a),r.push({key:a,link:l})),r},[])}function qf(){let e=h.useContext(sr);return xo(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Wx(){let e=h.useContext(Fs);return xo(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var go=h.createContext(void 0);go.displayName="FrameworkContext";function Jf(){let e=h.useContext(go);return xo(e,"You must render this element inside a <HydratedRouter> element"),e}function Yx(e,t){let n=h.useContext(go),[r,l]=h.useState(!1),[a,i]=h.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:c,onMouseLeave:p,onTouchStart:f}=t,x=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=m=>{m.forEach(d=>{i(d.isIntersecting)})},j=new IntersectionObserver(y,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),h.useEffect(()=>{if(r){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[r]);let v=()=>{l(!0)},N=()=>{l(!1),i(!1)};return n?e!=="intent"?[a,x,{}]:[a,x,{onFocus:mr(o,v),onBlur:mr(u,N),onMouseEnter:mr(c,v),onMouseLeave:mr(p,N),onTouchStart:mr(f,v)}]:[!1,x,{}]}function mr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Qx({page:e,...t}){let{router:n}=qf(),r=h.useMemo(()=>Lf(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(qx,{page:e,matches:r,...t}):null}function Kx(e){let{manifest:t,routeModules:n}=Jf(),[r,l]=h.useState([]);return h.useEffect(()=>{let a=!1;return $x(e,t,n).then(i=>{a||l(i)}),()=>{a=!0}},[e,t,n]),r}function qx({page:e,matches:t,...n}){let r=Mt(),{future:l,manifest:a,routeModules:i}=Jf(),{basename:o}=qf(),{loaderData:u,matches:c}=Wx(),p=h.useMemo(()=>qu(e,t,c,a,r,"data"),[e,t,c,a,r]),f=h.useMemo(()=>qu(e,t,c,a,r,"assets"),[e,t,c,a,r]),x=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,j=!1;if(t.forEach(d=>{var S;let g=a.routes[d.route.id];!g||!g.hasLoader||(!p.some(k=>k.route.id===d.route.id)&&d.route.id in u&&((S=i[d.route.id])!=null&&S.shouldRevalidate)||g.hasClientLoader?j=!0:y.add(d.route.id))}),y.size===0)return[];let m=zx(e,o,l.unstable_trailingSlashAwareDataRequests,"data");return j&&y.size>0&&m.searchParams.set("_routes",t.filter(d=>y.has(d.route.id)).map(d=>d.route.id).join(",")),[m.pathname+m.search]},[o,l.unstable_trailingSlashAwareDataRequests,u,r,a,p,t,e,i]),v=h.useMemo(()=>Bx(f,a),[f,a]),N=Kx(f);return h.createElement(h.Fragment,null,x.map(y=>h.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),v.map(y=>h.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),N.map(({key:y,link:j})=>h.createElement("link",{key:y,nonce:n.nonce,...j})))}function Jx(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Gx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Gx&&(window.__reactRouterVersion="7.12.0")}catch{}function Xx({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=h.useRef();l.current==null&&(l.current=Eh({window:r,v5Compat:!0}));let a=l.current,[i,o]=h.useState({action:a.action,location:a.location}),u=h.useCallback(c=>{n===!1?o(c):h.startTransition(()=>o(c))},[n]);return h.useLayoutEffect(()=>a.listen(u),[a,u]),h.createElement(Cx,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var Gf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Re=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:a,replace:i,state:o,target:u,to:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x,...v},N){let{basename:y,unstable_useTransitions:j}=h.useContext(tt),m=typeof c=="string"&&Gf.test(c),d=$f(c,y);c=d.to;let g=ix(c,{relative:l}),[S,k,T]=Yx(r,v),A=ng(c,{replace:i,state:o,target:u,preventScrollReset:p,relative:l,viewTransition:f,unstable_defaultShouldRevalidate:x,unstable_useTransitions:j});function L(F){t&&t(F),F.defaultPrevented||A(F)}let O=h.createElement("a",{...v,...T,href:d.absoluteURL||g,onClick:d.isExternal||a?t:L,ref:Jx(N,k),target:u,"data-discover":!m&&n==="render"?"true":void 0});return S&&!m?h.createElement(h.Fragment,null,O,h.createElement(Qx,{page:g})):O});Re.displayName="Link";var Zx=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:a,to:i,viewTransition:o,children:u,...c},p){let f=il(i,{relative:c.relative}),x=Mt(),v=h.useContext(Fs),{navigator:N,basename:y}=h.useContext(tt),j=v!=null&&og(f)&&o===!0,m=N.encodeLocation?N.encodeLocation(f).pathname:f.pathname,d=x.pathname,g=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(d=d.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase()),g&&y&&(g=At(g,y)||g);const S=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let k=d===m||!l&&d.startsWith(m)&&d.charAt(S)==="/",T=g!=null&&(g===m||!l&&g.startsWith(m)&&g.charAt(m.length)==="/"),A={isActive:k,isPending:T,isTransitioning:j},L=k?t:void 0,O;typeof r=="function"?O=r(A):O=[r,k?"active":null,T?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(A):a;return h.createElement(Re,{...c,"aria-current":L,className:O,ref:p,style:F,to:i,viewTransition:o},typeof u=="function"?u(A):u)});Zx.displayName="NavLink";var eg=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:a,method:i=Il,action:o,onSubmit:u,relative:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x,...v},N)=>{let{unstable_useTransitions:y}=h.useContext(tt),j=ag(),m=ig(o,{relative:c}),d=i.toLowerCase()==="get"?"get":"post",g=typeof o=="string"&&Gf.test(o),S=k=>{if(u&&u(k),k.defaultPrevented)return;k.preventDefault();let T=k.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||i,L=()=>j(T||k.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:l,state:a,relative:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x});y&&n!==!1?h.startTransition(()=>L()):L()};return h.createElement("form",{ref:N,method:d,action:m,onSubmit:r?u:S,...v,"data-discover":!g&&e==="render"?"true":void 0})});eg.displayName="Form";function tg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xf(e){let t=h.useContext(sr);return ne(t,tg(e)),t}function ng(e,{target:t,replace:n,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o,unstable_useTransitions:u}={}){let c=po(),p=Mt(),f=il(e,{relative:a});return h.useCallback(x=>{if(Px(x,t)){x.preventDefault();let v=n!==void 0?n:Yr(p)===Yr(f),N=()=>c(e,{replace:v,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o});u?h.startTransition(()=>N()):N()}},[p,c,f,n,r,t,e,l,a,i,o,u])}function rg(e){et(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=h.useRef(di(e)),n=h.useRef(!1),r=Mt(),l=h.useMemo(()=>Lx(r.search,n.current?null:t.current),[r.search]),a=po(),i=h.useCallback((o,u)=>{const c=di(typeof o=="function"?o(new URLSearchParams(l)):o);n.current=!0,a("?"+c,u)},[a,l]);return[l,i]}var lg=0,sg=()=>`__${String(++lg)}__`;function ag(){let{router:e}=Xf("useSubmit"),{basename:t}=h.useContext(tt),n=Nx(),r=e.fetch,l=e.navigate;return h.useCallback(async(a,i={})=>{let{action:o,method:u,encType:c,formData:p,body:f}=Ox(a,t);if(i.navigate===!1){let x=i.fetcherKey||sg();await r(x,n,i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||u,formEncType:i.encType||c,flushSync:i.flushSync})}else await l(i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||u,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,l,t,n])}function ig(e,{relative:t}={}){let{basename:n}=h.useContext(tt),r=h.useContext(dt);ne(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),a={...il(e||".",{relative:t})},i=Mt();if(e==null){a.search=i.search;let o=new URLSearchParams(a.search),u=o.getAll("index");if(u.some(p=>p==="")){o.delete("index"),u.filter(f=>f).forEach(f=>o.append("index",f));let p=o.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&l.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Ct([n,a.pathname])),Yr(a)}function og(e,{relative:t}={}){let n=h.useContext(Uf);ne(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Xf("useViewTransitionState"),l=il(e,{relative:t});if(!n.isTransitioning)return!1;let a=At(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=At(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ds(l.pathname,i)!=null||ds(l.pathname,a)!=null}/**
52
- * @license lucide-react v0.468.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const ug=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
57
- * @license lucide-react v0.468.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */var cg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
- * @license lucide-react v0.468.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const dg=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:a,iconNode:i,...o},u)=>h.createElement("svg",{ref:u,...cg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zf("lucide",l),...o},[...i.map(([c,p])=>h.createElement(c,p)),...Array.isArray(a)?a:[a]]));/**
67
- * @license lucide-react v0.468.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const H=(e,t)=>{const n=h.forwardRef(({className:r,...l},a)=>h.createElement(dg,{ref:a,iconNode:t,className:Zf(`lucide-${ug(e)}`,r),...l}));return n.displayName=`${e}`,n};/**
72
- * @license lucide-react v0.468.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const fs=H("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
77
- * @license lucide-react v0.468.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const fg=H("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
82
- * @license lucide-react v0.468.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const Qr=H("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
87
- * @license lucide-react v0.468.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const Ye=H("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
92
- * @license lucide-react v0.468.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const ft=H("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
97
- * @license lucide-react v0.468.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const yn=H("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
102
- * @license lucide-react v0.468.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const vo=H("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
107
- * @license lucide-react v0.468.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const ep=H("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
112
- * @license lucide-react v0.468.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const yo=H("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
117
- * @license lucide-react v0.468.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const jo=H("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
122
- * @license lucide-react v0.468.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const tp=H("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
127
- * @license lucide-react v0.468.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const Zt=H("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
132
- * @license lucide-react v0.468.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const No=H("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
137
- * @license lucide-react v0.468.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const np=H("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
142
- * @license lucide-react v0.468.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const rp=H("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
147
- * @license lucide-react v0.468.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const wo=H("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
152
- * @license lucide-react v0.468.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const pg=H("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
157
- * @license lucide-react v0.468.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const Ju=H("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
162
- * @license lucide-react v0.468.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const mg=H("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
167
- * @license lucide-react v0.468.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const hg=H("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
172
- * @license lucide-react v0.468.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const Gu=H("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
177
- * @license lucide-react v0.468.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const lp=H("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
182
- * @license lucide-react v0.468.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const sp=H("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
187
- * @license lucide-react v0.468.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const fn=H("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
192
- * @license lucide-react v0.468.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const ke=H("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
197
- * @license lucide-react v0.468.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const ps=H("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
202
- * @license lucide-react v0.468.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const ko=H("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
207
- * @license lucide-react v0.468.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const xg=H("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
212
- * @license lucide-react v0.468.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const ap=H("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
217
- * @license lucide-react v0.468.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const gg=H("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
222
- * @license lucide-react v0.468.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const vg=H("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
227
- * @license lucide-react v0.468.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const Ie=H("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
232
- * @license lucide-react v0.468.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const bo=H("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
237
- * @license lucide-react v0.468.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const yg=H("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
242
- * @license lucide-react v0.468.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const Kr=H("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
247
- * @license lucide-react v0.468.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const yt=H("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
252
- * @license lucide-react v0.468.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const Zn=H("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),jg=[{path:"/",label:"Dashboard",icon:hg},{path:"/results",label:"Results",icon:wo},{path:"/builder",label:"Builder",icon:Kr},{path:"/datasets",label:"Datasets",icon:Zt}];function Ng(){const e=Mt();return s.jsxs("div",{className:"app-shell",children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"p-5 border-b border-slate-800/70",children:[s.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Sandboxy Local"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Development Server"})]}),s.jsx("nav",{className:"p-4",children:s.jsx("ul",{className:"space-y-2",children:jg.map(({path:t,label:n,icon:r})=>s.jsx("li",{children:s.jsxs(Re,{to:t,"data-active":e.pathname===t,className:"nav-link",children:[s.jsx(r,{size:20}),n]})},t))})})]}),s.jsx("main",{className:"flex-1 overflow-auto",children:s.jsx(Sx,{})})]})}function wg(){const[e,t]=h.useState(null),[n,r]=h.useState(!0),[l,a]=h.useState(null);return h.useEffect(()=>{fetch("/api/v1/local/status").then(i=>{if(!i.ok)throw new Error("Failed to fetch status");return i.json()}).then(t).catch(i=>a(i.message)).finally(()=>r(!1))},[]),n?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})}):l?s.jsx("div",{className:"p-8 page",children:s.jsxs("div",{className:"text-red-400",children:["Error: ",l]})}):e?s.jsxs("div",{className:"p-8 page",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:"Dashboard"}),s.jsxs("p",{className:"text-slate-400",children:["Root: ",s.jsx("code",{className:"panel-subtle px-2 py-1 rounded",children:e.root_dir})]})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[s.jsx(rp,{size:20}),"Scenarios (",e.scenarios.length,")"]}),s.jsxs(Re,{to:"/builder",className:"flex items-center gap-1 px-3 py-1.5 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg text-sm font-semibold",children:[s.jsx(ke,{size:16}),"Create Scenario"]})]}),e.scenarios.length===0?s.jsx("p",{className:"text-slate-400",children:"No scenarios found in scenarios/"}):s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.scenarios.map(i=>s.jsxs("div",{className:"panel-card p-4",children:[s.jsx("h3",{className:"font-medium text-slate-100 mb-1",children:i.name}),s.jsx("p",{className:"text-sm text-slate-400 mb-3 line-clamp-2",children:i.description||"No description"}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-slate-500",children:i.relative_path}),s.jsxs(Re,{to:`/run/${i.id}`,className:"flex items-center gap-1 px-3 py-1 bg-orange-400 text-slate-900 rounded hover:bg-orange-300 transition-colors text-sm font-medium",children:[s.jsx(fn,{size:14}),"Run"]})]})]},i.id))})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[s.jsx(Kr,{size:20}),"Tools (",e.tools.length,")"]}),s.jsxs(Re,{to:"/tool-builder",className:"flex items-center gap-1 px-3 py-1.5 bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded-lg text-sm font-semibold",children:[s.jsx(ke,{size:16}),"Create Tool"]})]}),e.tools.length===0?s.jsx("p",{className:"text-slate-400",children:"No tools found in tools/"}):s.jsx("div",{className:"flex flex-wrap gap-2",children:e.tools.map(i=>s.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:i.name},i.id))})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(fg,{size:20}),"Agents (",e.agents.length,")"]}),e.agents.length===0?s.jsx("p",{className:"text-slate-400",children:"No agents found in agents/"}):s.jsx("div",{className:"flex flex-wrap gap-2",children:e.agents.map(i=>s.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:i.name},i.id))})]})]}):null}const kg="/api/v1";class bg{async fetch(t,n){const r=await fetch(`${kg}${t}`,{...n,headers:{"Content-Type":"application/json",...n==null?void 0:n.headers}});if(!r.ok){const l=await r.json().catch(()=>({detail:"Unknown error"}));throw new Error(l.detail||`HTTP ${r.status}`)}return r.json()}async getStatus(){return this.fetch("/local/status")}async listScenarios(){return this.fetch("/local/scenarios")}async getScenario(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}`)}async getScenarioGoals(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/goals`)}async getScenarioTools(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/tools`)}async listTools(){return this.fetch("/local/tools")}async getTool(t){return this.fetch(`/local/tools/${encodeURIComponent(t)}`)}async listAgents(){return this.fetch("/local/agents")}async getAgent(t){return this.fetch(`/local/agents/${encodeURIComponent(t)}`)}async listModels(){return this.fetch("/local/models")}async listRuns(){return this.fetch("/local/runs")}async getRun(t){return this.fetch(`/local/runs/${encodeURIComponent(t)}`)}async runScenario(t){return this.fetch("/local/run",{method:"POST",body:JSON.stringify(t)})}async compareModels(t){return this.fetch("/local/compare",{method:"POST",body:JSON.stringify(t)})}async listDatasets(){return this.fetch("/local/datasets")}async getDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`)}async saveDataset(t,n){return this.fetch("/local/datasets",{method:"POST",body:JSON.stringify({id:t,content:n})})}async updateDataset(t,n){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({id:t,content:n})})}async deleteDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"DELETE"})}async runDataset(t){return this.fetch("/local/run-dataset",{method:"POST",body:JSON.stringify(t)})}}const xe=new bg;function Sg(){const[e,t]=h.useState("idle"),[n,r]=h.useState(null),[l,a]=h.useState(null),[i,o]=h.useState(null),u=h.useCallback(()=>{t("idle"),r(null),a(null),o(null)},[]),c=h.useCallback(async(f,x,v)=>{u(),t("running");try{const N=await xe.runScenario({scenario_id:f,model:x,variables:v});N.error?(t("error"),o(N.error)):(t("completed"),r(N))}catch(N){t("error"),o(N instanceof Error?N.message:"Unknown error")}},[u]),p=h.useCallback(async(f,x,v=1,N)=>{u(),t("running");try{const y=await xe.compareModels({scenario_id:f,models:x,runs_per_model:v,variables:N});t("completed"),a(y)}catch(y){t("error"),o(y instanceof Error?y.message:"Unknown error")}},[u]);return{state:e,result:n,comparison:l,error:i,runScenario:c,compareModels:p,reset:u}}function ip(e){return e==null?"-":e<1e-4?"<$0.0001":e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function So({result:e}){var r,l,a;const[t,n]=h.useState(!1);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[e.evaluation&&s.jsxs("div",{className:"panel-card p-4 col-span-2 md:col-span-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(bo,{className:"w-4 h-4"}),"Score"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.evaluation.percentage.toFixed(0),"%"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[e.evaluation.total_score.toFixed(0)," / ",e.evaluation.max_score.toFixed(0)," pts"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(yo,{className:"w-4 h-4"}),"Latency"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[((e.latency_ms||0)/1e3).toFixed(1),"s"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(lp,{className:"w-4 h-4"}),"Messages"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((r=e.history)==null?void 0:r.length)||0})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Zn,{className:"w-4 h-4"}),"Tool Calls"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((l=e.tool_calls)==null?void 0:l.length)||0})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(mg,{className:"w-4 h-4"}),"Tokens"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((e.input_tokens||0)+(e.output_tokens||0)).toLocaleString()}),s.jsxs("div",{className:"text-xs text-slate-500",children:[(e.input_tokens||0).toLocaleString()," in / ",(e.output_tokens||0).toLocaleString()," out"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(No,{className:"w-4 h-4"}),"Cost"]}),s.jsx("div",{className:"text-2xl font-bold text-emerald-300",children:ip(e.cost_usd)})]})]}),e.evaluation&&e.evaluation.goals&&e.evaluation.goals.length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goals"}),s.jsx("div",{className:"space-y-3",children:e.evaluation.goals.map(i=>s.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${i.achieved?"bg-emerald-500/10 border-emerald-400/40":"bg-slate-950/40 border-slate-800/70"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[i.achieved?s.jsx(vo,{className:"w-5 h-5 text-emerald-400"}):s.jsx(ep,{className:"w-5 h-5 text-slate-500"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-slate-100",children:i.name||i.id}),i.reason&&s.jsx("div",{className:"text-sm text-slate-400",children:i.reason})]})]}),s.jsxs("div",{className:`font-bold ${i.achieved?"text-emerald-300":"text-slate-500"}`,children:[i.achieved?`+${i.points}`:"0"," pts"]})]},i.id))})]}),((a=e.evaluation)==null?void 0:a.judge)&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Judge Evaluation"}),s.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[s.jsxs("div",{className:`text-3xl font-bold ${e.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:[(e.evaluation.judge.score*100).toFixed(0),"%"]}),s.jsx("div",{className:`px-3 py-1 rounded-full text-sm ${e.evaluation.judge.passed?"bg-emerald-500/15 text-emerald-300":"bg-red-900/50 text-red-400"}`,children:e.evaluation.judge.passed?"Passed":"Failed"})]}),s.jsx("p",{className:"text-slate-400",children:e.evaluation.judge.reasoning})]}),e.response&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Response"}),s.jsx("div",{className:"panel-subtle rounded-lg p-4 whitespace-pre-wrap text-slate-200",children:e.response||"(No response)"})]}),e.history&&e.history.length>0&&s.jsxs("div",{className:"panel-card",children:[s.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/60 transition-colors rounded-lg",children:[s.jsxs("span",{className:"font-semibold text-slate-100",children:["Conversation History (",e.history.length," messages)"]}),s.jsx("span",{className:"text-slate-400",children:t?"Hide":"Show"})]}),t&&s.jsx("div",{className:"px-6 pb-6 space-y-4",children:e.history.map((i,o)=>s.jsxs("div",{className:`p-3 rounded-lg ${i.role==="user"?"bg-orange-500/10 border border-orange-400/40":i.role==="assistant"?"panel-subtle":i.role==="tool"?"bg-amber-500/10 border border-amber-400/40":"panel-subtle"}`,children:[s.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1 uppercase",children:i.role}),s.jsx("div",{className:"text-slate-200 whitespace-pre-wrap text-sm",children:i.content||"(empty)"})]},o))})]}),e.tool_calls&&e.tool_calls.length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:["Tool Calls (",e.tool_calls.length,")"]}),s.jsx("div",{className:"space-y-3",children:e.tool_calls.map((i,o)=>s.jsx(Cg,{call:i},o))})]}),e.error&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-red-500 bg-red-950/30",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-400 mb-1",children:[s.jsx(yn,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Error"})]}),s.jsx("p",{className:"text-sm text-red-300",children:e.error})]})]})}function Cg({call:e}){const[t,n]=h.useState(!1),r=e.result!==void 0&&e.result!==null,l=e.error!==void 0&&e.error!==null;return s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${e.success?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[t?s.jsx(Ye,{className:"w-4 h-4 text-slate-500"}):s.jsx(ft,{className:"w-4 h-4 text-slate-500"}),s.jsxs("code",{className:"text-orange-300",children:[e.tool,".",e.action,"()"]})]}),s.jsx("span",{className:`text-sm ${e.success?"text-emerald-300":"text-red-400"}`,children:e.success?"✓ Success":"✗ Failed"})]}),t&&s.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1",children:"Arguments"}),s.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-slate-950/50 rounded p-2",children:JSON.stringify(e.args,null,2)})]}),r&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-emerald-400 mb-1",children:"Result"}),s.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-emerald-950/30 rounded p-2 max-h-48",children:typeof e.result=="string"?e.result:JSON.stringify(e.result,null,2)})]}),l&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-red-400 mb-1",children:"Error"}),s.jsx("pre",{className:"text-xs text-red-300 overflow-auto bg-red-950/30 rounded p-2",children:e.error})]})]})]})}function Eg(e){var o;const t=e.ranking||[],n=[];for(const u of t){const c=(o=e.stats)==null?void 0:o[u];if(!c)continue;const p=c.avg_score||0,f=c.avg_cost_usd||0,x=c.avg_latency_ms||0,v=f>0?p/(f*100):p>0?1/0:0;n.push({modelId:u,score:p,cost:f,latency:x,efficiency:v,badges:[]})}if(n.length===0)return n;const r=n.reduce((u,c)=>u.score>c.score?u:c),l=n.reduce((u,c)=>u.efficiency>c.efficiency?u:c),a=n.filter(u=>u.score>=r.score*.7),i=a.length>0?a.reduce((u,c)=>u.latency<c.latency?u:c):null;for(const u of n)u.modelId===r.modelId&&u.badges.push("quality"),u.modelId===l.modelId&&l.cost>0&&u.badges.push("value"),i&&u.modelId===i.modelId&&u.badges.push("fast");return n}function _g({type:e}){switch(e){case"quality":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/20 text-amber-300 border border-amber-500/30",children:[s.jsx(bo,{className:"w-3 h-3"})," Best Quality"]});case"value":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",children:[s.jsx(No,{className:"w-3 h-3"})," Best Value"]});case"fast":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-blue-500/20 text-blue-300 border border-blue-500/30",children:[s.jsx(Zn,{className:"w-3 h-3"})," Fastest"]});default:return null}}function Rg({run:e,onClose:t}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70",onClick:t,children:s.jsxs("div",{className:"bg-slate-900 rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col",onClick:n=>n.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-800",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Details"}),s.jsx("p",{className:"text-sm text-slate-400",children:e.model})]}),s.jsx("button",{onClick:t,className:"p-2 text-slate-400 hover:text-slate-100 hover:bg-slate-800 rounded-lg",children:s.jsx(yt,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"overflow-auto p-4",children:s.jsx(So,{result:e})})]})})}function op({comparison:e}){var p,f,x,v,N,y,j,m;const[t,n]=h.useState(null),[r,l]=h.useState(null),a=e.ranking||[],i=Eg(e),o=new Map(i.map(d=>[d.modelId,d])),u=new Map;if(e.results)for(const d of e.results){const g=u.get(d.model)||[];g.push(d),u.set(d.model,g)}const c=e.results&&e.results.length>0;return s.jsxs(s.Fragment,{children:[r&&s.jsx(Rg,{run:r,onClose:()=>l(null)}),s.jsxs("div",{className:"space-y-6",children:[i.length>0&&s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.find(d=>d.badges.includes("quality"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-amber-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 mb-1",children:[s.jsx(bo,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Best Quality"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((p=i.find(d=>d.badges.includes("quality")))==null?void 0:p.modelId.split("/")[1])||((f=i.find(d=>d.badges.includes("quality")))==null?void 0:f.modelId)}),s.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:["Highest score: ",(x=i.find(d=>d.badges.includes("quality")))==null?void 0:x.score.toFixed(1)," pts"]})]}),i.find(d=>d.badges.includes("value"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-emerald-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-emerald-300 mb-1",children:[s.jsx(No,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Best Value"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((v=i.find(d=>d.badges.includes("value")))==null?void 0:v.modelId.split("/")[1])||((N=i.find(d=>d.badges.includes("value")))==null?void 0:N.modelId)}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:(()=>{const d=i.find(T=>T.badges.includes("value")),g=i.find(T=>T.badges.includes("quality"));if(!d||!g)return"";if(d.cost===0)return"Free!";if(d.modelId===g.modelId)return"Also the best quality!";const S=Math.round(d.score/g.score*100),k=g.cost>0?Math.round(d.cost/g.cost*100):0;return k===0?`${S}% quality, nearly free`:`${S}% quality at ${k}% cost`})()})]}),i.find(d=>d.badges.includes("fast"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-blue-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-blue-300 mb-1",children:[s.jsx(Zn,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Fastest"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((y=i.find(d=>d.badges.includes("fast")))==null?void 0:y.modelId.split("/")[1])||((j=i.find(d=>d.badges.includes("fast")))==null?void 0:j.modelId)}),s.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:[((((m=i.find(d=>d.badges.includes("fast")))==null?void 0:m.latency)||0)/1e3).toFixed(1),"s avg latency"]})]})]}),s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Model Comparison"}),s.jsxs("p",{className:"text-sm text-slate-400",children:[e.runs_per_model," run(s) per model"]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-slate-950/70",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Rank"}),s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Score"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Judge"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Latency"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Tokens"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Cost"})]})}),s.jsx("tbody",{children:a.map((d,g)=>{var L,O;const S=(L=e.stats)==null?void 0:L[d],k=o.get(d),T=u.get(d)||[],A=t===d;return S?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`border-t border-slate-800/70 hover:bg-slate-900/40 ${c?"cursor-pointer":""}`,onClick:()=>c&&n(A?null:d),children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[c&&(A?s.jsx(Ye,{className:"w-4 h-4 text-slate-500"}):s.jsx(ft,{className:"w-4 h-4 text-slate-500"})),s.jsxs("span",{className:`font-bold ${g===0?"text-amber-300":"text-slate-400"}`,children:["#",g+1]})]})}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"text-slate-100 font-medium",children:d}),k&&k.badges.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:k.badges.map(F=>s.jsx(_g,{type:F},F))})]}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-100 font-semibold",children:((O=S.avg_score)==null?void 0:O.toFixed(1))||"0"}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:S.avg_judge_score!=null?`${(S.avg_judge_score*100).toFixed(0)}%`:"-"}),s.jsxs("td",{className:"px-4 py-3 text-right text-slate-400",children:[((S.avg_latency_ms||0)/1e3).toFixed(1),"s"]}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:((S.total_input_tokens||0)+(S.total_output_tokens||0)).toLocaleString()}),s.jsx("td",{className:"px-4 py-3 text-right text-emerald-300 font-medium",children:ip(S.avg_cost_usd)})]},d),A&&T.length>0&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-4 py-2 bg-slate-950/50",children:s.jsxs("div",{className:"ml-8 space-y-2",children:[s.jsxs("div",{className:"text-sm font-medium text-slate-400 mb-2",children:["Individual Runs (",T.length,")"]}),T.map((F,B)=>{var Y,le,se;return s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-slate-900/50 border border-slate-800/50 hover:bg-slate-800/50 cursor-pointer",onClick:_=>{_.stopPropagation(),l(F)},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-slate-500 text-sm",children:["Run ",B+1]}),s.jsxs("span",{className:"text-slate-100 font-medium",children:[((le=(Y=F.evaluation)==null?void 0:Y.percentage)==null?void 0:le.toFixed(0))||0,"%"]}),((se=F.evaluation)==null?void 0:se.judge)&&s.jsx("span",{className:`text-sm ${F.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:F.evaluation.judge.passed?"✓ Passed":"✗ Failed"}),F.error&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center gap-1",children:[s.jsx(yn,{className:"w-3 h-3"})," Error"]})]}),s.jsxs("button",{className:"flex items-center gap-1 text-sm text-orange-300 hover:text-orange-200",onClick:_=>{_.stopPropagation(),l(F)},children:[s.jsx(np,{className:"w-4 h-4"}),"View Details"]})]},B)})]})})},`${d}-runs`)]}):null})})]})})]}),e.stats&&Object.values(e.stats).some(d=>d.goal_rates&&Object.keys(d.goal_rates).length>0)&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goal Achievement Rates"}),(()=>{const d=new Set;return Object.values(e.stats).forEach(g=>{g.goal_rates&&Object.keys(g.goal_rates).forEach(S=>d.add(S))}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-slate-950/70",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),Array.from(d).map(g=>s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:g},g))]})}),s.jsx("tbody",{children:a.map(g=>{var k;const S=(k=e.stats)==null?void 0:k[g];return S?s.jsxs("tr",{className:"border-t border-slate-800/70",children:[s.jsx("td",{className:"px-4 py-3 text-slate-100 font-medium",children:g}),Array.from(d).map(T=>{var L;const A=((L=S.goal_rates)==null?void 0:L[T])??0;return s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsxs("span",{className:A>=100?"text-emerald-300":A>=50?"text-amber-300":"text-red-400",children:[A.toFixed(0),"%"]})},T)})]},g):null})})]})})})()]})]})]})}function Xu({models:e,value:t,onChange:n,disabled:r,placeholder:l="Select a model..."}){const[a,i]=h.useState(!1),[o,u]=h.useState(""),c=h.useRef(null),p=h.useRef(null),f=e.find(j=>j.id===t);h.useEffect(()=>{const j=m=>{c.current&&!c.current.contains(m.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),h.useEffect(()=>{a&&p.current&&p.current.focus()},[a]);const x=e.filter(j=>j.name.toLowerCase().includes(o.toLowerCase())||j.id.toLowerCase().includes(o.toLowerCase())),v=x.reduce((j,m)=>{const d=m.id.split("/")[0]||"other";return j[d]||(j[d]=[]),j[d].push(m),j},{}),N=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],y=Object.keys(v).sort((j,m)=>{const d=N.indexOf(j),g=N.indexOf(m);return d===-1&&g===-1?j.localeCompare(m):d===-1?1:g===-1?-1:d-g});return s.jsxs("div",{ref:c,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>!r&&i(!a),disabled:r,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${r?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${a?"ring-2 ring-orange-400":""}`,children:[f?s.jsxs("div",{className:"flex items-center justify-between flex-1 min-w-0",children:[s.jsx("span",{className:"text-slate-100 truncate",children:f.name}),s.jsx("span",{className:"text-xs text-slate-500 ml-2 shrink-0",children:f.price})]}):s.jsx("span",{className:"text-slate-500",children:l}),s.jsx(Ye,{size:18,className:`text-slate-400 shrink-0 transition-transform ${a?"rotate-180":""}`})]}),a&&s.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 shadow-xl max-h-80 overflow-hidden flex flex-col",children:[s.jsx("div",{className:"p-2 border-b border-slate-800/70",children:s.jsxs("div",{className:"relative",children:[s.jsx(ko,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{ref:p,type:"text",value:o,onChange:j=>u(j.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),s.jsxs("div",{className:"overflow-y-auto flex-1",children:[y.map(j=>s.jsxs("div",{children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0",children:j}),v[j].map(m=>s.jsxs("button",{type:"button",onClick:()=>{n(m.id),i(!1),u("")},className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${m.id===t?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"truncate",children:m.name})}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:m.price}),m.id===t&&s.jsx(Qr,{size:16,className:"text-orange-400 shrink-0"})]},m.id))]},j)),x.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function Tg({models:e,selected:t,onChange:n,disabled:r}){const[l,a]=h.useState(!1),[i,o]=h.useState(""),u=h.useRef(null),c=h.useRef(null);h.useEffect(()=>{const j=m=>{u.current&&!u.current.contains(m.target)&&a(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),h.useEffect(()=>{l&&c.current&&c.current.focus()},[l]);const p=j=>{t.includes(j)?n(t.filter(m=>m!==j)):n([...t,j])},f=(j,m)=>{m.stopPropagation(),n(t.filter(d=>d!==j))},x=e.filter(j=>j.name.toLowerCase().includes(i.toLowerCase())||j.id.toLowerCase().includes(i.toLowerCase())),v=x.reduce((j,m)=>{const d=m.id.split("/")[0]||"other";return j[d]||(j[d]=[]),j[d].push(m),j},{}),N=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],y=Object.keys(v).sort((j,m)=>{const d=N.indexOf(j),g=N.indexOf(m);return d===-1&&g===-1?j.localeCompare(m):d===-1?1:g===-1?-1:d-g});return s.jsxs("div",{ref:u,className:"relative",children:[t.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(j=>{const m=e.find(d=>d.id===j);return s.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 bg-orange-500/20 border border-orange-400/40 rounded-full text-sm text-slate-100",children:[(m==null?void 0:m.name)||j,s.jsx("button",{type:"button",onClick:d=>f(j,d),className:"hover:text-red-400 transition-colors",disabled:r,children:s.jsx(yt,{size:14})})]},j)})}),s.jsxs("button",{type:"button",onClick:()=>!r&&a(!l),disabled:r,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${r?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${l?"ring-2 ring-orange-400":""}`,children:[s.jsx("span",{className:"text-slate-500",children:t.length===0?"Click to add models...":"Add more models..."}),s.jsx(Ye,{size:18,className:`text-slate-400 shrink-0 transition-transform ${l?"rotate-180":""}`})]}),l&&s.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 shadow-xl max-h-80 overflow-hidden flex flex-col",children:[s.jsx("div",{className:"p-2 border-b border-slate-800/70",children:s.jsxs("div",{className:"relative",children:[s.jsx(ko,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{ref:c,type:"text",value:i,onChange:j=>o(j.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),s.jsxs("div",{className:"overflow-y-auto flex-1",children:[y.map(j=>s.jsxs("div",{children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0",children:j}),v[j].map(m=>{const d=t.includes(m.id);return s.jsxs("button",{type:"button",onClick:()=>p(m.id),className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${d?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[s.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center shrink-0 ${d?"bg-orange-400 border-orange-400":"border-slate-600"}`,children:d&&s.jsx(Qr,{size:12,className:"text-slate-900"})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"truncate",children:m.name})}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:m.price})]},m.id)})]},j)),x.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function Zu(){var wn;const{scenarioId:e}=dx(),[t]=rg(),n=t.get("dataset"),r=parseInt(t.get("parallel")||"5"),[l,a]=h.useState([]),[i,o]=h.useState(null),[u,c]=h.useState(e||""),[p,f]=h.useState([]),[x,v]=h.useState(""),[N,y]=h.useState([]),[j,m]=h.useState(n?"dataset":"single"),[d,g]=h.useState(1),[S,k]=h.useState({}),[T,A]=h.useState(!0),[L,O]=h.useState(null),[F,B]=h.useState([]),[Y,le]=h.useState(n||""),[se,_]=h.useState(null),[R,E]=h.useState(!1),[w,b]=h.useState(r),{state:C,result:M,comparison:I,error:J,runScenario:Z,compareModels:nt}=Sg();h.useEffect(()=>{(async()=>{try{const[G,Pe,Xp]=await Promise.all([xe.listScenarios(),xe.listModels(),xe.listDatasets()]);if(a(G),f(Pe),B(Xp),Pe.length>0&&v(Pe[0].id),e){c(e);const Po=await xe.getScenario(e);o(Po);const Lo={};for(const Mo of Po.variables||[])Lo[Mo.name]=Mo.default??"";k(Lo)}}catch(G){O(G instanceof Error?G.message:"Failed to load data")}finally{A(!1)}})()},[e]),h.useEffect(()=>{u&&u!==e&&xe.getScenario(u).then($=>{o($);const G={};for(const Pe of $.variables||[])G[Pe.name]=Pe.default??"";k(G)}).catch($=>O($.message))},[u,e]);const Qe=async()=>{const $=u||e;if($)if(j==="dataset"){if(!Y||!x)return;E(!0),_(null);try{const G=await xe.runDataset({scenario_id:$,dataset_id:Y,model:x,parallel:w});_(G)}catch(G){O(G instanceof Error?G.message:"Dataset run failed")}finally{E(!1)}}else if(j==="single"){if(!x)return;await Z($,x,S)}else{if(N.length===0)return;await nt($,N,d,S)}},rt=($,G)=>{k(Pe=>({...Pe,[$]:G}))};return T?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Gu,{className:"w-8 h-8 animate-spin text-orange-400"})}):L?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"panel-solid p-4 text-red-400 border border-red-700/60",children:L})}):s.jsxs("div",{className:"p-8 max-w-6xl mx-auto page",children:[s.jsxs(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 mb-6",children:[s.jsx(fs,{size:20}),"Back to Dashboard"]}),s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:(i==null?void 0:i.name)||e}),(i==null?void 0:i.description)&&s.jsx("p",{className:"text-slate-400",children:i.description})]}),s.jsxs("div",{className:"panel-card p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Configuration"}),s.jsxs(Re,{to:"/builder",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 text-sm",children:[s.jsx(gg,{size:16}),"Edit Scenario"]})]}),!e&&s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Scenario"}),s.jsxs("select",{value:u,onChange:$=>c($.target.value),disabled:C==="running"||R,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:[s.jsx("option",{value:"",children:"Select a scenario..."}),l.map($=>s.jsx("option",{value:$.id,children:$.name},$.id))]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Mode"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>m("single"),disabled:C==="running"||R,className:`px-4 py-2 rounded-lg transition-colors ${j==="single"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Single Model"}),s.jsx("button",{onClick:()=>m("compare"),disabled:C==="running"||R,className:`px-4 py-2 rounded-lg transition-colors ${j==="compare"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Compare Models"}),s.jsxs("button",{onClick:()=>m("dataset"),disabled:C==="running"||R||F.length===0,className:`flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${j==="dataset"?"bg-blue-500 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[s.jsx(Zt,{size:16}),"Dataset Benchmark"]})]})]}),j==="single"?s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),s.jsx(Xu,{models:p,value:x,onChange:v,disabled:C==="running"})]}):j==="compare"?s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Models to Compare"}),s.jsx(Tg,{models:p,selected:N,onChange:y,disabled:C==="running"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Runs per Model"}),s.jsx("input",{type:"number",min:1,max:10,value:d,onChange:$=>g(Math.max(1,Math.min(10,parseInt($.target.value)||1))),disabled:C==="running",className:"w-32 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"More runs = more statistical significance"})]})]}):s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Dataset"}),s.jsxs("select",{value:Y,onChange:$=>le($.target.value),disabled:R,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[s.jsx("option",{value:"",children:"Select a dataset..."}),F.map($=>s.jsxs("option",{value:$.id,children:[$.name," (",$.case_count," cases)"]},$.id))]}),F.length===0&&s.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["No datasets found. ",s.jsx(Re,{to:"/datasets",className:"text-blue-400 hover:underline",children:"Create one"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),s.jsx(Xu,{models:p,value:x,onChange:v,disabled:R})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Parallel Runs"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"number",min:1,max:20,value:w,onChange:$=>b(Math.max(1,Math.min(20,parseInt($.target.value)||1))),disabled:R,className:"w-20 panel-subtle px-3 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400"}),s.jsx("span",{className:"text-sm text-slate-500",children:"concurrent cases"})]}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Higher = faster, but may hit rate limits"})]})]}),i&&i.variables&&i.variables.length>0&&s.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(ap,{size:18,className:"text-slate-400"}),s.jsx("h3",{className:"font-medium text-slate-100",children:"Variables"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.variables.map($=>s.jsx(Pg,{variable:$,value:S[$.name],onChange:G=>rt($.name,G),disabled:C==="running"},$.name))})]}),s.jsx("button",{onClick:Qe,disabled:C==="running"||R||!u||(j==="single"?!x:j==="compare"?N.length===0:!Y||!x),className:`flex items-center gap-2 ${j==="dataset"?"bg-blue-500 hover:bg-blue-400":"bg-orange-400 hover:bg-orange-300"} disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-6 py-2 rounded-lg transition-colors font-semibold`,children:C==="running"||R?s.jsxs(s.Fragment,{children:[s.jsx(Gu,{className:"w-4 h-4 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[j==="dataset"?s.jsx(Zt,{className:"w-4 h-4"}):s.jsx(fn,{className:"w-4 h-4"}),j==="single"?"Run Scenario":j==="compare"?`Compare ${N.length} Models`:`Run ${((wn=F.find($=>$.id===Y))==null?void 0:wn.case_count)||0} Cases`]})})]}),J&&s.jsx("div",{className:"panel-solid border border-red-700/60 p-4 mb-6 text-red-400",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ep,{className:"w-5 h-5"}),s.jsx("span",{children:J})]})}),M&&s.jsx(So,{result:M}),I&&s.jsx(op,{comparison:I}),se&&s.jsx(Ag,{result:se})]})}function Ag({result:e}){const[t,n]=h.useState(new Set),r=l=>{const a=new Set(t);a.has(l)?a.delete(l):a.add(l),n(a)};return s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(Zt,{size:20}),"Dataset Benchmark Results"]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.passed_cases,"/",e.total_cases]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Cases Passed"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:`text-2xl font-bold ${e.pass_rate>=.9?"text-green-400":e.pass_rate>=.7?"text-yellow-400":"text-red-400"}`,children:[(e.pass_rate*100).toFixed(1),"%"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Pass Rate"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Avg Score"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Total Time"})]})]}),Object.keys(e.by_expected).length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"font-medium text-slate-300 mb-3",children:"By Expected Outcome"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:Object.entries(e.by_expected).map(([l,a])=>{const i=a.passed+a.failed,o=i>0?a.passed/i:0;return s.jsxs("div",{className:"panel-subtle p-3 rounded",children:[s.jsx("div",{className:"font-medium text-slate-200",children:l}),s.jsxs("div",{className:"text-sm text-slate-400",children:[a.passed,"/",i," (",(o*100).toFixed(0),"%)"]})]},l)})})]}),s.jsxs("div",{children:[s.jsxs("h3",{className:"font-medium text-slate-300 mb-3",children:["Case Results (",e.failed_cases," failed)"]}),s.jsx("div",{className:"space-y-2 max-h-[40vh] overflow-y-auto",children:e.case_results.map(l=>s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${l.passed?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>r(l.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[l.passed?s.jsx(Qr,{size:16,className:"text-green-400"}):s.jsx(yt,{size:16,className:"text-red-400"}),s.jsx("span",{className:"font-medium text-slate-200",children:l.case_id}),l.expected&&s.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",l.expected]}),s.jsxs("span",{className:"ml-auto text-sm text-slate-400",children:[l.percentage.toFixed(0),"% | ",l.latency_ms,"ms"]})]}),t.has(l.case_id)&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[l.failure_reason&&s.jsx("div",{className:"text-red-400 text-sm mb-2",children:l.failure_reason}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Expected:"})," ",s.jsx("span",{className:"text-slate-200",children:l.expected||"N/A"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Actual:"})," ",s.jsx("span",{className:"text-slate-200",children:l.actual_outcome||"None"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Score:"})," ",s.jsxs("span",{className:"text-slate-200",children:[l.goal_score,"/",l.max_score]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Latency:"})," ",s.jsxs("span",{className:"text-slate-200",children:[l.latency_ms,"ms"]})]})]})]})]},l.case_id))})]})]})}function Pg({variable:e,value:t,onChange:n,disabled:r}){const l="w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400 disabled:opacity-50";return s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:[e.label,e.required&&s.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),e.type==="select"&&e.options.length>0?s.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value),disabled:r,className:l,children:[s.jsx("option",{value:"",children:"Select..."}),e.options.map(a=>s.jsx("option",{value:a,children:a},a))]}):e.type==="boolean"?s.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value==="true"),disabled:r,className:l,children:[s.jsx("option",{value:"",children:"Select..."}),s.jsx("option",{value:"true",children:"True"}),s.jsx("option",{value:"false",children:"False"})]}):e.type==="number"?s.jsx("input",{type:"number",value:String(t??""),onChange:a=>n(a.target.value?Number(a.target.value):""),disabled:r,placeholder:e.default!==null?`Default: ${e.default}`:"",className:l}):s.jsx("input",{type:"text",value:String(t??""),onChange:a=>n(a.target.value),disabled:r,placeholder:e.default!==null?`Default: ${e.default}`:"",className:l})]})}const ec=e=>e.scenario_id.endsWith("_comparison")||e.filename.includes("_comparison_"),tc=e=>e.scenario_id.includes("_dataset_")||e.filename.includes("_dataset_"),Cl=e=>e.replace(/_comparison$/,"").replace(/_dataset_.*$/,"");function Lg(){const[e,t]=h.useState([]),[n,r]=h.useState(!0),[l,a]=h.useState(null),[i,o]=h.useState(null),[u,c]=h.useState(null),[p,f]=h.useState(!1),[x,v]=h.useState(!1),[N,y]=h.useState(""),[j,m]=h.useState("all"),[d,g]=h.useState(new Set),S=_=>{g(R=>{const E=new Set(R);return E.has(_)?E.delete(_):E.add(_),E})},{filteredResults:k,groupedResults:T,scenarioOrder:A}=h.useMemo(()=>{let _=e.filter(w=>{if(N){const b=N.toLowerCase();if(!w.scenario_id.toLowerCase().includes(b))return!1}if(j!=="all"){const b=ec(w),C=tc(w);if(j==="comparison"&&!b||j==="dataset"&&!C||j==="single"&&(b||C))return!1}return!0});_=_.sort((w,b)=>new Date(b.timestamp).getTime()-new Date(w.timestamp).getTime());const R={},E=[];for(const w of _){const b=Cl(w.scenario_id);R[b]||(R[b]=[],E.push(b)),R[b].push(w)}return{filteredResults:_,groupedResults:R,scenarioOrder:E}},[e,N,j]);h.useEffect(()=>{fetch("/api/v1/local/runs").then(_=>{if(!_.ok)throw new Error("Failed to fetch results");return _.json()}).then(t).catch(_=>a(_.message)).finally(()=>r(!1))},[]);const L=async _=>{try{const R=await fetch(`/api/v1/local/runs/${encodeURIComponent(_)}`);if(!R.ok)throw new Error("Failed to fetch result");const E=await R.json();o(E),c(_),f(!1)}catch(R){console.error("Error fetching result:",R)}},O=async()=>{if(i)try{await navigator.clipboard.writeText(JSON.stringify(i,null,2)),v(!0),setTimeout(()=>v(!1),2e3)}catch(_){console.error("Failed to copy:",_)}},F=_=>{var M,I,J,Z,nt;if(!_)return"unknown";const R=_.case_results||((M=_.result)==null?void 0:M.case_results),E=_.dataset_id||((I=_.result)==null?void 0:I.dataset_id);if(R||E)return"dataset";if(_.ranking||((J=_.result)==null?void 0:J.ranking))return"comparison";const b=_.model||((Z=_.result)==null?void 0:Z.model),C=_.response||((nt=_.result)==null?void 0:nt.response);return b||C!==void 0?"single":"unknown"},B=_=>{const R=_.result||_;return{id:R.id||"",scenario_id:R.scenario_id||_.scenario_id||"",model:R.model||"",response:R.response||"",history:R.history||[],tool_calls:R.tool_calls||[],final_state:R.final_state||{},evaluation:R.evaluation||null,latency_ms:R.latency_ms||0,input_tokens:R.input_tokens||0,output_tokens:R.output_tokens||0,cost_usd:R.cost_usd||null,error:R.error||null}},Y=_=>{const R=_.result||_;return{scenario_id:R.scenario_id||_.scenario_id||"",scenario_name:R.scenario_name||_.scenario_id||"",models:R.models||[],runs_per_model:R.runs_per_model||1,stats:R.stats||{},ranking:R.ranking||[],winner:R.winner||null,results:R.results||[]}},le=_=>{const R=_.result||_;return{scenario_id:R.scenario_id||_.scenario_id||"",model:R.model||"",dataset_id:R.dataset_id||"",total_cases:R.total_cases||0,passed_cases:R.passed_cases||0,failed_cases:R.failed_cases||0,pass_rate:R.pass_rate||0,avg_score:R.avg_score||0,avg_percentage:R.avg_percentage||0,by_expected:R.by_expected||{},total_time_ms:R.total_time_ms||0,case_results:R.case_results||[]}};if(n)return s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})});if(l)return s.jsx("div",{className:"p-8 page",children:s.jsxs("div",{className:"text-red-400",children:["Error: ",l]})});const se=F(i);return s.jsxs("div",{className:"p-8 page",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-6",children:"Run Results"}),e.length===0?s.jsxs("div",{className:"panel-card p-6 text-center",children:[s.jsx(wo,{size:48,className:"mx-auto text-slate-600 mb-4"}),s.jsx("p",{className:"text-slate-400 mb-2",children:"No run results found"}),s.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Run a scenario to see results here."}),s.jsxs(Re,{to:"/",className:"inline-flex items-center gap-2 text-orange-300 hover:text-orange-200",children:[s.jsx(fn,{size:16}),"Go to Dashboard"]})]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(ko,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{type:"text",placeholder:"Search scenarios...",value:N,onChange:_=>y(_.target.value),className:"w-full bg-slate-900/60 border border-slate-700/50 rounded-lg pl-10 pr-4 py-2 text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/50"})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 p-1 bg-slate-900/60 rounded-lg border border-slate-700/50",children:[s.jsx("button",{onClick:()=>m("all"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors ${j==="all"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"All"}),s.jsxs("button",{onClick:()=>m("single"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="single"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(Zn,{size:12}),"Single"]}),s.jsxs("button",{onClick:()=>m("comparison"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="comparison"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(Ju,{size:12}),"Compare"]}),s.jsxs("button",{onClick:()=>m("dataset"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="dataset"?"bg-blue-600/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(Zt,{size:12}),"Dataset"]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h2",{className:"text-sm font-medium text-slate-400",children:[k.length," result",k.length!==1?"s":""," in ",A.length," scenario",A.length!==1?"s":""]}),N&&s.jsx("button",{onClick:()=>y(""),className:"text-xs text-slate-500 hover:text-slate-300",children:"Clear"})]}),s.jsx("div",{className:"space-y-2 max-h-[70vh] overflow-y-auto pr-2",children:A.length===0?s.jsxs("div",{className:"text-center py-8 text-slate-500",children:[s.jsx(pg,{size:24,className:"mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"No results match your filters"})]}):A.map(_=>{const R=T[_],E=d.has(_);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("button",{onClick:()=>S(_),className:"w-full flex items-center justify-between p-3 hover:bg-slate-800/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[E?s.jsx(ft,{size:16,className:"text-slate-500"}):s.jsx(Ye,{size:16,className:"text-slate-500"}),s.jsx("span",{className:"font-medium text-slate-200 text-sm",children:_})]}),s.jsx("span",{className:"text-xs text-slate-500 bg-slate-800/60 px-2 py-0.5 rounded",children:R.length})]}),!E&&s.jsx("div",{className:"border-t border-slate-800/50",children:R.map(w=>{const b=ec(w),C=tc(w);return s.jsxs("div",{className:`flex items-center justify-between p-3 cursor-pointer transition-colors border-l-2 ${u===w.filename?"bg-slate-800/60 border-l-orange-400":"hover:bg-slate-800/40 border-l-transparent"}`,onClick:()=>L(w.filename),children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C?s.jsx(Zt,{size:14,className:"text-blue-400 flex-shrink-0"}):b?s.jsx(Ju,{size:14,className:"text-purple-400 flex-shrink-0"}):s.jsx(Zn,{size:14,className:"text-orange-400 flex-shrink-0"}),s.jsx("div",{className:"min-w-0",children:s.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1",children:[s.jsx(yo,{size:10}),new Date(w.timestamp).toLocaleString()]})})]}),s.jsx(Re,{to:`/run/${Cl(w.scenario_id)}`,onClick:M=>M.stopPropagation(),className:"p-1.5 text-slate-500 hover:text-orange-300 hover:bg-slate-700/60 rounded flex-shrink-0",title:"Run again",children:s.jsx(fn,{size:12})})]},w.filename)})})]},_)})})]}),s.jsx("div",{className:"lg:col-span-2",children:i?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"panel-card p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"font-semibold text-slate-100 truncate",children:Cl(i.scenario_id)}),se==="single"&&B(i).model&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Model: ",B(i).model]}),se==="comparison"&&s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Model Comparison"}),se==="dataset"&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Dataset: ",le(i).dataset_id," | Model: ",le(i).model]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs("button",{onClick:O,className:`flex items-center gap-1 text-xs px-2 py-1 border rounded whitespace-nowrap transition-colors ${x?"text-emerald-400 border-emerald-500/50 bg-emerald-500/10":"text-slate-400 hover:text-slate-100 border-slate-700/70"}`,children:[s.jsx(tp,{size:12}),x?"Copied!":"Copy JSON"]}),s.jsx("button",{onClick:()=>f(!p),className:"text-xs text-slate-400 hover:text-slate-100 px-2 py-1 border border-slate-700/70 rounded whitespace-nowrap",children:p?"View Details":"View JSON"}),s.jsxs(Re,{to:`/run/${Cl(i.scenario_id)}`,className:"flex items-center gap-1 bg-orange-400 hover:bg-orange-300 text-slate-900 px-3 py-1 rounded text-sm font-semibold whitespace-nowrap",children:[s.jsx(fn,{size:14}),"Run Again"]})]})]})}),p?s.jsx("div",{className:"panel-card p-4",children:s.jsx("pre",{className:"text-xs text-slate-300 bg-slate-950/70 p-3 rounded overflow-auto max-h-[70vh]",children:JSON.stringify(i,null,2)})}):s.jsxs(s.Fragment,{children:[se==="single"&&s.jsx(So,{result:B(i)}),se==="comparison"&&s.jsx(op,{comparison:Y(i)}),se==="dataset"&&s.jsx(Mg,{result:le(i)}),se==="unknown"&&s.jsx("div",{className:"panel-card p-6 text-center",children:s.jsx("p",{className:"text-slate-500",children:'Could not parse result format. Click "View JSON" to see raw data.'})})]})]}):s.jsxs("div",{className:"panel-card p-8 text-center",children:[s.jsx(np,{size:32,className:"mx-auto text-slate-600 mb-3"}),s.jsx("p",{className:"text-slate-400",children:"Select a result to view details"})]})})]})]})}function Mg({result:e}){const[t,n]=h.useState(new Set),r=o=>{const u=new Set(t);u.has(o)?u.delete(o):u.add(o),n(u)},l=e.passed_cases,a=e.total_cases,i=e.pass_rate;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Zt,{className:"w-4 h-4"}),"Cases Passed"]}),s.jsxs("div",{className:`text-2xl font-bold ${i>=.9?"text-emerald-300":i>=.7?"text-amber-300":"text-red-400"}`,children:[l,"/",a]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[(i*100).toFixed(1),"% pass rate"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Qr,{className:"w-4 h-4"}),"Avg Score"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[e.avg_score.toFixed(1)," points"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(yo,{className:"w-4 h-4"}),"Total Time"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[Math.round(e.total_time_ms/Math.max(a,1)),"ms/case"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(yt,{className:"w-4 h-4"}),"Failed"]}),s.jsx("div",{className:"text-2xl font-bold text-red-400",children:e.failed_cases}),s.jsxs("div",{className:"text-xs text-slate-500",children:[a-l," case",a-l!==1?"s":""," failed"]})]})]}),Object.keys(e.by_expected).length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"font-semibold text-slate-100 mb-4",children:"By Expected Outcome"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Object.entries(e.by_expected).map(([o,u])=>{const c=u.passed+u.failed,p=c>0?u.passed/c:0;return s.jsxs("div",{className:"panel-subtle p-3 rounded-lg",children:[s.jsx("div",{className:"font-medium text-slate-200",children:o}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("div",{className:`text-lg font-semibold ${p>=.9?"text-emerald-300":p>=.7?"text-amber-300":"text-red-400"}`,children:[u.passed,"/",c]}),s.jsxs("span",{className:"text-xs text-slate-500",children:["(",(p*100).toFixed(0),"%)"]})]})]},o)})})]}),s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h3",{className:"font-semibold text-slate-100 mb-4",children:["Case Results (",e.failed_cases," failed, ",e.passed_cases," passed)"]}),s.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.case_results.map(o=>s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${o.passed?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>r(o.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[o.passed?s.jsx(Qr,{size:16,className:"text-emerald-400 flex-shrink-0"}):s.jsx(yt,{size:16,className:"text-red-400 flex-shrink-0"}),s.jsx("span",{className:"font-medium text-slate-200",children:o.case_id}),o.expected&&o.expected.length>0&&s.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",o.expected.join(" or ")]}),s.jsxs("span",{className:"ml-auto text-sm text-slate-400 flex-shrink-0",children:[o.percentage.toFixed(0),"% | ",o.latency_ms,"ms"]}),t.has(o.case_id)?s.jsx(Ye,{size:14,className:"text-slate-500 flex-shrink-0"}):s.jsx(ft,{size:14,className:"text-slate-500 flex-shrink-0"})]}),t.has(o.case_id)&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[o.failure_reason&&s.jsx("div",{className:"text-red-400 text-sm mb-2 p-2 bg-red-950/30 rounded",children:o.failure_reason}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Expected:"})," ",s.jsx("span",{className:"text-slate-200",children:o.expected&&o.expected.length>0?o.expected.join(" or "):"N/A"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Actual:"})," ",s.jsx("span",{className:"text-slate-200",children:o.actual_outcome||"None"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Score:"})," ",s.jsxs("span",{className:"text-slate-200",children:[o.goal_score,"/",o.max_score]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Latency:"})," ",s.jsxs("span",{className:"text-slate-200",children:[o.latency_ms,"ms"]})]})]})]})]},o.case_id))})]})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function up(e){return typeof e>"u"||e===null}function Fg(e){return typeof e=="object"&&e!==null}function Og(e){return Array.isArray(e)?e:up(e)?[]:[e]}function zg(e,t){var n,r,l,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)l=a[n],e[l]=t[l];return e}function Dg(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Ig(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var $g=up,Bg=Fg,Ug=Og,Hg=Dg,Vg=Ig,Wg=zg,de={isNothing:$g,isObject:Bg,toArray:Ug,repeat:Hg,isNegativeZero:Vg,extend:Wg};function cp(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
257
-
258
- `+e.mark.snippet),r+" "+n):r}function qr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=cp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}qr.prototype=Object.create(Error.prototype);qr.prototype.constructor=qr;qr.prototype.toString=function(t){return this.name+": "+cp(this,t)};var Ee=qr;function pa(e,t,n,r,l){var a="",i="",o=Math.floor(l/2)-1;return r-t>o&&(a=" ... ",t=r-o+a.length),n-r>o&&(i=" ...",n=r+o-i.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+i,pos:r-t+a.length}}function ma(e,t){return de.repeat(" ",t-e.length)+e}function Yg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],l=[],a,i=-1;a=n.exec(e.buffer);)l.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&i<0&&(i=r.length-2);i<0&&(i=r.length-1);var o="",u,c,p=Math.min(e.line+t.linesAfter,l.length).toString().length,f=t.maxLength-(t.indent+p+3);for(u=1;u<=t.linesBefore&&!(i-u<0);u++)c=pa(e.buffer,r[i-u],l[i-u],e.position-(r[i]-r[i-u]),f),o=de.repeat(" ",t.indent)+ma((e.line-u+1).toString(),p)+" | "+c.str+`
259
- `+o;for(c=pa(e.buffer,r[i],l[i],e.position,f),o+=de.repeat(" ",t.indent)+ma((e.line+1).toString(),p)+" | "+c.str+`
260
- `,o+=de.repeat("-",t.indent+p+3+c.pos)+`^
261
- `,u=1;u<=t.linesAfter&&!(i+u>=l.length);u++)c=pa(e.buffer,r[i+u],l[i+u],e.position-(r[i]-r[i+u]),f),o+=de.repeat(" ",t.indent)+ma((e.line+u+1).toString(),p)+" | "+c.str+`
262
- `;return o.replace(/\n$/,"")}var Qg=Yg,Kg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],qg=["scalar","sequence","mapping"];function Jg(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Gg(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Kg.indexOf(n)===-1)throw new Ee('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Jg(t.styleAliases||null),qg.indexOf(this.kind)===-1)throw new Ee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ve=Gg;function nc(e,t){var n=[];return e[t].forEach(function(r){var l=n.length;n.forEach(function(a,i){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(l=i)}),n[l]=r}),n}function Xg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(l){l.multi?(e.multi[l.kind].push(l),e.multi.fallback.push(l)):e[l.kind][l.tag]=e.fallback[l.tag]=l}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function fi(e){return this.extend(e)}fi.prototype.extend=function(t){var n=[],r=[];if(t instanceof ve)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Ee("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof ve))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Ee("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Ee("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof ve))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(fi.prototype);return l.implicit=(this.implicit||[]).concat(n),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=nc(l,"implicit"),l.compiledExplicit=nc(l,"explicit"),l.compiledTypeMap=Xg(l.compiledImplicit,l.compiledExplicit),l};var dp=fi,fp=new ve("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),pp=new ve("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),mp=new ve("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),hp=new dp({explicit:[fp,pp,mp]});function Zg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ev(){return null}function tv(e){return e===null}var xp=new ve("tag:yaml.org,2002:null",{kind:"scalar",resolve:Zg,construct:ev,predicate:tv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function nv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function rv(e){return e==="true"||e==="True"||e==="TRUE"}function lv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var gp=new ve("tag:yaml.org,2002:bool",{kind:"scalar",resolve:nv,construct:rv,predicate:lv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function sv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function av(e){return 48<=e&&e<=55}function iv(e){return 48<=e&&e<=57}function ov(e){if(e===null)return!1;var t=e.length,n=0,r=!1,l;if(!t)return!1;if(l=e[n],(l==="-"||l==="+")&&(l=e[++n]),l==="0"){if(n+1===t)return!0;if(l=e[++n],l==="b"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(l!=="0"&&l!=="1")return!1;r=!0}return r&&l!=="_"}if(l==="x"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(!sv(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}if(l==="o"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(!av(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}}if(l==="_")return!1;for(;n<t;n++)if(l=e[n],l!=="_"){if(!iv(e.charCodeAt(n)))return!1;r=!0}return!(!r||l==="_")}function uv(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function cv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var vp=new ve("tag:yaml.org,2002:int",{kind:"scalar",resolve:ov,construct:uv,predicate:cv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),dv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function fv(e){return!(e===null||!dv.test(e)||e[e.length-1]==="_")}function pv(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var mv=/^[-+]?[0-9]+e/;function hv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),mv.test(n)?n.replace("e",".e"):n}function xv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var yp=new ve("tag:yaml.org,2002:float",{kind:"scalar",resolve:fv,construct:pv,predicate:xv,represent:hv,defaultStyle:"lowercase"}),jp=hp.extend({implicit:[xp,gp,vp,yp]}),Np=jp,wp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),kp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function gv(e){return e===null?!1:wp.exec(e)!==null||kp.exec(e)!==null}function vv(e){var t,n,r,l,a,i,o,u=0,c=null,p,f,x;if(t=wp.exec(e),t===null&&(t=kp.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,l=+t[3],!t[4])return new Date(Date.UTC(n,r,l));if(a=+t[4],i=+t[5],o=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(p=+t[10],f=+(t[11]||0),c=(p*60+f)*6e4,t[9]==="-"&&(c=-c)),x=new Date(Date.UTC(n,r,l,a,i,o,u)),c&&x.setTime(x.getTime()-c),x}function yv(e){return e.toISOString()}var bp=new ve("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:gv,construct:vv,instanceOf:Date,represent:yv});function jv(e){return e==="<<"||e===null}var Sp=new ve("tag:yaml.org,2002:merge",{kind:"scalar",resolve:jv}),Co=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
263
- \r`;function Nv(e){if(e===null)return!1;var t,n,r=0,l=e.length,a=Co;for(n=0;n<l;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function wv(e){var t,n,r=e.replace(/[\r\n=]/g,""),l=r.length,a=Co,i=0,o=[];for(t=0;t<l;t++)t%4===0&&t&&(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)),i=i<<6|a.indexOf(r.charAt(t));return n=l%4*6,n===0?(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)):n===18?(o.push(i>>10&255),o.push(i>>2&255)):n===12&&o.push(i>>4&255),new Uint8Array(o)}function kv(e){var t="",n=0,r,l,a=e.length,i=Co;for(r=0;r<a;r++)r%3===0&&r&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[r];return l=a%3,l===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):l===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):l===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}function bv(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Cp=new ve("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Nv,construct:wv,predicate:bv,represent:kv}),Sv=Object.prototype.hasOwnProperty,Cv=Object.prototype.toString;function Ev(e){if(e===null)return!0;var t=[],n,r,l,a,i,o=e;for(n=0,r=o.length;n<r;n+=1){if(l=o[n],i=!1,Cv.call(l)!=="[object Object]")return!1;for(a in l)if(Sv.call(l,a))if(!i)i=!0;else return!1;if(!i)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function _v(e){return e!==null?e:[]}var Ep=new ve("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ev,construct:_v}),Rv=Object.prototype.toString;function Tv(e){if(e===null)return!0;var t,n,r,l,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1){if(r=i[t],Rv.call(r)!=="[object Object]"||(l=Object.keys(r),l.length!==1))return!1;a[t]=[l[0],r[l[0]]]}return!0}function Av(e){if(e===null)return[];var t,n,r,l,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1)r=i[t],l=Object.keys(r),a[t]=[l[0],r[l[0]]];return a}var _p=new ve("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Tv,construct:Av}),Pv=Object.prototype.hasOwnProperty;function Lv(e){if(e===null)return!0;var t,n=e;for(t in n)if(Pv.call(n,t)&&n[t]!==null)return!1;return!0}function Mv(e){return e!==null?e:{}}var Rp=new ve("tag:yaml.org,2002:set",{kind:"mapping",resolve:Lv,construct:Mv}),Eo=Np.extend({implicit:[bp,Sp],explicit:[Cp,Ep,_p,Rp]}),en=Object.prototype.hasOwnProperty,ms=1,Tp=2,Ap=3,hs=4,ha=1,Fv=2,rc=3,Ov=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zv=/[\x85\u2028\u2029]/,Dv=/[,\[\]\{\}]/,Pp=/^(?:!|!!|![a-z\-]+!)$/i,Lp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function lc(e){return Object.prototype.toString.call(e)}function vt(e){return e===10||e===13}function pn(e){return e===9||e===32}function Fe(e){return e===9||e===32||e===10||e===13}function Dn(e){return e===44||e===91||e===93||e===123||e===125}function Iv(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function $v(e){return e===120?2:e===117?4:e===85?8:0}function Bv(e){return 48<=e&&e<=57?e-48:-1}function sc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
264
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Uv(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Mp(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var Fp=new Array(256),Op=new Array(256);for(var bn=0;bn<256;bn++)Fp[bn]=sc(bn)?1:0,Op[bn]=sc(bn);function Hv(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Eo,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function zp(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Qg(n),new Ee(t,n)}function D(e,t){throw zp(e,t)}function xs(e,t){e.onWarning&&e.onWarning.call(null,zp(e,t))}var ac={YAML:function(t,n,r){var l,a,i;t.version!==null&&D(t,"duplication of %YAML directive"),r.length!==1&&D(t,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),l===null&&D(t,"ill-formed argument of the YAML directive"),a=parseInt(l[1],10),i=parseInt(l[2],10),a!==1&&D(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&xs(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var l,a;r.length!==2&&D(t,"TAG directive accepts exactly two arguments"),l=r[0],a=r[1],Pp.test(l)||D(t,"ill-formed tag handle (first argument) of the TAG directive"),en.call(t.tagMap,l)&&D(t,'there is a previously declared suffix for "'+l+'" tag handle'),Lp.test(a)||D(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{D(t,"tag prefix is malformed: "+a)}t.tagMap[l]=a}};function Jt(e,t,n,r){var l,a,i,o;if(t<n){if(o=e.input.slice(t,n),r)for(l=0,a=o.length;l<a;l+=1)i=o.charCodeAt(l),i===9||32<=i&&i<=1114111||D(e,"expected valid JSON character");else Ov.test(o)&&D(e,"the stream contains non-printable characters");e.result+=o}}function ic(e,t,n,r){var l,a,i,o;for(de.isObject(n)||D(e,"cannot merge mappings; the provided source object is unacceptable"),l=Object.keys(n),i=0,o=l.length;i<o;i+=1)a=l[i],en.call(t,a)||(Mp(t,a,n[a]),r[a]=!0)}function In(e,t,n,r,l,a,i,o,u){var c,p;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,p=l.length;c<p;c+=1)Array.isArray(l[c])&&D(e,"nested arrays are not supported inside keys"),typeof l=="object"&&lc(l[c])==="[object Object]"&&(l[c]="[object Object]");if(typeof l=="object"&&lc(l)==="[object Object]"&&(l="[object Object]"),l=String(l),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,p=a.length;c<p;c+=1)ic(e,t,a[c],n);else ic(e,t,a,n);else!e.json&&!en.call(n,l)&&en.call(t,l)&&(e.line=i||e.line,e.lineStart=o||e.lineStart,e.position=u||e.position,D(e,"duplicated mapping key")),Mp(t,l,a),delete n[l];return t}function _o(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):D(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ue(e,t,n){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;pn(l);)l===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),l=e.input.charCodeAt(++e.position);if(t&&l===35)do l=e.input.charCodeAt(++e.position);while(l!==10&&l!==13&&l!==0);if(vt(l))for(_o(e),l=e.input.charCodeAt(e.position),r++,e.lineIndent=0;l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&xs(e,"deficient indentation"),r}function zs(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Fe(n)))}function Ro(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
265
- `,t-1))}function Vv(e,t,n){var r,l,a,i,o,u,c,p,f=e.kind,x=e.result,v;if(v=e.input.charCodeAt(e.position),Fe(v)||Dn(v)||v===35||v===38||v===42||v===33||v===124||v===62||v===39||v===34||v===37||v===64||v===96||(v===63||v===45)&&(l=e.input.charCodeAt(e.position+1),Fe(l)||n&&Dn(l)))return!1;for(e.kind="scalar",e.result="",a=i=e.position,o=!1;v!==0;){if(v===58){if(l=e.input.charCodeAt(e.position+1),Fe(l)||n&&Dn(l))break}else if(v===35){if(r=e.input.charCodeAt(e.position-1),Fe(r))break}else{if(e.position===e.lineStart&&zs(e)||n&&Dn(v))break;if(vt(v))if(u=e.line,c=e.lineStart,p=e.lineIndent,ue(e,!1,-1),e.lineIndent>=t){o=!0,v=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=u,e.lineStart=c,e.lineIndent=p;break}}o&&(Jt(e,a,i,!1),Ro(e,e.line-u),a=i=e.position,o=!1),pn(v)||(i=e.position+1),v=e.input.charCodeAt(++e.position)}return Jt(e,a,i,!1),e.result?!0:(e.kind=f,e.result=x,!1)}function Wv(e,t){var n,r,l;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=l=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Jt(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,l=e.position;else return!0;else vt(n)?(Jt(e,r,l,!0),Ro(e,ue(e,!1,t)),r=l=e.position):e.position===e.lineStart&&zs(e)?D(e,"unexpected end of the document within a single quoted scalar"):(e.position++,l=e.position);D(e,"unexpected end of the stream within a single quoted scalar")}function Yv(e,t){var n,r,l,a,i,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Jt(e,n,e.position,!0),e.position++,!0;if(o===92){if(Jt(e,n,e.position,!0),o=e.input.charCodeAt(++e.position),vt(o))ue(e,!1,t);else if(o<256&&Fp[o])e.result+=Op[o],e.position++;else if((i=$v(o))>0){for(l=i,a=0;l>0;l--)o=e.input.charCodeAt(++e.position),(i=Iv(o))>=0?a=(a<<4)+i:D(e,"expected hexadecimal character");e.result+=Uv(a),e.position++}else D(e,"unknown escape sequence");n=r=e.position}else vt(o)?(Jt(e,n,r,!0),Ro(e,ue(e,!1,t)),n=r=e.position):e.position===e.lineStart&&zs(e)?D(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}D(e,"unexpected end of the stream within a double quoted scalar")}function Qv(e,t){var n=!0,r,l,a,i=e.tag,o,u=e.anchor,c,p,f,x,v,N=Object.create(null),y,j,m,d;if(d=e.input.charCodeAt(e.position),d===91)p=93,v=!1,o=[];else if(d===123)p=125,v=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);d!==0;){if(ue(e,!0,t),d=e.input.charCodeAt(e.position),d===p)return e.position++,e.tag=i,e.anchor=u,e.kind=v?"mapping":"sequence",e.result=o,!0;n?d===44&&D(e,"expected the node content, but found ','"):D(e,"missed comma between flow collection entries"),j=y=m=null,f=x=!1,d===63&&(c=e.input.charCodeAt(e.position+1),Fe(c)&&(f=x=!0,e.position++,ue(e,!0,t))),r=e.line,l=e.lineStart,a=e.position,er(e,t,ms,!1,!0),j=e.tag,y=e.result,ue(e,!0,t),d=e.input.charCodeAt(e.position),(x||e.line===r)&&d===58&&(f=!0,d=e.input.charCodeAt(++e.position),ue(e,!0,t),er(e,t,ms,!1,!0),m=e.result),v?In(e,o,N,j,y,m,r,l,a):f?o.push(In(e,null,N,j,y,m,r,l,a)):o.push(y),ue(e,!0,t),d=e.input.charCodeAt(e.position),d===44?(n=!0,d=e.input.charCodeAt(++e.position)):n=!1}D(e,"unexpected end of the stream within a flow collection")}function Kv(e,t){var n,r,l=ha,a=!1,i=!1,o=t,u=0,c=!1,p,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)ha===l?l=f===43?rc:Fv:D(e,"repeat of a chomping mode identifier");else if((p=Bv(f))>=0)p===0?D(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?D(e,"repeat of an indentation width identifier"):(o=t+p-1,i=!0);else break;if(pn(f)){do f=e.input.charCodeAt(++e.position);while(pn(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!vt(f)&&f!==0)}for(;f!==0;){for(_o(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!i||e.lineIndent<o)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>o&&(o=e.lineIndent),vt(f)){u++;continue}if(e.lineIndent<o){l===rc?e.result+=de.repeat(`
266
- `,a?1+u:u):l===ha&&a&&(e.result+=`
267
- `);break}for(r?pn(f)?(c=!0,e.result+=de.repeat(`
268
- `,a?1+u:u)):c?(c=!1,e.result+=de.repeat(`
269
- `,u+1)):u===0?a&&(e.result+=" "):e.result+=de.repeat(`
270
- `,u):e.result+=de.repeat(`
271
- `,a?1+u:u),a=!0,i=!0,u=0,n=e.position;!vt(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Jt(e,n,e.position,!1)}return!0}function oc(e,t){var n,r=e.tag,l=e.anchor,a=[],i,o=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,"tab characters must not be used in indentation")),!(u!==45||(i=e.input.charCodeAt(e.position+1),!Fe(i))));){if(o=!0,e.position++,ue(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,er(e,t,Ap,!1,!0),a.push(e.result),ue(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)D(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=r,e.anchor=l,e.kind="sequence",e.result=a,!0):!1}function qv(e,t,n){var r,l,a,i,o,u,c=e.tag,p=e.anchor,f={},x=Object.create(null),v=null,N=null,y=null,j=!1,m=!1,d;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),d=e.input.charCodeAt(e.position);d!==0;){if(!j&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(d===63||d===58)&&Fe(r))d===63?(j&&(In(e,f,x,v,N,null,i,o,u),v=N=y=null),m=!0,j=!0,l=!0):j?(j=!1,l=!0):D(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,d=r;else{if(i=e.line,o=e.lineStart,u=e.position,!er(e,n,Tp,!1,!0))break;if(e.line===a){for(d=e.input.charCodeAt(e.position);pn(d);)d=e.input.charCodeAt(++e.position);if(d===58)d=e.input.charCodeAt(++e.position),Fe(d)||D(e,"a whitespace character is expected after the key-value separator within a block mapping"),j&&(In(e,f,x,v,N,null,i,o,u),v=N=y=null),m=!0,j=!1,l=!1,v=e.tag,N=e.result;else if(m)D(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=p,!0}else if(m)D(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=p,!0}if((e.line===a||e.lineIndent>t)&&(j&&(i=e.line,o=e.lineStart,u=e.position),er(e,t,hs,!0,l)&&(j?N=e.result:y=e.result),j||(In(e,f,x,v,N,y,i,o,u),v=N=y=null),ue(e,!0,-1),d=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&d!==0)D(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return j&&In(e,f,x,v,N,null,i,o,u),m&&(e.tag=c,e.anchor=p,e.kind="mapping",e.result=f),m}function Jv(e){var t,n=!1,r=!1,l,a,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&D(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(n=!0,i=e.input.charCodeAt(++e.position)):i===33?(r=!0,l="!!",i=e.input.charCodeAt(++e.position)):l="!",t=e.position,n){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(a=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):D(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!Fe(i);)i===33&&(r?D(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(t-1,e.position+1),Pp.test(l)||D(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Dv.test(a)&&D(e,"tag suffix cannot contain flow indicator characters")}a&&!Lp.test(a)&&D(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{D(e,"tag name is malformed: "+a)}return n?e.tag=a:en.call(e.tagMap,l)?e.tag=e.tagMap[l]+a:l==="!"?e.tag="!"+a:l==="!!"?e.tag="tag:yaml.org,2002:"+a:D(e,'undeclared tag handle "'+l+'"'),!0}function Gv(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&D(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Fe(n)&&!Dn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&D(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Xv(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Fe(r)&&!Dn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&D(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),en.call(e.anchorMap,n)||D(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ue(e,!0,-1),!0}function er(e,t,n,r,l){var a,i,o,u=1,c=!1,p=!1,f,x,v,N,y,j;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=i=o=hs===n||Ap===n,r&&ue(e,!0,-1)&&(c=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;Jv(e)||Gv(e);)ue(e,!0,-1)?(c=!0,o=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):o=!1;if(o&&(o=c||l),(u===1||hs===n)&&(ms===n||Tp===n?y=t:y=t+1,j=e.position-e.lineStart,u===1?o&&(oc(e,j)||qv(e,j,y))||Qv(e,y)?p=!0:(i&&Kv(e,y)||Wv(e,y)||Yv(e,y)?p=!0:Xv(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&D(e,"alias node should not have any properties")):Vv(e,y,ms===n)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(p=o&&oc(e,j))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&D(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,x=e.implicitTypes.length;f<x;f+=1)if(N=e.implicitTypes[f],N.resolve(e.result)){e.result=N.construct(e.result),e.tag=N.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(en.call(e.typeMap[e.kind||"fallback"],e.tag))N=e.typeMap[e.kind||"fallback"][e.tag];else for(N=null,v=e.typeMap.multi[e.kind||"fallback"],f=0,x=v.length;f<x;f+=1)if(e.tag.slice(0,v[f].tag.length)===v[f].tag){N=v[f];break}N||D(e,"unknown tag !<"+e.tag+">"),e.result!==null&&N.kind!==e.kind&&D(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+N.kind+'", not "'+e.kind+'"'),N.resolve(e.result,e.tag)?(e.result=N.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):D(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Zv(e){var t=e.position,n,r,l,a=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(i=e.input.charCodeAt(e.position))!==0&&(ue(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(a=!0,i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!Fe(i);)i=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),l=[],r.length<1&&D(e,"directive name must not be less than one character in length");i!==0;){for(;pn(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!vt(i));break}if(vt(i))break;for(n=e.position;i!==0&&!Fe(i);)i=e.input.charCodeAt(++e.position);l.push(e.input.slice(n,e.position))}i!==0&&_o(e),en.call(ac,r)?ac[r](e,r,l):xs(e,'unknown document directive "'+r+'"')}if(ue(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ue(e,!0,-1)):a&&D(e,"directives end mark is expected"),er(e,e.lineIndent-1,hs,!1,!0),ue(e,!0,-1),e.checkLineBreaks&&zv.test(e.input.slice(t,e.position))&&xs(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&zs(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ue(e,!0,-1));return}if(e.position<e.length-1)D(e,"end of the stream or a document separator is expected");else return}function Dp(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
272
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Hv(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,D(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Zv(n);return n.documents}function ey(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=Dp(e,n);if(typeof t!="function")return r;for(var l=0,a=r.length;l<a;l+=1)t(r[l])}function ty(e,t){var n=Dp(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ee("expected a single document in the stream, but found more")}}var ny=ey,ry=ty,Ip={loadAll:ny,load:ry},$p=Object.prototype.toString,Bp=Object.prototype.hasOwnProperty,To=65279,ly=9,Jr=10,sy=13,ay=32,iy=33,oy=34,pi=35,uy=37,cy=38,dy=39,fy=42,Up=44,py=45,gs=58,my=61,hy=62,xy=63,gy=64,Hp=91,Vp=93,vy=96,Wp=123,yy=124,Yp=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var jy=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ny=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wy(e,t){var n,r,l,a,i,o,u;if(t===null)return{};for(n={},r=Object.keys(t),l=0,a=r.length;l<a;l+=1)i=r[l],o=String(t[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),u=e.compiledTypeMap.fallback[i],u&&Bp.call(u.styleAliases,o)&&(o=u.styleAliases[o]),n[i]=o;return n}function ky(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Ee("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",r-t.length)+t}var by=1,Gr=2;function Sy(e){this.schema=e.schema||Eo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=wy(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Gr:by,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function uc(e,t){for(var n=de.repeat(" ",t),r=0,l=-1,a="",i,o=e.length;r<o;)l=e.indexOf(`
273
- `,r),l===-1?(i=e.slice(r),r=o):(i=e.slice(r,l+1),r=l+1),i.length&&i!==`
274
- `&&(a+=n),a+=i;return a}function mi(e,t){return`
275
- `+de.repeat(" ",e.indent*t)}function Cy(e,t){var n,r,l;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(l=e.implicitTypes[n],l.resolve(t))return!0;return!1}function vs(e){return e===ay||e===ly}function Xr(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==To||65536<=e&&e<=1114111}function cc(e){return Xr(e)&&e!==To&&e!==sy&&e!==Jr}function dc(e,t,n){var r=cc(e),l=r&&!vs(e);return(n?r:r&&e!==Up&&e!==Hp&&e!==Vp&&e!==Wp&&e!==Yp)&&e!==pi&&!(t===gs&&!l)||cc(t)&&!vs(t)&&e===pi||t===gs&&l}function Ey(e){return Xr(e)&&e!==To&&!vs(e)&&e!==py&&e!==xy&&e!==gs&&e!==Up&&e!==Hp&&e!==Vp&&e!==Wp&&e!==Yp&&e!==pi&&e!==cy&&e!==fy&&e!==iy&&e!==yy&&e!==my&&e!==hy&&e!==dy&&e!==oy&&e!==uy&&e!==gy&&e!==vy}function _y(e){return!vs(e)&&e!==gs}function yr(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function Qp(e){var t=/^\n* /;return t.test(e)}var Kp=1,hi=2,qp=3,Jp=4,Sn=5;function Ry(e,t,n,r,l,a,i,o){var u,c=0,p=null,f=!1,x=!1,v=r!==-1,N=-1,y=Ey(yr(e,0))&&_y(yr(e,e.length-1));if(t||i)for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=yr(e,u),!Xr(c))return Sn;y=y&&dc(c,p,o),p=c}else{for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=yr(e,u),c===Jr)f=!0,v&&(x=x||u-N-1>r&&e[N+1]!==" ",N=u);else if(!Xr(c))return Sn;y=y&&dc(c,p,o),p=c}x=x||v&&u-N-1>r&&e[N+1]!==" "}return!f&&!x?y&&!i&&!l(e)?Kp:a===Gr?Sn:hi:n>9&&Qp(e)?Sn:i?a===Gr?Sn:hi:x?Jp:qp}function Ty(e,t,n,r,l){e.dump=function(){if(t.length===0)return e.quotingType===Gr?'""':"''";if(!e.noCompatMode&&(jy.indexOf(t)!==-1||Ny.test(t)))return e.quotingType===Gr?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),o=r||e.flowLevel>-1&&n>=e.flowLevel;function u(c){return Cy(e,c)}switch(Ry(t,o,e.indent,i,u,e.quotingType,e.forceQuotes&&!r,l)){case Kp:return t;case hi:return"'"+t.replace(/'/g,"''")+"'";case qp:return"|"+fc(t,e.indent)+pc(uc(t,a));case Jp:return">"+fc(t,e.indent)+pc(uc(Ay(t,i),a));case Sn:return'"'+Py(t)+'"';default:throw new Ee("impossible error: invalid scalar style")}}()}function fc(e,t){var n=Qp(e)?String(t):"",r=e[e.length-1]===`
276
- `,l=r&&(e[e.length-2]===`
277
- `||e===`
278
- `),a=l?"+":r?"":"-";return n+a+`
279
- `}function pc(e){return e[e.length-1]===`
280
- `?e.slice(0,-1):e}function Ay(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
281
- `);return c=c!==-1?c:e.length,n.lastIndex=c,mc(e.slice(0,c),t)}(),l=e[0]===`
282
- `||e[0]===" ",a,i;i=n.exec(e);){var o=i[1],u=i[2];a=u[0]===" ",r+=o+(!l&&!a&&u!==""?`
283
- `:"")+mc(u,t),l=a}return r}function mc(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,l=0,a,i=0,o=0,u="";r=n.exec(e);)o=r.index,o-l>t&&(a=i>l?i:o,u+=`
284
- `+e.slice(l,a),l=a+1),i=o;return u+=`
285
- `,e.length-l>t&&i>l?u+=e.slice(l,i)+`
286
- `+e.slice(i+1):u+=e.slice(l),u.slice(1)}function Py(e){for(var t="",n=0,r,l=0;l<e.length;n>=65536?l+=2:l++)n=yr(e,l),r=Se[n],!r&&Xr(n)?(t+=e[l],n>=65536&&(t+=e[l+1])):t+=r||ky(n);return t}function Ly(e,t,n){var r="",l=e.tag,a,i,o;for(a=0,i=n.length;a<i;a+=1)o=n[a],e.replacer&&(o=e.replacer.call(n,String(a),o)),(Pt(e,t,o,!1,!1)||typeof o>"u"&&Pt(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=l,e.dump="["+r+"]"}function hc(e,t,n,r){var l="",a=e.tag,i,o,u;for(i=0,o=n.length;i<o;i+=1)u=n[i],e.replacer&&(u=e.replacer.call(n,String(i),u)),(Pt(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&Pt(e,t+1,null,!0,!0,!1,!0))&&((!r||l!=="")&&(l+=mi(e,t)),e.dump&&Jr===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=a,e.dump=l||"[]"}function My(e,t,n){var r="",l=e.tag,a=Object.keys(n),i,o,u,c,p;for(i=0,o=a.length;i<o;i+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),u=a[i],c=n[u],e.replacer&&(c=e.replacer.call(n,u,c)),Pt(e,t,u,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Pt(e,t,c,!1,!1)&&(p+=e.dump,r+=p));e.tag=l,e.dump="{"+r+"}"}function Fy(e,t,n,r){var l="",a=e.tag,i=Object.keys(n),o,u,c,p,f,x;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new Ee("sortKeys must be a boolean or a function");for(o=0,u=i.length;o<u;o+=1)x="",(!r||l!=="")&&(x+=mi(e,t)),c=i[o],p=n[c],e.replacer&&(p=e.replacer.call(n,c,p)),Pt(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Jr===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,f&&(x+=mi(e,t)),Pt(e,t+1,p,!0,f)&&(e.dump&&Jr===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,l+=x));e.tag=a,e.dump=l||"{}"}function xc(e,t,n){var r,l,a,i,o,u;for(l=n?e.explicitTypes:e.implicitTypes,a=0,i=l.length;a<i;a+=1)if(o=l[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(n?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(u=e.styleMap[o.tag]||o.defaultStyle,$p.call(o.represent)==="[object Function]")r=o.represent(t,u);else if(Bp.call(o.represent,u))r=o.represent[u](t,u);else throw new Ee("!<"+o.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function Pt(e,t,n,r,l,a,i){e.tag=null,e.dump=n,xc(e,n,!1)||xc(e,n,!0);var o=$p.call(e.dump),u=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var p=o==="[object Object]"||o==="[object Array]",f,x;if(p&&(f=e.duplicates.indexOf(n),x=f!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(l=!1),x&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(p&&x&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(Fy(e,t,e.dump,l),x&&(e.dump="&ref_"+f+e.dump)):(My(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!i&&t>0?hc(e,t-1,e.dump,l):hc(e,t,e.dump,l),x&&(e.dump="&ref_"+f+e.dump)):(Ly(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&Ty(e,e.dump,t,a,u);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ee("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Oy(e,t){var n=[],r=[],l,a;for(xi(e,n,r),l=0,a=r.length;l<a;l+=1)t.duplicates.push(n[r[l]]);t.usedDuplicates=new Array(a)}function xi(e,t,n){var r,l,a;if(e!==null&&typeof e=="object")if(l=t.indexOf(e),l!==-1)n.indexOf(l)===-1&&n.push(l);else if(t.push(e),Array.isArray(e))for(l=0,a=e.length;l<a;l+=1)xi(e[l],t,n);else for(r=Object.keys(e),l=0,a=r.length;l<a;l+=1)xi(e[r[l]],t,n)}function zy(e,t){t=t||{};var n=new Sy(t);n.noRefs||Oy(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Pt(n,0,r,!0,!0)?n.dump+`
287
- `:""}var Dy=zy,Iy={dump:Dy};function Ao(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var $y=ve,By=dp,Uy=hp,Hy=jp,Vy=Np,Wy=Eo,Yy=Ip.load,Qy=Ip.loadAll,Ky=Iy.dump,qy=Ee,Jy={binary:Cp,float:yp,map:mp,null:xp,pairs:_p,set:Rp,timestamp:bp,bool:gp,int:vp,merge:Sp,omap:Ep,seq:pp,str:fp},Gy=Ao("safeLoad","load"),Xy=Ao("safeLoadAll","loadAll"),Zy=Ao("safeDump","dump"),Zr={Type:$y,Schema:By,FAILSAFE_SCHEMA:Uy,JSON_SCHEMA:Hy,CORE_SCHEMA:Vy,DEFAULT_SCHEMA:Wy,load:Yy,loadAll:Qy,dump:Ky,YAMLException:qy,types:Jy,safeLoad:Gy,safeLoadAll:Xy,safeDump:Zy};const gc={id:"",name:"",description:"",category:"",tags:[],variables:[],interactionMode:"prompt",prompt:"",style:"",systemPrompt:"",steps:[],toolsFrom:[],inlineTools:{},initialState:{},goals:[],judge:null,maxScore:null};function e1(){const[e,t]=h.useState(gc),n=h.useMemo(()=>{const _={};e.id&&(_.id=e.id),e.name&&(_.name=e.name),e.description&&(_.description=e.description),e.category&&(_.category=e.category),e.tags.length>0&&(_.tags=e.tags),e.variables.length>0&&(_.variables=e.variables.map(E=>{const w={name:E.name,type:E.type};return E.label&&(w.label=E.label),E.default!==""&&E.default!==void 0&&(w.default=E.default),E.type==="select"&&E.options.length>0&&(w.options=E.options),E.required||(w.required=!1),w})),e.systemPrompt&&(_.system_prompt=e.systemPrompt),e.interactionMode==="prompt"?(e.prompt&&(_.prompt=e.prompt),e.style&&(_.style=e.style)):e.steps.length>0&&(_.steps=e.steps.map(E=>({id:E.id,action:E.action,params:E.params}))),e.toolsFrom.length>0&&(_.tools_from=e.toolsFrom),Object.keys(e.inlineTools).length>0&&(_.tools=e.inlineTools),Object.keys(e.initialState).length>0&&(_.initial_state=e.initialState);const R={};return e.goals.length>0&&(R.goals=e.goals.map(E=>({id:E.id,name:E.name,description:E.description,points:E.points,detection:E.detection}))),e.judge&&(R.judge=e.judge),e.maxScore!==null&&(R.max_score=e.maxScore),Object.keys(R).length>0&&(_.evaluation=R),Zr.dump(_,{lineWidth:-1,noRefs:!0})},[e]),r=h.useMemo(()=>{const _=[];return e.id?/^[a-z0-9-]+$/.test(e.id)||_.push("ID must be lowercase letters, numbers, and hyphens only"):_.push("Scenario ID is required"),e.interactionMode==="prompt"&&!e.prompt&&_.push("Prompt is required for single-turn scenarios"),e.interactionMode==="steps"&&e.steps.length===0&&_.push("At least one step is required for multi-turn scenarios"),e.steps.forEach((R,E)=>{R.id||_.push(`Step ${E+1}: ID is required`),R.action==="inject_user"&&!R.params.content&&_.push(`Step ${E+1}: Content is required for inject_user`)}),e.goals.forEach((R,E)=>{R.id||_.push(`Goal ${E+1}: ID is required`),R.detection.type||_.push(`Goal ${E+1}: Detection type is required`)}),_},[e]),l=r.length===0,a=h.useCallback(_=>{t(R=>({...R,id:_}))},[]),i=h.useCallback(_=>{t(R=>({...R,name:_}))},[]),o=h.useCallback(_=>{t(R=>({...R,description:_}))},[]),u=h.useCallback(_=>{t(R=>({...R,category:_}))},[]),c=h.useCallback(_=>{t(R=>({...R,tags:_}))},[]),p=h.useCallback(_=>{t(R=>({...R,variables:[...R.variables,_]}))},[]),f=h.useCallback((_,R)=>{t(E=>({...E,variables:E.variables.map((w,b)=>b===_?R:w)}))},[]),x=h.useCallback(_=>{t(R=>({...R,variables:R.variables.filter((E,w)=>w!==_)}))},[]),v=h.useCallback(_=>{t(R=>({...R,interactionMode:_}))},[]),N=h.useCallback(_=>{t(R=>({...R,prompt:_}))},[]),y=h.useCallback(_=>{t(R=>({...R,style:_}))},[]),j=h.useCallback(_=>{t(R=>({...R,systemPrompt:_}))},[]),m=h.useCallback(_=>{t(R=>({...R,steps:[...R.steps,_]}))},[]),d=h.useCallback((_,R)=>{t(E=>({...E,steps:E.steps.map((w,b)=>b===_?R:w)}))},[]),g=h.useCallback(_=>{t(R=>({...R,steps:R.steps.filter((E,w)=>w!==_)}))},[]),S=h.useCallback((_,R)=>{t(E=>{const w=[...E.steps],[b]=w.splice(_,1);return w.splice(R,0,b),{...E,steps:w}})},[]),k=h.useCallback(_=>{t(R=>({...R,toolsFrom:_}))},[]),T=h.useCallback(_=>{t(R=>({...R,inlineTools:_}))},[]),A=h.useCallback(_=>{t(R=>({...R,initialState:_}))},[]),L=h.useCallback(_=>{t(R=>({...R,goals:[...R.goals,_]}))},[]),O=h.useCallback((_,R)=>{t(E=>({...E,goals:E.goals.map((w,b)=>b===_?R:w)}))},[]),F=h.useCallback(_=>{t(R=>({...R,goals:R.goals.filter((E,w)=>w!==_)}))},[]),B=h.useCallback(_=>{t(R=>({...R,judge:_}))},[]),Y=h.useCallback(_=>{t(R=>({...R,maxScore:_}))},[]),le=h.useCallback(()=>{t(gc)},[]),se=h.useCallback(_=>{var R,E,w,b;try{const C=Zr.load(_);t({id:C.id||"",name:C.name||"",description:C.description||"",category:C.category||"",tags:C.tags||[],variables:(C.variables||[]).map(M=>({name:M.name||"",label:M.label||"",type:M.type||"string",default:M.default??"",options:M.options||[],required:M.required!==!1})),interactionMode:C.steps?"steps":"prompt",prompt:C.prompt||"",style:C.style||"",systemPrompt:C.system_prompt||"",steps:(C.steps||[]).map((M,I)=>({id:M.id||`step_${I}`,action:M.action||"await_agent",params:M.params||{}})),toolsFrom:C.tools_from||[],inlineTools:C.tools||{},initialState:C.initial_state||{},goals:((E=((R=C.evaluation)==null?void 0:R.goals)||C.goals)==null?void 0:E.map((M,I)=>({id:M.id||`goal_${I}`,name:M.name||"",description:M.description||"",points:M.points||0,detection:M.detection||{type:""}})))||[],judge:((w=C.evaluation)==null?void 0:w.judge)||null,maxScore:((b=C.evaluation)==null?void 0:b.max_score)||null})}catch(C){console.error("Failed to parse YAML:",C)}},[]);return{state:e,yamlPreview:n,isValid:l,validationErrors:r,setId:a,setName:i,setDescription:o,setCategory:u,setTags:c,addVariable:p,updateVariable:f,removeVariable:x,setInteractionMode:v,setPrompt:N,setStyle:y,setSystemPrompt:j,addStep:m,updateStep:d,removeStep:g,reorderSteps:S,setToolsFrom:k,setInlineTools:T,setInitialState:A,addGoal:L,updateGoal:O,removeGoal:F,setJudge:B,setMaxScore:Y,reset:le,loadFromYaml:se}}const t1=["","brief","spicy","professional","formal","wholesome","chaotic","poetic"],n1=[{value:"tool_called",label:"Tool Called"},{value:"env_state",label:"Environment State"},{value:"agent_contains",label:"Agent Contains"},{value:"any_tool_called",label:"Any Tool Called"}];function r1(){const e=po(),[t,n]=h.useState("basic"),[r,l]=h.useState(!0),[a,i]=h.useState([]),[o,u]=h.useState(!1),[c,p]=h.useState(null),f=e1();h.useEffect(()=>{xe.listTools().then(y=>{i(y.map(j=>j.id))}).catch(()=>{})},[]);const x=async()=>{if(!f.isValid)return!1;u(!0),p(null);try{const y=await fetch("/api/v1/local/scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:f.state.id,content:f.yamlPreview})});if(y.ok)return p({type:"success",text:"Scenario saved successfully!"}),!0;{const j=await y.json();return p({type:"error",text:j.detail||"Failed to save"}),!1}}catch(y){return p({type:"error",text:y instanceof Error?y.message:"Failed to save"}),!1}finally{u(!1)}},v=async()=>{await x()&&e(`/run/${f.state.id}`)},N=[{id:"basic",label:"Basic Info",icon:wo},{id:"variables",label:"Variables",icon:yg},{id:"interaction",label:"Interaction",icon:lp},{id:"tools",label:"Tools",icon:Kr},{id:"evaluation",label:"Evaluation",icon:vg}];return s.jsxs("div",{className:"flex h-full page",children:[s.jsxs("div",{className:`flex-1 flex flex-col ${r?"lg:mr-96":""}`,children:[s.jsxs("div",{className:"p-4 sm:p-6 border-b border-slate-800/70",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:s.jsx(fs,{size:20})}),s.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-slate-100",children:"Scenario Builder"})]}),s.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[s.jsxs("button",{onClick:()=>l(!r),className:"px-3 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg text-sm",children:[s.jsxs("span",{className:"hidden sm:inline",children:[r?"Hide":"Show"," "]}),"YAML"]}),s.jsxs("button",{onClick:()=>x(),disabled:!f.isValid||o,className:"flex items-center gap-2 bg-slate-800 hover:bg-slate-700 disabled:bg-slate-900 disabled:text-slate-500 disabled:cursor-not-allowed text-slate-100 px-3 py-2 rounded-lg text-sm",children:[s.jsx(ps,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:"Save"})]}),s.jsxs("button",{onClick:v,disabled:!f.isValid||o,className:"flex items-center gap-2 bg-emerald-400 hover:bg-emerald-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-3 py-2 rounded-lg font-semibold text-sm",children:[s.jsx(fn,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save & Run"})]})]})]}),c&&s.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 text-sm ${c.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[c.type==="success"?s.jsx(vo,{size:18}):s.jsx(yn,{size:18}),c.text]}),f.validationErrors.length>0&&s.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2 text-sm",children:[s.jsx(yn,{size:18}),"Validation Issues"]}),s.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-xs sm:text-sm space-y-1",children:f.validationErrors.map((y,j)=>s.jsx("li",{children:y},j))})]})]}),s.jsx("div",{className:"flex overflow-x-auto border-b border-slate-800/70 scrollbar-hide",children:N.map(y=>s.jsxs("button",{onClick:()=>n(y.id),className:`flex items-center gap-2 px-4 sm:px-6 py-3 font-medium transition-colors whitespace-nowrap ${t===y.id?"text-orange-300 border-b-2 border-orange-300":"text-slate-400 hover:text-slate-100"}`,children:[s.jsx(y.icon,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:y.label})]},y.id))}),s.jsxs("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:[t==="basic"&&s.jsx(l1,{builder:f}),t==="variables"&&s.jsx(a1,{builder:f}),t==="interaction"&&s.jsx(o1,{builder:f}),t==="tools"&&s.jsx(d1,{builder:f,availableTools:a}),t==="evaluation"&&s.jsx(f1,{builder:f})]})]}),r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/50 lg:hidden z-40",onClick:()=>l(!1)}),s.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-full sm:w-96 bg-slate-950 border-l border-slate-800/70 flex flex-col z-50",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[s.jsx("h2",{className:"font-semibold text-slate-100",children:"YAML Preview"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>navigator.clipboard.writeText(f.yamlPreview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"}),s.jsx("button",{onClick:()=>l(!1),className:"lg:hidden text-slate-400 hover:text-slate-100 p-1",children:s.jsx(fs,{size:18})})]})]}),s.jsx("pre",{className:"flex-1 overflow-auto p-4 text-xs sm:text-sm text-slate-300 font-mono",children:f.yamlPreview})]})]})]})}function l1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Scenario ID ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.id,onChange:t=>e.setId(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and hyphens only"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Display Name"}),s.jsx("input",{type:"text",value:e.state.name,onChange:t=>e.setName(t.target.value),placeholder:"My Scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),s.jsx("textarea",{value:e.state.description,onChange:t=>e.setDescription(t.target.value),placeholder:"Describe what this scenario tests...",rows:3,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Category"}),s.jsx("input",{type:"text",value:e.state.category,onChange:t=>e.setCategory(t.target.value),placeholder:"e.g., customer-service, coding, reasoning",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Tags"}),s.jsx("input",{type:"text",value:e.state.tags.join(", "),onChange:t=>e.setTags(t.target.value.split(",").map(n=>n.trim()).filter(Boolean)),placeholder:"tag1, tag2, tag3",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Comma-separated tags"})]})]})}const s1=[{value:"string",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Yes/No"},{value:"select",label:"Dropdown"}];function a1({builder:e}){const t=()=>{e.addVariable({name:`var_${e.state.variables.length+1}`,label:"",type:"string",default:"",options:[],required:!0})};return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-slate-400",children:"Scenario Variables"}),s.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Define variables that can be filled in when running the scenario. Use ",s.jsx("code",{className:"text-orange-300",children:"{variable_name}"})," in prompts."]})]}),s.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Variable"]})]}),e.state.variables.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No variables defined. Add a variable to make your scenario parameterizable."}):s.jsx("div",{className:"space-y-4",children:e.state.variables.map((n,r)=>s.jsx(i1,{variable:n,onUpdate:l=>e.updateVariable(r,l),onRemove:()=>e.removeVariable(r)},r))}),e.state.variables.length>0&&s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Usage Example"}),s.jsx("code",{className:"text-sm text-orange-300",children:e.state.variables.map(n=>`{${n.name}}`).join(", ")}),s.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Use these placeholders in your prompts, system prompt, or step content."})]})]})}function i1({variable:e,onUpdate:t,onRemove:n}){const[r,l]=h.useState(!0);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Ye,{size:18}):s.jsx(ft,{size:18}),s.jsx("code",{className:"text-orange-300",children:`{${e.name}}`}),s.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.label||e.name}),s.jsx("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:e.type}),s.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx(Ie,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Variable Name"}),s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.replace(/[^a-z0-9_]/gi,"_").toLowerCase()}),placeholder:"variable_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Type"}),s.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:s1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Display Label"}),s.jsx("input",{type:"text",value:e.label,onChange:a=>t({...e,label:a.target.value}),placeholder:"Human-readable label",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Default Value"}),e.type==="boolean"?s.jsxs("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value==="true"}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"true",children:"Yes"}),s.jsx("option",{value:"false",children:"No"})]}):e.type==="number"?s.jsx("input",{type:"number",value:e.default,onChange:a=>t({...e,default:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"}):e.type==="select"&&e.options.length>0?s.jsx("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:e.options.map(a=>s.jsx("option",{value:a,children:a},a))}):s.jsx("input",{type:"text",value:String(e.default),onChange:a=>t({...e,default:a.target.value}),placeholder:"Default value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsx("div",{className:"flex items-center sm:pt-5",children:s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsx("span",{className:"text-sm text-slate-400",children:"Required"})]})})]}),e.type==="select"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Options (comma-separated)"}),s.jsx("input",{type:"text",value:e.options.join(", "),onChange:a=>t({...e,options:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function o1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Interaction Mode"}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[s.jsxs("button",{onClick:()=>e.setInteractionMode("prompt"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="prompt"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:"Single-Turn"}),s.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Simple prompt → response"})]}),s.jsxs("button",{onClick:()=>e.setInteractionMode("steps"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="steps"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:"Multi-Turn"}),s.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Conversation steps with tools"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"System Prompt"}),s.jsx("textarea",{value:e.state.systemPrompt,onChange:t=>e.setSystemPrompt(t.target.value),placeholder:"Instructions for the AI agent...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono text-sm"})]}),e.state.interactionMode==="prompt"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Prompt ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("textarea",{value:e.state.prompt,onChange:t=>e.setPrompt(t.target.value),placeholder:"Enter the prompt for the AI...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Response Style"}),s.jsx("select",{value:e.state.style,onChange:t=>e.setStyle(t.target.value),className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:t1.map(t=>s.jsx("option",{value:t,children:t||"(None)"},t))})]})]}):s.jsx(u1,{builder:e})]})}function u1({builder:e}){const t=n=>{const r={id:`step_${e.state.steps.length+1}`,action:n,params:n==="inject_user"?{content:""}:{}};e.addStep(r)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Conversation Steps"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>t("inject_user"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," User"]}),s.jsxs("button",{onClick:()=>t("await_agent"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Agent"]})]})]}),e.state.steps.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No steps yet. Add a step to start building your conversation."}):s.jsx("div",{className:"space-y-3",children:e.state.steps.map((n,r)=>s.jsx(c1,{step:n,onUpdate:l=>e.updateStep(r,l),onRemove:()=>e.removeStep(r)},r))})]})}function c1({step:e,onUpdate:t,onRemove:n}){const[r,l]=h.useState(!0),a={inject_user:"bg-orange-400 text-slate-900",await_agent:"bg-emerald-400 text-slate-900",await_user:"bg-amber-300 text-slate-900"};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Ye,{size:18}):s.jsx(ft,{size:18}),s.jsx("span",{className:`px-2 py-0.5 rounded text-xs text-white ${a[e.action]||"bg-slate-700 text-slate-200"}`,children:e.action}),s.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.id}),s.jsx("button",{onClick:i=>{i.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx(Ie,{size:16})})]}),r&&s.jsxs("div",{className:"p-3 border-t border-slate-800/70 space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Step ID"}),s.jsx("input",{type:"text",value:e.id,onChange:i=>t({...e,id:i.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.action==="inject_user"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Content"}),s.jsx("textarea",{value:e.params.content||"",onChange:i=>t({...e,params:{...e.params,content:i.target.value}}),rows:3,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function d1({builder:e,availableTools:t}){const[n,r]=h.useState(()=>JSON.stringify(e.state.initialState,null,2)||"{}"),[l,a]=h.useState(null),i=u=>{e.state.toolsFrom.includes(u)?e.setToolsFrom(e.state.toolsFrom.filter(c=>c!==u)):e.setToolsFrom([...e.state.toolsFrom,u])},o=u=>{r(u);try{const c=JSON.parse(u);e.setInitialState(c),a(null)}catch{a("Invalid JSON")}};return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Import Tool Libraries"}),t.length===0?s.jsx("div",{className:"text-slate-500 text-sm",children:"No tool libraries found in tools/ directory."}):s.jsx("div",{className:"space-y-2",children:t.map(u=>s.jsxs("label",{className:"flex items-center gap-3 p-3 panel-subtle rounded-lg cursor-pointer hover:border-slate-600/70",children:[s.jsx("input",{type:"checkbox",checked:e.state.toolsFrom.includes(u),onChange:()=>i(u),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsx("code",{className:"text-orange-300",children:u})]},u))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Initial State (JSON)"}),s.jsx("textarea",{value:n,onChange:u=>o(u.target.value),placeholder:'{"key": "value"}',rows:4,className:`w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 font-mono text-sm ${l?"focus:ring-red-400 border-red-500/50":"focus:ring-orange-400"}`}),l&&s.jsx("p",{className:"mt-1 text-xs text-red-400",children:l})]})]})}function f1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-3xl",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Goals (Rule-Based Scoring)"}),s.jsxs("button",{onClick:()=>e.addGoal({id:`goal_${e.state.goals.length+1}`,name:"",description:"",points:10,detection:{type:""}}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Goal"]})]}),e.state.goals.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No goals defined. Add a goal to enable rule-based scoring."}):s.jsx("div",{className:"space-y-4",children:e.state.goals.map((t,n)=>s.jsx(p1,{goal:t,onUpdate:r=>e.updateGoal(n,r),onRemove:()=>e.removeGoal(n)},n))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Judge (LLM-Based Scoring)"}),e.state.judge?s.jsxs("button",{onClick:()=>e.setJudge(null),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-red-500 hover:bg-red-400 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(Ie,{size:14})," Remove Judge"]}):s.jsxs("button",{onClick:()=>e.setJudge({type:"llm",model:"gpt-4o-mini",rubric:"",pass_threshold:.5}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Judge"]})]}),e.state.judge&&s.jsx(m1,{judge:e.state.judge,onUpdate:t=>e.setJudge(t)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Max Score (Optional)"}),s.jsx("input",{type:"number",value:e.state.maxScore??"",onChange:t=>e.setMaxScore(t.target.value?Number(t.target.value):null),placeholder:"Auto-calculated from goals",className:"w-48 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})}function p1({goal:e,onUpdate:t,onRemove:n}){const[r,l]=h.useState(!0);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Ye,{size:18}):s.jsx(ft,{size:18}),s.jsx("span",{className:"text-slate-100 font-medium flex-1",children:e.name||e.id}),s.jsxs("span",{className:"text-emerald-300 text-sm",children:["+",e.points," pts"]}),s.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx(Ie,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Goal ID"}),s.jsx("input",{type:"text",value:e.id,onChange:a=>t({...e,id:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Points"}),s.jsx("input",{type:"number",value:e.points,onChange:a=>t({...e,points:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Name"}),s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value}),placeholder:"Human-readable name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Detection Type"}),s.jsxs("select",{value:e.detection.type,onChange:a=>t({...e,detection:{type:a.target.value}}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"",children:"Select type..."}),n1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))]})]}),e.detection.type==="tool_called"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool Name"}),s.jsx("input",{type:"text",value:e.detection.tool||"",onChange:a=>t({...e,detection:{...e.detection,tool:a.target.value}}),placeholder:"e.g., check_status",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.detection.type==="env_state"&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"State Key"}),s.jsx("input",{type:"text",value:e.detection.key||"",onChange:a=>t({...e,detection:{...e.detection,key:a.target.value}}),placeholder:"e.g., order_complete",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Expected Value"}),s.jsx("input",{type:"text",value:String(e.detection.value??""),onChange:a=>{let i=a.target.value;i==="true"?i=!0:i==="false"?i=!1:isNaN(Number(i))||(i=Number(i)),t({...e,detection:{...e.detection,value:i}})},placeholder:"true, false, or value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.detection.type==="agent_contains"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Patterns (comma-separated)"}),s.jsx("input",{type:"text",value:(e.detection.patterns||[]).join(", "),onChange:a=>t({...e,detection:{...e.detection,patterns:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}}),placeholder:"sorry, apologize, my mistake",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function m1({judge:e,onUpdate:t}){return s.jsxs("div",{className:"panel-card p-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Type"}),s.jsxs("select",{value:e.type,onChange:n=>t({...e,type:n.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"llm",children:"LLM Judge"}),s.jsx("option",{value:"contains",children:"Contains"}),s.jsx("option",{value:"regex",children:"Regex"}),s.jsx("option",{value:"exact",children:"Exact Match"}),s.jsx("option",{value:"length",children:"Length"})]})]}),e.type==="llm"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Model"}),s.jsx("input",{type:"text",value:e.model||"",onChange:n=>t({...e,model:n.target.value}),placeholder:"gpt-4o-mini",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.type==="llm"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rubric"}),s.jsx("textarea",{value:e.rubric||"",onChange:n=>t({...e,rubric:n.target.value}),placeholder:"Score the response from 0.0 to 1.0 based on...",rows:4,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),(e.type==="contains"||e.type==="regex"||e.type==="exact")&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pattern"}),s.jsx("input",{type:"text",value:e.pattern||"",onChange:n=>t({...e,pattern:n.target.value}),placeholder:e.type==="regex"?"\\d+":"expected text",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.type==="length"&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Min Length"}),s.jsx("input",{type:"number",value:e.min_length??"",onChange:n=>t({...e,min_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Max Length"}),s.jsx("input",{type:"number",value:e.max_length??"",onChange:n=>t({...e,max_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pass Threshold (0.0 - 1.0)"}),s.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",value:e.pass_threshold??.5,onChange:n=>t({...e,pass_threshold:Number(n.target.value)}),className:"w-32 panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})}const vc={toolType:"yaml",name:"",description:"",actions:[],pythonClassName:"",pythonActions:[],mcpTransport:"stdio",mcpCommand:"",mcpArgs:[],mcpUrl:"",mcpEnv:[]};function h1(){const[e,t]=h.useState(vc),n=h.useMemo(()=>e.toolType==="yaml"?x1(e):e.toolType==="python"?g1(e):v1(e),[e]),r=h.useMemo(()=>{const E=[];return e.name?/^[a-z0-9_]+$/.test(e.name)||E.push("Name must be lowercase letters, numbers, and underscores only"):E.push("Tool name is required"),e.toolType==="yaml"?(e.actions.length===0&&E.push("At least one action is required"),e.actions.forEach((w,b)=>{w.name?/^[a-z0-9_]+$/.test(w.name)||E.push(`Action ${b+1}: Name must be lowercase letters, numbers, and underscores`):E.push(`Action ${b+1}: Name is required`),w.params.forEach((C,M)=>{C.name||E.push(`Action ${b+1}, Param ${M+1}: Name is required`)})})):e.toolType==="python"?(e.pythonClassName?/^[A-Z][a-zA-Z0-9]*Tool$/.test(e.pythonClassName)||E.push('Class name should be PascalCase ending with "Tool" (e.g., MyCustomTool)'):E.push("Class name is required"),e.pythonActions.length===0&&E.push("At least one action is required")):e.toolType==="mcp"&&(e.mcpTransport==="stdio"&&!e.mcpCommand&&E.push("Command is required for stdio transport"),(e.mcpTransport==="sse"||e.mcpTransport==="http")&&!e.mcpUrl&&E.push("URL is required for HTTP/SSE transport")),E},[e]),l=r.length===0,a=h.useCallback(E=>{t(w=>({...w,toolType:E}))},[]),i=h.useCallback(E=>{t(w=>({...w,name:E}))},[]),o=h.useCallback(E=>{t(w=>({...w,description:E}))},[]),u=h.useCallback(()=>{t(E=>({...E,actions:[...E.actions,{id:`action_${Date.now()}`,name:`action_${E.actions.length+1}`,description:"",params:[],returns:"",returnsType:"simple",sideEffects:[]}]}))},[]),c=h.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((C,M)=>M===E?w:C)}))},[]),p=h.useCallback(E=>{t(w=>({...w,actions:w.actions.filter((b,C)=>C!==E)}))},[]),f=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,C)=>C!==E?b:{...b,params:[...b.params,{name:`param_${b.params.length+1}`,type:"string",required:!0,description:""}]})}))},[]),x=h.useCallback((E,w,b)=>{t(C=>({...C,actions:C.actions.map((M,I)=>I!==E?M:{...M,params:M.params.map((J,Z)=>Z===w?b:J)})}))},[]),v=h.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((C,M)=>M!==E?C:{...C,params:C.params.filter((I,J)=>J!==w)})}))},[]),N=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,C)=>C!==E?b:{...b,sideEffects:[...b.sideEffects,{set:"",value:""}]})}))},[]),y=h.useCallback((E,w,b)=>{t(C=>({...C,actions:C.actions.map((M,I)=>I!==E?M:{...M,sideEffects:M.sideEffects.map((J,Z)=>Z===w?b:J)})}))},[]),j=h.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((C,M)=>M!==E?C:{...C,sideEffects:C.sideEffects.filter((I,J)=>J!==w)})}))},[]),m=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,C)=>{if(C!==E)return b;const M=Array.isArray(b.returns)?b.returns:[];return{...b,returnsType:"conditional",returns:[...M,{when:"",value:""}]}})}))},[]),d=h.useCallback((E,w,b)=>{t(C=>({...C,actions:C.actions.map((M,I)=>I!==E||!Array.isArray(M.returns)?M:{...M,returns:M.returns.map((J,Z)=>Z===w?b:J)})}))},[]),g=h.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((C,M)=>{if(M!==E||!Array.isArray(C.returns))return C;const I=C.returns.filter((J,Z)=>Z!==w);return{...C,returnsType:I.length>0?"conditional":"simple",returns:I.length>0?I:""}})}))},[]),S=h.useCallback(E=>{t(w=>({...w,pythonClassName:E}))},[]),k=h.useCallback(()=>{t(E=>({...E,pythonActions:[...E.pythonActions,{name:`action_${E.pythonActions.length+1}`,description:"",params:[]}]}))},[]),T=h.useCallback((E,w)=>{t(b=>({...b,pythonActions:b.pythonActions.map((C,M)=>M===E?w:C)}))},[]),A=h.useCallback(E=>{t(w=>({...w,pythonActions:w.pythonActions.filter((b,C)=>C!==E)}))},[]),L=h.useCallback(E=>{t(w=>({...w,mcpTransport:E}))},[]),O=h.useCallback(E=>{t(w=>({...w,mcpCommand:E}))},[]),F=h.useCallback(E=>{t(w=>({...w,mcpArgs:E}))},[]),B=h.useCallback(E=>{t(w=>({...w,mcpUrl:E}))},[]),Y=h.useCallback(()=>{t(E=>({...E,mcpEnv:[...E.mcpEnv,{key:"",value:""}]}))},[]),le=h.useCallback((E,w)=>{t(b=>({...b,mcpEnv:b.mcpEnv.map((C,M)=>M===E?w:C)}))},[]),se=h.useCallback(E=>{t(w=>({...w,mcpEnv:w.mcpEnv.filter((b,C)=>C!==E)}))},[]),_=h.useCallback(()=>{t(vc)},[]),R=h.useCallback(E=>{try{const w=Zr.load(E),b=[],C=w.tools;if(C)for(const[M,I]of Object.entries(C)){const J=[],Z=I.params;if(Z)for(const[G,Pe]of Object.entries(Z))J.push({name:G,type:Pe.type||"string",required:Pe.required!==!1,default:Pe.default,description:Pe.description||"",enum:Pe.enum});const nt=[],Qe=I.side_effects;if(Qe)for(const G of Qe)nt.push({set:G.set,value:G.value});const rt=I.returns;let wn="",$="simple";Array.isArray(rt)?($="conditional",wn=rt.map(G=>({when:G.when,value:G.value}))):typeof rt=="string"&&(wn=rt),b.push({id:`action_${Date.now()}_${M}`,name:M,description:I.description||"",params:J,returns:wn,returnsType:$,errorWhen:I.error_when,returnsError:I.returns_error,sideEffects:nt})}t(M=>({...M,toolType:"yaml",name:w.name||"",description:w.description||"",actions:b}))}catch(w){console.error("Failed to parse YAML:",w)}},[]);return{state:e,preview:n,isValid:l,validationErrors:r,setToolType:a,setName:i,setDescription:o,addAction:u,updateAction:c,removeAction:p,addParam:f,updateParam:x,removeParam:v,addSideEffect:N,updateSideEffect:y,removeSideEffect:j,addConditionalReturn:m,updateConditionalReturn:d,removeConditionalReturn:g,setPythonClassName:S,addPythonAction:k,updatePythonAction:T,removePythonAction:A,setMcpTransport:L,setMcpCommand:O,setMcpArgs:F,setMcpUrl:B,addMcpEnvVar:Y,updateMcpEnvVar:le,removeMcpEnvVar:se,reset:_,loadFromYaml:R}}function x1(e){const t={};if(e.name&&(t.name=e.name),e.description&&(t.description=e.description),e.actions.length>0){const n={};for(const r of e.actions){const l={};if(r.description&&(l.description=r.description),r.params.length>0){const a={};for(const i of r.params){const o={type:i.type};i.required&&(o.required=!0),i.default!==void 0&&i.default!==""&&(o.default=i.default),i.description&&(o.description=i.description),i.enum&&i.enum.length>0&&(o.enum=i.enum),a[i.name]=o}l.params=a}r.errorWhen&&(l.error_when=r.errorWhen),r.returnsError&&(l.returns_error=r.returnsError),r.returnsType==="conditional"&&Array.isArray(r.returns)?l.returns=r.returns.map(a=>({when:a.when,value:a.value})):typeof r.returns=="string"&&r.returns&&(l.returns=r.returns),r.sideEffects.length>0&&(l.side_effects=r.sideEffects.map(a=>({set:a.set,value:a.value}))),n[r.name]=l}t.tools=n}return Zr.dump(t,{lineWidth:-1,noRefs:!0})}function g1(e){const t=e.pythonClassName||"MyCustomTool",n=e.name||"my_custom_tool";let r=`"""${e.description||"Custom tool implementation."}
288
-
289
- Tool name: ${n}
290
- """
291
-
292
- from sandboxy.tools.base import BaseTool, ToolConfig, ToolResult
293
-
294
-
295
- class ${t}(BaseTool):
296
- """${e.description||"Custom tool implementation."}"""
297
-
298
- def __init__(self, config: ToolConfig) -> None:
299
- super().__init__(config)
300
- # Add your initialization here
301
- self.data: dict = {}
302
-
303
- def invoke(self, action: str, args: dict, env_state: dict) -> ToolResult:
304
- """Handle tool actions."""
305
- handlers = {
306
- `;for(const l of e.pythonActions)r+=` "${l.name}": self._${l.name},
307
- `;r+=` }
308
-
309
- handler = handlers.get(action)
310
- if not handler:
311
- return ToolResult(success=False, error=f"Unknown action: {action}")
312
-
313
- return handler(args, env_state)
314
- `;for(const l of e.pythonActions){const a=l.params.map(i=>` ${i.name}: ${i.description||i.type}`).join(`
315
- `);r+=`
316
- def _${l.name}(self, args: dict, env_state: dict) -> ToolResult:
317
- """${l.description||"TODO: Add description"}
318
-
319
- Args:
320
- ${a||" (no parameters)"}
321
- """
322
- # TODO: Implement this action
323
- ${l.params.map(i=>`${i.name} = args.get("${i.name}")`).join(`
324
- `)}
325
-
326
- return ToolResult(success=True, data={"result": "TODO"})
327
- `}r+=`
328
- def get_actions(self) -> list[dict]:
329
- """Define available actions with their schemas."""
330
- return [
331
- `;for(const l of e.pythonActions){r+=` {
332
- "name": "${l.name}",
333
- "description": "${l.description||""}",
334
- "parameters": {
335
- "type": "object",
336
- "properties": {
337
- `;for(const a of l.params)r+=` "${a.name}": {"type": "${a.type}", "description": "${a.description||""}"},
338
- `;r+=` },
339
- "required": [${l.params.map(a=>`"${a.name}"`).join(", ")}],
340
- },
341
- },
342
- `}return r+=` ]
343
- `,r}function v1(e){const t={name:e.name||"my_mcp_server",type:"mcp",transport:e.mcpTransport};if(e.description&&(t.description=e.description),e.mcpTransport==="stdio"?(e.mcpCommand&&(t.command=e.mcpCommand),e.mcpArgs.length>0&&(t.args=e.mcpArgs)):e.mcpUrl&&(t.url=e.mcpUrl),e.mcpEnv.length>0){const n={};for(const r of e.mcpEnv)r.key&&(n[r.key]=r.value);Object.keys(n).length>0&&(t.env=n)}return Zr.dump(t,{lineWidth:-1,noRefs:!0})}const y1=[{value:"string",label:"String"},{value:"boolean",label:"Boolean"},{value:"integer",label:"Integer"},{value:"number",label:"Number"},{value:"array",label:"Array"}],j1=[{value:"yaml",label:"Mock (YAML)",icon:rp,description:"Declarative tools with params, returns, and side effects"},{value:"python",label:"Python",icon:jo,description:"Code-based tools for complex logic"},{value:"mcp",label:"MCP Server",icon:xg,description:"Connect to an external MCP server"}];function N1(){const[e,t]=h.useState(!0),[n,r]=h.useState(!1),[l,a]=h.useState(null),i=h1(),o=async()=>{if(!i.isValid)return!1;r(!0),a(null);try{const c=await fetch("/api/v1/local/tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.state.name,toolType:i.state.toolType,content:i.preview})});if(c.ok)return a({type:"success",text:"Tool saved successfully!"}),!0;{const p=await c.json();return a({type:"error",text:p.detail||"Failed to save"}),!1}}catch(c){return a({type:"error",text:c instanceof Error?c.message:"Failed to save"}),!1}finally{r(!1)}},u=i.state.toolType==="python"?"python":"yaml";return s.jsxs("div",{className:"flex h-full page",children:[s.jsxs("div",{className:`flex-1 flex flex-col ${e?"mr-[28rem]":""}`,children:[s.jsxs("div",{className:"p-6 border-b border-slate-800/70",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:s.jsx(fs,{size:20})}),s.jsx("h1",{className:"text-2xl font-semibold text-slate-100",children:"Tool Builder"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:()=>t(!e),className:"px-4 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg",children:[e?"Hide":"Show"," Preview"]}),s.jsxs("button",{onClick:()=>o(),disabled:!i.isValid||n,className:"flex items-center gap-2 bg-orange-400 hover:bg-orange-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-4 py-2 rounded-lg font-semibold",children:[s.jsx(ps,{size:18}),n?"Saving...":"Save Tool"]})]})]}),l&&s.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 ${l.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[l.type==="success"?s.jsx(vo,{size:18}):s.jsx(yn,{size:18}),l.text]}),i.validationErrors.length>0&&s.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2",children:[s.jsx(yn,{size:18}),"Validation Issues"]}),s.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-sm space-y-1",children:i.validationErrors.map((c,p)=>s.jsx("li",{children:c},p))})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-6",children:s.jsxs("div",{className:"space-y-8 max-w-3xl",children:[s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-medium text-slate-100 mb-4",children:"Tool Type"}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:j1.map(c=>s.jsxs("button",{onClick:()=>i.setToolType(c.value),className:`p-4 rounded-lg border text-left transition-colors ${i.state.toolType===c.value?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx(c.icon,{size:24,className:i.state.toolType===c.value?"text-orange-400":"text-slate-400"}),s.jsx("div",{className:"font-medium text-slate-100 mt-2",children:c.label}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:c.description})]},c.value))})]}),s.jsxs("section",{children:[s.jsxs("h2",{className:"text-lg font-medium text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(ap,{size:20}),"Basic Info"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Tool Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:i.state.name,onChange:c=>i.setName(c.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"my_custom_tool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and underscores only"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),s.jsx("textarea",{value:i.state.description,onChange:c=>i.setDescription(c.target.value),placeholder:"Describe what this tool does...",rows:2,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})]}),i.state.toolType==="yaml"&&s.jsx(w1,{builder:i}),i.state.toolType==="python"&&s.jsx(E1,{builder:i}),i.state.toolType==="mcp"&&s.jsx(R1,{builder:i})]})})]}),e&&s.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-[28rem] bg-slate-950/80 border-l border-slate-800/70 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[s.jsxs("h2",{className:"font-semibold text-slate-100",children:[u==="python"?"Python Code":"YAML"," Preview"]}),s.jsx("button",{onClick:()=>navigator.clipboard.writeText(i.preview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"})]}),s.jsx("pre",{className:`flex-1 overflow-auto p-4 text-sm text-slate-300 font-mono ${u==="python"?"text-xs":""}`,children:i.preview})]})]})}function w1({builder:e}){return s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[s.jsx(Kr,{size:20}),"Actions"]}),s.jsxs("button",{onClick:e.addAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Add Action"]})]}),e.state.actions.length===0?s.jsxs("div",{className:"text-center py-12 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:[s.jsx(Kr,{size:32,className:"mx-auto mb-3 opacity-50"}),s.jsx("p",{children:"No actions defined yet."}),s.jsx("p",{className:"text-sm mt-1",children:"Add an action to define what this tool can do."})]}):s.jsx("div",{className:"space-y-4",children:e.state.actions.map((t,n)=>s.jsx(k1,{action:t,index:n,builder:e},t.id))})]})}function k1({action:e,index:t,builder:n}){const[r,l]=h.useState(!0),a=(i,o)=>{n.updateAction(t,{...e,[i]:o})};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Ye,{size:18}):s.jsx(ft,{size:18}),s.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed_action"}),s.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),s.jsxs("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:[e.params.length," params"]}),s.jsx("button",{onClick:i=>{i.stopPropagation(),n.removeAction(t)},className:"text-slate-500 hover:text-red-400",children:s.jsx(Ie,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name *"}),s.jsx("input",{type:"text",value:e.name,onChange:i=>a("name",i.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"action_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),s.jsx("input",{type:"text",value:e.description,onChange:i=>a("description",i.target.value),placeholder:"What does this action do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),s.jsxs("button",{onClick:()=>n.addParam(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Param"]})]}),e.params.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):s.jsx("div",{className:"space-y-2",children:e.params.map((i,o)=>s.jsx(b1,{param:i,onUpdate:u=>n.updateParam(t,o,u),onRemove:()=>n.removeParam(t,o)},o))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Returns"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>a("returnsType","simple"),className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="simple"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Simple"}),s.jsx("button",{onClick:()=>{a("returnsType","conditional"),Array.isArray(e.returns)||a("returns",[])},className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="conditional"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Conditional"})]})]}),e.returnsType==="simple"?s.jsx("textarea",{value:typeof e.returns=="string"?e.returns:"",onChange:i=>a("returns",i.target.value),placeholder:"Return value with {param} interpolation",rows:2,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100 font-mono"}):s.jsxs("div",{className:"space-y-2",children:[Array.isArray(e.returns)&&e.returns.map((i,o)=>s.jsx(C1,{ret:i,onUpdate:u=>n.updateConditionalReturn(t,o,u),onRemove:()=>n.removeConditionalReturn(t,o)},o)),s.jsxs("button",{onClick:()=>n.addConditionalReturn(t),className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Condition"]})]}),s.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["Use ",s.jsx("code",{className:"text-orange-300",children:"{param_name}"})," or ",s.jsx("code",{className:"text-orange-300",children:"{state.key}"})," for interpolation"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-2 block",children:"Error Handling (Optional)"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("input",{type:"text",value:e.errorWhen||"",onChange:i=>a("errorWhen",i.target.value),placeholder:"error_when condition",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100 font-mono"}),s.jsx("input",{type:"text",value:e.returnsError||"",onChange:i=>a("returnsError",i.target.value),placeholder:"Error message",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 flex items-center gap-1",children:[s.jsx(Zn,{size:12}),"Side Effects"]}),s.jsxs("button",{onClick:()=>n.addSideEffect(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Effect"]})]}),e.sideEffects.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No side effects (tool doesn't modify state)"}):s.jsx("div",{className:"space-y-2",children:e.sideEffects.map((i,o)=>s.jsx(S1,{effect:i,onUpdate:u=>n.updateSideEffect(t,o,u),onRemove:()=>n.removeSideEffect(t,o)},o))})]})]})]})}function b1({param:e,onUpdate:t,onRemove:n}){const[r,l]=h.useState(e.enum&&e.enum.length>0);return s.jsxs("div",{className:"p-2 bg-slate-900/50 rounded space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-start",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2",children:[s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"name",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:y1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))}),s.jsx("input",{type:"text",value:e.description,onChange:a=>t({...e,description:a.target.value}),placeholder:"description",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[s.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-3 h-3"}),"Req"]}),e.type==="string"&&s.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:a=>{l(a.target.checked),a.target.checked||t({...e,enum:void 0})},className:"w-3 h-3"}),"Enum"]})]})]}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Ie,{size:14})})]}),r&&e.type==="string"&&s.jsx("input",{type:"text",value:(e.enum||[]).join(", "),onChange:a=>t({...e,enum:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-2 py-1 text-xs text-slate-100"})]})}function S1({effect:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"set"}),s.jsx("input",{type:"text",value:e.set,onChange:r=>t({...e,set:r.target.value}),placeholder:"state_key",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("span",{className:"text-xs text-slate-500",children:"="}),s.jsx("input",{type:"text",value:String(e.value),onChange:r=>{let l=r.target.value;l==="true"?l=!0:l==="false"?l=!1:!isNaN(Number(l))&&l!==""&&(l=Number(l)),t({...e,value:l})},placeholder:"value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Ie,{size:14})})]})}function C1({ret:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-start p-2 bg-slate-900/50 rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500 w-12",children:"when:"}),s.jsx("input",{type:"text",value:e.when,onChange:r=>t({...e,when:r.target.value}),placeholder:"condition or 'default'",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500 w-12",children:"value:"}),s.jsx("input",{type:"text",value:e.value,onChange:r=>t({...e,value:r.target.value}),placeholder:"Return value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]})]}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Ie,{size:14})})]})}function E1({builder:e}){return s.jsxs("section",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Class Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.pythonClassName,onChange:t=>e.setPythonClassName(t.target.value),placeholder:"MyCustomTool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:'PascalCase class name ending with "Tool"'})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[s.jsx(jo,{size:20}),"Actions"]}),s.jsxs("button",{onClick:e.addPythonAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Add Action"]})]}),e.state.pythonActions.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:s.jsx("p",{children:"Define the actions your Python tool will support."})}):s.jsx("div",{className:"space-y-4",children:e.state.pythonActions.map((t,n)=>s.jsx(_1,{action:t,index:n,builder:e},n))})]}),s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"What happens when you save:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[s.jsxs("li",{children:["A Python file will be created in your ",s.jsx("code",{className:"text-orange-300",children:"tools/"})," directory"]}),s.jsx("li",{children:"The file includes TODO comments where you need to add your logic"}),s.jsx("li",{children:"The tool will be automatically discovered and available to use"})]})]})]})}function _1({action:e,index:t,builder:n}){const[r,l]=h.useState(!0),a=c=>{n.updatePythonAction(t,{...e,...c})},i=()=>{a({params:[...e.params,{name:"",type:"string",description:""}]})},o=(c,p)=>{a({params:e.params.map((f,x)=>x===c?{...f,...p}:f)})},u=c=>{a({params:e.params.filter((p,f)=>f!==c)})};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Ye,{size:18}):s.jsx(ft,{size:18}),s.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed"}),s.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),s.jsx("button",{onClick:c=>{c.stopPropagation(),n.removePythonAction(t)},className:"text-slate-500 hover:text-red-400",children:s.jsx(Ie,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name"}),s.jsx("input",{type:"text",value:e.name,onChange:c=>a({name:c.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"do_something",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),s.jsx("input",{type:"text",value:e.description,onChange:c=>a({description:c.target.value}),placeholder:"What does this do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),s.jsxs("button",{onClick:i,className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add"]})]}),e.params.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):s.jsx("div",{className:"space-y-2",children:e.params.map((c,p)=>s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("input",{type:"text",value:c.name,onChange:f=>o(p,{name:f.target.value}),placeholder:"name",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsxs("select",{value:c.type,onChange:f=>o(p,{type:f.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:[s.jsx("option",{value:"string",children:"string"}),s.jsx("option",{value:"number",children:"number"}),s.jsx("option",{value:"boolean",children:"boolean"}),s.jsx("option",{value:"dict",children:"dict"}),s.jsx("option",{value:"list",children:"list"})]}),s.jsx("input",{type:"text",value:c.description,onChange:f=>o(p,{description:f.target.value}),placeholder:"description",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsx("button",{onClick:()=>u(p),className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Ie,{size:14})})]},p))})]})]})]})}function R1({builder:e}){return s.jsxs("section",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Transport Type"}),s.jsx("div",{className:"flex gap-4",children:["stdio","sse","http"].map(t=>s.jsxs("button",{onClick:()=>e.setMcpTransport(t),className:`flex-1 p-3 rounded-lg border text-center transition-colors ${e.state.mcpTransport===t?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:t.toUpperCase()}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:t==="stdio"?"Local process":t==="sse"?"Server-sent events":"HTTP endpoint"})]},t))})]}),e.state.mcpTransport==="stdio"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Command ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.mcpCommand,onChange:t=>e.setMcpCommand(t.target.value),placeholder:"python -m my_mcp_server",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Arguments (optional)"}),s.jsx("input",{type:"text",value:e.state.mcpArgs.join(" "),onChange:t=>e.setMcpArgs(t.target.value.split(" ").filter(Boolean)),placeholder:"--port 8080 --debug",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]})]}):s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["URL ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.mcpUrl,onChange:t=>e.setMcpUrl(t.target.value),placeholder:"https://api.example.com/mcp",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-400",children:"Environment Variables"}),s.jsxs("button",{onClick:e.addMcpEnvVar,className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add"]})]}),e.state.mcpEnv.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No environment variables"}):s.jsx("div",{className:"space-y-2",children:e.state.mcpEnv.map((t,n)=>s.jsx(T1,{envVar:t,onUpdate:r=>e.updateMcpEnvVar(n,r),onRemove:()=>e.removeMcpEnvVar(n)},n))}),s.jsxs("p",{className:"mt-2 text-xs text-slate-500",children:["Use ",s.jsx("code",{className:"text-orange-300",children:"${ENV_VAR}"})," to reference system environment variables"]})]}),s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"How MCP tools work:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"MCP servers expose tools via the Model Context Protocol"}),s.jsx("li",{children:"The server will be started/connected when the tool is used"}),s.jsx("li",{children:"Tools are automatically discovered from the server"})]})]})]})}function T1({envVar:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("input",{type:"text",value:e.key,onChange:r=>t({...e,key:r.target.value}),placeholder:"KEY",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("span",{className:"text-slate-500",children:"="}),s.jsx("input",{type:"text",value:e.value,onChange:r=>t({...e,value:r.target.value}),placeholder:"value or ${ENV_VAR}",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Ie,{size:14})})]})}function A1(){const[e,t]=h.useState([]),[n,r]=h.useState([]),[l,a]=h.useState(null),[i,o]=h.useState(null),[u,c]=h.useState(new Set),[p,f]=h.useState(!0),[x,v]=h.useState(null),[N,y]=h.useState(!1),[j,m]=h.useState(!1),[d,g]=h.useState(null),[S,k]=h.useState(!1),[T,A]=h.useState([]),[L,O]=h.useState([]),[F,B]=h.useState(!1);h.useEffect(()=>{Y()},[]),h.useEffect(()=>{if(!(d!=null&&d.scenarioId)){A([]),O([]);return}xe.getScenarioGoals(d.scenarioId).then(b=>{const C=b.filter(M=>M.outcome);A(C.length>0?C:b)}).catch(()=>A([])),xe.getScenarioTools(d.scenarioId).then(O).catch(()=>O([]))},[d==null?void 0:d.scenarioId]),h.useEffect(()=>{l?xe.getDataset(l).then(b=>{o(b),v(null)}).catch(b=>v(b.message)):o(null)},[l]);async function Y(){f(!0);try{const[b,C]=await Promise.all([xe.listDatasets(),xe.listScenarios()]);t(b),r(C),v(null)}catch(b){v(b instanceof Error?b.message:"Failed to load datasets")}finally{f(!1)}}function le(b){const C=new Set(u);C.has(b)?C.delete(b):C.add(b),c(C)}function se(){i&&(g(O1(i)),m(!0))}function _(){g({id:"",name:"",description:"",scenarioId:"",cases:[{id:"case_001",expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]}),B(!0),m(!0)}async function R(){if(!d)return;const b=F?d.id:l;if(!b){v("Dataset ID is required");return}if(!/^[a-z0-9_-]+$/.test(b)){v("Dataset ID must contain only lowercase letters, numbers, hyphens, and underscores");return}y(!0);try{const C=Gp(d);F?await xe.saveDataset(b,C):await xe.updateDataset(b,C),m(!1),B(!1),g(null),await Y(),a(b),v(null)}catch(C){v(C instanceof Error?C.message:"Failed to save dataset")}finally{y(!1)}}async function E(b){if(confirm(`Delete dataset "${b}"?`))try{await xe.deleteDataset(b),l===b&&(a(null),o(null)),await Y(),v(null)}catch(C){v(C instanceof Error?C.message:"Failed to delete dataset")}}function w(){m(!1),B(!1),g(null)}return p?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading datasets..."})}):s.jsxs("div",{className:"p-8 page",children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("h1",{className:"text-2xl font-semibold text-slate-100 mb-2 flex items-center gap-2",children:[s.jsx(Zt,{size:24}),"Datasets"]}),s.jsx("p",{className:"text-slate-400",children:"Manage test case datasets for multi-case benchmarking"})]}),x&&s.jsxs("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-500/50 rounded-lg flex items-center gap-2 text-red-300",children:[s.jsx(yn,{size:16}),x,s.jsx("button",{onClick:()=>v(null),className:"ml-auto",children:s.jsx(yt,{size:16})})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"font-semibold text-slate-200",children:"Datasets"}),s.jsxs("button",{onClick:_,className:"flex items-center gap-1 px-2 py-1 bg-blue-500 hover:bg-blue-400 text-white rounded text-sm",children:[s.jsx(ke,{size:14}),"New"]})]}),e.length===0?s.jsx("p",{className:"text-slate-500 text-sm",children:"No datasets found. Create one to get started."}):s.jsx("div",{className:"space-y-2",children:e.map(b=>s.jsxs("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${l===b.id?"bg-blue-500/20 border border-blue-500/50":"panel-subtle hover:bg-slate-700/50"}`,onClick:()=>{a(b.id),m(!1),B(!1)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-slate-200",children:b.name}),s.jsxs("span",{className:"text-xs text-slate-500",children:[b.case_count," cases"]})]}),b.description&&s.jsx("p",{className:"text-sm text-slate-400 mt-1 line-clamp-1",children:b.description})]},b.id))})]}),s.jsx("div",{className:"lg:col-span-2 panel-card p-4 overflow-auto max-h-[80vh]",children:j&&d?s.jsx(P1,{data:d,isNew:F,saving:N,showYaml:S,scenarios:n,outcomeGoals:T,scenarioTools:L,onDataChange:g,onToggleYaml:()=>k(!S),onSave:R,onCancel:w}):i?s.jsx(M1,{dataset:i,expandedCases:u,onToggleCase:le,onEdit:se,onDelete:()=>E(i.id)}):s.jsx("div",{className:"text-center text-slate-500 py-12",children:"Select a dataset or create a new one"})})]})]})}function P1({data:e,isNew:t,saving:n,showYaml:r,scenarios:l,outcomeGoals:a,scenarioTools:i,onDataChange:o,onToggleYaml:u,onSave:c,onCancel:p}){const f=(y,j)=>{const m=[...e.cases];m[y]={...m[y],...j},o({...e,cases:m})},x=()=>{const y=`case_${String(e.cases.length+1).padStart(3,"0")}`;o({...e,cases:[...e.cases,{id:y,expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]})},v=y=>{e.cases.length<=1||o({...e,cases:e.cases.filter((j,m)=>m!==y)})},N=y=>{const j=e.cases[y],m=`${j.id}_copy`,d={...j,id:m,variables:[...j.variables.map(g=>({...g}))],toolResponses:j.toolResponses.map(g=>({...g,fields:[...g.fields.map(S=>({...S}))],rawJson:g.rawJson})),tags:[...j.tags]};o({...e,cases:[...e.cases.slice(0,y+1),d,...e.cases.slice(y+1)]})};return r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(sp,{size:14}),"Form View"]}),s.jsxs("button",{onClick:p,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[s.jsx(yt,{size:14}),"Cancel"]}),s.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[s.jsx(ps,{size:14}),n?"Saving...":"Save"]})]})]}),s.jsx("pre",{className:"p-4 bg-slate-800 rounded-lg text-sm text-slate-300 overflow-auto max-h-[60vh]",children:Gp(e)})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(jo,{size:14}),"YAML"]}),s.jsxs("button",{onClick:p,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[s.jsx(yt,{size:14}),"Cancel"]}),s.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[s.jsx(ps,{size:14}),n?"Saving...":"Save"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[t&&s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Dataset ID ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.id,onChange:y=>o({...e,id:y.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"-")}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"my-test-cases"})]}),s.jsxs("div",{className:t?"":"col-span-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Name"}),s.jsx("input",{type:"text",value:e.name,onChange:y=>o({...e,name:y.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"My Test Cases"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Scenario ",s.jsx("span",{className:"text-slate-500",children:"(for goal dropdown)"})]}),s.jsxs("select",{value:e.scenarioId,onChange:y=>o({...e,scenarioId:y.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select a scenario..."}),l.map(y=>s.jsx("option",{value:y.id,children:y.name},y.id))]}),!e.scenarioId&&s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Link to a scenario to enable outcome goal dropdown in case editor"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Description"}),s.jsx("textarea",{value:e.description,onChange:y=>o({...e,description:y.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",rows:2,placeholder:"Test cases for evaluating..."})]})]}),s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("h3",{className:"font-medium text-slate-200",children:["Test Cases (",e.cases.length,")"]}),s.jsxs("button",{onClick:x,className:"flex items-center gap-1 px-2 py-1 bg-blue-500/20 hover:bg-blue-500/30 text-blue-300 rounded text-sm",children:[s.jsx(ke,{size:14}),"Add Case"]})]}),s.jsx("div",{className:"space-y-4",children:e.cases.map((y,j)=>s.jsx(L1,{case_:y,index:j,outcomeGoals:a,scenarioTools:i,onChange:m=>f(j,m),onRemove:()=>v(j),onDuplicate:()=>N(j),canRemove:e.cases.length>1},j))})]})}function L1({case_:e,index:t,outcomeGoals:n,scenarioTools:r,onChange:l,onRemove:a,onDuplicate:i,canRemove:o}){const[u,c]=h.useState(!0),p=k=>{e.expected.includes(k)?l({expected:e.expected.filter(T=>T!==k)}):l({expected:[...e.expected,k]})},f=()=>{l({variables:[...e.variables,{key:"",value:""}]})},x=(k,T,A)=>{const L=[...e.variables];L[k]={key:T,value:A},l({variables:L})},v=k=>{l({variables:e.variables.filter((T,A)=>A!==k)})},N=()=>{l({toolResponses:[...e.toolResponses,{tool:"",action:"",mode:"fields",fields:[{key:"",value:""}],rawJson:`{
344
-
345
- }`}]})},y=(k,T)=>{const A=[...e.toolResponses];A[k]={...A[k],...T},l({toolResponses:A})},j=k=>{l({toolResponses:e.toolResponses.filter((T,A)=>A!==k)})},m=k=>{const T=[...e.toolResponses];T[k]={...T[k],fields:[...T[k].fields,{key:"",value:""}]},l({toolResponses:T})},d=(k,T,A,L)=>{const O=[...e.toolResponses],F=[...O[k].fields];F[T]={key:A,value:L},O[k]={...O[k],fields:F},l({toolResponses:O})},g=(k,T)=>{const A=[...e.toolResponses];A[k]={...A[k],fields:A[k].fields.filter((L,O)=>O!==T)},l({toolResponses:A})},S=k=>{const T=k.split(",").map(A=>A.trim()).filter(Boolean);l({tags:T})};return s.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-slate-700/50",onClick:()=>c(!u),children:[u?s.jsx(Ye,{size:16}):s.jsx(ft,{size:16}),s.jsxs("span",{className:"font-medium text-slate-200",children:["Case ",t+1,": ",e.id]}),e.expected.length>0&&s.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),s.jsxs("div",{className:"ml-auto flex gap-1",onClick:k=>k.stopPropagation(),children:[s.jsx("button",{onClick:i,className:"p-1 text-slate-400 hover:text-slate-200",title:"Duplicate case",children:s.jsx(tp,{size:14})}),o&&s.jsx("button",{onClick:a,className:"p-1 text-red-400 hover:text-red-300",title:"Remove case",children:s.jsx(Ie,{size:14})})]})]}),u&&s.jsxs("div",{className:"px-4 pb-4 pt-2 border-t border-slate-700 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Case ID"}),s.jsx("input",{type:"text",value:e.id,onChange:k=>l({id:k.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"case_001"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:["Expected Outcome(s) ",e.expected.length>1&&s.jsx("span",{className:"text-blue-400",children:"(any)"})]}),n.length>0?s.jsx("div",{className:"space-y-1.5 max-h-32 overflow-y-auto p-2 bg-slate-800 border border-slate-700 rounded",children:n.map(k=>s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-slate-700/50 p-1 rounded",children:[s.jsx("input",{type:"checkbox",checked:e.expected.includes(k.id),onChange:()=>p(k.id),className:"w-4 h-4 rounded border-slate-600 bg-slate-800 text-blue-500 focus:ring-blue-500"}),s.jsx("span",{className:"text-sm text-slate-200",children:k.name||k.id}),k.description&&s.jsx("span",{className:"text-xs text-slate-500 truncate",children:k.description})]},k.id))}):s.jsx("input",{type:"text",value:e.expected.join(", "),onChange:k=>l({expected:k.target.value.split(",").map(T=>T.trim()).filter(Boolean)}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"goal_id (link scenario for dropdown)"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Tags (comma-separated)"}),s.jsx("input",{type:"text",value:e.tags.join(", "),onChange:k=>S(k.target.value),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"basic, edge-case, high-value"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Variables"}),s.jsx("button",{onClick:f,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Variable"})]}),s.jsx("div",{className:"space-y-2",children:e.variables.map((k,T)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:k.key,onChange:A=>x(T,A.target.value,k.value),className:"w-1/3 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"key"}),s.jsx("input",{type:"text",value:k.value,onChange:A=>x(T,k.key,A.target.value),className:"flex-1 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"value"}),s.jsx("button",{onClick:()=>v(T),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(yt,{size:14})})]},T))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Tool Response Overrides"}),s.jsx("button",{onClick:N,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Override"})]}),s.jsxs("div",{className:"space-y-3",children:[e.toolResponses.map((k,T)=>{const A=r.find(O=>O.name===k.tool),L=(A==null?void 0:A.actions)||[];return s.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg border border-slate-700 space-y-3",children:[s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2",children:[r.length>0?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),s.jsxs("select",{value:k.tool,onChange:O=>{const F=O.target.value,B=r.find(le=>le.name===F),Y=(B==null?void 0:B.actions.length)===1&&B.actions[0].name==="call"?"call":"";y(T,{tool:F,action:Y})},className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select tool..."}),r.map(O=>s.jsx("option",{value:O.name,children:O.name},O.name))]})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),s.jsx("input",{type:"text",value:k.tool,onChange:O=>y(T,{tool:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"tool_name"})]}),L.length===1&&L[0].name==="call"?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsxs("div",{className:"px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-400 text-sm",children:["call ",s.jsx("span",{className:"text-xs",children:"(single-action)"})]})]}):L.length>0?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsxs("select",{value:k.action,onChange:O=>y(T,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select action..."}),L.map(O=>s.jsx("option",{value:O.name,children:O.name},O.name))]})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsx("input",{type:"text",value:k.action,onChange:O=>y(T,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"call"})]})]}),s.jsx("button",{onClick:()=>j(T),className:"p-1.5 text-red-400 hover:text-red-300 self-end mb-1",title:"Remove override",children:s.jsx(Ie,{size:14})})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("label",{className:"text-xs text-slate-500",children:"Response Data"}),s.jsxs("div",{className:"flex text-xs bg-slate-900 rounded overflow-hidden border border-slate-600",children:[s.jsx("button",{onClick:()=>y(T,{mode:"fields"}),className:`px-2 py-1 ${k.mode==="fields"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Fields"}),s.jsx("button",{onClick:()=>y(T,{mode:"json"}),className:`px-2 py-1 ${k.mode==="json"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"JSON"})]})]}),k.mode==="fields"&&s.jsx("button",{onClick:()=>m(T),className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Field"})]}),k.mode==="fields"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-2",children:k.fields.map((O,F)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:O.key,onChange:B=>d(T,F,B.target.value,O.value),className:"w-1/3 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"field_name"}),s.jsx("input",{type:"text",value:O.value,onChange:B=>d(T,F,O.key,B.target.value),className:"flex-1 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"value (strings, numbers, or JSON)"}),k.fields.length>1&&s.jsx("button",{onClick:()=>g(T,F),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(yt,{size:14})})]},F))}),s.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Each field becomes a key in the response object. Values are auto-parsed (numbers, booleans, JSON)."})]}):s.jsxs(s.Fragment,{children:[s.jsx("textarea",{value:k.rawJson,onChange:O=>y(T,{rawJson:O.target.value}),className:"w-full px-3 py-2 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm font-mono",rows:6,placeholder:'{"status": "open", "priority": "high", "items": [1, 2, 3]}'}),s.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Enter the complete JSON response object. This replaces the tool's normal return value."})]})]})]},T)}),e.toolResponses.length===0&&s.jsx("p",{className:"text-xs text-slate-500 p-3 bg-slate-800/30 rounded-lg border border-dashed border-slate-700",children:r.length>0?"Add overrides to inject custom tool responses for this test case":"Link a scenario above to enable tool dropdowns, or add overrides manually"})]})]})]})]})}function M1({dataset:e,expandedCases:t,onToggleCase:n,onEdit:r,onDelete:l}){const[a,i]=h.useState(5);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:e.name}),s.jsx("p",{className:"text-slate-400 text-sm",children:e.description})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:r,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(sp,{size:14}),"Edit"]}),s.jsxs("button",{onClick:l,className:"flex items-center gap-1 px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded text-sm",children:[s.jsx(Ie,{size:14}),"Delete"]})]})]}),s.jsxs("div",{className:"mb-4 text-sm text-slate-400",children:[e.cases.length," test case",e.cases.length!==1?"s":"",e.generator&&" (generated)"]}),s.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.cases.map(o=>s.jsx(F1,{case_:o,expanded:t.has(o.id),onToggle:()=>n(o.id)},o.id))}),e.cases.length>0&&s.jsx("div",{className:"mt-4 pt-4 border-t border-slate-700",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs(Re,{to:`/run?dataset=${e.id}&parallel=${a}`,className:"flex items-center gap-2 px-4 py-2 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg font-medium",children:[s.jsx(fn,{size:16}),"Run All Cases"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("label",{className:"text-sm text-slate-400",children:"Parallel:"}),s.jsx("input",{type:"number",min:1,max:20,value:a,onChange:o=>i(Math.max(1,Math.min(20,parseInt(o.target.value)||1))),className:"w-16 px-2 py-1 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm"}),s.jsx("span",{className:"text-xs text-slate-500",children:"concurrent runs"})]})]})})]})}function F1({case_:e,expanded:t,onToggle:n}){return s.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[s.jsxs("button",{onClick:n,className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[t?s.jsx(Ye,{size:16}):s.jsx(ft,{size:16}),s.jsx("span",{className:"font-medium text-slate-200",children:e.id}),e.expected.length>0&&s.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),e.tags.length>0&&s.jsx("div",{className:"flex gap-1 ml-auto",children:e.tags.map(r=>s.jsx("span",{className:"px-2 py-0.5 bg-slate-700 rounded text-xs text-slate-400",children:r},r))})]}),t&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[Object.keys(e.variables).length>0&&s.jsxs("div",{className:"mb-3",children:[s.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Variables"}),s.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.variables,null,2)})]}),Object.keys(e.tool_responses).length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Tool Response Overrides"}),s.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.tool_responses,null,2)})]})]})]})}function O1(e){return{id:e.id,name:e.name,description:e.description,scenarioId:e.scenario_id||"",cases:e.cases.map(t=>({id:t.id,expected:t.expected||[],variables:Object.entries(t.variables).map(([n,r])=>({key:n,value:typeof r=="string"?r:JSON.stringify(r)})),toolResponses:Object.entries(t.tool_responses).map(([n,r])=>{const l=n.split("."),a=l[0]||n,i=l.slice(1).join(".")||"",o=[];let u=!1;if(typeof r=="object"&&r!==null)for(const[c,p]of Object.entries(r))typeof p=="object"&&p!==null&&(u=!0),o.push({key:c,value:typeof p=="string"?p:JSON.stringify(p)});return o.length===0&&o.push({key:"",value:""}),{tool:a,action:i,mode:u?"json":"fields",fields:o,rawJson:JSON.stringify(r,null,2)}}),tags:t.tags}))}}function Gp(e){const t=[];e.name&&t.push(`name: "${e.name}"`),e.description&&(t.push("description: |"),e.description.split(`
346
- `).forEach(n=>{t.push(` ${n}`)})),e.scenarioId&&t.push(`scenario_id: ${e.scenarioId}`),t.push(""),t.push("cases:");for(const n of e.cases){t.push(` - id: ${n.id}`),n.expected.length===1?t.push(` expected: ${n.expected[0]}`):n.expected.length>1&&t.push(` expected: [${n.expected.join(", ")}]`);const r=n.variables.filter(a=>a.key.trim());if(r.length>0){t.push(" variables:");for(const a of r){const i=yc(a.value);typeof i=="string"?t.push(` ${a.key}: "${i}"`):t.push(` ${a.key}: ${JSON.stringify(i)}`)}}const l=n.toolResponses.filter(a=>a.tool.trim()?a.mode==="json"?a.rawJson.trim().length>0:a.fields.some(i=>i.key.trim()):!1);if(l.length>0){t.push(" tool_responses:");for(const a of l){const i=a.action?`${a.tool}.${a.action}`:a.tool;if(t.push(` ${i}:`),a.mode==="json")try{const o=JSON.parse(a.rawJson);if(typeof o=="object"&&o!==null)for(const[u,c]of Object.entries(o))typeof c=="string"?t.push(` ${u}: "${c}"`):t.push(` ${u}: ${JSON.stringify(c)}`)}catch{t.push(" # Invalid JSON")}else for(const o of a.fields){if(!o.key.trim())continue;const u=yc(o.value);typeof u=="string"?t.push(` ${o.key}: "${u}"`):t.push(` ${o.key}: ${JSON.stringify(u)}`)}}}n.tags.length>0&&t.push(` tags: [${n.tags.join(", ")}]`)}return t.join(`
347
- `)}function yc(e){try{return JSON.parse(e)}catch{const t=Number(e);return!isNaN(t)&&e.trim()!==""?t:e.toLowerCase()==="true"?!0:e.toLowerCase()==="false"?!1:e}}function z1(){return s.jsx(Ex,{children:s.jsxs(jt,{path:"/",element:s.jsx(Ng,{}),children:[s.jsx(jt,{index:!0,element:s.jsx(wg,{})}),s.jsx(jt,{path:"run/:scenarioId",element:s.jsx(Zu,{})}),s.jsx(jt,{path:"run",element:s.jsx(Zu,{})}),s.jsx(jt,{path:"results",element:s.jsx(Lg,{})}),s.jsx(jt,{path:"builder",element:s.jsx(r1,{})}),s.jsx(jt,{path:"tool-builder",element:s.jsx(N1,{})}),s.jsx(jt,{path:"datasets",element:s.jsx(A1,{})})]})})}xa.createRoot(document.getElementById("root")).render(s.jsx(hm.StrictMode,{children:s.jsx(Xx,{children:s.jsx(z1,{})})}));