assuremind 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +5 -4
- package/LICENSE +20 -20
- package/README.md +93 -310
- package/dist/cli/index.js +1400 -303
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.mts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +43 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -3
- package/dist/index.mjs.map +1 -1
- package/docs/CLI-REFERENCE.md +17 -0
- package/docs/GETTING-STARTED.md +7 -0
- package/docs/STUDIO.md +37 -3
- package/package.json +3 -1
- package/templates/{AUTOMIND.md → ASSUREMIND.md} +30 -2
- package/templates/docs/CLI-REFERENCE.md +18 -1
- package/templates/docs/GETTING-STARTED.md +7 -1
- package/templates/docs/STUDIO.md +43 -2
- package/ui/dist/assets/index-By2Hw5l2.css +1 -0
- package/ui/dist/assets/index-DaQ-JHje.js +819 -0
- package/ui/dist/favicon.svg +36 -36
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-CdtAorWT.js +0 -819
- package/ui/dist/assets/index-KjpMCzao.css +0 -1
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
var Pm=e=>{throw TypeError(e)};var Tc=(e,t,s)=>t.has(e)||Pm("Cannot "+s);var S=(e,t,s)=>(Tc(e,t,"read from private field"),s?s.call(e):t.get(e)),Z=(e,t,s)=>t.has(e)?Pm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),V=(e,t,s,r)=>(Tc(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),le=(e,t,s)=>(Tc(e,t,"access private method"),s);var jl=(e,t,s,r)=>({set _(a){V(e,t,a,s)},get _(){return S(e,t,r)}});function Wy(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function s(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=s(a);fetch(a.href,i)}})();function Vy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uf={exports:{}},Xo={},Bf={exports:{}},me={};/**
|
|
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 cl=Symbol.for("react.element"),Qy=Symbol.for("react.portal"),Gy=Symbol.for("react.fragment"),Yy=Symbol.for("react.strict_mode"),Jy=Symbol.for("react.profiler"),Xy=Symbol.for("react.provider"),Zy=Symbol.for("react.context"),eb=Symbol.for("react.forward_ref"),tb=Symbol.for("react.suspense"),nb=Symbol.for("react.memo"),sb=Symbol.for("react.lazy"),zm=Symbol.iterator;function rb(e){return e===null||typeof e!="object"?null:(e=zm&&e[zm]||e["@@iterator"],typeof e=="function"?e:null)}var Hf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qf=Object.assign,Kf={};function $a(e,t,s){this.props=e,this.context=t,this.refs=Kf,this.updater=s||Hf}$a.prototype.isReactComponent={};$a.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")};$a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Wf(){}Wf.prototype=$a.prototype;function ox(e,t,s){this.props=e,this.context=t,this.refs=Kf,this.updater=s||Hf}var cx=ox.prototype=new Wf;cx.constructor=ox;qf(cx,$a.prototype);cx.isPureReactComponent=!0;var Mm=Array.isArray,Vf=Object.prototype.hasOwnProperty,dx={current:null},Qf={key:!0,ref:!0,__self:!0,__source:!0};function Gf(e,t,s){var r,a={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Vf.call(t,r)&&!Qf.hasOwnProperty(r)&&(a[r]=t[r]);var o=arguments.length-2;if(o===1)a.children=s;else if(1<o){for(var c=Array(o),d=0;d<o;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)a[r]===void 0&&(a[r]=o[r]);return{$$typeof:cl,type:e,key:i,ref:l,props:a,_owner:dx.current}}function ab(e,t){return{$$typeof:cl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ux(e){return typeof e=="object"&&e!==null&&e.$$typeof===cl}function ib(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(s){return t[s]})}var Tm=/\/+/g;function Rc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ib(""+e.key):t.toString(36)}function Gl(e,t,s,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case cl:case Qy:l=!0}}if(l)return l=e,a=a(l),e=r===""?"."+Rc(l,0):r,Mm(a)?(s="",e!=null&&(s=e.replace(Tm,"$&/")+"/"),Gl(a,t,s,"",function(d){return d})):a!=null&&(ux(a)&&(a=ab(a,s+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(Tm,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=r===""?".":r+":",Mm(e))for(var o=0;o<e.length;o++){i=e[o];var c=r+Rc(i,o);l+=Gl(i,t,s,c,a)}else if(c=rb(e),typeof c=="function")for(e=c.call(e),o=0;!(i=e.next()).done;)i=i.value,c=r+Rc(i,o++),l+=Gl(i,t,s,c,a);else if(i==="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 l}function Nl(e,t,s){if(e==null)return e;var r=[],a=0;return Gl(e,r,"","",function(i){return t.call(s,i,a++)}),r}function lb(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s)},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var vt={current:null},Yl={transition:null},ob={ReactCurrentDispatcher:vt,ReactCurrentBatchConfig:Yl,ReactCurrentOwner:dx};function Yf(){throw Error("act(...) is not supported in production builds of React.")}me.Children={map:Nl,forEach:function(e,t,s){Nl(e,function(){t.apply(this,arguments)},s)},count:function(e){var t=0;return Nl(e,function(){t++}),t},toArray:function(e){return Nl(e,function(t){return t})||[]},only:function(e){if(!ux(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Component=$a;me.Fragment=Gy;me.Profiler=Jy;me.PureComponent=ox;me.StrictMode=Yy;me.Suspense=tb;me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ob;me.act=Yf;me.cloneElement=function(e,t,s){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=qf({},e.props),a=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=dx.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Vf.call(t,c)&&!Qf.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=s;else if(1<c){o=Array(c);for(var d=0;d<c;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:cl,type:e.type,key:a,ref:i,props:r,_owner:l}};me.createContext=function(e){return e={$$typeof:Zy,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Xy,_context:e},e.Consumer=e};me.createElement=Gf;me.createFactory=function(e){var t=Gf.bind(null,e);return t.type=e,t};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:eb,render:e}};me.isValidElement=ux;me.lazy=function(e){return{$$typeof:sb,_payload:{_status:-1,_result:e},_init:lb}};me.memo=function(e,t){return{$$typeof:nb,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=Yl.transition;Yl.transition={};try{e()}finally{Yl.transition=t}};me.unstable_act=Yf;me.useCallback=function(e,t){return vt.current.useCallback(e,t)};me.useContext=function(e){return vt.current.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e){return vt.current.useDeferredValue(e)};me.useEffect=function(e,t){return vt.current.useEffect(e,t)};me.useId=function(){return vt.current.useId()};me.useImperativeHandle=function(e,t,s){return vt.current.useImperativeHandle(e,t,s)};me.useInsertionEffect=function(e,t){return vt.current.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return vt.current.useLayoutEffect(e,t)};me.useMemo=function(e,t){return vt.current.useMemo(e,t)};me.useReducer=function(e,t,s){return vt.current.useReducer(e,t,s)};me.useRef=function(e){return vt.current.useRef(e)};me.useState=function(e){return vt.current.useState(e)};me.useSyncExternalStore=function(e,t,s){return vt.current.useSyncExternalStore(e,t,s)};me.useTransition=function(){return vt.current.useTransition()};me.version="18.3.1";Bf.exports=me;var m=Bf.exports;const cb=Vy(m),db=Wy({__proto__:null,default:cb},[m]);/**
|
|
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 ub=m,xb=Symbol.for("react.element"),mb=Symbol.for("react.fragment"),hb=Object.prototype.hasOwnProperty,fb=ub.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pb={key:!0,ref:!0,__self:!0,__source:!0};function Jf(e,t,s){var r,a={},i=null,l=null;s!==void 0&&(i=""+s),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)hb.call(t,r)&&!pb.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:xb,type:e,key:i,ref:l,props:a,_owner:fb.current}}Xo.Fragment=mb;Xo.jsx=Jf;Xo.jsxs=Jf;Uf.exports=Xo;var n=Uf.exports,Xf={exports:{}},$t={},Zf={exports:{}},ep={};/**
|
|
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(z,K){var T=z.length;z.push(K);e:for(;0<T;){var W=T-1>>>1,A=z[W];if(0<a(A,K))z[W]=K,z[T]=A,T=W;else break e}}function s(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var K=z[0],T=z.pop();if(T!==K){z[0]=T;e:for(var W=0,A=z.length,te=A>>>1;W<te;){var B=2*(W+1)-1,de=z[B],xe=B+1,ue=z[xe];if(0>a(de,T))xe<A&&0>a(ue,de)?(z[W]=ue,z[xe]=T,W=xe):(z[W]=de,z[B]=T,W=B);else if(xe<A&&0>a(ue,T))z[W]=ue,z[xe]=T,W=xe;else break e}}return K}function a(z,K){var T=z.sortIndex-K.sortIndex;return T!==0?T:z.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var c=[],d=[],x=1,f=null,g=3,b=!1,y=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(z){for(var K=s(d);K!==null;){if(K.callback===null)r(d);else if(K.startTime<=z)r(d),K.sortIndex=K.expirationTime,t(c,K);else break;K=s(d)}}function v(z){if(j=!1,p(z),!y)if(s(c)!==null)y=!0,ee(w);else{var K=s(d);K!==null&&ae(v,K.startTime-z)}}function w(z,K){y=!1,j&&(j=!1,h(E),E=-1),b=!0;var T=g;try{for(p(K),f=s(c);f!==null&&(!(f.expirationTime>K)||z&&!G());){var W=f.callback;if(typeof W=="function"){f.callback=null,g=f.priorityLevel;var A=W(f.expirationTime<=K);K=e.unstable_now(),typeof A=="function"?f.callback=A:f===s(c)&&r(c),p(K)}else r(c);f=s(c)}if(f!==null)var te=!0;else{var B=s(d);B!==null&&ae(v,B.startTime-K),te=!1}return te}finally{f=null,g=T,b=!1}}var N=!1,P=null,E=-1,_=5,D=-1;function G(){return!(e.unstable_now()-D<_)}function J(){if(P!==null){var z=e.unstable_now();D=z;var K=!0;try{K=P(!0,z)}finally{K?se():(N=!1,P=null)}}else N=!1}var se;if(typeof u=="function")se=function(){u(J)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,F=M.port2;M.port1.onmessage=J,se=function(){F.postMessage(null)}}else se=function(){k(J,0)};function ee(z){P=z,N||(N=!0,se())}function ae(z,K){E=k(function(){z(e.unstable_now())},K)}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(z){z.callback=null},e.unstable_continueExecution=function(){y||b||(y=!0,ee(w))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return s(c)},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var K=3;break;default:K=g}var T=g;g=K;try{return z()}finally{g=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var T=g;g=z;try{return K()}finally{g=T}},e.unstable_scheduleCallback=function(z,K,T){var W=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?W+T:W):T=W,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=T+A,z={id:x++,callback:K,priorityLevel:z,startTime:T,expirationTime:A,sortIndex:-1},T>W?(z.sortIndex=T,t(d,z),s(c)===null&&z===s(d)&&(j?(h(E),E=-1):j=!0,ae(v,T-W))):(z.sortIndex=A,t(c,z),y||b||(y=!0,ee(w))),z},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(z){var K=g;return function(){var T=g;g=K;try{return z.apply(this,arguments)}finally{g=T}}}})(ep);Zf.exports=ep;var gb=Zf.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 yb=m,_t=gb;function U(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);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 tp=new Set,zi={};function Tr(e,t){za(e,t),za(e+"Capture",t)}function za(e,t){for(zi[e]=t,e=0;e<t.length;e++)tp.add(t[e])}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rd=Object.prototype.hasOwnProperty,bb=/^[: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]*$/,Rm={},Om={};function vb(e){return Rd.call(Om,e)?!0:Rd.call(Rm,e)?!1:bb.test(e)?Om[e]=!0:(Rm[e]=!0,!1)}function jb(e,t,s,r){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Nb(e,t,s,r){if(t===null||typeof t>"u"||jb(e,t,s,r))return!0;if(r)return!1;if(s!==null)switch(s.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 jt(e,t,s,r,a,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rt[e]=new jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rt[t]=new jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rt[e]=new jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rt[e]=new jt(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){rt[e]=new jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rt[e]=new jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rt[e]=new jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rt[e]=new jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rt[e]=new jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var xx=/[\-:]([a-z])/g;function mx(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(xx,mx);rt[t]=new jt(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(xx,mx);rt[t]=new jt(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(xx,mx);rt[t]=new jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rt[e]=new jt(e,1,!1,e.toLowerCase(),null,!1,!1)});rt.xlinkHref=new jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rt[e]=new jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function hx(e,t,s,r){var a=rt.hasOwnProperty(t)?rt[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Nb(t,s,a,r)&&(s=null),r||a===null?vb(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):a.mustUseProperty?e[a.propertyName]=s===null?a.type===3?!1:"":s:(t=a.attributeName,r=a.attributeNamespace,s===null?e.removeAttribute(t):(a=a.type,s=a===3||a===4&&s===!0?"":""+s,r?e.setAttributeNS(r,t,s):e.setAttribute(t,s))))}var es=yb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wl=Symbol.for("react.element"),Yr=Symbol.for("react.portal"),Jr=Symbol.for("react.fragment"),fx=Symbol.for("react.strict_mode"),Od=Symbol.for("react.profiler"),np=Symbol.for("react.provider"),sp=Symbol.for("react.context"),px=Symbol.for("react.forward_ref"),Dd=Symbol.for("react.suspense"),Ad=Symbol.for("react.suspense_list"),gx=Symbol.for("react.memo"),cs=Symbol.for("react.lazy"),rp=Symbol.for("react.offscreen"),Dm=Symbol.iterator;function Qa(e){return e===null||typeof e!="object"?null:(e=Dm&&e[Dm]||e["@@iterator"],typeof e=="function"?e:null)}var Ae=Object.assign,Oc;function xi(e){if(Oc===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Oc=t&&t[1]||""}return`
|
|
34
|
+
`+Oc+e}var Dc=!1;function Ac(e,t){if(!e||Dc)return"";Dc=!0;var s=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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var a=d.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),l=a.length-1,o=i.length-1;1<=l&&0<=o&&a[l]!==i[o];)o--;for(;1<=l&&0<=o;l--,o--)if(a[l]!==i[o]){if(l!==1||o!==1)do if(l--,o--,0>o||a[l]!==i[o]){var c=`
|
|
37
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=o);break}}}finally{Dc=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?xi(e):""}function wb(e){switch(e.tag){case 5:return xi(e.type);case 16:return xi("Lazy");case 13:return xi("Suspense");case 19:return xi("SuspenseList");case 0:case 2:case 15:return e=Ac(e.type,!1),e;case 11:return e=Ac(e.type.render,!1),e;case 1:return e=Ac(e.type,!0),e;default:return""}}function Ld(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 Jr:return"Fragment";case Yr:return"Portal";case Od:return"Profiler";case fx:return"StrictMode";case Dd:return"Suspense";case Ad:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sp:return(e.displayName||"Context")+".Consumer";case np:return(e._context.displayName||"Context")+".Provider";case px:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gx:return t=e.displayName||null,t!==null?t:Ld(e.type)||"Memo";case cs:t=e._payload,e=e._init;try{return Ld(e(t))}catch{}}return null}function kb(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 Ld(t);case 8:return t===fx?"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 Fs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sb(e){var t=ap(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var a=s.get,i=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kl(e){e._valueTracker||(e._valueTracker=Sb(e))}function ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),r="";return e&&(r=ap(e)?e.checked?"true":"false":e.value),e=r,e!==s?(t.setValue(e),!0):!1}function xo(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 Id(e,t){var s=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Am(e,t){var s=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;s=Fs(t.value!=null?t.value:s),e._wrapperState={initialChecked:r,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function lp(e,t){t=t.checked,t!=null&&hx(e,"checked",t,!1)}function Fd(e,t){lp(e,t);var s=Fs(t.value),r=t.type;if(s!=null)r==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_d(e,t.type,s):t.hasOwnProperty("defaultValue")&&_d(e,t.type,Fs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lm(e,t,s){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,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function _d(e,t,s){(t!=="number"||xo(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var mi=Array.isArray;function da(e,t,s,r){if(e=e.options,t){t={};for(var a=0;a<s.length;a++)t["$"+s[a]]=!0;for(s=0;s<e.length;s++)a=t.hasOwnProperty("$"+e[s].value),e[s].selected!==a&&(e[s].selected=a),a&&r&&(e[s].defaultSelected=!0)}else{for(s=""+Fs(s),t=null,a=0;a<e.length;a++){if(e[a].value===s){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function $d(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Ae({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Im(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(U(92));if(mi(s)){if(1<s.length)throw Error(U(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:Fs(s)}}function op(e,t){var s=Fs(t.value),r=Fs(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),r!=null&&(e.defaultValue=""+r)}function Fm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function cp(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 Ud(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?cp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Sl,dp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,s,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Sl=Sl||document.createElement("div"),Sl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Sl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Mi(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var vi={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},Cb=["Webkit","ms","Moz","O"];Object.keys(vi).forEach(function(e){Cb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),vi[t]=vi[e]})});function up(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||vi.hasOwnProperty(e)&&vi[e]?(""+t).trim():t+"px"}function xp(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var r=s.indexOf("--")===0,a=up(s,t[s],r);s==="float"&&(s="cssFloat"),r?e.setProperty(s,a):e[s]=a}}var Eb=Ae({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 Bd(e,t){if(t){if(Eb[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function Hd(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 qd=null;function yx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kd=null,ua=null,xa=null;function _m(e){if(e=xl(e)){if(typeof Kd!="function")throw Error(U(280));var t=e.stateNode;t&&(t=sc(t),Kd(e.stateNode,e.type,t))}}function mp(e){ua?xa?xa.push(e):xa=[e]:ua=e}function hp(){if(ua){var e=ua,t=xa;if(xa=ua=null,_m(e),t)for(e=0;e<t.length;e++)_m(t[e])}}function fp(e,t){return e(t)}function pp(){}var Lc=!1;function gp(e,t,s){if(Lc)return e(t,s);Lc=!0;try{return fp(e,t,s)}finally{Lc=!1,(ua!==null||xa!==null)&&(pp(),hp())}}function Ti(e,t){var s=e.stateNode;if(s===null)return null;var r=sc(s);if(r===null)return null;s=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(s&&typeof s!="function")throw Error(U(231,t,typeof s));return s}var Wd=!1;if(Qn)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){Wd=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{Wd=!1}function Pb(e,t,s,r,a,i,l,o,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(s,d)}catch(x){this.onError(x)}}var ji=!1,mo=null,ho=!1,Vd=null,zb={onError:function(e){ji=!0,mo=e}};function Mb(e,t,s,r,a,i,l,o,c){ji=!1,mo=null,Pb.apply(zb,arguments)}function Tb(e,t,s,r,a,i,l,o,c){if(Mb.apply(this,arguments),ji){if(ji){var d=mo;ji=!1,mo=null}else throw Error(U(198));ho||(ho=!0,Vd=d)}}function Rr(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function yp(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 $m(e){if(Rr(e)!==e)throw Error(U(188))}function Rb(e){var t=e.alternate;if(!t){if(t=Rr(e),t===null)throw Error(U(188));return t!==e?null:e}for(var s=e,r=t;;){var a=s.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){s=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===s)return $m(a),e;if(i===r)return $m(a),t;i=i.sibling}throw Error(U(188))}if(s.return!==r.return)s=a,r=i;else{for(var l=!1,o=a.child;o;){if(o===s){l=!0,s=a,r=i;break}if(o===r){l=!0,r=a,s=i;break}o=o.sibling}if(!l){for(o=i.child;o;){if(o===s){l=!0,s=i,r=a;break}if(o===r){l=!0,r=i,s=a;break}o=o.sibling}if(!l)throw Error(U(189))}}if(s.alternate!==r)throw Error(U(190))}if(s.tag!==3)throw Error(U(188));return s.stateNode.current===s?e:t}function bp(e){return e=Rb(e),e!==null?vp(e):null}function vp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vp(e);if(t!==null)return t;e=e.sibling}return null}var jp=_t.unstable_scheduleCallback,Um=_t.unstable_cancelCallback,Ob=_t.unstable_shouldYield,Db=_t.unstable_requestPaint,$e=_t.unstable_now,Ab=_t.unstable_getCurrentPriorityLevel,bx=_t.unstable_ImmediatePriority,Np=_t.unstable_UserBlockingPriority,fo=_t.unstable_NormalPriority,Lb=_t.unstable_LowPriority,wp=_t.unstable_IdlePriority,Zo=null,kn=null;function Ib(e){if(kn&&typeof kn.onCommitFiberRoot=="function")try{kn.onCommitFiberRoot(Zo,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:$b,Fb=Math.log,_b=Math.LN2;function $b(e){return e>>>=0,e===0?32:31-(Fb(e)/_b|0)|0}var Cl=64,El=4194304;function hi(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 po(e,t){var s=e.pendingLanes;if(s===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,l=s&268435455;if(l!==0){var o=l&~a;o!==0?r=hi(o):(i&=l,i!==0&&(r=hi(i)))}else l=s&~a,l!==0?r=hi(l):i!==0&&(r=hi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)s=31-un(t),a=1<<s,r|=e[s],t&=~a;return r}function Ub(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 Bb(e,t){for(var s=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-un(i),o=1<<l,c=a[l];c===-1?(!(o&s)||o&r)&&(a[l]=Ub(o,t)):c<=t&&(e.expiredLanes|=o),i&=~o}}function Qd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function kp(){var e=Cl;return Cl<<=1,!(Cl&4194240)&&(Cl=64),e}function Ic(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function dl(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=s}function Hb(e,t){var s=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<s;){var a=31-un(s),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,s&=~i}}function vx(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var r=31-un(s),a=1<<r;a&t|e[r]&t&&(e[r]|=t),s&=~a}}var we=0;function Sp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Cp,jx,Ep,Pp,zp,Gd=!1,Pl=[],Ps=null,zs=null,Ms=null,Ri=new Map,Oi=new Map,ms=[],qb="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 Bm(e,t){switch(e){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":zs=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Ri.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(t.pointerId)}}function Ya(e,t,s,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:s,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=xl(t),t!==null&&jx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Kb(e,t,s,r,a){switch(t){case"focusin":return Ps=Ya(Ps,e,t,s,r,a),!0;case"dragenter":return zs=Ya(zs,e,t,s,r,a),!0;case"mouseover":return Ms=Ya(Ms,e,t,s,r,a),!0;case"pointerover":var i=a.pointerId;return Ri.set(i,Ya(Ri.get(i)||null,e,t,s,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Oi.set(i,Ya(Oi.get(i)||null,e,t,s,r,a)),!0}return!1}function Mp(e){var t=nr(e.target);if(t!==null){var s=Rr(t);if(s!==null){if(t=s.tag,t===13){if(t=yp(s),t!==null){e.blockedOn=t,zp(e.priority,function(){Ep(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Yd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var r=new s.constructor(s.type,s);qd=r,s.target.dispatchEvent(r),qd=null}else return t=xl(s),t!==null&&jx(t),e.blockedOn=s,!1;t.shift()}return!0}function Hm(e,t,s){Jl(e)&&s.delete(t)}function Wb(){Gd=!1,Ps!==null&&Jl(Ps)&&(Ps=null),zs!==null&&Jl(zs)&&(zs=null),Ms!==null&&Jl(Ms)&&(Ms=null),Ri.forEach(Hm),Oi.forEach(Hm)}function Ja(e,t){e.blockedOn===t&&(e.blockedOn=null,Gd||(Gd=!0,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,Wb)))}function Di(e){function t(a){return Ja(a,e)}if(0<Pl.length){Ja(Pl[0],e);for(var s=1;s<Pl.length;s++){var r=Pl[s];r.blockedOn===e&&(r.blockedOn=null)}}for(Ps!==null&&Ja(Ps,e),zs!==null&&Ja(zs,e),Ms!==null&&Ja(Ms,e),Ri.forEach(t),Oi.forEach(t),s=0;s<ms.length;s++)r=ms[s],r.blockedOn===e&&(r.blockedOn=null);for(;0<ms.length&&(s=ms[0],s.blockedOn===null);)Mp(s),s.blockedOn===null&&ms.shift()}var ma=es.ReactCurrentBatchConfig,go=!0;function Vb(e,t,s,r){var a=we,i=ma.transition;ma.transition=null;try{we=1,Nx(e,t,s,r)}finally{we=a,ma.transition=i}}function Qb(e,t,s,r){var a=we,i=ma.transition;ma.transition=null;try{we=4,Nx(e,t,s,r)}finally{we=a,ma.transition=i}}function Nx(e,t,s,r){if(go){var a=Yd(e,t,s,r);if(a===null)Vc(e,t,r,yo,s),Bm(e,r);else if(Kb(a,e,t,s,r))r.stopPropagation();else if(Bm(e,r),t&4&&-1<qb.indexOf(e)){for(;a!==null;){var i=xl(a);if(i!==null&&Cp(i),i=Yd(e,t,s,r),i===null&&Vc(e,t,r,yo,s),i===a)break;a=i}a!==null&&r.stopPropagation()}else Vc(e,t,r,null,s)}}var yo=null;function Yd(e,t,s,r){if(yo=null,e=yx(r),e=nr(e),e!==null)if(t=Rr(e),t===null)e=null;else if(s=t.tag,s===13){if(e=yp(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return yo=e,null}function Tp(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(Ab()){case bx:return 1;case Np:return 4;case fo:case Lb:return 16;case wp:return 536870912;default:return 16}default:return 16}}var Ss=null,wx=null,Xl=null;function Rp(){if(Xl)return Xl;var e,t=wx,s=t.length,r,a="value"in Ss?Ss.value:Ss.textContent,i=a.length;for(e=0;e<s&&t[e]===a[e];e++);var l=s-e;for(r=1;r<=l&&t[s-r]===a[i-r];r++);return Xl=a.slice(e,1<r?1-r:void 0)}function Zl(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 zl(){return!0}function qm(){return!1}function Ut(e){function t(s,r,a,i,l){this._reactName=s,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(s=e[o],this[o]=s?s(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?zl:qm,this.isPropagationStopped=qm,this}return Ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),t}var Ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kx=Ut(Ua),ul=Ae({},Ua,{view:0,detail:0}),Gb=Ut(ul),Fc,_c,Xa,ec=Ae({},ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sx,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!==Xa&&(Xa&&e.type==="mousemove"?(Fc=e.screenX-Xa.screenX,_c=e.screenY-Xa.screenY):_c=Fc=0,Xa=e),Fc)},movementY:function(e){return"movementY"in e?e.movementY:_c}}),Km=Ut(ec),Yb=Ae({},ec,{dataTransfer:0}),Jb=Ut(Yb),Xb=Ae({},ul,{relatedTarget:0}),$c=Ut(Xb),Zb=Ae({},Ua,{animationName:0,elapsedTime:0,pseudoElement:0}),e1=Ut(Zb),t1=Ae({},Ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),n1=Ut(t1),s1=Ae({},Ua,{data:0}),Wm=Ut(s1),r1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a1={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"},i1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=i1[e])?!!t[e]:!1}function Sx(){return l1}var o1=Ae({},ul,{key:function(e){if(e.key){var t=r1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?a1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sx,charCode:function(e){return e.type==="keypress"?Zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),c1=Ut(o1),d1=Ae({},ec,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vm=Ut(d1),u1=Ae({},ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sx}),x1=Ut(u1),m1=Ae({},Ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),h1=Ut(m1),f1=Ae({},ec,{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}),p1=Ut(f1),g1=[9,13,27,32],Cx=Qn&&"CompositionEvent"in window,Ni=null;Qn&&"documentMode"in document&&(Ni=document.documentMode);var y1=Qn&&"TextEvent"in window&&!Ni,Op=Qn&&(!Cx||Ni&&8<Ni&&11>=Ni),Qm=" ",Gm=!1;function Dp(e,t){switch(e){case"keyup":return g1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ap(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function b1(e,t){switch(e){case"compositionend":return Ap(t);case"keypress":return t.which!==32?null:(Gm=!0,Qm);case"textInput":return e=t.data,e===Qm&&Gm?null:e;default:return null}}function v1(e,t){if(Xr)return e==="compositionend"||!Cx&&Dp(e,t)?(e=Rp(),Xl=wx=Ss=null,Xr=!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 Op&&t.locale!=="ko"?null:t.data;default:return null}}var j1={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 Ym(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!j1[e.type]:t==="textarea"}function Lp(e,t,s,r){mp(r),t=bo(t,"onChange"),0<t.length&&(s=new kx("onChange","change",null,s,r),e.push({event:s,listeners:t}))}var wi=null,Ai=null;function N1(e){Vp(e,0)}function tc(e){var t=ta(e);if(ip(t))return e}function w1(e,t){if(e==="change")return t}var Ip=!1;if(Qn){var Uc;if(Qn){var Bc="oninput"in document;if(!Bc){var Jm=document.createElement("div");Jm.setAttribute("oninput","return;"),Bc=typeof Jm.oninput=="function"}Uc=Bc}else Uc=!1;Ip=Uc&&(!document.documentMode||9<document.documentMode)}function Xm(){wi&&(wi.detachEvent("onpropertychange",Fp),Ai=wi=null)}function Fp(e){if(e.propertyName==="value"&&tc(Ai)){var t=[];Lp(t,Ai,e,yx(e)),gp(N1,t)}}function k1(e,t,s){e==="focusin"?(Xm(),wi=t,Ai=s,wi.attachEvent("onpropertychange",Fp)):e==="focusout"&&Xm()}function S1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tc(Ai)}function C1(e,t){if(e==="click")return tc(t)}function E1(e,t){if(e==="input"||e==="change")return tc(t)}function P1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:P1;function Li(e,t){if(hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(r=0;r<s.length;r++){var a=s[r];if(!Rd.call(t,a)||!hn(e[a],t[a]))return!1}return!0}function Zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eh(e,t){var s=Zm(e);e=0;for(var r;s;){if(s.nodeType===3){if(r=e+s.textContent.length,e<=t&&r>=t)return{node:s,offset:t-e};e=r}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Zm(s)}}function _p(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_p(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $p(){for(var e=window,t=xo();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=xo(e.document)}return t}function Ex(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 z1(e){var t=$p(),s=e.focusedElem,r=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&_p(s.ownerDocument.documentElement,s)){if(r!==null&&Ex(s)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=s.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=eh(s,i);var l=eh(s,r);a&&l&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var M1=Qn&&"documentMode"in document&&11>=document.documentMode,Zr=null,Jd=null,ki=null,Xd=!1;function th(e,t,s){var r=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Xd||Zr==null||Zr!==xo(r)||(r=Zr,"selectionStart"in r&&Ex(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}),ki&&Li(ki,r)||(ki=r,r=bo(Jd,"onSelect"),0<r.length&&(t=new kx("onSelect","select",null,t,s),e.push({event:t,listeners:r}),t.target=Zr)))}function Ml(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ea={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},Hc={},Up={};Qn&&(Up=document.createElement("div").style,"AnimationEvent"in window||(delete ea.animationend.animation,delete ea.animationiteration.animation,delete ea.animationstart.animation),"TransitionEvent"in window||delete ea.transitionend.transition);function nc(e){if(Hc[e])return Hc[e];if(!ea[e])return e;var t=ea[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Up)return Hc[e]=t[s];return e}var Bp=nc("animationend"),Hp=nc("animationiteration"),qp=nc("animationstart"),Kp=nc("transitionend"),Wp=new Map,nh="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 Us(e,t){Wp.set(e,t),Tr(t,[e])}for(var qc=0;qc<nh.length;qc++){var Kc=nh[qc],T1=Kc.toLowerCase(),R1=Kc[0].toUpperCase()+Kc.slice(1);Us(T1,"on"+R1)}Us(Bp,"onAnimationEnd");Us(Hp,"onAnimationIteration");Us(qp,"onAnimationStart");Us("dblclick","onDoubleClick");Us("focusin","onFocus");Us("focusout","onBlur");Us(Kp,"onTransitionEnd");za("onMouseEnter",["mouseout","mouseover"]);za("onMouseLeave",["mouseout","mouseover"]);za("onPointerEnter",["pointerout","pointerover"]);za("onPointerLeave",["pointerout","pointerover"]);Tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Tr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fi="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(" "),O1=new Set("cancel close invalid load scroll toggle".split(" ").concat(fi));function sh(e,t,s){var r=e.type||"unknown-event";e.currentTarget=s,Tb(r,t,void 0,e),e.currentTarget=null}function Vp(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var r=e[s],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var l=r.length-1;0<=l;l--){var o=r[l],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==i&&a.isPropagationStopped())break e;sh(a,o,d),i=c}else for(l=0;l<r.length;l++){if(o=r[l],c=o.instance,d=o.currentTarget,o=o.listener,c!==i&&a.isPropagationStopped())break e;sh(a,o,d),i=c}}}if(ho)throw e=Vd,ho=!1,Vd=null,e}function ze(e,t){var s=t[su];s===void 0&&(s=t[su]=new Set);var r=e+"__bubble";s.has(r)||(Qp(t,e,2,!1),s.add(r))}function Wc(e,t,s){var r=0;t&&(r|=4),Qp(s,e,r,t)}var Tl="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[Tl]){e[Tl]=!0,tp.forEach(function(s){s!=="selectionchange"&&(O1.has(s)||Wc(s,!1,e),Wc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Tl]||(t[Tl]=!0,Wc("selectionchange",!1,t))}}function Qp(e,t,s,r){switch(Tp(t)){case 1:var a=Vb;break;case 4:a=Qb;break;default:a=Nx}s=a.bind(null,t,s,e),a=void 0,!Wd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,s,{capture:!0,passive:a}):e.addEventListener(t,s,!0):a!==void 0?e.addEventListener(t,s,{passive:a}):e.addEventListener(t,s,!1)}function Vc(e,t,s,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var o=r.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(l===4)for(l=r.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;l=l.return}for(;o!==null;){if(l=nr(o),l===null)return;if(c=l.tag,c===5||c===6){r=i=l;continue e}o=o.parentNode}}r=r.return}gp(function(){var d=i,x=yx(s),f=[];e:{var g=Wp.get(e);if(g!==void 0){var b=kx,y=e;switch(e){case"keypress":if(Zl(s)===0)break e;case"keydown":case"keyup":b=c1;break;case"focusin":y="focus",b=$c;break;case"focusout":y="blur",b=$c;break;case"beforeblur":case"afterblur":b=$c;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":b=Km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=Jb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=x1;break;case Bp:case Hp:case qp:b=e1;break;case Kp:b=h1;break;case"scroll":b=Gb;break;case"wheel":b=p1;break;case"copy":case"cut":case"paste":b=n1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=Vm}var j=(t&4)!==0,k=!j&&e==="scroll",h=j?g!==null?g+"Capture":null:g;j=[];for(var u=d,p;u!==null;){p=u;var v=p.stateNode;if(p.tag===5&&v!==null&&(p=v,h!==null&&(v=Ti(u,h),v!=null&&j.push(Fi(u,v,p)))),k)break;u=u.return}0<j.length&&(g=new b(g,y,null,s,x),f.push({event:g,listeners:j}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",g&&s!==qd&&(y=s.relatedTarget||s.fromElement)&&(nr(y)||y[Gn]))break e;if((b||g)&&(g=x.window===x?x:(g=x.ownerDocument)?g.defaultView||g.parentWindow:window,b?(y=s.relatedTarget||s.toElement,b=d,y=y?nr(y):null,y!==null&&(k=Rr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(b=null,y=d),b!==y)){if(j=Km,v="onMouseLeave",h="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(j=Vm,v="onPointerLeave",h="onPointerEnter",u="pointer"),k=b==null?g:ta(b),p=y==null?g:ta(y),g=new j(v,u+"leave",b,s,x),g.target=k,g.relatedTarget=p,v=null,nr(x)===d&&(j=new j(h,u+"enter",y,s,x),j.target=p,j.relatedTarget=k,v=j),k=v,b&&y)t:{for(j=b,h=y,u=0,p=j;p;p=Ur(p))u++;for(p=0,v=h;v;v=Ur(v))p++;for(;0<u-p;)j=Ur(j),u--;for(;0<p-u;)h=Ur(h),p--;for(;u--;){if(j===h||h!==null&&j===h.alternate)break t;j=Ur(j),h=Ur(h)}j=null}else j=null;b!==null&&rh(f,g,b,j,!1),y!==null&&k!==null&&rh(f,k,y,j,!0)}}e:{if(g=d?ta(d):window,b=g.nodeName&&g.nodeName.toLowerCase(),b==="select"||b==="input"&&g.type==="file")var w=w1;else if(Ym(g))if(Ip)w=E1;else{w=S1;var N=k1}else(b=g.nodeName)&&b.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(w=C1);if(w&&(w=w(e,d))){Lp(f,w,s,x);break e}N&&N(e,g,d),e==="focusout"&&(N=g._wrapperState)&&N.controlled&&g.type==="number"&&_d(g,"number",g.value)}switch(N=d?ta(d):window,e){case"focusin":(Ym(N)||N.contentEditable==="true")&&(Zr=N,Jd=d,ki=null);break;case"focusout":ki=Jd=Zr=null;break;case"mousedown":Xd=!0;break;case"contextmenu":case"mouseup":case"dragend":Xd=!1,th(f,s,x);break;case"selectionchange":if(M1)break;case"keydown":case"keyup":th(f,s,x)}var P;if(Cx)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Xr?Dp(e,s)&&(E="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(E="onCompositionStart");E&&(Op&&s.locale!=="ko"&&(Xr||E!=="onCompositionStart"?E==="onCompositionEnd"&&Xr&&(P=Rp()):(Ss=x,wx="value"in Ss?Ss.value:Ss.textContent,Xr=!0)),N=bo(d,E),0<N.length&&(E=new Wm(E,e,null,s,x),f.push({event:E,listeners:N}),P?E.data=P:(P=Ap(s),P!==null&&(E.data=P)))),(P=y1?b1(e,s):v1(e,s))&&(d=bo(d,"onBeforeInput"),0<d.length&&(x=new Wm("onBeforeInput","beforeinput",null,s,x),f.push({event:x,listeners:d}),x.data=P))}Vp(f,t)})}function Fi(e,t,s){return{instance:e,listener:t,currentTarget:s}}function bo(e,t){for(var s=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Ti(e,s),i!=null&&r.unshift(Fi(e,i,a)),i=Ti(e,t),i!=null&&r.push(Fi(e,i,a))),e=e.return}return r}function Ur(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rh(e,t,s,r,a){for(var i=t._reactName,l=[];s!==null&&s!==r;){var o=s,c=o.alternate,d=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&d!==null&&(o=d,a?(c=Ti(s,i),c!=null&&l.unshift(Fi(s,c,o))):a||(c=Ti(s,i),c!=null&&l.push(Fi(s,c,o)))),s=s.return}l.length!==0&&e.push({event:t,listeners:l})}var D1=/\r\n?/g,A1=/\u0000|\uFFFD/g;function ah(e){return(typeof e=="string"?e:""+e).replace(D1,`
|
|
38
|
+
`).replace(A1,"")}function Rl(e,t,s){if(t=ah(t),ah(e)!==t&&s)throw Error(U(425))}function vo(){}var Zd=null,eu=null;function tu(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 nu=typeof setTimeout=="function"?setTimeout:void 0,L1=typeof clearTimeout=="function"?clearTimeout:void 0,ih=typeof Promise=="function"?Promise:void 0,I1=typeof queueMicrotask=="function"?queueMicrotask:typeof ih<"u"?function(e){return ih.resolve(null).then(e).catch(F1)}:nu;function F1(e){setTimeout(function(){throw e})}function Qc(e,t){var s=t,r=0;do{var a=s.nextSibling;if(e.removeChild(s),a&&a.nodeType===8)if(s=a.data,s==="/$"){if(r===0){e.removeChild(a),Di(t);return}r--}else s!=="$"&&s!=="$?"&&s!=="$!"||r++;s=a}while(s);Di(t)}function Ts(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 lh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var Ba=Math.random().toString(36).slice(2),Nn="__reactFiber$"+Ba,_i="__reactProps$"+Ba,Gn="__reactContainer$"+Ba,su="__reactEvents$"+Ba,_1="__reactListeners$"+Ba,$1="__reactHandles$"+Ba;function nr(e){var t=e[Nn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gn]||s[Nn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=lh(e);e!==null;){if(s=e[Nn])return s;e=lh(e)}return t}e=s,s=e.parentNode}return null}function xl(e){return e=e[Nn]||e[Gn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ta(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function sc(e){return e[_i]||null}var ru=[],na=-1;function Bs(e){return{current:e}}function Me(e){0>na||(e.current=ru[na],ru[na]=null,na--)}function Ee(e,t){na++,ru[na]=e.current,e.current=t}var _s={},xt=Bs(_s),Pt=Bs(!1),jr=_s;function Ma(e,t){var s=e.type.contextTypes;if(!s)return _s;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in s)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function zt(e){return e=e.childContextTypes,e!=null}function jo(){Me(Pt),Me(xt)}function oh(e,t,s){if(xt.current!==_s)throw Error(U(168));Ee(xt,t),Ee(Pt,s)}function Gp(e,t,s){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return s;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(U(108,kb(e)||"Unknown",a));return Ae({},s,r)}function No(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_s,jr=xt.current,Ee(xt,e),Ee(Pt,Pt.current),!0}function ch(e,t,s){var r=e.stateNode;if(!r)throw Error(U(169));s?(e=Gp(e,t,jr),r.__reactInternalMemoizedMergedChildContext=e,Me(Pt),Me(xt),Ee(xt,e)):Me(Pt),Ee(Pt,s)}var Fn=null,rc=!1,Gc=!1;function Yp(e){Fn===null?Fn=[e]:Fn.push(e)}function U1(e){rc=!0,Yp(e)}function Hs(){if(!Gc&&Fn!==null){Gc=!0;var e=0,t=we;try{var s=Fn;for(we=1;e<s.length;e++){var r=s[e];do r=r(!0);while(r!==null)}Fn=null,rc=!1}catch(a){throw Fn!==null&&(Fn=Fn.slice(e+1)),jp(bx,Hs),a}finally{we=t,Gc=!1}}return null}var sa=[],ra=0,wo=null,ko=0,Wt=[],Vt=0,Nr=null,qn=1,Kn="";function Zs(e,t){sa[ra++]=ko,sa[ra++]=wo,wo=e,ko=t}function Jp(e,t,s){Wt[Vt++]=qn,Wt[Vt++]=Kn,Wt[Vt++]=Nr,Nr=e;var r=qn;e=Kn;var a=32-un(r)-1;r&=~(1<<a),s+=1;var i=32-un(t)+a;if(30<i){var l=a-a%5;i=(r&(1<<l)-1).toString(32),r>>=l,a-=l,qn=1<<32-un(t)+a|s<<a|r,Kn=i+e}else qn=1<<i|s<<a|r,Kn=e}function Px(e){e.return!==null&&(Zs(e,1),Jp(e,1,0))}function zx(e){for(;e===wo;)wo=sa[--ra],sa[ra]=null,ko=sa[--ra],sa[ra]=null;for(;e===Nr;)Nr=Wt[--Vt],Wt[Vt]=null,Kn=Wt[--Vt],Wt[Vt]=null,qn=Wt[--Vt],Wt[Vt]=null}var Ft=null,It=null,Te=!1,cn=null;function Xp(e,t){var s=Qt(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function dh(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ft=e,It=Ts(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ft=e,It=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=Nr!==null?{id:qn,overflow:Kn}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=Qt(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,Ft=e,It=null,!0):!1;default:return!1}}function au(e){return(e.mode&1)!==0&&(e.flags&128)===0}function iu(e){if(Te){var t=It;if(t){var s=t;if(!dh(e,t)){if(au(e))throw Error(U(418));t=Ts(s.nextSibling);var r=Ft;t&&dh(e,t)?Xp(r,s):(e.flags=e.flags&-4097|2,Te=!1,Ft=e)}}else{if(au(e))throw Error(U(418));e.flags=e.flags&-4097|2,Te=!1,Ft=e}}}function uh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ft=e}function Ol(e){if(e!==Ft)return!1;if(!Te)return uh(e),Te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!tu(e.type,e.memoizedProps)),t&&(t=It)){if(au(e))throw Zp(),Error(U(418));for(;t;)Xp(e,t),t=Ts(t.nextSibling)}if(uh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){It=Ts(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}It=null}}else It=Ft?Ts(e.stateNode.nextSibling):null;return!0}function Zp(){for(var e=It;e;)e=Ts(e.nextSibling)}function Ta(){It=Ft=null,Te=!1}function Mx(e){cn===null?cn=[e]:cn.push(e)}var B1=es.ReactCurrentBatchConfig;function Za(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(U(309));var r=s.stateNode}if(!r)throw Error(U(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var o=a.refs;l===null?delete o[i]:o[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!s._owner)throw Error(U(290,e))}return e}function Dl(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xh(e){var t=e._init;return t(e._payload)}function e0(e){function t(h,u){if(e){var p=h.deletions;p===null?(h.deletions=[u],h.flags|=16):p.push(u)}}function s(h,u){if(!e)return null;for(;u!==null;)t(h,u),u=u.sibling;return null}function r(h,u){for(h=new Map;u!==null;)u.key!==null?h.set(u.key,u):h.set(u.index,u),u=u.sibling;return h}function a(h,u){return h=As(h,u),h.index=0,h.sibling=null,h}function i(h,u,p){return h.index=p,e?(p=h.alternate,p!==null?(p=p.index,p<u?(h.flags|=2,u):p):(h.flags|=2,u)):(h.flags|=1048576,u)}function l(h){return e&&h.alternate===null&&(h.flags|=2),h}function o(h,u,p,v){return u===null||u.tag!==6?(u=nd(p,h.mode,v),u.return=h,u):(u=a(u,p),u.return=h,u)}function c(h,u,p,v){var w=p.type;return w===Jr?x(h,u,p.props.children,v,p.key):u!==null&&(u.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cs&&xh(w)===u.type)?(v=a(u,p.props),v.ref=Za(h,u,p),v.return=h,v):(v=io(p.type,p.key,p.props,null,h.mode,v),v.ref=Za(h,u,p),v.return=h,v)}function d(h,u,p,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==p.containerInfo||u.stateNode.implementation!==p.implementation?(u=sd(p,h.mode,v),u.return=h,u):(u=a(u,p.children||[]),u.return=h,u)}function x(h,u,p,v,w){return u===null||u.tag!==7?(u=gr(p,h.mode,v,w),u.return=h,u):(u=a(u,p),u.return=h,u)}function f(h,u,p){if(typeof u=="string"&&u!==""||typeof u=="number")return u=nd(""+u,h.mode,p),u.return=h,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case wl:return p=io(u.type,u.key,u.props,null,h.mode,p),p.ref=Za(h,null,u),p.return=h,p;case Yr:return u=sd(u,h.mode,p),u.return=h,u;case cs:var v=u._init;return f(h,v(u._payload),p)}if(mi(u)||Qa(u))return u=gr(u,h.mode,p,null),u.return=h,u;Dl(h,u)}return null}function g(h,u,p,v){var w=u!==null?u.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return w!==null?null:o(h,u,""+p,v);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case wl:return p.key===w?c(h,u,p,v):null;case Yr:return p.key===w?d(h,u,p,v):null;case cs:return w=p._init,g(h,u,w(p._payload),v)}if(mi(p)||Qa(p))return w!==null?null:x(h,u,p,v,null);Dl(h,p)}return null}function b(h,u,p,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return h=h.get(p)||null,o(u,h,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wl:return h=h.get(v.key===null?p:v.key)||null,c(u,h,v,w);case Yr:return h=h.get(v.key===null?p:v.key)||null,d(u,h,v,w);case cs:var N=v._init;return b(h,u,p,N(v._payload),w)}if(mi(v)||Qa(v))return h=h.get(p)||null,x(u,h,v,w,null);Dl(u,v)}return null}function y(h,u,p,v){for(var w=null,N=null,P=u,E=u=0,_=null;P!==null&&E<p.length;E++){P.index>E?(_=P,P=null):_=P.sibling;var D=g(h,P,p[E],v);if(D===null){P===null&&(P=_);break}e&&P&&D.alternate===null&&t(h,P),u=i(D,u,E),N===null?w=D:N.sibling=D,N=D,P=_}if(E===p.length)return s(h,P),Te&&Zs(h,E),w;if(P===null){for(;E<p.length;E++)P=f(h,p[E],v),P!==null&&(u=i(P,u,E),N===null?w=P:N.sibling=P,N=P);return Te&&Zs(h,E),w}for(P=r(h,P);E<p.length;E++)_=b(P,h,E,p[E],v),_!==null&&(e&&_.alternate!==null&&P.delete(_.key===null?E:_.key),u=i(_,u,E),N===null?w=_:N.sibling=_,N=_);return e&&P.forEach(function(G){return t(h,G)}),Te&&Zs(h,E),w}function j(h,u,p,v){var w=Qa(p);if(typeof w!="function")throw Error(U(150));if(p=w.call(p),p==null)throw Error(U(151));for(var N=w=null,P=u,E=u=0,_=null,D=p.next();P!==null&&!D.done;E++,D=p.next()){P.index>E?(_=P,P=null):_=P.sibling;var G=g(h,P,D.value,v);if(G===null){P===null&&(P=_);break}e&&P&&G.alternate===null&&t(h,P),u=i(G,u,E),N===null?w=G:N.sibling=G,N=G,P=_}if(D.done)return s(h,P),Te&&Zs(h,E),w;if(P===null){for(;!D.done;E++,D=p.next())D=f(h,D.value,v),D!==null&&(u=i(D,u,E),N===null?w=D:N.sibling=D,N=D);return Te&&Zs(h,E),w}for(P=r(h,P);!D.done;E++,D=p.next())D=b(P,h,E,D.value,v),D!==null&&(e&&D.alternate!==null&&P.delete(D.key===null?E:D.key),u=i(D,u,E),N===null?w=D:N.sibling=D,N=D);return e&&P.forEach(function(J){return t(h,J)}),Te&&Zs(h,E),w}function k(h,u,p,v){if(typeof p=="object"&&p!==null&&p.type===Jr&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case wl:e:{for(var w=p.key,N=u;N!==null;){if(N.key===w){if(w=p.type,w===Jr){if(N.tag===7){s(h,N.sibling),u=a(N,p.props.children),u.return=h,h=u;break e}}else if(N.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===cs&&xh(w)===N.type){s(h,N.sibling),u=a(N,p.props),u.ref=Za(h,N,p),u.return=h,h=u;break e}s(h,N);break}else t(h,N);N=N.sibling}p.type===Jr?(u=gr(p.props.children,h.mode,v,p.key),u.return=h,h=u):(v=io(p.type,p.key,p.props,null,h.mode,v),v.ref=Za(h,u,p),v.return=h,h=v)}return l(h);case Yr:e:{for(N=p.key;u!==null;){if(u.key===N)if(u.tag===4&&u.stateNode.containerInfo===p.containerInfo&&u.stateNode.implementation===p.implementation){s(h,u.sibling),u=a(u,p.children||[]),u.return=h,h=u;break e}else{s(h,u);break}else t(h,u);u=u.sibling}u=sd(p,h.mode,v),u.return=h,h=u}return l(h);case cs:return N=p._init,k(h,u,N(p._payload),v)}if(mi(p))return y(h,u,p,v);if(Qa(p))return j(h,u,p,v);Dl(h,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,u!==null&&u.tag===6?(s(h,u.sibling),u=a(u,p),u.return=h,h=u):(s(h,u),u=nd(p,h.mode,v),u.return=h,h=u),l(h)):s(h,u)}return k}var Ra=e0(!0),t0=e0(!1),So=Bs(null),Co=null,aa=null,Tx=null;function Rx(){Tx=aa=Co=null}function Ox(e){var t=So.current;Me(So),e._currentValue=t}function lu(e,t,s){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===s)break;e=e.return}}function ha(e,t){Co=e,Tx=aa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Et=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(Tx!==e)if(e={context:e,memoizedValue:t,next:null},aa===null){if(Co===null)throw Error(U(308));aa=e,Co.dependencies={lanes:0,firstContext:e}}else aa=aa.next=e;return t}var sr=null;function Dx(e){sr===null?sr=[e]:sr.push(e)}function n0(e,t,s,r){var a=t.interleaved;return a===null?(s.next=s,Dx(t)):(s.next=a.next,a.next=s),t.interleaved=s,Yn(e,r)}function Yn(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var ds=!1;function Ax(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s0(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 Wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rs(e,t,s){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ye&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Yn(e,s)}return a=r.interleaved,a===null?(t.next=t,Dx(r)):(t.next=a.next,a.next=t),r.interleaved=t,Yn(e,s)}function eo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,s|=r,t.lanes=s,vx(e,s)}}function mh(e,t){var s=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,s===r)){var a=null,i=null;if(s=s.firstBaseUpdate,s!==null){do{var l={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};i===null?a=i=l:i=i.next=l,s=s.next}while(s!==null);i===null?a=i=t:i=i.next=t}else a=i=t;s={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function Eo(e,t,s,r){var a=e.updateQueue;ds=!1;var i=a.firstBaseUpdate,l=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,l===null?i=d:l.next=d,l=c;var x=e.alternate;x!==null&&(x=x.updateQueue,o=x.lastBaseUpdate,o!==l&&(o===null?x.firstBaseUpdate=d:o.next=d,x.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;l=0,x=d=c=null,o=i;do{var g=o.lane,b=o.eventTime;if((r&g)===g){x!==null&&(x=x.next={eventTime:b,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=e,j=o;switch(g=t,b=s,j.tag){case 1:if(y=j.payload,typeof y=="function"){f=y.call(b,f,g);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=j.payload,g=typeof y=="function"?y.call(b,f,g):y,g==null)break e;f=Ae({},f,g);break e;case 2:ds=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,g=a.effects,g===null?a.effects=[o]:g.push(o))}else b={eventTime:b,lane:g,tag:o.tag,payload:o.payload,callback:o.callback,next:null},x===null?(d=x=b,c=f):x=x.next=b,l|=g;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);if(x===null&&(c=f),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=x,t=a.shared.interleaved,t!==null){a=t;do l|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);kr|=l,e.lanes=l,e.memoizedState=f}}function hh(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=s,typeof a!="function")throw Error(U(191,a));a.call(r)}}}var ml={},Sn=Bs(ml),$i=Bs(ml),Ui=Bs(ml);function rr(e){if(e===ml)throw Error(U(174));return e}function Lx(e,t){switch(Ee(Ui,t),Ee($i,e),Ee(Sn,ml),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ud(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ud(t,e)}Me(Sn),Ee(Sn,t)}function Oa(){Me(Sn),Me($i),Me(Ui)}function r0(e){rr(Ui.current);var t=rr(Sn.current),s=Ud(t,e.type);t!==s&&(Ee($i,e),Ee(Sn,s))}function Ix(e){$i.current===e&&(Me(Sn),Me($i))}var Oe=Bs(0);function Po(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.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 Yc=[];function Fx(){for(var e=0;e<Yc.length;e++)Yc[e]._workInProgressVersionPrimary=null;Yc.length=0}var to=es.ReactCurrentDispatcher,Jc=es.ReactCurrentBatchConfig,wr=0,De=null,We=null,Je=null,zo=!1,Si=!1,Bi=0,H1=0;function lt(){throw Error(U(321))}function _x(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!hn(e[s],t[s]))return!1;return!0}function $x(e,t,s,r,a,i){if(wr=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,to.current=e===null||e.memoizedState===null?V1:Q1,e=s(r,a),Si){i=0;do{if(Si=!1,Bi=0,25<=i)throw Error(U(301));i+=1,Je=We=null,t.updateQueue=null,to.current=G1,e=s(r,a)}while(Si)}if(to.current=Mo,t=We!==null&&We.next!==null,wr=0,Je=We=De=null,zo=!1,t)throw Error(U(300));return e}function Ux(){var e=Bi!==0;return Bi=0,e}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?De.memoizedState=Je=e:Je=Je.next=e,Je}function Xt(){if(We===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=Je===null?De.memoizedState:Je.next;if(t!==null)Je=t,We=e;else{if(e===null)throw Error(U(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},Je===null?De.memoizedState=Je=e:Je=Je.next=e}return Je}function Hi(e,t){return typeof t=="function"?t(e):t}function Xc(e){var t=Xt(),s=t.queue;if(s===null)throw Error(U(311));s.lastRenderedReducer=e;var r=We,a=r.baseQueue,i=s.pending;if(i!==null){if(a!==null){var l=a.next;a.next=i.next,i.next=l}r.baseQueue=a=i,s.pending=null}if(a!==null){i=a.next,r=r.baseState;var o=l=null,c=null,d=i;do{var x=d.lane;if((wr&x)===x)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:x,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(o=c=f,l=r):c=c.next=f,De.lanes|=x,kr|=x}d=d.next}while(d!==null&&d!==i);c===null?l=r:c.next=o,hn(r,t.memoizedState)||(Et=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=c,s.lastRenderedState=r}if(e=s.interleaved,e!==null){a=e;do i=a.lane,De.lanes|=i,kr|=i,a=a.next;while(a!==e)}else a===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function Zc(e){var t=Xt(),s=t.queue;if(s===null)throw Error(U(311));s.lastRenderedReducer=e;var r=s.dispatch,a=s.pending,i=t.memoizedState;if(a!==null){s.pending=null;var l=a=a.next;do i=e(i,l.action),l=l.next;while(l!==a);hn(i,t.memoizedState)||(Et=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),s.lastRenderedState=i}return[i,r]}function a0(){}function i0(e,t){var s=De,r=Xt(),a=t(),i=!hn(r.memoizedState,a);if(i&&(r.memoizedState=a,Et=!0),r=r.queue,Bx(c0.bind(null,s,r,e),[e]),r.getSnapshot!==t||i||Je!==null&&Je.memoizedState.tag&1){if(s.flags|=2048,qi(9,o0.bind(null,s,r,a,t),void 0,null),Xe===null)throw Error(U(349));wr&30||l0(s,t,a)}return a}function l0(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function o0(e,t,s,r){t.value=s,t.getSnapshot=r,d0(t)&&u0(e)}function c0(e,t,s){return s(function(){d0(t)&&u0(e)})}function d0(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!hn(e,s)}catch{return!0}}function u0(e){var t=Yn(e,1);t!==null&&xn(t,e,1,-1)}function fh(e){var t=yn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:e},t.queue=e,e=e.dispatch=W1.bind(null,De,e),[t.memoizedState,e]}function qi(e,t,s,r){return e={tag:e,create:t,destroy:s,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(r=s.next,s.next=e,e.next=r,t.lastEffect=e)),e}function x0(){return Xt().memoizedState}function no(e,t,s,r){var a=yn();De.flags|=e,a.memoizedState=qi(1|t,s,void 0,r===void 0?null:r)}function ac(e,t,s,r){var a=Xt();r=r===void 0?null:r;var i=void 0;if(We!==null){var l=We.memoizedState;if(i=l.destroy,r!==null&&_x(r,l.deps)){a.memoizedState=qi(t,s,i,r);return}}De.flags|=e,a.memoizedState=qi(1|t,s,i,r)}function ph(e,t){return no(8390656,8,e,t)}function Bx(e,t){return ac(2048,8,e,t)}function m0(e,t){return ac(4,2,e,t)}function h0(e,t){return ac(4,4,e,t)}function f0(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 p0(e,t,s){return s=s!=null?s.concat([e]):null,ac(4,4,f0.bind(null,t,e),s)}function Hx(){}function g0(e,t){var s=Xt();t=t===void 0?null:t;var r=s.memoizedState;return r!==null&&t!==null&&_x(t,r[1])?r[0]:(s.memoizedState=[e,t],e)}function y0(e,t){var s=Xt();t=t===void 0?null:t;var r=s.memoizedState;return r!==null&&t!==null&&_x(t,r[1])?r[0]:(e=e(),s.memoizedState=[e,t],e)}function b0(e,t,s){return wr&21?(hn(s,t)||(s=kp(),De.lanes|=s,kr|=s,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Et=!0),e.memoizedState=s)}function q1(e,t){var s=we;we=s!==0&&4>s?s:4,e(!0);var r=Jc.transition;Jc.transition={};try{e(!1),t()}finally{we=s,Jc.transition=r}}function v0(){return Xt().memoizedState}function K1(e,t,s){var r=Ds(e);if(s={lane:r,action:s,hasEagerState:!1,eagerState:null,next:null},j0(e))N0(t,s);else if(s=n0(e,t,s,r),s!==null){var a=bt();xn(s,e,r,a),w0(s,t,r)}}function W1(e,t,s){var r=Ds(e),a={lane:r,action:s,hasEagerState:!1,eagerState:null,next:null};if(j0(e))N0(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,o=i(l,s);if(a.hasEagerState=!0,a.eagerState=o,hn(o,l)){var c=t.interleaved;c===null?(a.next=a,Dx(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}s=n0(e,t,a,r),s!==null&&(a=bt(),xn(s,e,r,a),w0(s,t,r))}}function j0(e){var t=e.alternate;return e===De||t!==null&&t===De}function N0(e,t){Si=zo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function w0(e,t,s){if(s&4194240){var r=t.lanes;r&=e.pendingLanes,s|=r,t.lanes=s,vx(e,s)}}var Mo={readContext:Jt,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useInsertionEffect:lt,useLayoutEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useMutableSource:lt,useSyncExternalStore:lt,useId:lt,unstable_isNewReconciler:!1},V1={readContext:Jt,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:ph,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,no(4194308,4,f0.bind(null,t,e),s)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var s=yn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var r=yn();return t=s!==void 0?s(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=K1.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:fh,useDebugValue:Hx,useDeferredValue:function(e){return yn().memoizedState=e},useTransition:function(){var e=fh(!1),t=e[0];return e=q1.bind(null,e[1]),yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var r=De,a=yn();if(Te){if(s===void 0)throw Error(U(407));s=s()}else{if(s=t(),Xe===null)throw Error(U(349));wr&30||l0(r,t,s)}a.memoizedState=s;var i={value:s,getSnapshot:t};return a.queue=i,ph(c0.bind(null,r,i,e),[e]),r.flags|=2048,qi(9,o0.bind(null,r,i,s,t),void 0,null),s},useId:function(){var e=yn(),t=Xe.identifierPrefix;if(Te){var s=Kn,r=qn;s=(r&~(1<<32-un(r)-1)).toString(32)+s,t=":"+t+"R"+s,s=Bi++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=H1++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Q1={readContext:Jt,useCallback:g0,useContext:Jt,useEffect:Bx,useImperativeHandle:p0,useInsertionEffect:m0,useLayoutEffect:h0,useMemo:y0,useReducer:Xc,useRef:x0,useState:function(){return Xc(Hi)},useDebugValue:Hx,useDeferredValue:function(e){var t=Xt();return b0(t,We.memoizedState,e)},useTransition:function(){var e=Xc(Hi)[0],t=Xt().memoizedState;return[e,t]},useMutableSource:a0,useSyncExternalStore:i0,useId:v0,unstable_isNewReconciler:!1},G1={readContext:Jt,useCallback:g0,useContext:Jt,useEffect:Bx,useImperativeHandle:p0,useInsertionEffect:m0,useLayoutEffect:h0,useMemo:y0,useReducer:Zc,useRef:x0,useState:function(){return Zc(Hi)},useDebugValue:Hx,useDeferredValue:function(e){var t=Xt();return We===null?t.memoizedState=e:b0(t,We.memoizedState,e)},useTransition:function(){var e=Zc(Hi)[0],t=Xt().memoizedState;return[e,t]},useMutableSource:a0,useSyncExternalStore:i0,useId:v0,unstable_isNewReconciler:!1};function an(e,t){if(e&&e.defaultProps){t=Ae({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function ou(e,t,s,r){t=e.memoizedState,s=s(r,t),s=s==null?t:Ae({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var ic={isMounted:function(e){return(e=e._reactInternals)?Rr(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var r=bt(),a=Ds(e),i=Wn(r,a);i.payload=t,s!=null&&(i.callback=s),t=Rs(e,i,a),t!==null&&(xn(t,e,a,r),eo(t,e,a))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var r=bt(),a=Ds(e),i=Wn(r,a);i.tag=1,i.payload=t,s!=null&&(i.callback=s),t=Rs(e,i,a),t!==null&&(xn(t,e,a,r),eo(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=bt(),r=Ds(e),a=Wn(s,r);a.tag=2,t!=null&&(a.callback=t),t=Rs(e,a,r),t!==null&&(xn(t,e,r,s),eo(t,e,r))}};function gh(e,t,s,r,a,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,l):t.prototype&&t.prototype.isPureReactComponent?!Li(s,r)||!Li(a,i):!0}function k0(e,t,s){var r=!1,a=_s,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(a=zt(t)?jr:xt.current,r=t.contextTypes,i=(r=r!=null)?Ma(e,a):_s),t=new t(s,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ic,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function yh(e,t,s,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,r),t.state!==e&&ic.enqueueReplaceState(t,t.state,null)}function cu(e,t,s,r){var a=e.stateNode;a.props=s,a.state=e.memoizedState,a.refs={},Ax(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Jt(i):(i=zt(t)?jr:xt.current,a.context=Ma(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ou(e,t,i,s),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&ic.enqueueReplaceState(a,a.state,null),Eo(e,s,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Da(e,t){try{var s="",r=t;do s+=wb(r),r=r.return;while(r);var a=s}catch(i){a=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:a,digest:null}}function ed(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function du(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var Y1=typeof WeakMap=="function"?WeakMap:Map;function S0(e,t,s){s=Wn(-1,s),s.tag=3,s.payload={element:null};var r=t.value;return s.callback=function(){Ro||(Ro=!0,vu=r),du(e,t)},s}function C0(e,t,s){s=Wn(-1,s),s.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;s.payload=function(){return r(a)},s.callback=function(){du(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(s.callback=function(){du(e,t),typeof r!="function"&&(Os===null?Os=new Set([this]):Os.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),s}function bh(e,t,s){var r=e.pingCache;if(r===null){r=e.pingCache=new Y1;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(s)||(a.add(s),e=dv.bind(null,e,t,s),t.then(e,e))}function vh(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 jh(e,t,s,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=Wn(-1,1),t.tag=2,Rs(s,t,1))),s.lanes|=1),e)}var J1=es.ReactCurrentOwner,Et=!1;function pt(e,t,s,r){t.child=e===null?t0(t,null,s,r):Ra(t,e.child,s,r)}function Nh(e,t,s,r,a){s=s.render;var i=t.ref;return ha(t,a),r=$x(e,t,s,r,i,a),s=Ux(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jn(e,t,a)):(Te&&s&&Px(t),t.flags|=1,pt(e,t,r,a),t.child)}function wh(e,t,s,r,a){if(e===null){var i=s.type;return typeof i=="function"&&!Jx(i)&&i.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=i,E0(e,t,i,r,a)):(e=io(s.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var l=i.memoizedProps;if(s=s.compare,s=s!==null?s:Li,s(l,r)&&e.ref===t.ref)return Jn(e,t,a)}return t.flags|=1,e=As(i,r),e.ref=t.ref,e.return=t,t.child=e}function E0(e,t,s,r,a){if(e!==null){var i=e.memoizedProps;if(Li(i,r)&&e.ref===t.ref)if(Et=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(Et=!0);else return t.lanes=e.lanes,Jn(e,t,a)}return uu(e,t,s,r,a)}function P0(e,t,s){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ee(la,At),At|=s;else{if(!(s&1073741824))return e=i!==null?i.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ee(la,At),At|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:s,Ee(la,At),At|=r}else i!==null?(r=i.baseLanes|s,t.memoizedState=null):r=s,Ee(la,At),At|=r;return pt(e,t,a,s),t.child}function z0(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function uu(e,t,s,r,a){var i=zt(s)?jr:xt.current;return i=Ma(t,i),ha(t,a),s=$x(e,t,s,r,i,a),r=Ux(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jn(e,t,a)):(Te&&r&&Px(t),t.flags|=1,pt(e,t,s,a),t.child)}function kh(e,t,s,r,a){if(zt(s)){var i=!0;No(t)}else i=!1;if(ha(t,a),t.stateNode===null)so(e,t),k0(t,s,r),cu(t,s,r,a),r=!0;else if(e===null){var l=t.stateNode,o=t.memoizedProps;l.props=o;var c=l.context,d=s.contextType;typeof d=="object"&&d!==null?d=Jt(d):(d=zt(s)?jr:xt.current,d=Ma(t,d));var x=s.getDerivedStateFromProps,f=typeof x=="function"||typeof l.getSnapshotBeforeUpdate=="function";f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==r||c!==d)&&yh(t,l,r,d),ds=!1;var g=t.memoizedState;l.state=g,Eo(t,r,l,a),c=t.memoizedState,o!==r||g!==c||Pt.current||ds?(typeof x=="function"&&(ou(t,s,x,r),c=t.memoizedState),(o=ds||gh(t,s,o,r,g,c,d))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),l.props=r,l.state=c,l.context=d,r=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,s0(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:an(t.type,o),l.props=d,f=t.pendingProps,g=l.context,c=s.contextType,typeof c=="object"&&c!==null?c=Jt(c):(c=zt(s)?jr:xt.current,c=Ma(t,c));var b=s.getDerivedStateFromProps;(x=typeof b=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==f||g!==c)&&yh(t,l,r,c),ds=!1,g=t.memoizedState,l.state=g,Eo(t,r,l,a);var y=t.memoizedState;o!==f||g!==y||Pt.current||ds?(typeof b=="function"&&(ou(t,s,b,r),y=t.memoizedState),(d=ds||gh(t,s,d,r,g,y,c)||!1)?(x||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,y,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,y,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),l.props=r,l.state=y,l.context=c,r=d):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return xu(e,t,s,r,i,a)}function xu(e,t,s,r,a,i){z0(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return a&&ch(t,s,!1),Jn(e,t,i);r=t.stateNode,J1.current=t;var o=l&&typeof s.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,o,i)):pt(e,t,o,i),t.memoizedState=r.state,a&&ch(t,s,!0),t.child}function M0(e){var t=e.stateNode;t.pendingContext?oh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oh(e,t.context,!1),Lx(e,t.containerInfo)}function Sh(e,t,s,r,a){return Ta(),Mx(a),t.flags|=256,pt(e,t,s,r),t.child}var mu={dehydrated:null,treeContext:null,retryLane:0};function hu(e){return{baseLanes:e,cachePool:null,transitions:null}}function T0(e,t,s){var r=t.pendingProps,a=Oe.current,i=!1,l=(t.flags&128)!==0,o;if((o=l)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ee(Oe,a&1),e===null)return iu(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):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=cc(l,r,0,null),e=gr(e,r,s,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=hu(s),t.memoizedState=mu,e):qx(t,l));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return X1(e,t,l,r,o,a,s);if(i){i=r.fallback,l=t.mode,a=e.child,o=a.sibling;var c={mode:"hidden",children:r.children};return!(l&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=As(a,c),r.subtreeFlags=a.subtreeFlags&14680064),o!==null?i=As(o,i):(i=gr(i,l,s,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?hu(s):{baseLanes:l.baseLanes|s,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~s,t.memoizedState=mu,r}return i=e.child,e=i.sibling,r=As(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=s),r.return=t,r.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=r,t.memoizedState=null,r}function qx(e,t){return t=cc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Al(e,t,s,r){return r!==null&&Mx(r),Ra(t,e.child,null,s),e=qx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function X1(e,t,s,r,a,i,l){if(s)return t.flags&256?(t.flags&=-257,r=ed(Error(U(422))),Al(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=cc({mode:"visible",children:r.children},a,0,null),i=gr(i,a,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ra(t,e.child,null,l),t.child.memoizedState=hu(l),t.memoizedState=mu,i);if(!(t.mode&1))return Al(e,t,l,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(U(419)),r=ed(i,r,void 0),Al(e,t,l,r)}if(o=(l&e.childLanes)!==0,Et||o){if(r=Xe,r!==null){switch(l&-l){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|l)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Yn(e,a),xn(r,e,a,-1))}return Yx(),r=ed(Error(U(421))),Al(e,t,l,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=uv.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,It=Ts(a.nextSibling),Ft=t,Te=!0,cn=null,e!==null&&(Wt[Vt++]=qn,Wt[Vt++]=Kn,Wt[Vt++]=Nr,qn=e.id,Kn=e.overflow,Nr=t),t=qx(t,r.children),t.flags|=4096,t)}function Ch(e,t,s){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),lu(e.return,t,s)}function td(e,t,s,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:s,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=s,i.tailMode=a)}function R0(e,t,s){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(pt(e,t,r.children,s),r=Oe.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&&Ch(e,s,t);else if(e.tag===19)Ch(e,s,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(Ee(Oe,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(s=t.child,a=null;s!==null;)e=s.alternate,e!==null&&Po(e)===null&&(a=s),s=s.sibling;s=a,s===null?(a=t.child,t.child=null):(a=s.sibling,s.sibling=null),td(t,!1,a,s,i);break;case"backwards":for(s=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Po(e)===null){t.child=a;break}e=a.sibling,a.sibling=s,s=a,a=e}td(t,!0,s,null,i);break;case"together":td(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function so(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jn(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),kr|=t.lanes,!(s&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));if(t.child!==null){for(e=t.child,s=As(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=As(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Z1(e,t,s){switch(t.tag){case 3:M0(t),Ta();break;case 5:r0(t);break;case 1:zt(t.type)&&No(t);break;case 4:Lx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Ee(So,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ee(Oe,Oe.current&1),t.flags|=128,null):s&t.child.childLanes?T0(e,t,s):(Ee(Oe,Oe.current&1),e=Jn(e,t,s),e!==null?e.sibling:null);Ee(Oe,Oe.current&1);break;case 19:if(r=(s&t.childLanes)!==0,e.flags&128){if(r)return R0(e,t,s);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ee(Oe,Oe.current),r)break;return null;case 22:case 23:return t.lanes=0,P0(e,t,s)}return Jn(e,t,s)}var O0,fu,D0,A0;O0=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}};fu=function(){};D0=function(e,t,s,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,rr(Sn.current);var i=null;switch(s){case"input":a=Id(e,a),r=Id(e,r),i=[];break;case"select":a=Ae({},a,{value:void 0}),r=Ae({},r,{value:void 0}),i=[];break;case"textarea":a=$d(e,a),r=$d(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vo)}Bd(s,r);var l;s=null;for(d in a)if(!r.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var o=a[d];for(l in o)o.hasOwnProperty(l)&&(s||(s={}),s[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(zi.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(o=a!=null?a[d]:void 0,r.hasOwnProperty(d)&&c!==o&&(c!=null||o!=null))if(d==="style")if(o){for(l in o)!o.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(s||(s={}),s[l]="");for(l in c)c.hasOwnProperty(l)&&o[l]!==c[l]&&(s||(s={}),s[l]=c[l])}else s||(i||(i=[]),i.push(d,s)),s=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(zi.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ze("scroll",e),i||o===c||(i=[])):(i=i||[]).push(d,c))}s&&(i=i||[]).push("style",s);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};A0=function(e,t,s,r){s!==r&&(t.flags|=4)};function ei(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,r=0;if(t)for(var a=e.child;a!==null;)s|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)s|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=s,t}function ev(e,t,s){var r=t.pendingProps;switch(zx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return zt(t.type)&&jo(),ot(t),null;case 3:return r=t.stateNode,Oa(),Me(Pt),Me(xt),Fx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cn!==null&&(wu(cn),cn=null))),fu(e,t),ot(t),null;case 5:Ix(t);var a=rr(Ui.current);if(s=t.type,e!==null&&t.stateNode!=null)D0(e,t,s,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return ot(t),null}if(e=rr(Sn.current),Ol(t)){r=t.stateNode,s=t.type;var i=t.memoizedProps;switch(r[Nn]=t,r[_i]=i,e=(t.mode&1)!==0,s){case"dialog":ze("cancel",r),ze("close",r);break;case"iframe":case"object":case"embed":ze("load",r);break;case"video":case"audio":for(a=0;a<fi.length;a++)ze(fi[a],r);break;case"source":ze("error",r);break;case"img":case"image":case"link":ze("error",r),ze("load",r);break;case"details":ze("toggle",r);break;case"input":Am(r,i),ze("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ze("invalid",r);break;case"textarea":Im(r,i),ze("invalid",r)}Bd(s,i),a=null;for(var l in i)if(i.hasOwnProperty(l)){var o=i[l];l==="children"?typeof o=="string"?r.textContent!==o&&(i.suppressHydrationWarning!==!0&&Rl(r.textContent,o,e),a=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Rl(r.textContent,o,e),a=["children",""+o]):zi.hasOwnProperty(l)&&o!=null&&l==="onScroll"&&ze("scroll",r)}switch(s){case"input":kl(r),Lm(r,i,!0);break;case"textarea":kl(r),Fm(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=vo)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=cp(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(s,{is:r.is}):(e=l.createElement(s),s==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,s),e[Nn]=t,e[_i]=r,O0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Hd(s,r),s){case"dialog":ze("cancel",e),ze("close",e),a=r;break;case"iframe":case"object":case"embed":ze("load",e),a=r;break;case"video":case"audio":for(a=0;a<fi.length;a++)ze(fi[a],e);a=r;break;case"source":ze("error",e),a=r;break;case"img":case"image":case"link":ze("error",e),ze("load",e),a=r;break;case"details":ze("toggle",e),a=r;break;case"input":Am(e,r),a=Id(e,r),ze("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ae({},r,{value:void 0}),ze("invalid",e);break;case"textarea":Im(e,r),a=$d(e,r),ze("invalid",e);break;default:a=r}Bd(s,a),o=a;for(i in o)if(o.hasOwnProperty(i)){var c=o[i];i==="style"?xp(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dp(e,c)):i==="children"?typeof c=="string"?(s!=="textarea"||c!=="")&&Mi(e,c):typeof c=="number"&&Mi(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(zi.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ze("scroll",e):c!=null&&hx(e,i,c,l))}switch(s){case"input":kl(e),Lm(e,r,!1);break;case"textarea":kl(e),Fm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fs(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?da(e,!!r.multiple,i,!1):r.defaultValue!=null&&da(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=vo)}switch(s){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 ot(t),null;case 6:if(e&&t.stateNode!=null)A0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(s=rr(Ui.current),rr(Sn.current),Ol(t)){if(r=t.stateNode,s=t.memoizedProps,r[Nn]=t,(i=r.nodeValue!==s)&&(e=Ft,e!==null))switch(e.tag){case 3:Rl(r.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rl(r.nodeValue,s,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(s.nodeType===9?s:s.ownerDocument).createTextNode(r),r[Nn]=t,t.stateNode=r}return ot(t),null;case 13:if(Me(Oe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Te&&It!==null&&t.mode&1&&!(t.flags&128))Zp(),Ta(),t.flags|=98560,i=!1;else if(i=Ol(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Nn]=t}else Ta(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ot(t),i=!1}else cn!==null&&(wu(cn),cn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=s,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Oe.current&1?Ge===0&&(Ge=3):Yx())),t.updateQueue!==null&&(t.flags|=4),ot(t),null);case 4:return Oa(),fu(e,t),e===null&&Ii(t.stateNode.containerInfo),ot(t),null;case 10:return Ox(t.type._context),ot(t),null;case 17:return zt(t.type)&&jo(),ot(t),null;case 19:if(Me(Oe),i=t.memoizedState,i===null)return ot(t),null;if(r=(t.flags&128)!==0,l=i.rendering,l===null)if(r)ei(i,!1);else{if(Ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Po(e),l!==null){for(t.flags|=128,ei(i,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=s,s=t.child;s!==null;)i=s,e=r,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Ee(Oe,Oe.current&1|2),t.child}e=e.sibling}i.tail!==null&&$e()>Aa&&(t.flags|=128,r=!0,ei(i,!1),t.lanes=4194304)}else{if(!r)if(e=Po(l),e!==null){if(t.flags|=128,r=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Te)return ot(t),null}else 2*$e()-i.renderingStartTime>Aa&&s!==1073741824&&(t.flags|=128,r=!0,ei(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(s=i.last,s!==null?s.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$e(),t.sibling=null,s=Oe.current,Ee(Oe,r?s&1|2:s&1),t):(ot(t),null);case 22:case 23:return Gx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?At&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function tv(e,t){switch(zx(t),t.tag){case 1:return zt(t.type)&&jo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(),Me(Pt),Me(xt),Fx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ix(t),null;case 13:if(Me(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));Ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(Oe),null;case 4:return Oa(),null;case 10:return Ox(t.type._context),null;case 22:case 23:return Gx(),null;case 24:return null;default:return null}}var Ll=!1,dt=!1,nv=typeof WeakSet=="function"?WeakSet:Set,Q=null;function ia(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(r){Fe(e,t,r)}else s.current=null}function pu(e,t,s){try{s()}catch(r){Fe(e,t,r)}}var Eh=!1;function sv(e,t){if(Zd=go,e=$p(),Ex(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{s.nodeType,i.nodeType}catch{s=null;break e}var l=0,o=-1,c=-1,d=0,x=0,f=e,g=null;t:for(;;){for(var b;f!==s||a!==0&&f.nodeType!==3||(o=l+a),f!==i||r!==0&&f.nodeType!==3||(c=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(b=f.firstChild)!==null;)g=f,f=b;for(;;){if(f===e)break t;if(g===s&&++d===a&&(o=l),g===i&&++x===r&&(c=l),(b=f.nextSibling)!==null)break;f=g,g=f.parentNode}f=b}s=o===-1||c===-1?null:{start:o,end:c}}else s=null}s=s||{start:0,end:0}}else s=null;for(eu={focusedElem:e,selectionRange:s},go=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var j=y.memoizedProps,k=y.memoizedState,h=t.stateNode,u=h.getSnapshotBeforeUpdate(t.elementType===t.type?j:an(t.type,j),k);h.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(v){Fe(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return y=Eh,Eh=!1,y}function Ci(e,t,s){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&pu(t,s,i)}a=a.next}while(a!==r)}}function lc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var r=s.create;s.destroy=r()}s=s.next}while(s!==t)}}function gu(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function L0(e){var t=e.alternate;t!==null&&(e.alternate=null,L0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[_i],delete t[su],delete t[_1],delete t[$1])),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 I0(e){return e.tag===5||e.tag===3||e.tag===4}function Ph(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||I0(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 yu(e,t,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=vo));else if(r!==4&&(e=e.child,e!==null))for(yu(e,t,s),e=e.sibling;e!==null;)yu(e,t,s),e=e.sibling}function bu(e,t,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bu(e,t,s),e=e.sibling;e!==null;)bu(e,t,s),e=e.sibling}var nt=null,on=!1;function rs(e,t,s){for(s=s.child;s!==null;)F0(e,t,s),s=s.sibling}function F0(e,t,s){if(kn&&typeof kn.onCommitFiberUnmount=="function")try{kn.onCommitFiberUnmount(Zo,s)}catch{}switch(s.tag){case 5:dt||ia(s,t);case 6:var r=nt,a=on;nt=null,rs(e,t,s),nt=r,on=a,nt!==null&&(on?(e=nt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):nt.removeChild(s.stateNode));break;case 18:nt!==null&&(on?(e=nt,s=s.stateNode,e.nodeType===8?Qc(e.parentNode,s):e.nodeType===1&&Qc(e,s),Di(e)):Qc(nt,s.stateNode));break;case 4:r=nt,a=on,nt=s.stateNode.containerInfo,on=!0,rs(e,t,s),nt=r,on=a;break;case 0:case 11:case 14:case 15:if(!dt&&(r=s.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&pu(s,t,l),a=a.next}while(a!==r)}rs(e,t,s);break;case 1:if(!dt&&(ia(s,t),r=s.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=s.memoizedProps,r.state=s.memoizedState,r.componentWillUnmount()}catch(o){Fe(s,t,o)}rs(e,t,s);break;case 21:rs(e,t,s);break;case 22:s.mode&1?(dt=(r=dt)||s.memoizedState!==null,rs(e,t,s),dt=r):rs(e,t,s);break;default:rs(e,t,s)}}function zh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new nv),t.forEach(function(r){var a=xv.bind(null,e,r);s.has(r)||(s.add(r),r.then(a,a))})}}function sn(e,t){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var a=s[r];try{var i=e,l=t,o=l;e:for(;o!==null;){switch(o.tag){case 5:nt=o.stateNode,on=!1;break e;case 3:nt=o.stateNode.containerInfo,on=!0;break e;case 4:nt=o.stateNode.containerInfo,on=!0;break e}o=o.return}if(nt===null)throw Error(U(160));F0(i,l,a),nt=null,on=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){Fe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_0(t,e),t=t.sibling}function _0(e,t){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sn(t,e),pn(e),r&4){try{Ci(3,e,e.return),lc(3,e)}catch(j){Fe(e,e.return,j)}try{Ci(5,e,e.return)}catch(j){Fe(e,e.return,j)}}break;case 1:sn(t,e),pn(e),r&512&&s!==null&&ia(s,s.return);break;case 5:if(sn(t,e),pn(e),r&512&&s!==null&&ia(s,s.return),e.flags&32){var a=e.stateNode;try{Mi(a,"")}catch(j){Fe(e,e.return,j)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,l=s!==null?s.memoizedProps:i,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&lp(a,i),Hd(o,l);var d=Hd(o,i);for(l=0;l<c.length;l+=2){var x=c[l],f=c[l+1];x==="style"?xp(a,f):x==="dangerouslySetInnerHTML"?dp(a,f):x==="children"?Mi(a,f):hx(a,x,f,d)}switch(o){case"input":Fd(a,i);break;case"textarea":op(a,i);break;case"select":var g=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var b=i.value;b!=null?da(a,!!i.multiple,b,!1):g!==!!i.multiple&&(i.defaultValue!=null?da(a,!!i.multiple,i.defaultValue,!0):da(a,!!i.multiple,i.multiple?[]:"",!1))}a[_i]=i}catch(j){Fe(e,e.return,j)}}break;case 6:if(sn(t,e),pn(e),r&4){if(e.stateNode===null)throw Error(U(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(j){Fe(e,e.return,j)}}break;case 3:if(sn(t,e),pn(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{Di(t.containerInfo)}catch(j){Fe(e,e.return,j)}break;case 4:sn(t,e),pn(e);break;case 13:sn(t,e),pn(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Vx=$e())),r&4&&zh(e);break;case 22:if(x=s!==null&&s.memoizedState!==null,e.mode&1?(dt=(d=dt)||x,sn(t,e),dt=d):sn(t,e),pn(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!x&&e.mode&1)for(Q=e,x=e.child;x!==null;){for(f=Q=x;Q!==null;){switch(g=Q,b=g.child,g.tag){case 0:case 11:case 14:case 15:Ci(4,g,g.return);break;case 1:ia(g,g.return);var y=g.stateNode;if(typeof y.componentWillUnmount=="function"){r=g,s=g.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(j){Fe(r,s,j)}}break;case 5:ia(g,g.return);break;case 22:if(g.memoizedState!==null){Th(f);continue}}b!==null?(b.return=g,Q=b):Th(f)}x=x.sibling}e:for(x=null,f=e;;){if(f.tag===5){if(x===null){x=f;try{a=f.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=f.stateNode,c=f.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=up("display",l))}catch(j){Fe(e,e.return,j)}}}else if(f.tag===6){if(x===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(j){Fe(e,e.return,j)}}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;x===f&&(x=null),f=f.return}x===f&&(x=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:sn(t,e),pn(e),r&4&&zh(e);break;case 21:break;default:sn(t,e),pn(e)}}function pn(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(I0(s)){var r=s;break e}s=s.return}throw Error(U(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Mi(a,""),r.flags&=-33);var i=Ph(e);bu(e,i,a);break;case 3:case 4:var l=r.stateNode.containerInfo,o=Ph(e);yu(e,o,l);break;default:throw Error(U(161))}}catch(c){Fe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rv(e,t,s){Q=e,$0(e)}function $0(e,t,s){for(var r=(e.mode&1)!==0;Q!==null;){var a=Q,i=a.child;if(a.tag===22&&r){var l=a.memoizedState!==null||Ll;if(!l){var o=a.alternate,c=o!==null&&o.memoizedState!==null||dt;o=Ll;var d=dt;if(Ll=l,(dt=c)&&!d)for(Q=a;Q!==null;)l=Q,c=l.child,l.tag===22&&l.memoizedState!==null?Rh(a):c!==null?(c.return=l,Q=c):Rh(a);for(;i!==null;)Q=i,$0(i),i=i.sibling;Q=a,Ll=o,dt=d}Mh(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Q=i):Mh(e)}}function Mh(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var s=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dt||lc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!dt)if(s===null)r.componentDidMount();else{var a=t.elementType===t.type?s.memoizedProps:an(t.type,s.memoizedProps);r.componentDidUpdate(a,s.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&hh(t,i,r);break;case 3:var l=t.updateQueue;if(l!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}hh(t,l,s)}break;case 5:var o=t.stateNode;if(s===null&&t.flags&4){s=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&s.focus();break;case"img":c.src&&(s.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var x=d.memoizedState;if(x!==null){var f=x.dehydrated;f!==null&&Di(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}dt||t.flags&512&&gu(t)}catch(g){Fe(t,t.return,g)}}if(t===e){Q=null;break}if(s=t.sibling,s!==null){s.return=t.return,Q=s;break}Q=t.return}}function Th(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Q=s;break}Q=t.return}}function Rh(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{lc(4,t)}catch(c){Fe(t,s,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){Fe(t,a,c)}}var i=t.return;try{gu(t)}catch(c){Fe(t,i,c)}break;case 5:var l=t.return;try{gu(t)}catch(c){Fe(t,l,c)}}}catch(c){Fe(t,t.return,c)}if(t===e){Q=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Q=o;break}Q=t.return}}var av=Math.ceil,To=es.ReactCurrentDispatcher,Kx=es.ReactCurrentOwner,Gt=es.ReactCurrentBatchConfig,ye=0,Xe=null,qe=null,st=0,At=0,la=Bs(0),Ge=0,Ki=null,kr=0,oc=0,Wx=0,Ei=null,Ct=null,Vx=0,Aa=1/0,In=null,Ro=!1,vu=null,Os=null,Il=!1,Cs=null,Oo=0,Pi=0,ju=null,ro=-1,ao=0;function bt(){return ye&6?$e():ro!==-1?ro:ro=$e()}function Ds(e){return e.mode&1?ye&2&&st!==0?st&-st:B1.transition!==null?(ao===0&&(ao=kp()),ao):(e=we,e!==0||(e=window.event,e=e===void 0?16:Tp(e.type)),e):1}function xn(e,t,s,r){if(50<Pi)throw Pi=0,ju=null,Error(U(185));dl(e,s,r),(!(ye&2)||e!==Xe)&&(e===Xe&&(!(ye&2)&&(oc|=s),Ge===4&&hs(e,st)),Mt(e,r),s===1&&ye===0&&!(t.mode&1)&&(Aa=$e()+500,rc&&Hs()))}function Mt(e,t){var s=e.callbackNode;Bb(e,t);var r=po(e,e===Xe?st:0);if(r===0)s!==null&&Um(s),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(s!=null&&Um(s),t===1)e.tag===0?U1(Oh.bind(null,e)):Yp(Oh.bind(null,e)),I1(function(){!(ye&6)&&Hs()}),s=null;else{switch(Sp(r)){case 1:s=bx;break;case 4:s=Np;break;case 16:s=fo;break;case 536870912:s=wp;break;default:s=fo}s=Q0(s,U0.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function U0(e,t){if(ro=-1,ao=0,ye&6)throw Error(U(327));var s=e.callbackNode;if(fa()&&e.callbackNode!==s)return null;var r=po(e,e===Xe?st:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Do(e,r);else{t=r;var a=ye;ye|=2;var i=H0();(Xe!==e||st!==t)&&(In=null,Aa=$e()+500,pr(e,t));do try{ov();break}catch(o){B0(e,o)}while(!0);Rx(),To.current=i,ye=a,qe!==null?t=0:(Xe=null,st=0,t=Ge)}if(t!==0){if(t===2&&(a=Qd(e),a!==0&&(r=a,t=Nu(e,a))),t===1)throw s=Ki,pr(e,0),hs(e,r),Mt(e,$e()),s;if(t===6)hs(e,r);else{if(a=e.current.alternate,!(r&30)&&!iv(a)&&(t=Do(e,r),t===2&&(i=Qd(e),i!==0&&(r=i,t=Nu(e,i))),t===1))throw s=Ki,pr(e,0),hs(e,r),Mt(e,$e()),s;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:er(e,Ct,In);break;case 3:if(hs(e,r),(r&130023424)===r&&(t=Vx+500-$e(),10<t)){if(po(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=nu(er.bind(null,e,Ct,In),t);break}er(e,Ct,In);break;case 4:if(hs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var l=31-un(r);i=1<<l,l=t[l],l>a&&(a=l),r&=~i}if(r=a,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*av(r/1960))-r,10<r){e.timeoutHandle=nu(er.bind(null,e,Ct,In),r);break}er(e,Ct,In);break;case 5:er(e,Ct,In);break;default:throw Error(U(329))}}}return Mt(e,$e()),e.callbackNode===s?U0.bind(null,e):null}function Nu(e,t){var s=Ei;return e.current.memoizedState.isDehydrated&&(pr(e,t).flags|=256),e=Do(e,t),e!==2&&(t=Ct,Ct=s,t!==null&&wu(t)),e}function wu(e){Ct===null?Ct=e:Ct.push.apply(Ct,e)}function iv(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var r=0;r<s.length;r++){var a=s[r],i=a.getSnapshot;a=a.value;try{if(!hn(i(),a))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 hs(e,t){for(t&=~Wx,t&=~oc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-un(t),r=1<<s;e[s]=-1,t&=~r}}function Oh(e){if(ye&6)throw Error(U(327));fa();var t=po(e,0);if(!(t&1))return Mt(e,$e()),null;var s=Do(e,t);if(e.tag!==0&&s===2){var r=Qd(e);r!==0&&(t=r,s=Nu(e,r))}if(s===1)throw s=Ki,pr(e,0),hs(e,t),Mt(e,$e()),s;if(s===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,Ct,In),Mt(e,$e()),null}function Qx(e,t){var s=ye;ye|=1;try{return e(t)}finally{ye=s,ye===0&&(Aa=$e()+500,rc&&Hs())}}function Sr(e){Cs!==null&&Cs.tag===0&&!(ye&6)&&fa();var t=ye;ye|=1;var s=Gt.transition,r=we;try{if(Gt.transition=null,we=1,e)return e()}finally{we=r,Gt.transition=s,ye=t,!(ye&6)&&Hs()}}function Gx(){At=la.current,Me(la)}function pr(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,L1(s)),qe!==null)for(s=qe.return;s!==null;){var r=s;switch(zx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&jo();break;case 3:Oa(),Me(Pt),Me(xt),Fx();break;case 5:Ix(r);break;case 4:Oa();break;case 13:Me(Oe);break;case 19:Me(Oe);break;case 10:Ox(r.type._context);break;case 22:case 23:Gx()}s=s.return}if(Xe=e,qe=e=As(e.current,null),st=At=t,Ge=0,Ki=null,Wx=oc=kr=0,Ct=Ei=null,sr!==null){for(t=0;t<sr.length;t++)if(s=sr[t],r=s.interleaved,r!==null){s.interleaved=null;var a=r.next,i=s.pending;if(i!==null){var l=i.next;i.next=a,r.next=l}s.pending=r}sr=null}return e}function B0(e,t){do{var s=qe;try{if(Rx(),to.current=Mo,zo){for(var r=De.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}zo=!1}if(wr=0,Je=We=De=null,Si=!1,Bi=0,Kx.current=null,s===null||s.return===null){Ge=1,Ki=t,qe=null;break}e:{var i=e,l=s.return,o=s,c=t;if(t=st,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,x=o,f=x.tag;if(!(x.mode&1)&&(f===0||f===11||f===15)){var g=x.alternate;g?(x.updateQueue=g.updateQueue,x.memoizedState=g.memoizedState,x.lanes=g.lanes):(x.updateQueue=null,x.memoizedState=null)}var b=vh(l);if(b!==null){b.flags&=-257,jh(b,l,o,i,t),b.mode&1&&bh(i,d,t),t=b,c=d;var y=t.updateQueue;if(y===null){var j=new Set;j.add(c),t.updateQueue=j}else y.add(c);break e}else{if(!(t&1)){bh(i,d,t),Yx();break e}c=Error(U(426))}}else if(Te&&o.mode&1){var k=vh(l);if(k!==null){!(k.flags&65536)&&(k.flags|=256),jh(k,l,o,i,t),Mx(Da(c,o));break e}}i=c=Da(c,o),Ge!==4&&(Ge=2),Ei===null?Ei=[i]:Ei.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=S0(i,c,t);mh(i,h);break e;case 1:o=c;var u=i.type,p=i.stateNode;if(!(i.flags&128)&&(typeof u.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Os===null||!Os.has(p)))){i.flags|=65536,t&=-t,i.lanes|=t;var v=C0(i,o,t);mh(i,v);break e}}i=i.return}while(i!==null)}K0(s)}catch(w){t=w,qe===s&&s!==null&&(qe=s=s.return);continue}break}while(!0)}function H0(){var e=To.current;return To.current=Mo,e===null?Mo:e}function Yx(){(Ge===0||Ge===3||Ge===2)&&(Ge=4),Xe===null||!(kr&268435455)&&!(oc&268435455)||hs(Xe,st)}function Do(e,t){var s=ye;ye|=2;var r=H0();(Xe!==e||st!==t)&&(In=null,pr(e,t));do try{lv();break}catch(a){B0(e,a)}while(!0);if(Rx(),ye=s,To.current=r,qe!==null)throw Error(U(261));return Xe=null,st=0,Ge}function lv(){for(;qe!==null;)q0(qe)}function ov(){for(;qe!==null&&!Ob();)q0(qe)}function q0(e){var t=V0(e.alternate,e,At);e.memoizedProps=e.pendingProps,t===null?K0(e):qe=t,Kx.current=null}function K0(e){var t=e;do{var s=t.alternate;if(e=t.return,t.flags&32768){if(s=tv(s,t),s!==null){s.flags&=32767,qe=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ge=6,qe=null;return}}else if(s=ev(s,t,At),s!==null){qe=s;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Ge===0&&(Ge=5)}function er(e,t,s){var r=we,a=Gt.transition;try{Gt.transition=null,we=1,cv(e,t,s,r)}finally{Gt.transition=a,we=r}return null}function cv(e,t,s,r){do fa();while(Cs!==null);if(ye&6)throw Error(U(327));s=e.finishedWork;var a=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=s.lanes|s.childLanes;if(Hb(e,i),e===Xe&&(qe=Xe=null,st=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||Il||(Il=!0,Q0(fo,function(){return fa(),null})),i=(s.flags&15990)!==0,s.subtreeFlags&15990||i){i=Gt.transition,Gt.transition=null;var l=we;we=1;var o=ye;ye|=4,Kx.current=null,sv(e,s),_0(s,e),z1(eu),go=!!Zd,eu=Zd=null,e.current=s,rv(s),Db(),ye=o,we=l,Gt.transition=i}else e.current=s;if(Il&&(Il=!1,Cs=e,Oo=a),i=e.pendingLanes,i===0&&(Os=null),Ib(s.stateNode),Mt(e,$e()),t!==null)for(r=e.onRecoverableError,s=0;s<t.length;s++)a=t[s],r(a.value,{componentStack:a.stack,digest:a.digest});if(Ro)throw Ro=!1,e=vu,vu=null,e;return Oo&1&&e.tag!==0&&fa(),i=e.pendingLanes,i&1?e===ju?Pi++:(Pi=0,ju=e):Pi=0,Hs(),null}function fa(){if(Cs!==null){var e=Sp(Oo),t=Gt.transition,s=we;try{if(Gt.transition=null,we=16>e?16:e,Cs===null)var r=!1;else{if(e=Cs,Cs=null,Oo=0,ye&6)throw Error(U(331));var a=ye;for(ye|=4,Q=e.current;Q!==null;){var i=Q,l=i.child;if(Q.flags&16){var o=i.deletions;if(o!==null){for(var c=0;c<o.length;c++){var d=o[c];for(Q=d;Q!==null;){var x=Q;switch(x.tag){case 0:case 11:case 15:Ci(8,x,i)}var f=x.child;if(f!==null)f.return=x,Q=f;else for(;Q!==null;){x=Q;var g=x.sibling,b=x.return;if(L0(x),x===d){Q=null;break}if(g!==null){g.return=b,Q=g;break}Q=b}}}var y=i.alternate;if(y!==null){var j=y.child;if(j!==null){y.child=null;do{var k=j.sibling;j.sibling=null,j=k}while(j!==null)}}Q=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,Q=l;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ci(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,Q=h;break e}Q=i.return}}var u=e.current;for(Q=u;Q!==null;){l=Q;var p=l.child;if(l.subtreeFlags&2064&&p!==null)p.return=l,Q=p;else e:for(l=u;Q!==null;){if(o=Q,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:lc(9,o)}}catch(w){Fe(o,o.return,w)}if(o===l){Q=null;break e}var v=o.sibling;if(v!==null){v.return=o.return,Q=v;break e}Q=o.return}}if(ye=a,Hs(),kn&&typeof kn.onPostCommitFiberRoot=="function")try{kn.onPostCommitFiberRoot(Zo,e)}catch{}r=!0}return r}finally{we=s,Gt.transition=t}}return!1}function Dh(e,t,s){t=Da(s,t),t=S0(e,t,1),e=Rs(e,t,1),t=bt(),e!==null&&(dl(e,1,t),Mt(e,t))}function Fe(e,t,s){if(e.tag===3)Dh(e,e,s);else for(;t!==null;){if(t.tag===3){Dh(t,e,s);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Os===null||!Os.has(r))){e=Da(s,e),e=C0(t,e,1),t=Rs(t,e,1),e=bt(),t!==null&&(dl(t,1,e),Mt(t,e));break}}t=t.return}}function dv(e,t,s){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&s,Xe===e&&(st&s)===s&&(Ge===4||Ge===3&&(st&130023424)===st&&500>$e()-Vx?pr(e,0):Wx|=s),Mt(e,t)}function W0(e,t){t===0&&(e.mode&1?(t=El,El<<=1,!(El&130023424)&&(El=4194304)):t=1);var s=bt();e=Yn(e,t),e!==null&&(dl(e,t,s),Mt(e,s))}function uv(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),W0(e,s)}function xv(e,t){var s=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(s=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),W0(e,s)}var V0;V0=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)Et=!0;else{if(!(e.lanes&s)&&!(t.flags&128))return Et=!1,Z1(e,t,s);Et=!!(e.flags&131072)}else Et=!1,Te&&t.flags&1048576&&Jp(t,ko,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;so(e,t),e=t.pendingProps;var a=Ma(t,xt.current);ha(t,s),a=$x(null,t,r,e,a,s);var i=Ux();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zt(r)?(i=!0,No(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ax(t),a.updater=ic,t.stateNode=a,a._reactInternals=t,cu(t,r,e,s),t=xu(null,t,r,!0,i,s)):(t.tag=0,Te&&i&&Px(t),pt(null,t,a,s),t=t.child),t;case 16:r=t.elementType;e:{switch(so(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=hv(r),e=an(r,e),a){case 0:t=uu(null,t,r,e,s);break e;case 1:t=kh(null,t,r,e,s);break e;case 11:t=Nh(null,t,r,e,s);break e;case 14:t=wh(null,t,r,an(r.type,e),s);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:an(r,a),uu(e,t,r,a,s);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:an(r,a),kh(e,t,r,a,s);case 3:e:{if(M0(t),e===null)throw Error(U(387));r=t.pendingProps,i=t.memoizedState,a=i.element,s0(e,t),Eo(t,r,null,s);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Da(Error(U(423)),t),t=Sh(e,t,r,s,a);break e}else if(r!==a){a=Da(Error(U(424)),t),t=Sh(e,t,r,s,a);break e}else for(It=Ts(t.stateNode.containerInfo.firstChild),Ft=t,Te=!0,cn=null,s=t0(t,null,r,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ta(),r===a){t=Jn(e,t,s);break e}pt(e,t,r,s)}t=t.child}return t;case 5:return r0(t),e===null&&iu(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,l=a.children,tu(r,a)?l=null:i!==null&&tu(r,i)&&(t.flags|=32),z0(e,t),pt(e,t,l,s),t.child;case 6:return e===null&&iu(t),null;case 13:return T0(e,t,s);case 4:return Lx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,s):pt(e,t,r,s),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:an(r,a),Nh(e,t,r,a,s);case 7:return pt(e,t,t.pendingProps,s),t.child;case 8:return pt(e,t,t.pendingProps.children,s),t.child;case 12:return pt(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,l=a.value,Ee(So,r._currentValue),r._currentValue=l,i!==null)if(hn(i.value,l)){if(i.children===a.children&&!Pt.current){t=Jn(e,t,s);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){l=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Wn(-1,s&-s),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var x=d.pending;x===null?c.next=c:(c.next=x.next,x.next=c),d.pending=c}}i.lanes|=s,c=i.alternate,c!==null&&(c.lanes|=s),lu(i.return,s,t),o.lanes|=s;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(U(341));l.lanes|=s,o=l.alternate,o!==null&&(o.lanes|=s),lu(l,s,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}pt(e,t,a.children,s),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,ha(t,s),a=Jt(a),r=r(a),t.flags|=1,pt(e,t,r,s),t.child;case 14:return r=t.type,a=an(r,t.pendingProps),a=an(r.type,a),wh(e,t,r,a,s);case 15:return E0(e,t,t.type,t.pendingProps,s);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:an(r,a),so(e,t),t.tag=1,zt(r)?(e=!0,No(t)):e=!1,ha(t,s),k0(t,r,a),cu(t,r,a,s),xu(null,t,r,!0,e,s);case 19:return R0(e,t,s);case 22:return P0(e,t,s)}throw Error(U(156,t.tag))};function Q0(e,t){return jp(e,t)}function mv(e,t,s,r){this.tag=e,this.key=s,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 Qt(e,t,s,r){return new mv(e,t,s,r)}function Jx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hv(e){if(typeof e=="function")return Jx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===px)return 11;if(e===gx)return 14}return 2}function As(e,t){var s=e.alternate;return s===null?(s=Qt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function io(e,t,s,r,a,i){var l=2;if(r=e,typeof e=="function")Jx(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Jr:return gr(s.children,a,i,t);case fx:l=8,a|=8;break;case Od:return e=Qt(12,s,t,a|2),e.elementType=Od,e.lanes=i,e;case Dd:return e=Qt(13,s,t,a),e.elementType=Dd,e.lanes=i,e;case Ad:return e=Qt(19,s,t,a),e.elementType=Ad,e.lanes=i,e;case rp:return cc(s,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case np:l=10;break e;case sp:l=9;break e;case px:l=11;break e;case gx:l=14;break e;case cs:l=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Qt(l,s,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function gr(e,t,s,r){return e=Qt(7,e,r,t),e.lanes=s,e}function cc(e,t,s,r){return e=Qt(22,e,r,t),e.elementType=rp,e.lanes=s,e.stateNode={isHidden:!1},e}function nd(e,t,s){return e=Qt(6,e,null,t),e.lanes=s,e}function sd(e,t,s){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fv(e,t,s,r,a){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=Ic(0),this.expirationTimes=Ic(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Xx(e,t,s,r,a,i,l,o,c){return e=new fv(e,t,s,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ax(i),e}function pv(e,t,s){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:s}}function G0(e){if(!e)return _s;e=e._reactInternals;e:{if(Rr(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(zt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var s=e.type;if(zt(s))return Gp(e,s,t)}return t}function Y0(e,t,s,r,a,i,l,o,c){return e=Xx(s,r,!0,e,a,i,l,o,c),e.context=G0(null),s=e.current,r=bt(),a=Ds(s),i=Wn(r,a),i.callback=t??null,Rs(s,i,a),e.current.lanes=a,dl(e,a,r),Mt(e,r),e}function dc(e,t,s,r){var a=t.current,i=bt(),l=Ds(a);return s=G0(s),t.context===null?t.context=s:t.pendingContext=s,t=Wn(i,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Rs(a,t,l),e!==null&&(xn(e,a,l,i),eo(e,a,l)),l}function Ao(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 Ah(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Zx(e,t){Ah(e,t),(e=e.alternate)&&Ah(e,t)}function gv(){return null}var J0=typeof reportError=="function"?reportError:function(e){console.error(e)};function em(e){this._internalRoot=e}uc.prototype.render=em.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));dc(e,t,null,null)};uc.prototype.unmount=em.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sr(function(){dc(null,e,null,null)}),t[Gn]=null}};function uc(e){this._internalRoot=e}uc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pp();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ms.length&&t!==0&&t<ms[s].priority;s++);ms.splice(s,0,e),s===0&&Mp(e)}};function tm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lh(){}function yv(e,t,s,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var d=Ao(l);i.call(d)}}var l=Y0(t,r,e,0,null,!1,!1,"",Lh);return e._reactRootContainer=l,e[Gn]=l.current,Ii(e.nodeType===8?e.parentNode:e),Sr(),l}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var o=r;r=function(){var d=Ao(c);o.call(d)}}var c=Xx(e,0,!1,null,null,!1,!1,"",Lh);return e._reactRootContainer=c,e[Gn]=c.current,Ii(e.nodeType===8?e.parentNode:e),Sr(function(){dc(t,c,s,r)}),c}function mc(e,t,s,r,a){var i=s._reactRootContainer;if(i){var l=i;if(typeof a=="function"){var o=a;a=function(){var c=Ao(l);o.call(c)}}dc(t,l,e,a)}else l=yv(s,t,e,a,r);return Ao(l)}Cp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=hi(t.pendingLanes);s!==0&&(vx(t,s|1),Mt(t,$e()),!(ye&6)&&(Aa=$e()+500,Hs()))}break;case 13:Sr(function(){var r=Yn(e,1);if(r!==null){var a=bt();xn(r,e,1,a)}}),Zx(e,1)}};jx=function(e){if(e.tag===13){var t=Yn(e,134217728);if(t!==null){var s=bt();xn(t,e,134217728,s)}Zx(e,134217728)}};Ep=function(e){if(e.tag===13){var t=Ds(e),s=Yn(e,t);if(s!==null){var r=bt();xn(s,e,t,r)}Zx(e,t)}};Pp=function(){return we};zp=function(e,t){var s=we;try{return we=e,t()}finally{we=s}};Kd=function(e,t,s){switch(t){case"input":if(Fd(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var r=s[t];if(r!==e&&r.form===e.form){var a=sc(r);if(!a)throw Error(U(90));ip(r),Fd(r,a)}}}break;case"textarea":op(e,s);break;case"select":t=s.value,t!=null&&da(e,!!s.multiple,t,!1)}};fp=Qx;pp=Sr;var bv={usingClientEntryPoint:!1,Events:[xl,ta,sc,mp,hp,Qx]},ti={findFiberByHostInstance:nr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},vv={bundleType:ti.bundleType,version:ti.version,rendererPackageName:ti.rendererPackageName,rendererConfig:ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:es.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bp(e),e===null?null:e.stateNode},findFiberByHostInstance:ti.findFiberByHostInstance||gv,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 Fl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fl.isDisabled&&Fl.supportsFiber)try{Zo=Fl.inject(vv),kn=Fl}catch{}}$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bv;$t.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tm(t))throw Error(U(200));return pv(e,t,null,s)};$t.createRoot=function(e,t){if(!tm(e))throw Error(U(299));var s=!1,r="",a=J0;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Xx(e,1,!1,null,null,s,!1,r,a),e[Gn]=t.current,Ii(e.nodeType===8?e.parentNode:e),new em(t)};$t.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(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=bp(t),e=e===null?null:e.stateNode,e};$t.flushSync=function(e){return Sr(e)};$t.hydrate=function(e,t,s){if(!xc(t))throw Error(U(200));return mc(null,e,t,!0,s)};$t.hydrateRoot=function(e,t,s){if(!tm(e))throw Error(U(405));var r=s!=null&&s.hydratedSources||null,a=!1,i="",l=J0;if(s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(i=s.identifierPrefix),s.onRecoverableError!==void 0&&(l=s.onRecoverableError)),t=Y0(t,null,e,1,s??null,a,!1,i,l),e[Gn]=t.current,Ii(e),r)for(e=0;e<r.length;e++)s=r[e],a=s._getVersion,a=a(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,a]:t.mutableSourceEagerHydrationData.push(s,a);return new uc(t)};$t.render=function(e,t,s){if(!xc(t))throw Error(U(200));return mc(null,e,t,!1,s)};$t.unmountComponentAtNode=function(e){if(!xc(e))throw Error(U(40));return e._reactRootContainer?(Sr(function(){mc(null,null,e,!1,function(){e._reactRootContainer=null,e[Gn]=null})}),!0):!1};$t.unstable_batchedUpdates=Qx;$t.unstable_renderSubtreeIntoContainer=function(e,t,s,r){if(!xc(s))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return mc(e,t,s,!1,r)};$t.version="18.3.1-next-f1338f8080-20240426";function X0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X0)}catch(e){console.error(e)}}X0(),Xf.exports=$t;var jv=Xf.exports,Z0,Ih=jv;Z0=Ih.createRoot,Ih.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
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
|
+
*/function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Wi.apply(this,arguments)}var Es;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Es||(Es={}));const Fh="popstate";function Nv(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:l,hash:o}=r.location;return ku("",{pathname:i,search:l,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function s(r,a){return typeof a=="string"?a:Lo(a)}return kv(t,s,null,e)}function _e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wv(){return Math.random().toString(36).substr(2,8)}function _h(e,t){return{usr:e.state,key:e.key,idx:t}}function ku(e,t,s,r){return s===void 0&&(s=null),Wi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ha(t):t,{state:s,key:t&&t.key||r||wv()})}function Lo(e){let{pathname:t="/",search:s="",hash:r=""}=e;return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ha(e){let t={};if(e){let s=e.indexOf("#");s>=0&&(t.hash=e.substr(s),e=e.substr(0,s));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function kv(e,t,s,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,o=Es.Pop,c=null,d=x();d==null&&(d=0,l.replaceState(Wi({},l.state,{idx:d}),""));function x(){return(l.state||{idx:null}).idx}function f(){o=Es.Pop;let k=x(),h=k==null?null:k-d;d=k,c&&c({action:o,location:j.location,delta:h})}function g(k,h){o=Es.Push;let u=ku(j.location,k,h);d=x()+1;let p=_h(u,d),v=j.createHref(u);try{l.pushState(p,"",v)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;a.location.assign(v)}i&&c&&c({action:o,location:j.location,delta:1})}function b(k,h){o=Es.Replace;let u=ku(j.location,k,h);d=x();let p=_h(u,d),v=j.createHref(u);l.replaceState(p,"",v),i&&c&&c({action:o,location:j.location,delta:0})}function y(k){let h=a.location.origin!=="null"?a.location.origin:a.location.href,u=typeof k=="string"?k:Lo(k);return u=u.replace(/ $/,"%20"),_e(h,"No window.location.(origin|href) available to create URL for href: "+u),new URL(u,h)}let j={get action(){return o},get location(){return e(a,l)},listen(k){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(Fh,f),c=k,()=>{a.removeEventListener(Fh,f),c=null}},createHref(k){return t(a,k)},createURL:y,encodeLocation(k){let h=y(k);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:g,replace:b,go(k){return l.go(k)}};return j}var $h;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($h||($h={}));function Sv(e,t,s){return s===void 0&&(s="/"),Cv(e,t,s)}function Cv(e,t,s,r){let a=typeof t=="string"?Ha(t):t,i=La(a.pathname||"/",s);if(i==null)return null;let l=eg(e);Ev(l);let o=null;for(let c=0;o==null&&c<l.length;++c){let d=Fv(i);o=Lv(l[c],d)}return o}function eg(e,t,s,r){t===void 0&&(t=[]),s===void 0&&(s=[]),r===void 0&&(r="");let a=(i,l,o)=>{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};c.relativePath.startsWith("/")&&(_e(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ls([r,c.relativePath]),x=s.concat(c);i.children&&i.children.length>0&&(_e(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),eg(i.children,t,x,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:Dv(d,i.index),routesMeta:x})};return e.forEach((i,l)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,l);else for(let c of tg(i.path))a(i,l,c)}),t}function tg(e){let t=e.split("/");if(t.length===0)return[];let[s,...r]=t,a=s.endsWith("?"),i=s.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=tg(r.join("/")),o=[];return o.push(...l.map(c=>c===""?i:[i,c].join("/"))),a&&o.push(...l),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function Ev(e){e.sort((t,s)=>t.score!==s.score?s.score-t.score:Av(t.routesMeta.map(r=>r.childrenIndex),s.routesMeta.map(r=>r.childrenIndex)))}const Pv=/^:[\w-]+$/,zv=3,Mv=2,Tv=1,Rv=10,Ov=-2,Uh=e=>e==="*";function Dv(e,t){let s=e.split("/"),r=s.length;return s.some(Uh)&&(r+=Ov),t&&(r+=Mv),s.filter(a=>!Uh(a)).reduce((a,i)=>a+(Pv.test(i)?zv:i===""?Tv:Rv),r)}function Av(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Lv(e,t,s){let{routesMeta:r}=e,a={},i="/",l=[];for(let o=0;o<r.length;++o){let c=r[o],d=o===r.length-1,x=i==="/"?t:t.slice(i.length)||"/",f=Su({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},x),g=c.route;if(!f)return null;Object.assign(a,f.params),l.push({params:a,pathname:Ls([i,f.pathname]),pathnameBase:Hv(Ls([i,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(i=Ls([i,f.pathnameBase]))}return l}function Su(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[s,r]=Iv(e.path,e.caseSensitive,e.end),a=t.match(s);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:r.reduce((d,x,f)=>{let{paramName:g,isOptional:b}=x;if(g==="*"){let j=o[f]||"";l=i.slice(0,i.length-j.length).replace(/(.)\/+$/,"$1")}const y=o[f];return b&&!y?d[g]=void 0:d[g]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:l,pattern:e}}function Iv(e,t,s){t===void 0&&(t=!1),s===void 0&&(s=!0),nm(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Fv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function La(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,r=e.charAt(s);return r&&r!=="/"?null:e.slice(s)||"/"}const _v=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$v=e=>_v.test(e);function Uv(e,t){t===void 0&&(t="/");let{pathname:s,search:r="",hash:a=""}=typeof e=="string"?Ha(e):e,i;if(s)if($v(s))i=s;else{if(s.includes("//")){let l=s;s=s.replace(/\/\/+/g,"/"),nm(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+s))}s.startsWith("/")?i=Bh(s.substring(1),"/"):i=Bh(s,t)}else i=t;return{pathname:i,search:qv(r),hash:Kv(a)}}function Bh(e,t){let s=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?s.length>1&&s.pop():a!=="."&&s.push(a)}),s.length>1?s.join("/"):"/"}function rd(e,t,s,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Bv(e){return e.filter((t,s)=>s===0||t.route.path&&t.route.path.length>0)}function ng(e,t){let s=Bv(e);return t?s.map((r,a)=>a===s.length-1?r.pathname:r.pathnameBase):s.map(r=>r.pathnameBase)}function sg(e,t,s,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Ha(e):(a=Wi({},e),_e(!a.pathname||!a.pathname.includes("?"),rd("?","pathname","search",a)),_e(!a.pathname||!a.pathname.includes("#"),rd("#","pathname","hash",a)),_e(!a.search||!a.search.includes("#"),rd("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,o;if(l==null)o=s;else{let f=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),f-=1;a.pathname=g.join("/")}o=f>=0?t[f]:"/"}let c=Uv(a,o),d=l&&l!=="/"&&l.endsWith("/"),x=(i||l===".")&&s.endsWith("/");return!c.pathname.endsWith("/")&&(d||x)&&(c.pathname+="/"),c}const Ls=e=>e.join("/").replace(/\/\/+/g,"/"),Hv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Kv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Wv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rg=["post","put","patch","delete"];new Set(rg);const Vv=["get",...rg];new Set(Vv);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Vi.apply(this,arguments)}const hc=m.createContext(null),ag=m.createContext(null),qs=m.createContext(null),fc=m.createContext(null),Ks=m.createContext({outlet:null,matches:[],isDataRoute:!1}),ig=m.createContext(null);function Qv(e,t){let{relative:s}=t===void 0?{}:t;hl()||_e(!1);let{basename:r,navigator:a}=m.useContext(qs),{hash:i,pathname:l,search:o}=pc(e,{relative:s}),c=l;return r!=="/"&&(c=l==="/"?r:Ls([r,l])),a.createHref({pathname:c,search:o,hash:i})}function hl(){return m.useContext(fc)!=null}function Ws(){return hl()||_e(!1),m.useContext(fc).location}function lg(e){m.useContext(qs).static||m.useLayoutEffect(e)}function Pn(){let{isDataRoute:e}=m.useContext(Ks);return e?oj():Gv()}function Gv(){hl()||_e(!1);let e=m.useContext(hc),{basename:t,future:s,navigator:r}=m.useContext(qs),{matches:a}=m.useContext(Ks),{pathname:i}=Ws(),l=JSON.stringify(ng(a,s.v7_relativeSplatPath)),o=m.useRef(!1);return lg(()=>{o.current=!0}),m.useCallback(function(d,x){if(x===void 0&&(x={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let f=sg(d,JSON.parse(l),i,x.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ls([t,f.pathname])),(x.replace?r.replace:r.push)(f,x.state,x)},[t,r,l,i,e])}function Yv(){let{matches:e}=m.useContext(Ks),t=e[e.length-1];return t?t.params:{}}function pc(e,t){let{relative:s}=t===void 0?{}:t,{future:r}=m.useContext(qs),{matches:a}=m.useContext(Ks),{pathname:i}=Ws(),l=JSON.stringify(ng(a,r.v7_relativeSplatPath));return m.useMemo(()=>sg(e,JSON.parse(l),i,s==="path"),[e,l,i,s])}function Jv(e,t){return Xv(e,t)}function Xv(e,t,s,r){hl()||_e(!1);let{navigator:a}=m.useContext(qs),{matches:i}=m.useContext(Ks),l=i[i.length-1],o=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let d=Ws(),x;if(t){var f;let k=typeof t=="string"?Ha(t):t;c==="/"||(f=k.pathname)!=null&&f.startsWith(c)||_e(!1),x=k}else x=d;let g=x.pathname||"/",b=g;if(c!=="/"){let k=c.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(k.length).join("/")}let y=Sv(e,{pathname:b}),j=sj(y&&y.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:Ls([c,a.encodeLocation?a.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?c:Ls([c,a.encodeLocation?a.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,s,r);return t&&j?m.createElement(fc.Provider,{value:{location:Vi({pathname:"/",search:"",hash:"",state:null,key:"default"},x),navigationType:Es.Pop}},j):j}function Zv(){let e=lj(),t=Wv(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),s=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),s?m.createElement("pre",{style:a},s):null,null)}const ej=m.createElement(Zv,null);class tj extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){console.error("React Router caught the following error during render",t,s)}render(){return this.state.error!==void 0?m.createElement(Ks.Provider,{value:this.props.routeContext},m.createElement(ig.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function nj(e){let{routeContext:t,match:s,children:r}=e,a=m.useContext(hc);return a&&a.static&&a.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=s.route.id),m.createElement(Ks.Provider,{value:t},r)}function sj(e,t,s,r){var a;if(t===void 0&&(t=[]),s===void 0&&(s=null),r===void 0&&(r=null),e==null){var i;if(!s)return null;if(s.errors)e=s.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let l=e,o=(a=s)==null?void 0:a.errors;if(o!=null){let x=l.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);x>=0||_e(!1),l=l.slice(0,Math.min(l.length,x+1))}let c=!1,d=-1;if(s&&r&&r.v7_partialHydration)for(let x=0;x<l.length;x++){let f=l[x];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=x),f.route.id){let{loaderData:g,errors:b}=s,y=f.route.loader&&g[f.route.id]===void 0&&(!b||b[f.route.id]===void 0);if(f.route.lazy||y){c=!0,d>=0?l=l.slice(0,d+1):l=[l[0]];break}}}return l.reduceRight((x,f,g)=>{let b,y=!1,j=null,k=null;s&&(b=o&&f.route.id?o[f.route.id]:void 0,j=f.route.errorElement||ej,c&&(d<0&&g===0?(cj("route-fallback"),y=!0,k=null):d===g&&(y=!0,k=f.route.hydrateFallbackElement||null)));let h=t.concat(l.slice(0,g+1)),u=()=>{let p;return b?p=j:y?p=k:f.route.Component?p=m.createElement(f.route.Component,null):f.route.element?p=f.route.element:p=x,m.createElement(nj,{match:f,routeContext:{outlet:x,matches:h,isDataRoute:s!=null},children:p})};return s&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?m.createElement(tj,{location:s.location,revalidation:s.revalidation,component:j,error:b,children:u(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):u()},null)}var og=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(og||{}),cg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(cg||{});function rj(e){let t=m.useContext(hc);return t||_e(!1),t}function aj(e){let t=m.useContext(ag);return t||_e(!1),t}function ij(e){let t=m.useContext(Ks);return t||_e(!1),t}function dg(e){let t=ij(),s=t.matches[t.matches.length-1];return s.route.id||_e(!1),s.route.id}function lj(){var e;let t=m.useContext(ig),s=aj(),r=dg();return t!==void 0?t:(e=s.errors)==null?void 0:e[r]}function oj(){let{router:e}=rj(og.UseNavigateStable),t=dg(cg.UseNavigateStable),s=m.useRef(!1);return lg(()=>{s.current=!0}),m.useCallback(function(a,i){i===void 0&&(i={}),s.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Vi({fromRouteId:t},i)))},[e,t])}const Hh={};function cj(e,t,s){Hh[e]||(Hh[e]=!0)}function dj(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wt(e){_e(!1)}function uj(e){let{basename:t="/",children:s=null,location:r,navigationType:a=Es.Pop,navigator:i,static:l=!1,future:o}=e;hl()&&_e(!1);let c=t.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:i,static:l,future:Vi({v7_relativeSplatPath:!1},o)}),[c,o,i,l]);typeof r=="string"&&(r=Ha(r));let{pathname:x="/",search:f="",hash:g="",state:b=null,key:y="default"}=r,j=m.useMemo(()=>{let k=La(x,c);return k==null?null:{location:{pathname:k,search:f,hash:g,state:b,key:y},navigationType:a}},[c,x,f,g,b,y,a]);return j==null?null:m.createElement(qs.Provider,{value:d},m.createElement(fc.Provider,{children:s,value:j}))}function xj(e){let{children:t,location:s}=e;return Jv(Cu(t),s)}new Promise(()=>{});function Cu(e,t){t===void 0&&(t=[]);let s=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let i=[...t,a];if(r.type===m.Fragment){s.push.apply(s,Cu(r.props.children,i));return}r.type!==wt&&_e(!1),!r.props.index||!r.props.children||_e(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Cu(r.props.children,i)),s.push(l)}),s}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function Io(){return Io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Io.apply(this,arguments)}function ug(e,t){if(e==null)return{};var s={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(s[a]=e[a]);return s}function mj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hj(e,t){return e.button===0&&(!t||t==="_self")&&!mj(e)}const fj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],pj=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],gj="6";try{window.__reactRouterVersion=gj}catch{}const yj=m.createContext({isTransitioning:!1}),bj="startTransition",qh=db[bj];function vj(e){let{basename:t,children:s,future:r,window:a}=e,i=m.useRef();i.current==null&&(i.current=Nv({window:a,v5Compat:!0}));let l=i.current,[o,c]=m.useState({action:l.action,location:l.location}),{v7_startTransition:d}=r||{},x=m.useCallback(f=>{d&&qh?qh(()=>c(f)):c(f)},[c,d]);return m.useLayoutEffect(()=>l.listen(x),[l,x]),m.useEffect(()=>dj(r),[r]),m.createElement(uj,{basename:t,children:s,location:o.location,navigationType:o.action,navigator:l,future:r})}const jj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Nj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wj=m.forwardRef(function(t,s){let{onClick:r,relative:a,reloadDocument:i,replace:l,state:o,target:c,to:d,preventScrollReset:x,viewTransition:f}=t,g=ug(t,fj),{basename:b}=m.useContext(qs),y,j=!1;if(typeof d=="string"&&Nj.test(d)&&(y=d,jj))try{let p=new URL(window.location.href),v=d.startsWith("//")?new URL(p.protocol+d):new URL(d),w=La(v.pathname,b);v.origin===p.origin&&w!=null?d=w+v.search+v.hash:j=!0}catch{}let k=Qv(d,{relative:a}),h=Cj(d,{replace:l,state:o,target:c,preventScrollReset:x,relative:a,viewTransition:f});function u(p){r&&r(p),p.defaultPrevented||h(p)}return m.createElement("a",Io({},g,{href:y||k,onClick:j||i?r:u,ref:s,target:c}))}),kj=m.forwardRef(function(t,s){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:l=!1,style:o,to:c,viewTransition:d,children:x}=t,f=ug(t,pj),g=pc(c,{relative:f.relative}),b=Ws(),y=m.useContext(ag),{navigator:j,basename:k}=m.useContext(qs),h=y!=null&&Ej(g)&&d===!0,u=j.encodeLocation?j.encodeLocation(g).pathname:g.pathname,p=b.pathname,v=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;a||(p=p.toLowerCase(),v=v?v.toLowerCase():null,u=u.toLowerCase()),v&&k&&(v=La(v,k)||v);const w=u!=="/"&&u.endsWith("/")?u.length-1:u.length;let N=p===u||!l&&p.startsWith(u)&&p.charAt(w)==="/",P=v!=null&&(v===u||!l&&v.startsWith(u)&&v.charAt(u.length)==="/"),E={isActive:N,isPending:P,isTransitioning:h},_=N?r:void 0,D;typeof i=="function"?D=i(E):D=[i,N?"active":null,P?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let G=typeof o=="function"?o(E):o;return m.createElement(wj,Io({},f,{"aria-current":_,className:D,ref:s,style:G,to:c,viewTransition:d}),typeof x=="function"?x(E):x)});var Eu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Eu||(Eu={}));var Kh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Kh||(Kh={}));function Sj(e){let t=m.useContext(hc);return t||_e(!1),t}function Cj(e,t){let{target:s,replace:r,state:a,preventScrollReset:i,relative:l,viewTransition:o}=t===void 0?{}:t,c=Pn(),d=Ws(),x=pc(e,{relative:l});return m.useCallback(f=>{if(hj(f,s)){f.preventDefault();let g=r!==void 0?r:Lo(d)===Lo(x);c(e,{replace:g,state:a,preventScrollReset:i,relative:l,viewTransition:o})}},[d,c,x,r,a,s,e,i,l,o])}function Ej(e,t){t===void 0&&(t={});let s=m.useContext(yj);s==null&&_e(!1);let{basename:r}=Sj(Eu.useViewTransitionState),a=pc(e,{relative:t.relative});if(!s.isTransitioning)return!1;let i=La(s.currentLocation.pathname,r)||s.currentLocation.pathname,l=La(s.nextLocation.pathname,r)||s.nextLocation.pathname;return Su(a.pathname,l)!=null||Su(a.pathname,i)!=null}var qa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lr,ps,ga,Mf,Pj=(Mf=class extends qa{constructor(){super();Z(this,lr);Z(this,ps);Z(this,ga);V(this,ga,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){S(this,ps)||this.setEventListener(S(this,ga))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,ps))==null||t.call(this),V(this,ps,void 0))}setEventListener(t){var s;V(this,ga,t),(s=S(this,ps))==null||s.call(this),V(this,ps,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,lr)!==t&&(V(this,lr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof S(this,lr)=="boolean"?S(this,lr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},lr=new WeakMap,ps=new WeakMap,ga=new WeakMap,Mf),sm=new Pj,zj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gs,lx,Tf,Mj=(Tf=class{constructor(){Z(this,gs,zj);Z(this,lx,!1)}setTimeoutProvider(e){V(this,gs,e)}setTimeout(e,t){return S(this,gs).setTimeout(e,t)}clearTimeout(e){S(this,gs).clearTimeout(e)}setInterval(e,t){return S(this,gs).setInterval(e,t)}clearInterval(e){S(this,gs).clearInterval(e)}},gs=new WeakMap,lx=new WeakMap,Tf),ar=new Mj;function Tj(e){setTimeout(e,0)}var Rj=typeof window>"u"||"Deno"in globalThis;function gt(){}function Oj(e,t){return typeof e=="function"?e(t):e}function Pu(e){return typeof e=="number"&&e>=0&&e!==1/0}function xg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Is(e,t){return typeof e=="function"?e(t):e}function Kt(e,t){return typeof e=="function"?e(t):e}function Wh(e,t){const{type:s="all",exact:r,fetchStatus:a,predicate:i,queryKey:l,stale:o}=e;if(l){if(r){if(t.queryHash!==rm(l,t.options))return!1}else if(!Qi(t.queryKey,l))return!1}if(s!=="all"){const c=t.isActive();if(s==="active"&&!c||s==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||a&&a!==t.state.fetchStatus||i&&!i(t))}function Vh(e,t){const{exact:s,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(s){if(Cr(t.options.mutationKey)!==Cr(i))return!1}else if(!Qi(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Cr)(e)}function Cr(e){return JSON.stringify(e,(t,s)=>zu(s)?Object.keys(s).sort().reduce((r,a)=>(r[a]=s[a],r),{}):s)}function Qi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Qi(e[s],t[s])):!1}var Dj=Object.prototype.hasOwnProperty;function mg(e,t,s=0){if(e===t)return e;if(s>500)return t;const r=Qh(e)&&Qh(t);if(!r&&!(zu(e)&&zu(t)))return t;const i=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),o=l.length,c=r?new Array(o):{};let d=0;for(let x=0;x<o;x++){const f=r?x:l[x],g=e[f],b=t[f];if(g===b){c[f]=g,(r?x<i:Dj.call(e,f))&&d++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){c[f]=b;continue}const y=mg(g,b,s+1);c[f]=y,y===g&&d++}return i===o&&d===i?e:c}function Fo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Qh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zu(e){if(!Gh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Gh(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Aj(e){return new Promise(t=>{ar.setTimeout(t,e)})}function Mu(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?mg(e,t):t}function Lj(e,t,s=0){const r=[...e,t];return s&&r.length>s?r.slice(1):r}function Ij(e,t,s=0){const r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var am=Symbol();function hg(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function im(e,t){return typeof e=="function"?e(...t):!!e}function Fj(e,t,s){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?s():a.addEventListener("abort",s,{once:!0})),a)}),e}var Gi=(()=>{let e=()=>Rj;return{isServer(){return e()},setIsServer(t){e=t}}})();function Tu(){let e,t;const s=new Promise((a,i)=>{e=a,t=i});s.status="pending",s.catch(()=>{});function r(a){Object.assign(s,a),delete s.resolve,delete s.reject}return s.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},s.reject=a=>{r({status:"rejected",reason:a}),t(a)},s}var _j=Tj;function $j(){let e=[],t=0,s=o=>{o()},r=o=>{o()},a=_j;const i=o=>{t?e.push(o):a(()=>{s(o)})},l=()=>{const o=e;e=[],o.length&&a(()=>{r(()=>{o.forEach(c=>{s(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||l()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{a=o}}}var Ve=$j(),ya,ys,ba,Rf,Uj=(Rf=class extends qa{constructor(){super();Z(this,ya,!0);Z(this,ys);Z(this,ba);V(this,ba,t=>{if(typeof window<"u"&&window.addEventListener){const s=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){S(this,ys)||this.setEventListener(S(this,ba))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,ys))==null||t.call(this),V(this,ys,void 0))}setEventListener(t){var s;V(this,ba,t),(s=S(this,ys))==null||s.call(this),V(this,ys,t(this.setOnline.bind(this)))}setOnline(t){S(this,ya)!==t&&(V(this,ya,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,ya)}},ya=new WeakMap,ys=new WeakMap,ba=new WeakMap,Rf),_o=new Uj;function Bj(e){return Math.min(1e3*2**e,3e4)}function fg(e){return(e??"online")==="online"?_o.isOnline():!0}var Ru=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pg(e){let t=!1,s=0,r;const a=Tu(),i=()=>a.status!=="pending",l=j=>{var k;if(!i()){const h=new Ru(j);g(h),(k=e.onCancel)==null||k.call(e,h)}},o=()=>{t=!0},c=()=>{t=!1},d=()=>sm.isFocused()&&(e.networkMode==="always"||_o.isOnline())&&e.canRun(),x=()=>fg(e.networkMode)&&e.canRun(),f=j=>{i()||(r==null||r(),a.resolve(j))},g=j=>{i()||(r==null||r(),a.reject(j))},b=()=>new Promise(j=>{var k;r=h=>{(i()||d())&&j(h)},(k=e.onPause)==null||k.call(e)}).then(()=>{var j;r=void 0,i()||(j=e.onContinue)==null||j.call(e)}),y=()=>{if(i())return;let j;const k=s===0?e.initialPromise:void 0;try{j=k??e.fn()}catch(h){j=Promise.reject(h)}Promise.resolve(j).then(f).catch(h=>{var N;if(i())return;const u=e.retry??(Gi.isServer()?0:3),p=e.retryDelay??Bj,v=typeof p=="function"?p(s,h):p,w=u===!0||typeof u=="number"&&s<u||typeof u=="function"&&u(s,h);if(t||!w){g(h);return}s++,(N=e.onFail)==null||N.call(e,s,h),Aj(v).then(()=>d()?void 0:b()).then(()=>{t?g(h):y()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:o,continueRetry:c,canStart:x,start:()=>(x()?y():b().then(y),a)}}var or,Of,gg=(Of=class{constructor(){Z(this,or)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pu(this.gcTime)&&V(this,or,ar.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gi.isServer()?1/0:5*60*1e3))}clearGcTimeout(){S(this,or)&&(ar.clearTimeout(S(this,or)),V(this,or,void 0))}},or=new WeakMap,Of),cr,va,qt,dr,Ye,rl,ur,Lt,yg,Ln,Df,Hj=(Df=class extends gg{constructor(t){super();Z(this,Lt);Z(this,cr);Z(this,va);Z(this,qt);Z(this,dr);Z(this,Ye);Z(this,rl);Z(this,ur);V(this,ur,!1),V(this,rl,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,dr,t.client),V(this,qt,S(this,dr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,cr,Jh(this.options)),this.state=t.state??S(this,cr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,Ye))==null?void 0:t.promise}setOptions(t){if(this.options={...S(this,rl),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Jh(this.options);s.data!==void 0&&(this.setState(Yh(s.data,s.dataUpdatedAt)),V(this,cr,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,qt).remove(this)}setData(t,s){const r=Mu(this.state.data,t,this.options);return le(this,Lt,Ln).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(t,s){le(this,Lt,Ln).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var r,a;const s=(r=S(this,Ye))==null?void 0:r.promise;return(a=S(this,Ye))==null||a.cancel(t),s?s.then(gt).catch(gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,cr)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Kt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Is(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!xg(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=S(this,Ye))==null||s.continue()}onOnline(){var s;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=S(this,Ye))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(S(this,Ye)&&(S(this,ur)||le(this,Lt,yg).call(this)?S(this,Ye).cancel({revert:!0}):S(this,Ye).cancelRetry()),this.scheduleGc()),S(this,qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||le(this,Lt,Ln).call(this,{type:"invalidate"})}async fetch(t,s){var c,d,x,f,g,b,y,j,k,h,u,p;if(this.state.fetchStatus!=="idle"&&((c=S(this,Ye))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(S(this,Ye))return S(this,Ye).continueRetry(),S(this,Ye).promise}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(w=>w.options.queryFn);v&&this.setOptions(v.options)}const r=new AbortController,a=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(V(this,ur,!0),r.signal)})},i=()=>{const v=hg(this.options,s),N=(()=>{const P={client:S(this,dr),queryKey:this.queryKey,meta:this.meta};return a(P),P})();return V(this,ur,!1),this.options.persister?this.options.persister(v,N,this):v(N)},o=(()=>{const v={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:S(this,dr),state:this.state,fetchFn:i};return a(v),v})();(d=this.options.behavior)==null||d.onFetch(o,this),V(this,va,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=o.fetchOptions)==null?void 0:x.meta))&&le(this,Lt,Ln).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta}),V(this,Ye,pg({initialPromise:s==null?void 0:s.initialPromise,fn:o.fetchFn,onCancel:v=>{v instanceof Ru&&v.revert&&this.setState({...S(this,va),fetchStatus:"idle"}),r.abort()},onFail:(v,w)=>{le(this,Lt,Ln).call(this,{type:"failed",failureCount:v,error:w})},onPause:()=>{le(this,Lt,Ln).call(this,{type:"pause"})},onContinue:()=>{le(this,Lt,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const v=await S(this,Ye).start();if(v===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(v),(b=(g=S(this,qt).config).onSuccess)==null||b.call(g,v,this),(j=(y=S(this,qt).config).onSettled)==null||j.call(y,v,this.state.error,this),v}catch(v){if(v instanceof Ru){if(v.silent)return S(this,Ye).promise;if(v.revert){if(this.state.data===void 0)throw v;return this.state.data}}throw le(this,Lt,Ln).call(this,{type:"error",error:v}),(h=(k=S(this,qt).config).onError)==null||h.call(k,v,this),(p=(u=S(this,qt).config).onSettled)==null||p.call(u,this.state.data,v,this),v}finally{this.scheduleGc()}}},cr=new WeakMap,va=new WeakMap,qt=new WeakMap,dr=new WeakMap,Ye=new WeakMap,rl=new WeakMap,ur=new WeakMap,Lt=new WeakSet,yg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ln=function(t){const s=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...bg(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...Yh(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return V(this,va,t.manual?a:void 0),a;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=s(this.state),Ve.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,qt).notify({query:this,type:"updated",action:t})})},Df);function bg(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Yh(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var kt,ge,al,ft,xr,ja,_n,bs,il,Na,wa,mr,hr,vs,ka,je,pi,Ou,Du,Au,Lu,Iu,Fu,_u,vg,Af,qj=(Af=class extends qa{constructor(t,s){super();Z(this,je);Z(this,kt);Z(this,ge);Z(this,al);Z(this,ft);Z(this,xr);Z(this,ja);Z(this,_n);Z(this,bs);Z(this,il);Z(this,Na);Z(this,wa);Z(this,mr);Z(this,hr);Z(this,vs);Z(this,ka,new Set);this.options=s,V(this,kt,t),V(this,bs,null),V(this,_n,Tu()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,ge).addObserver(this),Xh(S(this,ge),this.options)?le(this,je,pi).call(this):this.updateResult(),le(this,je,Lu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $u(S(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $u(S(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,le(this,je,Iu).call(this),le(this,je,Fu).call(this),S(this,ge).removeObserver(this)}setOptions(t){const s=this.options,r=S(this,ge);if(this.options=S(this,kt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kt(this.options.enabled,S(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");le(this,je,_u).call(this),S(this,ge).setOptions(this.options),s._defaulted&&!Fo(this.options,s)&&S(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,ge),observer:this});const a=this.hasListeners();a&&Zh(S(this,ge),r,this.options,s)&&le(this,je,pi).call(this),this.updateResult(),a&&(S(this,ge)!==r||Kt(this.options.enabled,S(this,ge))!==Kt(s.enabled,S(this,ge))||Is(this.options.staleTime,S(this,ge))!==Is(s.staleTime,S(this,ge)))&&le(this,je,Ou).call(this);const i=le(this,je,Du).call(this);a&&(S(this,ge)!==r||Kt(this.options.enabled,S(this,ge))!==Kt(s.enabled,S(this,ge))||i!==S(this,vs))&&le(this,je,Au).call(this,i)}getOptimisticResult(t){const s=S(this,kt).getQueryCache().build(S(this,kt),t),r=this.createResult(s,t);return Wj(this,r)&&(V(this,ft,r),V(this,ja,this.options),V(this,xr,S(this,ge).state)),r}getCurrentResult(){return S(this,ft)}trackResult(t,s){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),s==null||s(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,_n).status==="pending"&&S(this,_n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){S(this,ka).add(t)}getCurrentQuery(){return S(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=S(this,kt).defaultQueryOptions(t),r=S(this,kt).getQueryCache().build(S(this,kt),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(t){return le(this,je,pi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,ft)))}createResult(t,s){var _;const r=S(this,ge),a=this.options,i=S(this,ft),l=S(this,xr),o=S(this,ja),d=t!==r?t.state:S(this,al),{state:x}=t;let f={...x},g=!1,b;if(s._optimisticResults){const D=this.hasListeners(),G=!D&&Xh(t,s),J=D&&Zh(t,r,s,a);(G||J)&&(f={...f,...bg(x.data,t.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:j,status:k}=f;b=f.data;let h=!1;if(s.placeholderData!==void 0&&b===void 0&&k==="pending"){let D;i!=null&&i.isPlaceholderData&&s.placeholderData===(o==null?void 0:o.placeholderData)?(D=i.data,h=!0):D=typeof s.placeholderData=="function"?s.placeholderData((_=S(this,wa))==null?void 0:_.state.data,S(this,wa)):s.placeholderData,D!==void 0&&(k="success",b=Mu(i==null?void 0:i.data,D,s),g=!0)}if(s.select&&b!==void 0&&!h)if(i&&b===(l==null?void 0:l.data)&&s.select===S(this,il))b=S(this,Na);else try{V(this,il,s.select),b=s.select(b),b=Mu(i==null?void 0:i.data,b,s),V(this,Na,b),V(this,bs,null)}catch(D){V(this,bs,D)}S(this,bs)&&(y=S(this,bs),b=S(this,Na),j=Date.now(),k="error");const u=f.fetchStatus==="fetching",p=k==="pending",v=k==="error",w=p&&u,N=b!==void 0,E={status:k,fetchStatus:f.fetchStatus,isPending:p,isSuccess:k==="success",isError:v,isInitialLoading:w,isLoading:w,data:b,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:j,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:u,isRefetching:u&&!p,isLoadingError:v&&!N,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:v&&N,isStale:lm(t,s),refetch:this.refetch,promise:S(this,_n),isEnabled:Kt(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=E.data!==void 0,G=E.status==="error"&&!D,J=F=>{G?F.reject(E.error):D&&F.resolve(E.data)},se=()=>{const F=V(this,_n,E.promise=Tu());J(F)},M=S(this,_n);switch(M.status){case"pending":t.queryHash===r.queryHash&&J(M);break;case"fulfilled":(G||E.data!==M.value)&&se();break;case"rejected":(!G||E.error!==M.reason)&&se();break}}return E}updateResult(){const t=S(this,ft),s=this.createResult(S(this,ge),this.options);if(V(this,xr,S(this,ge).state),V(this,ja,this.options),S(this,xr).data!==void 0&&V(this,wa,S(this,ge)),Fo(s,t))return;V(this,ft,s);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!S(this,ka).size)return!0;const l=new Set(i??S(this,ka));return this.options.throwOnError&&l.add("error"),Object.keys(S(this,ft)).some(o=>{const c=o;return S(this,ft)[c]!==t[c]&&l.has(c)})};le(this,je,vg).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&le(this,je,Lu).call(this)}},kt=new WeakMap,ge=new WeakMap,al=new WeakMap,ft=new WeakMap,xr=new WeakMap,ja=new WeakMap,_n=new WeakMap,bs=new WeakMap,il=new WeakMap,Na=new WeakMap,wa=new WeakMap,mr=new WeakMap,hr=new WeakMap,vs=new WeakMap,ka=new WeakMap,je=new WeakSet,pi=function(t){le(this,je,_u).call(this);let s=S(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(gt)),s},Ou=function(){le(this,je,Iu).call(this);const t=Is(this.options.staleTime,S(this,ge));if(Gi.isServer()||S(this,ft).isStale||!Pu(t))return;const r=xg(S(this,ft).dataUpdatedAt,t)+1;V(this,mr,ar.setTimeout(()=>{S(this,ft).isStale||this.updateResult()},r))},Du=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,ge)):this.options.refetchInterval)??!1},Au=function(t){le(this,je,Fu).call(this),V(this,vs,t),!(Gi.isServer()||Kt(this.options.enabled,S(this,ge))===!1||!Pu(S(this,vs))||S(this,vs)===0)&&V(this,hr,ar.setInterval(()=>{(this.options.refetchIntervalInBackground||sm.isFocused())&&le(this,je,pi).call(this)},S(this,vs)))},Lu=function(){le(this,je,Ou).call(this),le(this,je,Au).call(this,le(this,je,Du).call(this))},Iu=function(){S(this,mr)&&(ar.clearTimeout(S(this,mr)),V(this,mr,void 0))},Fu=function(){S(this,hr)&&(ar.clearInterval(S(this,hr)),V(this,hr,void 0))},_u=function(){const t=S(this,kt).getQueryCache().build(S(this,kt),this.options);if(t===S(this,ge))return;const s=S(this,ge);V(this,ge,t),V(this,al,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},vg=function(t){Ve.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(S(this,ft))}),S(this,kt).getQueryCache().notify({query:S(this,ge),type:"observerResultsUpdated"})})},Af);function Kj(e,t){return Kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Xh(e,t){return Kj(e,t)||e.state.data!==void 0&&$u(e,t,t.refetchOnMount)}function $u(e,t,s){if(Kt(t.enabled,e)!==!1&&Is(t.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&lm(e,t)}return!1}function Zh(e,t,s,r){return(e!==t||Kt(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&lm(e,s)}function lm(e,t){return Kt(t.enabled,e)!==!1&&e.isStaleByTime(Is(t.staleTime,e))}function Wj(e,t){return!Fo(e.getCurrentResult(),t)}function ef(e){return{onFetch:(t,s)=>{var x,f,g,b,y;const r=t.options,a=(g=(f=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,i=((b=t.state.data)==null?void 0:b.pages)||[],l=((y=t.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const d=async()=>{let j=!1;const k=p=>{Fj(p,()=>t.signal,()=>j=!0)},h=hg(t.options,t.fetchOptions),u=async(p,v,w)=>{if(j)return Promise.reject();if(v==null&&p.pages.length)return Promise.resolve(p);const P=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:v,direction:w?"backward":"forward",meta:t.options.meta};return k(G),G})(),E=await h(P),{maxPages:_}=t.options,D=w?Ij:Lj;return{pages:D(p.pages,E,_),pageParams:D(p.pageParams,v,_)}};if(a&&i.length){const p=a==="backward",v=p?Vj:tf,w={pages:i,pageParams:l},N=v(r,w);o=await u(w,N,p)}else{const p=e??i.length;do{const v=c===0?l[0]??r.initialPageParam:tf(r,o);if(c>0&&v==null)break;o=await u(o,v),c++}while(c<p)}return o};t.options.persister?t.fetchFn=()=>{var j,k;return(k=(j=t.options).persister)==null?void 0:k.call(j,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=d}}}function tf(e,{pages:t,pageParams:s}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}function Vj(e,{pages:t,pageParams:s}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,s[0],s):void 0}var ll,bn,ct,fr,vn,os,Lf,Qj=(Lf=class extends gg{constructor(t){super();Z(this,vn);Z(this,ll);Z(this,bn);Z(this,ct);Z(this,fr);V(this,ll,t.client),this.mutationId=t.mutationId,V(this,ct,t.mutationCache),V(this,bn,[]),this.state=t.state||jg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,bn).includes(t)||(S(this,bn).push(t),this.clearGcTimeout(),S(this,ct).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,bn,S(this,bn).filter(s=>s!==t)),this.scheduleGc(),S(this,ct).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,bn).length||(this.state.status==="pending"?this.scheduleGc():S(this,ct).remove(this))}continue(){var t;return((t=S(this,fr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,c,d,x,f,g,b,y,j,k,h,u,p,v,w,N,P;const s=()=>{le(this,vn,os).call(this,{type:"continue"})},r={client:S(this,ll),meta:this.options.meta,mutationKey:this.options.mutationKey};V(this,fr,pg({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(E,_)=>{le(this,vn,os).call(this,{type:"failed",failureCount:E,error:_})},onPause:()=>{le(this,vn,os).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,ct).canRun(this)}));const a=this.state.status==="pending",i=!S(this,fr).canStart();try{if(a)s();else{le(this,vn,os).call(this,{type:"pending",variables:t,isPaused:i}),S(this,ct).config.onMutate&&await S(this,ct).config.onMutate(t,this,r);const _=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,r));_!==this.state.context&&le(this,vn,os).call(this,{type:"pending",context:_,variables:t,isPaused:i})}const E=await S(this,fr).start();return await((d=(c=S(this,ct).config).onSuccess)==null?void 0:d.call(c,E,t,this.state.context,this,r)),await((f=(x=this.options).onSuccess)==null?void 0:f.call(x,E,t,this.state.context,r)),await((b=(g=S(this,ct).config).onSettled)==null?void 0:b.call(g,E,null,this.state.variables,this.state.context,this,r)),await((j=(y=this.options).onSettled)==null?void 0:j.call(y,E,null,t,this.state.context,r)),le(this,vn,os).call(this,{type:"success",data:E}),E}catch(E){try{await((h=(k=S(this,ct).config).onError)==null?void 0:h.call(k,E,t,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((p=(u=this.options).onError)==null?void 0:p.call(u,E,t,this.state.context,r))}catch(_){Promise.reject(_)}try{await((w=(v=S(this,ct).config).onSettled)==null?void 0:w.call(v,void 0,E,this.state.variables,this.state.context,this,r))}catch(_){Promise.reject(_)}try{await((P=(N=this.options).onSettled)==null?void 0:P.call(N,void 0,E,t,this.state.context,r))}catch(_){Promise.reject(_)}throw le(this,vn,os).call(this,{type:"error",error:E}),E}finally{S(this,ct).runNext(this)}}},ll=new WeakMap,bn=new WeakMap,ct=new WeakMap,fr=new WeakMap,vn=new WeakSet,os=function(t){const s=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Ve.batch(()=>{S(this,bn).forEach(r=>{r.onMutationUpdate(t)}),S(this,ct).notify({mutation:this,type:"updated",action:t})})},Lf);function jg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $n,ln,ol,If,Gj=(If=class extends qa{constructor(t={}){super();Z(this,$n);Z(this,ln);Z(this,ol);this.config=t,V(this,$n,new Set),V(this,ln,new Map),V(this,ol,0)}build(t,s,r){const a=new Qj({client:t,mutationCache:this,mutationId:++jl(this,ol)._,options:t.defaultMutationOptions(s),state:r});return this.add(a),a}add(t){S(this,$n).add(t);const s=_l(t);if(typeof s=="string"){const r=S(this,ln).get(s);r?r.push(t):S(this,ln).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,$n).delete(t)){const s=_l(t);if(typeof s=="string"){const r=S(this,ln).get(s);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&S(this,ln).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=_l(t);if(typeof s=="string"){const r=S(this,ln).get(s),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const s=_l(t);if(typeof s=="string"){const a=(r=S(this,ln).get(s))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ve.batch(()=>{S(this,$n).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,$n).clear(),S(this,ln).clear()})}getAll(){return Array.from(S(this,$n))}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Vh(s,r))}findAll(t={}){return this.getAll().filter(s=>Vh(t,s))}notify(t){Ve.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return Ve.batch(()=>Promise.all(t.map(s=>s.continue().catch(gt))))}},$n=new WeakMap,ln=new WeakMap,ol=new WeakMap,If);function _l(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Un,js,St,Bn,Vn,lo,Uu,Ff,Yj=(Ff=class extends qa{constructor(s,r){super();Z(this,Vn);Z(this,Un);Z(this,js);Z(this,St);Z(this,Bn);V(this,Un,s),this.setOptions(r),this.bindMethods(),le(this,Vn,lo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var a;const r=this.options;this.options=S(this,Un).defaultMutationOptions(s),Fo(this.options,r)||S(this,Un).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,St),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Cr(r.mutationKey)!==Cr(this.options.mutationKey)?this.reset():((a=S(this,St))==null?void 0:a.state.status)==="pending"&&S(this,St).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=S(this,St))==null||s.removeObserver(this)}onMutationUpdate(s){le(this,Vn,lo).call(this),le(this,Vn,Uu).call(this,s)}getCurrentResult(){return S(this,js)}reset(){var s;(s=S(this,St))==null||s.removeObserver(this),V(this,St,void 0),le(this,Vn,lo).call(this),le(this,Vn,Uu).call(this)}mutate(s,r){var a;return V(this,Bn,r),(a=S(this,St))==null||a.removeObserver(this),V(this,St,S(this,Un).getMutationCache().build(S(this,Un),this.options)),S(this,St).addObserver(this),S(this,St).execute(s)}},Un=new WeakMap,js=new WeakMap,St=new WeakMap,Bn=new WeakMap,Vn=new WeakSet,lo=function(){var r;const s=((r=S(this,St))==null?void 0:r.state)??jg();V(this,js,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},Uu=function(s){Ve.batch(()=>{var r,a,i,l,o,c,d,x;if(S(this,Bn)&&this.hasListeners()){const f=S(this,js).variables,g=S(this,js).context,b={client:S(this,Un),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(a=(r=S(this,Bn)).onSuccess)==null||a.call(r,s.data,f,g,b)}catch(y){Promise.reject(y)}try{(l=(i=S(this,Bn)).onSettled)==null||l.call(i,s.data,null,f,g,b)}catch(y){Promise.reject(y)}}else if((s==null?void 0:s.type)==="error"){try{(c=(o=S(this,Bn)).onError)==null||c.call(o,s.error,f,g,b)}catch(y){Promise.reject(y)}try{(x=(d=S(this,Bn)).onSettled)==null||x.call(d,void 0,s.error,f,g,b)}catch(y){Promise.reject(y)}}}this.listeners.forEach(f=>{f(S(this,js))})})},Ff),jn,_f,Jj=(_f=class extends qa{constructor(t={}){super();Z(this,jn);this.config=t,V(this,jn,new Map)}build(t,s,r){const a=s.queryKey,i=s.queryHash??rm(a,s);let l=this.get(i);return l||(l=new Hj({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(s),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){S(this,jn).has(t.queryHash)||(S(this,jn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=S(this,jn).get(t.queryHash);s&&(t.destroy(),s===t&&S(this,jn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ve.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,jn).get(t)}getAll(){return[...S(this,jn).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(r=>Wh(s,r))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(r=>Wh(t,r)):s}notify(t){Ve.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){Ve.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ve.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jn=new WeakMap,_f),Ie,Ns,ws,Sa,Ca,ks,Ea,Pa,$f,Xj=($f=class{constructor(e={}){Z(this,Ie);Z(this,Ns);Z(this,ws);Z(this,Sa);Z(this,Ca);Z(this,ks);Z(this,Ea);Z(this,Pa);V(this,Ie,e.queryCache||new Jj),V(this,Ns,e.mutationCache||new Gj),V(this,ws,e.defaultOptions||{}),V(this,Sa,new Map),V(this,Ca,new Map),V(this,ks,0)}mount(){jl(this,ks)._++,S(this,ks)===1&&(V(this,Ea,sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ie).onFocus())})),V(this,Pa,_o.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,Ie).onOnline())})))}unmount(){var e,t;jl(this,ks)._--,S(this,ks)===0&&((e=S(this,Ea))==null||e.call(this),V(this,Ea,void 0),(t=S(this,Pa))==null||t.call(this),V(this,Pa,void 0))}isFetching(e){return S(this,Ie).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,Ns).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=S(this,Ie).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=S(this,Ie).build(this,t),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Is(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,Ie).findAll(e).map(({queryKey:t,state:s})=>{const r=s.data;return[t,r]})}setQueryData(e,t,s){const r=this.defaultQueryOptions({queryKey:e}),a=S(this,Ie).get(r.queryHash),i=a==null?void 0:a.state.data,l=Oj(t,i);if(l!==void 0)return S(this,Ie).build(this,r).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return Ve.batch(()=>S(this,Ie).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=S(this,Ie).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=S(this,Ie);Ve.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=S(this,Ie);return Ve.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},r=Ve.batch(()=>S(this,Ie).findAll(e).map(a=>a.cancel(s)));return Promise.all(r).then(gt).catch(gt)}invalidateQueries(e,t={}){return Ve.batch(()=>(S(this,Ie).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},r=Ve.batch(()=>S(this,Ie).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,s);return s.throwOnError||(i=i.catch(gt)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=S(this,Ie).build(this,t);return s.isStaleByTime(Is(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gt).catch(gt)}fetchInfiniteQuery(e){return e.behavior=ef(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gt).catch(gt)}ensureInfiniteQueryData(e){return e.behavior=ef(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return _o.isOnline()?S(this,Ns).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Ie)}getMutationCache(){return S(this,Ns)}getDefaultOptions(){return S(this,ws)}setDefaultOptions(e){V(this,ws,e)}setQueryDefaults(e,t){S(this,Sa).set(Cr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Sa).values()],s={};return t.forEach(r=>{Qi(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,t){S(this,Ca).set(Cr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,Ca).values()],s={};return t.forEach(r=>{Qi(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,ws).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,ws).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,Ie).clear(),S(this,Ns).clear()}},Ie=new WeakMap,Ns=new WeakMap,ws=new WeakMap,Sa=new WeakMap,Ca=new WeakMap,ks=new WeakMap,Ea=new WeakMap,Pa=new WeakMap,$f),Ng=m.createContext(void 0),ie=e=>{const t=m.useContext(Ng);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Zj=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),n.jsx(Ng.Provider,{value:e,children:t})),wg=m.createContext(!1),e2=()=>m.useContext(wg);wg.Provider;function t2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var n2=m.createContext(t2()),s2=()=>m.useContext(n2),r2=(e,t,s)=>{const r=s!=null&&s.state.error&&typeof e.throwOnError=="function"?im(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},a2=e=>{m.useEffect(()=>{e.clearReset()},[e])},i2=({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||im(s,[e.error,r])),l2=e=>{if(e.suspense){const s=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>s(r(...a)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},o2=(e,t)=>e.isLoading&&e.isFetching&&!t,c2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nf=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function d2(e,t,s){var g,b,y,j;const r=e2(),a=s2(),i=ie(),l=i.defaultQueryOptions(e);(b=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||b.call(g,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",l2(l),r2(l,a,o),a2(a);const c=!i.getQueryCache().get(l.queryHash),[d]=m.useState(()=>new t(i,l)),x=d.getOptimisticResult(l),f=!r&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(k=>{const h=f?d.subscribe(Ve.batchCalls(k)):gt;return d.updateResult(),h},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(l)},[l,d]),c2(l,x))throw nf(l,d,a);if(i2({result:x,errorResetBoundary:a,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw x.error;if((j=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||j.call(y,l,x),l.experimental_prefetchInRender&&!Gi.isServer()&&o2(x,r)){const k=c?nf(l,d,a):o==null?void 0:o.promise;k==null||k.catch(gt).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?x:d.trackResult(x)}function ke(e,t){return d2(e,qj)}function Y(e,t){const s=ie(),[r]=m.useState(()=>new Yj(s,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);const a=m.useSyncExternalStore(m.useCallback(l=>r.subscribe(Ve.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=m.useCallback((l,o)=>{r.mutate(l,o).catch(gt)},[r]);if(a.error&&im(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}let u2={data:""},x2=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||u2},m2=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,h2=/\/\*[^]*?\*\/| +/g,sf=/\n+/g,fs=(e,t)=>{let s="",r="",a="";for(let i in e){let l=e[i];i[0]=="@"?i[1]=="i"?s=i+" "+l+";":r+=i[1]=="f"?fs(l,i):i+"{"+fs(l,i[1]=="k"?"":t)+"}":typeof l=="object"?r+=fs(l,t?t.replace(/([^,])+/g,o=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,o):o?o+" "+c:c)):i):l!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=fs.p?fs.p(i,l):i+":"+l+";")}return s+(t&&a?t+"{"+a+"}":a)+r},Dn={},kg=e=>{if(typeof e=="object"){let t="";for(let s in e)t+=s+kg(e[s]);return t}return e},f2=(e,t,s,r,a)=>{let i=kg(e),l=Dn[i]||(Dn[i]=(c=>{let d=0,x=11;for(;d<c.length;)x=101*x+c.charCodeAt(d++)>>>0;return"go"+x})(i));if(!Dn[l]){let c=i!==e?e:(d=>{let x,f,g=[{}];for(;x=m2.exec(d.replace(h2,""));)x[4]?g.shift():x[3]?(f=x[3].replace(sf," ").trim(),g.unshift(g[0][f]=g[0][f]||{})):g[0][x[1]]=x[2].replace(sf," ").trim();return g[0]})(e);Dn[l]=fs(a?{["@keyframes "+l]:c}:c,s?"":"."+l)}let o=s&&Dn.g?Dn.g:null;return s&&(Dn.g=Dn[l]),((c,d,x,f)=>{f?d.data=d.data.replace(f,c):d.data.indexOf(c)===-1&&(d.data=x?c+d.data:d.data+c)})(Dn[l],t,r,o),l},p2=(e,t,s)=>e.reduce((r,a,i)=>{let l=t[i];if(l&&l.call){let o=l(s),c=o&&o.props&&o.props.className||/^go/.test(o)&&o;l=c?"."+c:o&&typeof o=="object"?o.props?"":fs(o,""):o===!1?"":o}return r+a+(l??"")},"");function gc(e){let t=this||{},s=e.call?e(t.p):e;return f2(s.unshift?s.raw?p2(s,[].slice.call(arguments,1),t.p):s.reduce((r,a)=>Object.assign(r,a&&a.call?a(t.p):a),{}):s,x2(t.target),t.g,t.o,t.k)}let Sg,Bu,Hu;gc.bind({g:1});let Xn=gc.bind({k:1});function g2(e,t,s,r){fs.p=t,Sg=e,Bu=s,Hu=r}function Vs(e,t){let s=this||{};return function(){let r=arguments;function a(i,l){let o=Object.assign({},i),c=o.className||a.className;s.p=Object.assign({theme:Bu&&Bu()},o),s.o=/ *go\d+/.test(c),o.className=gc.apply(s,r)+(c?" "+c:"");let d=e;return e[0]&&(d=o.as||e,delete o.as),Hu&&d[0]&&Hu(o),Sg(d,o)}return a}}var y2=e=>typeof e=="function",$o=(e,t)=>y2(e)?e(t):e,b2=(()=>{let e=0;return()=>(++e).toString()})(),Cg=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),v2=20,om="default",Eg=(e,t)=>{let{toastLimit:s}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,s)};case 1:return{...e,toasts:e.toasts.map(l=>l.id===t.toast.id?{...l,...t.toast}:l)};case 2:let{toast:r}=t;return Eg(e,{type:e.toasts.find(l=>l.id===r.id)?1:0,toast:r});case 3:let{toastId:a}=t;return{...e,toasts:e.toasts.map(l=>l.id===a||a===void 0?{...l,dismissed:!0,visible:!1}:l)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(l=>l.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(l=>({...l,pauseDuration:l.pauseDuration+i}))}}},oo=[],Pg={toasts:[],pausedAt:void 0,settings:{toastLimit:v2}},wn={},zg=(e,t=om)=>{wn[t]=Eg(wn[t]||Pg,e),oo.forEach(([s,r])=>{s===t&&r(wn[t])})},Mg=e=>Object.keys(wn).forEach(t=>zg(e,t)),j2=e=>Object.keys(wn).find(t=>wn[t].toasts.some(s=>s.id===e)),yc=(e=om)=>t=>{zg(t,e)},N2={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},w2=(e={},t=om)=>{let[s,r]=m.useState(wn[t]||Pg),a=m.useRef(wn[t]);m.useEffect(()=>(a.current!==wn[t]&&r(wn[t]),oo.push([t,r]),()=>{let l=oo.findIndex(([o])=>o===t);l>-1&&oo.splice(l,1)}),[t]);let i=s.toasts.map(l=>{var o,c,d;return{...e,...e[l.type],...l,removeDelay:l.removeDelay||((o=e[l.type])==null?void 0:o.removeDelay)||(e==null?void 0:e.removeDelay),duration:l.duration||((c=e[l.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||N2[l.type],style:{...e.style,...(d=e[l.type])==null?void 0:d.style,...l.style}}});return{...s,toasts:i}},k2=(e,t="blank",s)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...s,id:(s==null?void 0:s.id)||b2()}),fl=e=>(t,s)=>{let r=k2(t,e,s);return yc(r.toasterId||j2(r.id))({type:2,toast:r}),r.id},Qe=(e,t)=>fl("blank")(e,t);Qe.error=fl("error");Qe.success=fl("success");Qe.loading=fl("loading");Qe.custom=fl("custom");Qe.dismiss=(e,t)=>{let s={type:3,toastId:e};t?yc(t)(s):Mg(s)};Qe.dismissAll=e=>Qe.dismiss(void 0,e);Qe.remove=(e,t)=>{let s={type:4,toastId:e};t?yc(t)(s):Mg(s)};Qe.removeAll=e=>Qe.remove(void 0,e);Qe.promise=(e,t,s)=>{let r=Qe.loading(t.loading,{...s,...s==null?void 0:s.loading});return typeof e=="function"&&(e=e()),e.then(a=>{let i=t.success?$o(t.success,a):void 0;return i?Qe.success(i,{id:r,...s,...s==null?void 0:s.success}):Qe.dismiss(r),a}).catch(a=>{let i=t.error?$o(t.error,a):void 0;i?Qe.error(i,{id:r,...s,...s==null?void 0:s.error}):Qe.dismiss(r)}),e};var S2=1e3,C2=(e,t="default")=>{let{toasts:s,pausedAt:r}=w2(e,t),a=m.useRef(new Map).current,i=m.useCallback((f,g=S2)=>{if(a.has(f))return;let b=setTimeout(()=>{a.delete(f),l({type:4,toastId:f})},g);a.set(f,b)},[]);m.useEffect(()=>{if(r)return;let f=Date.now(),g=s.map(b=>{if(b.duration===1/0)return;let y=(b.duration||0)+b.pauseDuration-(f-b.createdAt);if(y<0){b.visible&&Qe.dismiss(b.id);return}return setTimeout(()=>Qe.dismiss(b.id,t),y)});return()=>{g.forEach(b=>b&&clearTimeout(b))}},[s,r,t]);let l=m.useCallback(yc(t),[t]),o=m.useCallback(()=>{l({type:5,time:Date.now()})},[l]),c=m.useCallback((f,g)=>{l({type:1,toast:{id:f,height:g}})},[l]),d=m.useCallback(()=>{r&&l({type:6,time:Date.now()})},[r,l]),x=m.useCallback((f,g)=>{let{reverseOrder:b=!1,gutter:y=8,defaultPosition:j}=g||{},k=s.filter(p=>(p.position||j)===(f.position||j)&&p.height),h=k.findIndex(p=>p.id===f.id),u=k.filter((p,v)=>v<h&&p.visible).length;return k.filter(p=>p.visible).slice(...b?[u+1]:[0,u]).reduce((p,v)=>p+(v.height||0)+y,0)},[s]);return m.useEffect(()=>{s.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let g=a.get(f.id);g&&(clearTimeout(g),a.delete(f.id))}})},[s,i]),{toasts:s,handlers:{updateHeight:c,startPause:o,endPause:d,calculateOffset:x}}},E2=Xn`
|
|
68
|
+
from {
|
|
69
|
+
transform: scale(0) rotate(45deg);
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
to {
|
|
73
|
+
transform: scale(1) rotate(45deg);
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}`,P2=Xn`
|
|
76
|
+
from {
|
|
77
|
+
transform: scale(0);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
transform: scale(1);
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}`,z2=Xn`
|
|
84
|
+
from {
|
|
85
|
+
transform: scale(0) rotate(90deg);
|
|
86
|
+
opacity: 0;
|
|
87
|
+
}
|
|
88
|
+
to {
|
|
89
|
+
transform: scale(1) rotate(90deg);
|
|
90
|
+
opacity: 1;
|
|
91
|
+
}`,M2=Vs("div")`
|
|
92
|
+
width: 20px;
|
|
93
|
+
opacity: 0;
|
|
94
|
+
height: 20px;
|
|
95
|
+
border-radius: 10px;
|
|
96
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
97
|
+
position: relative;
|
|
98
|
+
transform: rotate(45deg);
|
|
99
|
+
|
|
100
|
+
animation: ${E2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
101
|
+
forwards;
|
|
102
|
+
animation-delay: 100ms;
|
|
103
|
+
|
|
104
|
+
&:after,
|
|
105
|
+
&:before {
|
|
106
|
+
content: '';
|
|
107
|
+
animation: ${P2} 0.15s ease-out forwards;
|
|
108
|
+
animation-delay: 150ms;
|
|
109
|
+
position: absolute;
|
|
110
|
+
border-radius: 3px;
|
|
111
|
+
opacity: 0;
|
|
112
|
+
background: ${e=>e.secondary||"#fff"};
|
|
113
|
+
bottom: 9px;
|
|
114
|
+
left: 4px;
|
|
115
|
+
height: 2px;
|
|
116
|
+
width: 12px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&:before {
|
|
120
|
+
animation: ${z2} 0.15s ease-out forwards;
|
|
121
|
+
animation-delay: 180ms;
|
|
122
|
+
transform: rotate(90deg);
|
|
123
|
+
}
|
|
124
|
+
`,T2=Xn`
|
|
125
|
+
from {
|
|
126
|
+
transform: rotate(0deg);
|
|
127
|
+
}
|
|
128
|
+
to {
|
|
129
|
+
transform: rotate(360deg);
|
|
130
|
+
}
|
|
131
|
+
`,R2=Vs("div")`
|
|
132
|
+
width: 12px;
|
|
133
|
+
height: 12px;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
border: 2px solid;
|
|
136
|
+
border-radius: 100%;
|
|
137
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
138
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
139
|
+
animation: ${T2} 1s linear infinite;
|
|
140
|
+
`,O2=Xn`
|
|
141
|
+
from {
|
|
142
|
+
transform: scale(0) rotate(45deg);
|
|
143
|
+
opacity: 0;
|
|
144
|
+
}
|
|
145
|
+
to {
|
|
146
|
+
transform: scale(1) rotate(45deg);
|
|
147
|
+
opacity: 1;
|
|
148
|
+
}`,D2=Xn`
|
|
149
|
+
0% {
|
|
150
|
+
height: 0;
|
|
151
|
+
width: 0;
|
|
152
|
+
opacity: 0;
|
|
153
|
+
}
|
|
154
|
+
40% {
|
|
155
|
+
height: 0;
|
|
156
|
+
width: 6px;
|
|
157
|
+
opacity: 1;
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
height: 10px;
|
|
162
|
+
}`,A2=Vs("div")`
|
|
163
|
+
width: 20px;
|
|
164
|
+
opacity: 0;
|
|
165
|
+
height: 20px;
|
|
166
|
+
border-radius: 10px;
|
|
167
|
+
background: ${e=>e.primary||"#61d345"};
|
|
168
|
+
position: relative;
|
|
169
|
+
transform: rotate(45deg);
|
|
170
|
+
|
|
171
|
+
animation: ${O2} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
172
|
+
forwards;
|
|
173
|
+
animation-delay: 100ms;
|
|
174
|
+
&:after {
|
|
175
|
+
content: '';
|
|
176
|
+
box-sizing: border-box;
|
|
177
|
+
animation: ${D2} 0.2s ease-out forwards;
|
|
178
|
+
opacity: 0;
|
|
179
|
+
animation-delay: 200ms;
|
|
180
|
+
position: absolute;
|
|
181
|
+
border-right: 2px solid;
|
|
182
|
+
border-bottom: 2px solid;
|
|
183
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
184
|
+
bottom: 6px;
|
|
185
|
+
left: 6px;
|
|
186
|
+
height: 10px;
|
|
187
|
+
width: 6px;
|
|
188
|
+
}
|
|
189
|
+
`,L2=Vs("div")`
|
|
190
|
+
position: absolute;
|
|
191
|
+
`,I2=Vs("div")`
|
|
192
|
+
position: relative;
|
|
193
|
+
display: flex;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
align-items: center;
|
|
196
|
+
min-width: 20px;
|
|
197
|
+
min-height: 20px;
|
|
198
|
+
`,F2=Xn`
|
|
199
|
+
from {
|
|
200
|
+
transform: scale(0.6);
|
|
201
|
+
opacity: 0.4;
|
|
202
|
+
}
|
|
203
|
+
to {
|
|
204
|
+
transform: scale(1);
|
|
205
|
+
opacity: 1;
|
|
206
|
+
}`,_2=Vs("div")`
|
|
207
|
+
position: relative;
|
|
208
|
+
transform: scale(0.6);
|
|
209
|
+
opacity: 0.4;
|
|
210
|
+
min-width: 20px;
|
|
211
|
+
animation: ${F2} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
212
|
+
forwards;
|
|
213
|
+
`,$2=({toast:e})=>{let{icon:t,type:s,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(_2,null,t):t:s==="blank"?null:m.createElement(I2,null,m.createElement(R2,{...r}),s!=="loading"&&m.createElement(L2,null,s==="error"?m.createElement(M2,{...r}):m.createElement(A2,{...r})))},U2=e=>`
|
|
214
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
215
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
216
|
+
`,B2=e=>`
|
|
217
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
218
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
219
|
+
`,H2="0%{opacity:0;} 100%{opacity:1;}",q2="0%{opacity:1;} 100%{opacity:0;}",K2=Vs("div")`
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
background: #fff;
|
|
223
|
+
color: #363636;
|
|
224
|
+
line-height: 1.3;
|
|
225
|
+
will-change: transform;
|
|
226
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
227
|
+
max-width: 350px;
|
|
228
|
+
pointer-events: auto;
|
|
229
|
+
padding: 8px 10px;
|
|
230
|
+
border-radius: 8px;
|
|
231
|
+
`,W2=Vs("div")`
|
|
232
|
+
display: flex;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
margin: 4px 10px;
|
|
235
|
+
color: inherit;
|
|
236
|
+
flex: 1 1 auto;
|
|
237
|
+
white-space: pre-line;
|
|
238
|
+
`,V2=(e,t)=>{let s=e.includes("top")?1:-1,[r,a]=Cg()?[H2,q2]:[U2(s),B2(s)];return{animation:t?`${Xn(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Xn(a)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Q2=m.memo(({toast:e,position:t,style:s,children:r})=>{let a=e.height?V2(e.position||t||"top-center",e.visible):{opacity:0},i=m.createElement($2,{toast:e}),l=m.createElement(W2,{...e.ariaProps},$o(e.message,e));return m.createElement(K2,{className:e.className,style:{...a,...s,...e.style}},typeof r=="function"?r({icon:i,message:l}):m.createElement(m.Fragment,null,i,l))});g2(m.createElement);var G2=({id:e,className:t,style:s,onHeightUpdate:r,children:a})=>{let i=m.useCallback(l=>{if(l){let o=()=>{let c=l.getBoundingClientRect().height;r(e,c)};o(),new MutationObserver(o).observe(l,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:i,className:t,style:s},a)},Y2=(e,t)=>{let s=e.includes("top"),r=s?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Cg()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(s?1:-1)}px)`,...r,...a}},J2=gc`
|
|
239
|
+
z-index: 9999;
|
|
240
|
+
> * {
|
|
241
|
+
pointer-events: auto;
|
|
242
|
+
}
|
|
243
|
+
`,$l=16,X2=({reverseOrder:e,position:t="top-center",toastOptions:s,gutter:r,children:a,toasterId:i,containerStyle:l,containerClassName:o})=>{let{toasts:c,handlers:d}=C2(s,i);return m.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:$l,left:$l,right:$l,bottom:$l,pointerEvents:"none",...l},className:o,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(x=>{let f=x.position||t,g=d.calculateOffset(x,{reverseOrder:e,gutter:r,defaultPosition:t}),b=Y2(f,g);return m.createElement(G2,{id:x.id,key:x.id,onHeightUpdate:d.updateHeight,className:x.visible?J2:"",style:b},x.type==="custom"?$o(x.message,x):a?a(x):m.createElement(Q2,{toast:x,position:f}))}))},O=Qe;/**
|
|
244
|
+
* @license lucide-react v0.451.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const Z2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tg=(...e)=>e.filter((t,s,r)=>!!t&&r.indexOf(t)===s).join(" ");/**
|
|
249
|
+
* @license lucide-react v0.451.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/var eN={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"};/**
|
|
254
|
+
* @license lucide-react v0.451.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const tN=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:l,...o},c)=>m.createElement("svg",{ref:c,...eN,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:Tg("lucide",a),...o},[...l.map(([d,x])=>m.createElement(d,x)),...Array.isArray(i)?i:[i]]));/**
|
|
259
|
+
* @license lucide-react v0.451.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const L=(e,t)=>{const s=m.forwardRef(({className:r,...a},i)=>m.createElement(tN,{ref:i,iconNode:t,className:Tg(`lucide-${Z2(e)}`,r),...a}));return s.displayName=`${e}`,s};/**
|
|
264
|
+
* @license lucide-react v0.451.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const qu=L("Accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]);/**
|
|
269
|
+
* @license lucide-react v0.451.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const nN=L("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
274
|
+
* @license lucide-react v0.451.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const Rg=L("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
|
|
279
|
+
* @license lucide-react v0.451.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const ir=L("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
284
|
+
* @license lucide-react v0.451.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const Og=L("ArrowUpFromLine",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
289
|
+
* @license lucide-react v0.451.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const sN=L("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
294
|
+
* @license lucide-react v0.451.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const Ku=L("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
299
|
+
* @license lucide-react v0.451.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const Yi=L("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
304
|
+
* @license lucide-react v0.451.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const rN=L("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"}]]);/**
|
|
309
|
+
* @license lucide-react v0.451.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const aN=L("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
314
|
+
* @license lucide-react v0.451.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const Er=L("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
|
|
319
|
+
* @license lucide-react v0.451.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const iN=L("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
324
|
+
* @license lucide-react v0.451.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const Cn=L("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
329
|
+
* @license lucide-react v0.451.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const Dg=L("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
|
|
334
|
+
* @license lucide-react v0.451.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const He=L("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
339
|
+
* @license lucide-react v0.451.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const Tt=L("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
344
|
+
* @license lucide-react v0.451.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const lN=L("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
349
|
+
* @license lucide-react v0.451.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const Zt=L("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
354
|
+
* @license lucide-react v0.451.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const oN=L("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
359
|
+
* @license lucide-react v0.451.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const Ue=L("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
364
|
+
* @license lucide-react v0.451.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const cN=L("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
|
|
369
|
+
* @license lucide-react v0.451.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const dN=L("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
|
|
374
|
+
* @license lucide-react v0.451.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const uN=L("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
379
|
+
* @license lucide-react v0.451.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const ut=L("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"}]]);/**
|
|
384
|
+
* @license lucide-react v0.451.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const Or=L("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
389
|
+
* @license lucide-react v0.451.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const ad=L("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
|
|
394
|
+
* @license lucide-react v0.451.0 - ISC
|
|
395
|
+
*
|
|
396
|
+
* This source code is licensed under the ISC license.
|
|
397
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
+
*/const Ag=L("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
399
|
+
* @license lucide-react v0.451.0 - ISC
|
|
400
|
+
*
|
|
401
|
+
* This source code is licensed under the ISC license.
|
|
402
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
+
*/const cm=L("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"}]]);/**
|
|
404
|
+
* @license lucide-react v0.451.0 - ISC
|
|
405
|
+
*
|
|
406
|
+
* This source code is licensed under the ISC license.
|
|
407
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
+
*/const xN=L("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
409
|
+
* @license lucide-react v0.451.0 - ISC
|
|
410
|
+
*
|
|
411
|
+
* This source code is licensed under the ISC license.
|
|
412
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
+
*/const Lg=L("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"}]]);/**
|
|
414
|
+
* @license lucide-react v0.451.0 - ISC
|
|
415
|
+
*
|
|
416
|
+
* This source code is licensed under the ISC license.
|
|
417
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
+
*/const bc=L("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
419
|
+
* @license lucide-react v0.451.0 - ISC
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the ISC license.
|
|
422
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/const Ka=L("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
424
|
+
* @license lucide-react v0.451.0 - ISC
|
|
425
|
+
*
|
|
426
|
+
* This source code is licensed under the ISC license.
|
|
427
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
+
*/const mN=L("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
429
|
+
* @license lucide-react v0.451.0 - ISC
|
|
430
|
+
*
|
|
431
|
+
* This source code is licensed under the ISC license.
|
|
432
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
+
*/const Ig=L("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"}]]);/**
|
|
434
|
+
* @license lucide-react v0.451.0 - ISC
|
|
435
|
+
*
|
|
436
|
+
* This source code is licensed under the ISC license.
|
|
437
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
+
*/const Fg=L("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
|
|
439
|
+
* @license lucide-react v0.451.0 - ISC
|
|
440
|
+
*
|
|
441
|
+
* This source code is licensed under the ISC license.
|
|
442
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
443
|
+
*/const _g=L("FileMinus",[["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:"M9 15h6",key:"cctwl0"}]]);/**
|
|
444
|
+
* @license lucide-react v0.451.0 - ISC
|
|
445
|
+
*
|
|
446
|
+
* This source code is licensed under the ISC license.
|
|
447
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
448
|
+
*/const $g=L("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
|
|
449
|
+
* @license lucide-react v0.451.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/const Ug=L("FilePlus",[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
454
|
+
* @license lucide-react v0.451.0 - ISC
|
|
455
|
+
*
|
|
456
|
+
* This source code is licensed under the ISC license.
|
|
457
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
458
|
+
*/const Bg=L("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/**
|
|
459
|
+
* @license lucide-react v0.451.0 - ISC
|
|
460
|
+
*
|
|
461
|
+
* This source code is licensed under the ISC license.
|
|
462
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
463
|
+
*/const mn=L("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"}]]);/**
|
|
464
|
+
* @license lucide-react v0.451.0 - ISC
|
|
465
|
+
*
|
|
466
|
+
* This source code is licensed under the ISC license.
|
|
467
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
468
|
+
*/const Hg=L("FileWarning",[["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:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
469
|
+
* @license lucide-react v0.451.0 - ISC
|
|
470
|
+
*
|
|
471
|
+
* This source code is licensed under the ISC license.
|
|
472
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
473
|
+
*/const qg=L("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
474
|
+
* @license lucide-react v0.451.0 - ISC
|
|
475
|
+
*
|
|
476
|
+
* This source code is licensed under the ISC license.
|
|
477
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
478
|
+
*/const Ji=L("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
479
|
+
* @license lucide-react v0.451.0 - ISC
|
|
480
|
+
*
|
|
481
|
+
* This source code is licensed under the ISC license.
|
|
482
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
483
|
+
*/const Kg=L("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
484
|
+
* @license lucide-react v0.451.0 - ISC
|
|
485
|
+
*
|
|
486
|
+
* This source code is licensed under the ISC license.
|
|
487
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
488
|
+
*/const hN=L("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
489
|
+
* @license lucide-react v0.451.0 - ISC
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the ISC license.
|
|
492
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/const Pr=L("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
494
|
+
* @license lucide-react v0.451.0 - ISC
|
|
495
|
+
*
|
|
496
|
+
* This source code is licensed under the ISC license.
|
|
497
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
498
|
+
*/const pa=L("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/**
|
|
499
|
+
* @license lucide-react v0.451.0 - ISC
|
|
500
|
+
*
|
|
501
|
+
* This source code is licensed under the ISC license.
|
|
502
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
503
|
+
*/const zr=L("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
504
|
+
* @license lucide-react v0.451.0 - ISC
|
|
505
|
+
*
|
|
506
|
+
* This source code is licensed under the ISC license.
|
|
507
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
508
|
+
*/const fN=L("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
509
|
+
* @license lucide-react v0.451.0 - ISC
|
|
510
|
+
*
|
|
511
|
+
* This source code is licensed under the ISC license.
|
|
512
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
513
|
+
*/const vc=L("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
514
|
+
* @license lucide-react v0.451.0 - ISC
|
|
515
|
+
*
|
|
516
|
+
* This source code is licensed under the ISC license.
|
|
517
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
518
|
+
*/const Wg=L("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"}]]);/**
|
|
519
|
+
* @license lucide-react v0.451.0 - ISC
|
|
520
|
+
*
|
|
521
|
+
* This source code is licensed under the ISC license.
|
|
522
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
523
|
+
*/const Uo=L("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/**
|
|
524
|
+
* @license lucide-react v0.451.0 - ISC
|
|
525
|
+
*
|
|
526
|
+
* This source code is licensed under the ISC license.
|
|
527
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
528
|
+
*/const rf=L("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
529
|
+
* @license lucide-react v0.451.0 - ISC
|
|
530
|
+
*
|
|
531
|
+
* This source code is licensed under the ISC license.
|
|
532
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
533
|
+
*/const af=L("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
534
|
+
* @license lucide-react v0.451.0 - ISC
|
|
535
|
+
*
|
|
536
|
+
* This source code is licensed under the ISC license.
|
|
537
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
538
|
+
*/const pl=L("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
539
|
+
* @license lucide-react v0.451.0 - ISC
|
|
540
|
+
*
|
|
541
|
+
* This source code is licensed under the ISC license.
|
|
542
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
543
|
+
*/const pN=L("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
544
|
+
* @license lucide-react v0.451.0 - ISC
|
|
545
|
+
*
|
|
546
|
+
* This source code is licensed under the ISC license.
|
|
547
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
548
|
+
*/const gN=L("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
549
|
+
* @license lucide-react v0.451.0 - ISC
|
|
550
|
+
*
|
|
551
|
+
* This source code is licensed under the ISC license.
|
|
552
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
553
|
+
*/const Bo=L("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
554
|
+
* @license lucide-react v0.451.0 - ISC
|
|
555
|
+
*
|
|
556
|
+
* This source code is licensed under the ISC license.
|
|
557
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
558
|
+
*/const yN=L("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
559
|
+
* @license lucide-react v0.451.0 - ISC
|
|
560
|
+
*
|
|
561
|
+
* This source code is licensed under the ISC license.
|
|
562
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
563
|
+
*/const ce=L("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
564
|
+
* @license lucide-react v0.451.0 - ISC
|
|
565
|
+
*
|
|
566
|
+
* This source code is licensed under the ISC license.
|
|
567
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
568
|
+
*/const id=L("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
569
|
+
* @license lucide-react v0.451.0 - ISC
|
|
570
|
+
*
|
|
571
|
+
* This source code is licensed under the ISC license.
|
|
572
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
573
|
+
*/const dm=L("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
574
|
+
* @license lucide-react v0.451.0 - ISC
|
|
575
|
+
*
|
|
576
|
+
* This source code is licensed under the ISC license.
|
|
577
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
578
|
+
*/const bN=L("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
579
|
+
* @license lucide-react v0.451.0 - ISC
|
|
580
|
+
*
|
|
581
|
+
* This source code is licensed under the ISC license.
|
|
582
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
583
|
+
*/const vN=L("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
584
|
+
* @license lucide-react v0.451.0 - ISC
|
|
585
|
+
*
|
|
586
|
+
* This source code is licensed under the ISC license.
|
|
587
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
588
|
+
*/const Vg=L("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
589
|
+
* @license lucide-react v0.451.0 - ISC
|
|
590
|
+
*
|
|
591
|
+
* This source code is licensed under the ISC license.
|
|
592
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
593
|
+
*/const oa=L("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
594
|
+
* @license lucide-react v0.451.0 - ISC
|
|
595
|
+
*
|
|
596
|
+
* This source code is licensed under the ISC license.
|
|
597
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
598
|
+
*/const jN=L("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
599
|
+
* @license lucide-react v0.451.0 - ISC
|
|
600
|
+
*
|
|
601
|
+
* This source code is licensed under the ISC license.
|
|
602
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
603
|
+
*/const NN=L("MoveRight",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);/**
|
|
604
|
+
* @license lucide-react v0.451.0 - ISC
|
|
605
|
+
*
|
|
606
|
+
* This source code is licensed under the ISC license.
|
|
607
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
608
|
+
*/const Dr=L("Pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
609
|
+
* @license lucide-react v0.451.0 - ISC
|
|
610
|
+
*
|
|
611
|
+
* This source code is licensed under the ISC license.
|
|
612
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
613
|
+
*/const Rt=L("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
614
|
+
* @license lucide-react v0.451.0 - ISC
|
|
615
|
+
*
|
|
616
|
+
* This source code is licensed under the ISC license.
|
|
617
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
618
|
+
*/const wN=L("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
619
|
+
* @license lucide-react v0.451.0 - ISC
|
|
620
|
+
*
|
|
621
|
+
* This source code is licensed under the ISC license.
|
|
622
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
623
|
+
*/const En=L("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
624
|
+
* @license lucide-react v0.451.0 - ISC
|
|
625
|
+
*
|
|
626
|
+
* This source code is licensed under the ISC license.
|
|
627
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
628
|
+
*/const um=L("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
629
|
+
* @license lucide-react v0.451.0 - ISC
|
|
630
|
+
*
|
|
631
|
+
* This source code is licensed under the ISC license.
|
|
632
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
633
|
+
*/const Qg=L("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
634
|
+
* @license lucide-react v0.451.0 - ISC
|
|
635
|
+
*
|
|
636
|
+
* This source code is licensed under the ISC license.
|
|
637
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
638
|
+
*/const jc=L("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
639
|
+
* @license lucide-react v0.451.0 - ISC
|
|
640
|
+
*
|
|
641
|
+
* This source code is licensed under the ISC license.
|
|
642
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
643
|
+
*/const Gg=L("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"}]]);/**
|
|
644
|
+
* @license lucide-react v0.451.0 - ISC
|
|
645
|
+
*
|
|
646
|
+
* This source code is licensed under the ISC license.
|
|
647
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
648
|
+
*/const Yg=L("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
|
|
649
|
+
* @license lucide-react v0.451.0 - ISC
|
|
650
|
+
*
|
|
651
|
+
* This source code is licensed under the ISC license.
|
|
652
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
653
|
+
*/const Mr=L("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
654
|
+
* @license lucide-react v0.451.0 - ISC
|
|
655
|
+
*
|
|
656
|
+
* This source code is licensed under the ISC license.
|
|
657
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
658
|
+
*/const kN=L("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"}]]);/**
|
|
659
|
+
* @license lucide-react v0.451.0 - ISC
|
|
660
|
+
*
|
|
661
|
+
* This source code is licensed under the ISC license.
|
|
662
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
663
|
+
*/const Ia=L("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
664
|
+
* @license lucide-react v0.451.0 - ISC
|
|
665
|
+
*
|
|
666
|
+
* This source code is licensed under the ISC license.
|
|
667
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
668
|
+
*/const Ho=L("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"}]]);/**
|
|
669
|
+
* @license lucide-react v0.451.0 - ISC
|
|
670
|
+
*
|
|
671
|
+
* This source code is licensed under the ISC license.
|
|
672
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
673
|
+
*/const xm=L("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
674
|
+
* @license lucide-react v0.451.0 - ISC
|
|
675
|
+
*
|
|
676
|
+
* This source code is licensed under the ISC license.
|
|
677
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
678
|
+
*/const SN=L("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
679
|
+
* @license lucide-react v0.451.0 - ISC
|
|
680
|
+
*
|
|
681
|
+
* This source code is licensed under the ISC license.
|
|
682
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
683
|
+
*/const Nc=L("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
684
|
+
* @license lucide-react v0.451.0 - ISC
|
|
685
|
+
*
|
|
686
|
+
* This source code is licensed under the ISC license.
|
|
687
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
688
|
+
*/const CN=L("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
689
|
+
* @license lucide-react v0.451.0 - ISC
|
|
690
|
+
*
|
|
691
|
+
* This source code is licensed under the ISC license.
|
|
692
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
693
|
+
*/const gi=L("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
694
|
+
* @license lucide-react v0.451.0 - ISC
|
|
695
|
+
*
|
|
696
|
+
* This source code is licensed under the ISC license.
|
|
697
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
698
|
+
*/const Ot=L("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
699
|
+
* @license lucide-react v0.451.0 - ISC
|
|
700
|
+
*
|
|
701
|
+
* This source code is licensed under the ISC license.
|
|
702
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
703
|
+
*/const EN=L("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
704
|
+
* @license lucide-react v0.451.0 - ISC
|
|
705
|
+
*
|
|
706
|
+
* This source code is licensed under the ISC license.
|
|
707
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
708
|
+
*/const PN=L("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
709
|
+
* @license lucide-react v0.451.0 - ISC
|
|
710
|
+
*
|
|
711
|
+
* This source code is licensed under the ISC license.
|
|
712
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
713
|
+
*/const co=L("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
|
|
714
|
+
* @license lucide-react v0.451.0 - ISC
|
|
715
|
+
*
|
|
716
|
+
* This source code is licensed under the ISC license.
|
|
717
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
718
|
+
*/const Jg=L("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
|
719
|
+
* @license lucide-react v0.451.0 - ISC
|
|
720
|
+
*
|
|
721
|
+
* This source code is licensed under the ISC license.
|
|
722
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
723
|
+
*/const wc=L("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
724
|
+
* @license lucide-react v0.451.0 - ISC
|
|
725
|
+
*
|
|
726
|
+
* This source code is licensed under the ISC license.
|
|
727
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
728
|
+
*/const lf=L("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
729
|
+
* @license lucide-react v0.451.0 - ISC
|
|
730
|
+
*
|
|
731
|
+
* This source code is licensed under the ISC license.
|
|
732
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
733
|
+
*/const fn=L("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"}]]);/**
|
|
734
|
+
* @license lucide-react v0.451.0 - ISC
|
|
735
|
+
*
|
|
736
|
+
* This source code is licensed under the ISC license.
|
|
737
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
738
|
+
*/const zN=L("Trash",[["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"}]]);/**
|
|
739
|
+
* @license lucide-react v0.451.0 - ISC
|
|
740
|
+
*
|
|
741
|
+
* This source code is licensed under the ISC license.
|
|
742
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
743
|
+
*/const MN=L("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
744
|
+
* @license lucide-react v0.451.0 - ISC
|
|
745
|
+
*
|
|
746
|
+
* This source code is licensed under the ISC license.
|
|
747
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
748
|
+
*/const Yt=L("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
749
|
+
* @license lucide-react v0.451.0 - ISC
|
|
750
|
+
*
|
|
751
|
+
* This source code is licensed under the ISC license.
|
|
752
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
753
|
+
*/const mm=L("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
754
|
+
* @license lucide-react v0.451.0 - ISC
|
|
755
|
+
*
|
|
756
|
+
* This source code is licensed under the ISC license.
|
|
757
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
758
|
+
*/const Xg=L("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
759
|
+
* @license lucide-react v0.451.0 - ISC
|
|
760
|
+
*
|
|
761
|
+
* This source code is licensed under the ISC license.
|
|
762
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
763
|
+
*/const kc=L("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
|
|
764
|
+
* @license lucide-react v0.451.0 - ISC
|
|
765
|
+
*
|
|
766
|
+
* This source code is licensed under the ISC license.
|
|
767
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
768
|
+
*/const Fa=L("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
769
|
+
* @license lucide-react v0.451.0 - ISC
|
|
770
|
+
*
|
|
771
|
+
* This source code is licensed under the ISC license.
|
|
772
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
773
|
+
*/const Se=L("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
774
|
+
* @license lucide-react v0.451.0 - ISC
|
|
775
|
+
*
|
|
776
|
+
* This source code is licensed under the ISC license.
|
|
777
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
778
|
+
*/const Be=L("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"}]]);function Zg(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(s=Zg(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function C(){for(var e,t,s=0,r="",a=arguments.length;s<a;s++)(e=arguments[s])&&(t=Zg(e))&&(r&&(r+=" "),r+=t);return r}function ey({size:e=40}){const t=`am-bg-${e}`;return n.jsxs("svg",{viewBox:"0 0 40 40",width:e,height:e,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"40",y2:"40",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"#312e81"})," ",n.jsx("stop",{offset:"0.50",stopColor:"#6366f1"})," ",n.jsx("stop",{offset:"1",stopColor:"#7c3aed"})," "]})}),n.jsx("rect",{width:"40",height:"40",rx:"9",fill:`url(#${t})`}),n.jsx("rect",{x:"3",y:"1.5",width:"34",height:"9",rx:"4.5",fill:"white",fillOpacity:"0.07"}),n.jsx("line",{x1:"5.5",y1:"34",x2:"20",y2:"12",stroke:"white",strokeWidth:"4.5",strokeLinecap:"round",strokeOpacity:"0.93"}),n.jsx("line",{x1:"34.5",y1:"34",x2:"20",y2:"12",stroke:"white",strokeWidth:"4.5",strokeLinecap:"round",strokeOpacity:"0.93"}),n.jsx("line",{x1:"12.5",y1:"24",x2:"27.5",y2:"24",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeOpacity:"0.93"}),n.jsx("line",{x1:"20",y1:"11",x2:"20",y2:"5.5",stroke:"white",strokeWidth:"2.0",strokeLinecap:"round",strokeOpacity:"0.82"}),n.jsx("line",{x1:"20",y1:"11",x2:"15.8",y2:"7.2",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round",strokeOpacity:"0.68"}),n.jsx("line",{x1:"20",y1:"11",x2:"24.2",y2:"7.2",stroke:"white",strokeWidth:"1.6",strokeLinecap:"round",strokeOpacity:"0.68"}),n.jsx("circle",{cx:"20",cy:"11",r:"4.5",fill:"white",fillOpacity:"0.10"}),n.jsx("circle",{cx:"20",cy:"11",r:"3.0",fill:"white",fillOpacity:"0.28"}),n.jsx("circle",{cx:"20",cy:"11",r:"1.8",fill:"white",fillOpacity:"0.96"})]})}function TN(){return n.jsxs("div",{className:"flex items-center gap-3 select-none min-w-0",children:[n.jsx(ey,{size:46}),n.jsxs("div",{className:"flex flex-col justify-center leading-none min-w-0",children:[n.jsx("span",{className:"text-[20px] font-bold text-white truncate",style:{letterSpacing:"-0.03em"},children:"Assuremind"}),n.jsx("span",{className:"text-[9.5px] font-semibold text-slate-300 uppercase mt-1",style:{letterSpacing:"0.18em"},children:"Studio"})]})]})}function RN(){return n.jsxs("div",{className:"flex flex-col items-center gap-1.5 select-none",children:[n.jsx(ey,{size:36}),n.jsx("span",{className:"text-[9px] font-bold text-white/80 whitespace-nowrap",style:{letterSpacing:"-0.01em"},children:"Assuremind"})]})}const ON=[{to:"/",icon:pN,label:"Dashboard"},{to:"/story",icon:Ot,label:"Smart Tests"},{to:"/tests",icon:Ji,label:"Test Editor"},{to:"/run",icon:Rt,label:"Run Config"},{to:"/reports",icon:iN,label:"Reports"},{to:"/variables",icon:CN,label:"Variables"},{to:"/healing",icon:Uo,label:"Self-Healing"},{to:"/git",icon:Pr,label:"Git Control Center"},{to:"/library",icon:gN,label:"Step Library"},{to:"/docs",icon:Yi,label:"Docs"},{to:"/settings",icon:Ho,label:"Settings"}];function DN({collapsed:e=!1,onToggle:t,mobileOpen:s=!1}){return n.jsxs(n.Fragment,{children:[s&&n.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-20 lg:hidden",onClick:t}),n.jsxs("aside",{className:C("fixed lg:relative z-30 flex flex-col h-full bg-sidebar text-white transition-all duration-300 ease-in-out flex-shrink-0",e?"w-[84px]":"w-[248px]",s?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[n.jsx("div",{className:C("flex items-center border-b border-white/[0.06] flex-shrink-0",e?"justify-center px-2 py-3":"px-5 py-3"),children:e?n.jsx(RN,{}):n.jsx(TN,{})}),n.jsx("nav",{className:"flex-1 overflow-hidden py-1.5 px-2.5 space-y-0.5",children:ON.map(({to:r,icon:a,label:i})=>n.jsxs(kj,{to:r,end:r==="/",className:({isActive:l})=>C("sidebar-item",l&&"active",e&&"justify-center !px-0"),title:e?i:void 0,children:[n.jsx(a,{size:18,className:"flex-shrink-0",strokeWidth:1.8}),!e&&n.jsx("span",{className:"truncate",children:i})]},r))}),n.jsx("button",{type:"button",onClick:t,className:C("hidden lg:flex items-center justify-center py-3.5","border-t border-white/[0.06] text-white/30 hover:text-white/70 transition-colors duration-200"),title:e?"Expand sidebar":"Collapse sidebar",children:e?n.jsx(Zt,{size:16}):n.jsx(lN,{size:16})})]})]})}function AN(){const[e,t]=m.useState(!1),[s,r]=m.useState(!1);return{collapsed:e,mobileOpen:s,toggle:()=>{t(i=>!i),r(i=>!i)}}}const hm="/api",LN=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,ty=["chromium","firefox","webkit"];let ld=null;const Wu=new Set;function of(){Wu.forEach(e=>e())}const yr={subscribe(e){return Wu.add(e),()=>{Wu.delete(e)}},getSnapshot(){return{activeModal:ld}},showModal(e){ld=e,of()},dismiss(){ld=null,of()}};function IN(){const[e,t]=m.useState(yr.getSnapshot);return m.useEffect(()=>yr.subscribe(()=>t(yr.getSnapshot())),[]),e}const FN=new Set(["AI_NOT_CONFIGURED","JIRA_NOT_CONFIGURED","XRAY_NOT_CONFIGURED"]);async function $(e,t){const s=(t==null?void 0:t.body)!==void 0,r=await fetch(`${hm}${e}`,{headers:{...s?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers},...t});if(!r.ok){const a=await r.text();if(r.status===422)try{const i=JSON.parse(a);if(i.featureHint&&FN.has(i.featureHint))throw yr.showModal(i.featureHint),new Error("Configuration required — check the setup instructions in the dialog.")}catch(i){if(i instanceof Error&&i.message.startsWith("Configuration required"))throw i}throw new Error(`API ${(t==null?void 0:t.method)??"GET"} ${e} → ${r.status}: ${a}`)}if(r.status!==204)return r.json()}const _a={get:()=>$("/config"),update:e=>$("/config",{method:"PUT",body:JSON.stringify(e)}),getAiProvider:()=>$("/ai-provider"),getMcpStatus:()=>$("/mcp/status")},Ar={list:e=>$(`/suites${e?`?type=${e}`:""}`),get:e=>$(`/suites/${e}`),create:e=>$("/suites",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>$(`/suites/${e}`,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>$(`/suites/${e}`,{method:"DELETE"})},$s={list:e=>$(`/suites/${e}/cases`),get:(e,t)=>$(`/suites/${e}/cases/${t}`),create:(e,t)=>$(`/suites/${e}/cases`,{method:"POST",body:JSON.stringify(t)}),update:(e,t,s)=>$(`/suites/${e}/cases/${t}`,{method:"PATCH",body:JSON.stringify(s)}),delete:(e,t)=>$(`/suites/${e}/cases/${t}`,{method:"DELETE"}),bulkDelete:(e,t)=>$(`/suites/${e}/cases/bulk-delete`,{method:"POST",body:JSON.stringify({ids:t})}),bulkMove:(e,t,s)=>$(`/suites/${e}/cases/bulk-move`,{method:"POST",body:JSON.stringify({ids:t,targetSuiteId:s})})},Lr={add:(e,t,s)=>$(`/suites/${e}/cases/${t}/steps`,{method:"POST",body:JSON.stringify(s)}),update:(e,t,s,r)=>$(`/suites/${e}/cases/${t}/steps/${s}`,{method:"PATCH",body:JSON.stringify(r)}),delete:(e,t,s)=>$(`/suites/${e}/cases/${t}/steps/${s}`,{method:"DELETE"}),generate:(e,t,s)=>$(`/suites/${e}/cases/${t}/steps/${s}/generate`,{method:"POST"}),generateAll:(e,t)=>$(`/suites/${e}/cases/${t}/steps/generate-all`,{method:"POST"}),reorder:(e,t,s)=>$(`/suites/${e}/cases/${t}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:s})})},Ir={get:e=>$(`/suites/${e}/hooks`),addStep:(e,t,s)=>$(`/suites/${e}/hooks/${t}/steps`,{method:"POST",body:JSON.stringify(s)}),updateStep:(e,t,s,r)=>$(`/suites/${e}/hooks/${t}/steps/${s}`,{method:"PATCH",body:JSON.stringify(r)}),deleteStep:(e,t,s)=>$(`/suites/${e}/hooks/${t}/steps/${s}`,{method:"DELETE"}),reorderSteps:(e,t,s)=>$(`/suites/${e}/hooks/${t}/steps/reorder`,{method:"PATCH",body:JSON.stringify({stepIds:s})}),generateStep:(e,t,s)=>$(`/suites/${e}/hooks/${t}/steps/${s}/generate`,{method:"POST"}),generateAll:(e,t)=>$(`/suites/${e}/hooks/${t}/steps/generate-all`,{method:"POST"})},od={getAll:()=>$("/variables"),getEnv:e=>$(`/variables/env/${e}`),set:(e,t)=>$(`/variables/${e}`,{method:"PUT",body:JSON.stringify({value:t})}),delete:e=>$(`/variables/${e}`,{method:"DELETE"})},Hn={list:()=>$("/healing"),pending:()=>$("/healing/pending"),stats:()=>$("/healing/stats"),accept:e=>$(`/healing/${e}/accept`,{method:"PATCH"}),reject:e=>$(`/healing/${e}/reject`,{method:"PATCH"}),acceptAll:()=>$("/healing/accept-all",{method:"POST"}),delete:e=>$(`/healing/${e}`,{method:"DELETE"}),deleteBulk:e=>$("/healing/delete-bulk",{method:"POST",body:JSON.stringify({ids:e})}),deleteAll:()=>$("/healing/clear-all",{method:"POST"})},Xi={start:e=>$("/run",{method:"POST",body:JSON.stringify(e)}),list:e=>$(`/run${e!==void 0?`?limit=${e}`:""}`),get:e=>$(`/run/${e}`)},qo={list:e=>$(`/report${e!==void 0?`?limit=${e}`:""}`),get:e=>$(`/report/${e}`),delete:e=>$(`/report/${e}`,{method:"DELETE"})},Br={generate:(e,t,s)=>$("/story/generate",{method:"POST",body:JSON.stringify({story:e,suiteName:t,jiraUrl:s})}),generateBulk:(e,t=3)=>$("/story/generate-bulk",{method:"POST",body:JSON.stringify({stories:e,concurrency:t})}),fetchJira:e=>$("/story/fetch-jira",{method:"POST",body:JSON.stringify({jiraUrl:e})}),swaggerPreview:e=>$("/story/swagger-preview",{method:"POST",body:JSON.stringify({specUrl:e})}),generateFromSwagger:(e,t,s,r)=>$("/story/generate-from-swagger",{method:"POST",body:JSON.stringify({specUrl:e,suiteName:t,tags:s,requirements:r||void 0})})},Fr={enabled:()=>$("/xray/enabled"),status:()=>$("/xray/status"),suiteStatus:e=>$(`/xray/status/${e}`),createAll:()=>$("/xray/create-all",{method:"POST"}),createSuite:e=>$(`/xray/create/suite/${e}`,{method:"POST"}),createCase:(e,t)=>$(`/xray/create/case/${e}/${t}`,{method:"POST"}),syncAll:()=>$("/xray/sync-all",{method:"POST"}),syncSuite:e=>$(`/xray/sync/suite/${e}`,{method:"POST"}),syncCase:(e,t)=>$(`/xray/sync/case/${e}/${t}`,{method:"POST"}),validate:()=>$("/xray/validate")},Hr={list:()=>$("/data-files"),get:e=>$(`/data-files/${encodeURIComponent(e)}`),upload:(e,t)=>$("/data-files/upload",{method:"POST",body:JSON.stringify({filename:e,content:t})}),update:(e,t)=>$(`/data-files/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})}),delete:e=>$(`/data-files/${encodeURIComponent(e)}`,{method:"DELETE"})},Ke={status:()=>$("/git/status"),branches:()=>$("/git/branches"),checkout:e=>$("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),commit:e=>$("/git/commit",{method:"POST",body:JSON.stringify({message:e})}),pull:e=>$("/git/pull",{method:"POST",body:JSON.stringify({rebase:e})}),push:()=>$("/git/push",{method:"POST"}),fullSync:e=>$("/git/full-sync",{method:"POST",body:JSON.stringify({message:e})}),log:e=>$(`/git/log${e?`?count=${e}`:""}`),diff:e=>$(`/git/diff${e?"?staged=true":""}`),conflictContent:e=>$(`/git/conflict-content/${encodeURIComponent(e)}`),resolveConflict:(e,t)=>$("/git/resolve-conflict",{method:"POST",body:JSON.stringify({filePath:e,content:t})}),continueRebase:()=>$("/git/continue-rebase",{method:"POST"}),abortRebase:()=>$("/git/abort-rebase",{method:"POST"}),generateCommitMessage:()=>$("/git/generate-commit-message",{method:"POST"}),resolveConflictAI:(e,t,s)=>$("/git/resolve-conflict-ai",{method:"POST",body:JSON.stringify({filePath:e,ours:t,theirs:s})}),impact:()=>$("/git/impact")};function Wa(e,t){const s=t.replace(/\\/g,"/").split("/").pop()??t;return`${hm}/results/${e}/${encodeURIComponent(s)}`}function _N(e){return`${hm}/results/baselines/${encodeURIComponent(e)}.png`}const $N={search:e=>$(`/search?q=${encodeURIComponent(e)}`)},UN={generate:e=>$("/ci-config",{method:"POST",body:JSON.stringify(e)})},BN={list:()=>$("/templates")},HN={get:(e,t)=>{const s=new URLSearchParams;return e&&s.set("suiteId",e),t&&s.set("caseId",t),$(`/flakiness?${s}`)}},ca={list:()=>$("/step-library"),create:e=>$("/step-library",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>$(`/step-library/${e}`,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>$(`/step-library/${e}`,{method:"DELETE"})},cf={capture:(e,t)=>$(`/baselines/${e}/capture`,{method:"POST",body:JSON.stringify({screenshotPath:t})}),get:e=>$(`/baselines/${e}`)};let ni=!1,cd=null;const qr=[];let dd=!1,ud=[];const Vu=new Set;function An(){for(const e of Vu)e()}const Pe={subscribe(e){return Vu.add(e),()=>{Vu.delete(e)}},getSnapshot(){return{panelOpen:ni,operationInProgress:cd,logSteps:[...qr],hasConflict:dd,conflictFiles:[...ud]}},togglePanel(){ni=!ni,An()},openPanel(){ni=!0,An()},closePanel(){ni=!1,An()},startOperation(e){cd=e,qr.length=0,An()},finishOperation(){cd=null,An()},addLogStep(e){const t=qr.findIndex(s=>s.step===e.step&&s.status==="running");t>=0&&e.status!=="running"?qr[t]=e:t<0&&qr.push(e),An()},clearLogs(){qr.length=0,An()},setConflict(e){dd=e.length>0,ud=e,An()},clearConflict(){dd=!1,ud=[],An()}};function Sc(){const[e,t]=m.useState(()=>Pe.getSnapshot());return m.useEffect(()=>Pe.subscribe(()=>t(Pe.getSnapshot())),[]),e}function fm(){return ke({queryKey:["git","status"],queryFn:Ke.status,refetchInterval:5e3,retry:1})}function ny(){return ke({queryKey:["git","branches"],queryFn:Ke.branches,staleTime:3e4,retry:1})}function sy(e){return ke({queryKey:["git","log",e],queryFn:()=>Ke.log(e),staleTime:1e4,retry:1})}function ry(){const e=ie();return Y({mutationFn:t=>Ke.checkout(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["git"]}),O.success(`Switched to ${s}`)},onError:t=>O.error(`Checkout failed: ${t.message}`)})}function ay(){const e=ie();return Y({mutationFn:t=>(Pe.startOperation("commit"),Ke.commit(t)),onSuccess:t=>{Pe.finishOperation(),e.invalidateQueries({queryKey:["git"]}),O.success(`Committed: ${t.hash}`)},onError:t=>{Pe.finishOperation(),O.error(`Commit failed: ${t.message}`)}})}function iy(){const e=ie();return Y({mutationFn:t=>(Pe.startOperation("pull"),Ke.pull(t)),onSuccess:()=>{Pe.finishOperation(),e.invalidateQueries({queryKey:["git"]}),O.success("Pull successful")},onError:t=>{Pe.finishOperation(),O.error(`Pull failed: ${t.message}`)}})}function ly(){const e=ie();return Y({mutationFn:()=>(Pe.startOperation("push"),Ke.push()),onSuccess:()=>{Pe.finishOperation(),e.invalidateQueries({queryKey:["git"]}),O.success("Pushed to remote")},onError:t=>{Pe.finishOperation(),O.error(`Push failed: ${t.message}`)}})}function oy(){const e=ie();return Y({mutationFn:t=>(Pe.startOperation("full-sync"),Ke.fullSync(t)),onSuccess:()=>{Pe.finishOperation(),e.invalidateQueries({queryKey:["git"]}),O.success("Full sync complete")},onError:t=>{Pe.finishOperation(),O.error(`Sync failed: ${t.message}`)}})}function cy(){return Y({mutationFn:()=>Ke.generateCommitMessage(),onError:e=>O.error(`AI generation failed: ${e.message}`)})}function dy(){const e=ie();return Y({mutationFn:({filePath:t,content:s})=>Ke.resolveConflict(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["git"]}),O.success("Conflict resolved")},onError:t=>O.error(`Resolve failed: ${t.message}`)})}function uy(){return Y({mutationFn:({filePath:e,ours:t,theirs:s})=>Ke.resolveConflictAI(e,t,s),onError:e=>O.error(`AI resolve failed: ${e.message}`)})}function xy(){const e=ie();return Y({mutationFn:()=>Ke.continueRebase(),onSuccess:()=>{Pe.clearConflict(),e.invalidateQueries({queryKey:["git"]}),O.success("Rebase continued")},onError:t=>O.error(`Continue rebase failed: ${t.message}`)})}function my(){const e=ie();return Y({mutationFn:()=>Ke.abortRebase(),onSuccess:()=>{Pe.clearConflict(),e.invalidateQueries({queryKey:["git"]}),O.success("Rebase aborted")},onError:t=>O.error(`Abort rebase failed: ${t.message}`)})}const hy="assuremind-theme";function qN(){var t;const e=localStorage.getItem(hy);return e==="dark"||e==="light"?e:(t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}let Gr=qN();const Qu=new Set;function fy(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}fy(Gr);function KN(){for(const e of Qu)e()}const xd={subscribe(e){return Qu.add(e),()=>{Qu.delete(e)}},getSnapshot(){return Gr},toggle(){Gr=Gr==="light"?"dark":"light",localStorage.setItem(hy,Gr),fy(Gr),KN()}};function WN(){return{theme:m.useSyncExternalStore(xd.subscribe,xd.getSnapshot),toggle:xd.toggle}}const py=6048e5,VN=864e5,Ul=43200,df=1440,uf=Symbol.for("constructDateFrom");function Zn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&uf in e?e[uf](t):e instanceof Date?new e.constructor(t):new Date(t)}function et(e,t){return Zn(t||e,e)}let QN={};function gl(){return QN}function Zi(e,t){var o,c,d,x;const s=gl(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??s.weekStartsOn??((x=(d=s.locale)==null?void 0:d.options)==null?void 0:x.weekStartsOn)??0,a=et(e,t==null?void 0:t.in),i=a.getDay(),l=(i<r?7:0)+i-r;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function Ko(e,t){return Zi(e,{...t,weekStartsOn:1})}function gy(e,t){const s=et(e,t==null?void 0:t.in),r=s.getFullYear(),a=Zn(s,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const i=Ko(a),l=Zn(s,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const o=Ko(l);return s.getTime()>=i.getTime()?r+1:s.getTime()>=o.getTime()?r:r-1}function Wo(e){const t=et(e),s=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return s.setUTCFullYear(t.getFullYear()),+e-+s}function Cc(e,...t){const s=Zn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(s)}function xf(e,t){const s=et(e,t==null?void 0:t.in);return s.setHours(0,0,0,0),s}function GN(e,t,s){const[r,a]=Cc(s==null?void 0:s.in,e,t),i=xf(r),l=xf(a),o=+i-Wo(i),c=+l-Wo(l);return Math.round((o-c)/VN)}function YN(e,t){const s=gy(e,t),r=Zn(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Ko(r)}function uo(e,t){const s=+et(e)-+et(t);return s<0?-1:s>0?1:s}function JN(e){return Zn(e,Date.now())}function XN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ZN(e){return!(!XN(e)&&typeof e!="number"||isNaN(+et(e)))}function ew(e,t,s){const[r,a]=Cc(s==null?void 0:s.in,e,t),i=r.getFullYear()-a.getFullYear(),l=r.getMonth()-a.getMonth();return i*12+l}function tw(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function nw(e,t){return+et(e)-+et(t)}function sw(e,t){const s=et(e,t==null?void 0:t.in);return s.setHours(23,59,59,999),s}function rw(e,t){const s=et(e,t==null?void 0:t.in),r=s.getMonth();return s.setFullYear(s.getFullYear(),r+1,0),s.setHours(23,59,59,999),s}function aw(e,t){const s=et(e,t==null?void 0:t.in);return+sw(s,t)==+rw(s,t)}function iw(e,t,s){const[r,a,i]=Cc(s==null?void 0:s.in,e,e,t),l=uo(a,i),o=Math.abs(ew(a,i));if(o<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-l*o);let c=uo(a,i)===-l;aw(r)&&o===1&&uo(r,i)===1&&(c=!1);const d=l*(o-+c);return d===0?0:d}function lw(e,t,s){const r=nw(e,t)/1e3;return tw(s==null?void 0:s.roundingMethod)(r)}function ow(e,t){const s=et(e,t==null?void 0:t.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}const cw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},dw=(e,t,s)=>{let r;const a=cw[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function md(e){return(t={})=>{const s=t.width?String(t.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}const uw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hw={date:md({formats:uw,defaultWidth:"full"}),time:md({formats:xw,defaultWidth:"full"}),dateTime:md({formats:mw,defaultWidth:"full"})},fw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pw=(e,t,s,r)=>fw[e];function si(e){return(t,s)=>{const r=s!=null&&s.context?String(s.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,o=s!=null&&s.width?String(s.width):l;a=e.formattingValues[o]||e.formattingValues[l]}else{const l=e.defaultWidth,o=s!=null&&s.width?String(s.width):e.defaultWidth;a=e.values[o]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const gw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vw={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},jw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Nw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ww=(e,t)=>{const s=Number(e),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},kw={ordinalNumber:ww,era:si({values:gw,defaultWidth:"wide"}),quarter:si({values:yw,defaultWidth:"wide",argumentCallback:e=>e-1}),month:si({values:bw,defaultWidth:"wide"}),day:si({values:vw,defaultWidth:"wide"}),dayPeriod:si({values:jw,defaultWidth:"wide",formattingValues:Nw,defaultFormattingWidth:"wide"})};function ri(e){return(t,s={})=>{const r=s.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const l=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Cw(o,f=>f.test(l)):Sw(o,f=>f.test(l));let d;d=e.valueCallback?e.valueCallback(c):c,d=s.valueCallback?s.valueCallback(d):d;const x=t.slice(l.length);return{value:d,rest:x}}}function Sw(e,t){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t(e[s]))return s}function Cw(e,t){for(let s=0;s<e.length;s++)if(t(e[s]))return s}function Ew(e){return(t,s={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=s.valueCallback?s.valueCallback(l):l;const o=t.slice(a.length);return{value:l,rest:o}}}const Pw=/^(\d+)(th|st|nd|rd)?/i,zw=/\d+/i,Mw={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tw={any:[/^b/i,/^(a|c)/i]},Rw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ow={any:[/1/i,/2/i,/3/i,/4/i]},Dw={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Aw={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Lw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Iw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Fw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},_w={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$w={ordinalNumber:Ew({matchPattern:Pw,parsePattern:zw,valueCallback:e=>parseInt(e,10)}),era:ri({matchPatterns:Mw,defaultMatchWidth:"wide",parsePatterns:Tw,defaultParseWidth:"any"}),quarter:ri({matchPatterns:Rw,defaultMatchWidth:"wide",parsePatterns:Ow,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ri({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Aw,defaultParseWidth:"any"}),day:ri({matchPatterns:Lw,defaultMatchWidth:"wide",parsePatterns:Iw,defaultParseWidth:"any"}),dayPeriod:ri({matchPatterns:Fw,defaultMatchWidth:"any",parsePatterns:_w,defaultParseWidth:"any"})},yy={code:"en-US",formatDistance:dw,formatLong:hw,formatRelative:pw,localize:kw,match:$w,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Uw(e,t){const s=et(e,t==null?void 0:t.in);return GN(s,ow(s))+1}function Bw(e,t){const s=et(e,t==null?void 0:t.in),r=+Ko(s)-+YN(s);return Math.round(r/py)+1}function by(e,t){var x,f,g,b;const s=et(e,t==null?void 0:t.in),r=s.getFullYear(),a=gl(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(x=t==null?void 0:t.locale)==null?void 0:x.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((b=(g=a.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,l=Zn((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,i),l.setHours(0,0,0,0);const o=Zi(l,t),c=Zn((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Zi(c,t);return+s>=+o?r+1:+s>=+d?r:r-1}function Hw(e,t){var o,c,d,x;const s=gl(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??s.firstWeekContainsDate??((x=(d=s.locale)==null?void 0:d.options)==null?void 0:x.firstWeekContainsDate)??1,a=by(e,t),i=Zn((t==null?void 0:t.in)||e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),Zi(i,t)}function qw(e,t){const s=et(e,t==null?void 0:t.in),r=+Zi(s,t)-+Hw(s,t);return Math.round(r/py)+1}function Ne(e,t){const s=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return s+r}const as={y(e,t){const s=e.getFullYear(),r=s>0?s:1-s;return Ne(t==="yy"?r%100:r,t.length)},M(e,t){const s=e.getMonth();return t==="M"?String(s+1):Ne(s+1,2)},d(e,t){return Ne(e.getDate(),t.length)},a(e,t){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(e,t){return Ne(e.getHours()%12||12,t.length)},H(e,t){return Ne(e.getHours(),t.length)},m(e,t){return Ne(e.getMinutes(),t.length)},s(e,t){return Ne(e.getSeconds(),t.length)},S(e,t){const s=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,s-3));return Ne(a,t.length)}},Kr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mf={G:function(e,t,s){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(e,t,s){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return s.ordinalNumber(a,{unit:"year"})}return as.y(e,t)},Y:function(e,t,s,r){const a=by(e,r),i=a>0?a:1-a;if(t==="YY"){const l=i%100;return Ne(l,2)}return t==="Yo"?s.ordinalNumber(i,{unit:"year"}):Ne(i,t.length)},R:function(e,t){const s=gy(e);return Ne(s,t.length)},u:function(e,t){const s=e.getFullYear();return Ne(s,t.length)},Q:function(e,t,s){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ne(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,s){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ne(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,s){const r=e.getMonth();switch(t){case"M":case"MM":return as.M(e,t);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,s){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ne(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,s,r){const a=qw(e,r);return t==="wo"?s.ordinalNumber(a,{unit:"week"}):Ne(a,t.length)},I:function(e,t,s){const r=Bw(e);return t==="Io"?s.ordinalNumber(r,{unit:"week"}):Ne(r,t.length)},d:function(e,t,s){return t==="do"?s.ordinalNumber(e.getDate(),{unit:"date"}):as.d(e,t)},D:function(e,t,s){const r=Uw(e);return t==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):Ne(r,t.length)},E:function(e,t,s){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,s,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ne(i,2);case"eo":return s.ordinalNumber(i,{unit:"day"});case"eee":return s.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(a,{width:"short",context:"formatting"});case"eeee":default:return s.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,s,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ne(i,t.length);case"co":return s.ordinalNumber(i,{unit:"day"});case"ccc":return s.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(a,{width:"narrow",context:"standalone"});case"cccccc":return s.day(a,{width:"short",context:"standalone"});case"cccc":default:return s.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,s){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Ne(a,t.length);case"io":return s.ordinalNumber(a,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,s){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,s){const r=e.getHours();let a;switch(r===12?a=Kr.noon:r===0?a=Kr.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,s){const r=e.getHours();let a;switch(r>=17?a=Kr.evening:r>=12?a=Kr.afternoon:r>=4?a=Kr.morning:a=Kr.night,t){case"B":case"BB":case"BBB":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,s){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return as.h(e,t)},H:function(e,t,s){return t==="Ho"?s.ordinalNumber(e.getHours(),{unit:"hour"}):as.H(e,t)},K:function(e,t,s){const r=e.getHours()%12;return t==="Ko"?s.ordinalNumber(r,{unit:"hour"}):Ne(r,t.length)},k:function(e,t,s){let r=e.getHours();return r===0&&(r=24),t==="ko"?s.ordinalNumber(r,{unit:"hour"}):Ne(r,t.length)},m:function(e,t,s){return t==="mo"?s.ordinalNumber(e.getMinutes(),{unit:"minute"}):as.m(e,t)},s:function(e,t,s){return t==="so"?s.ordinalNumber(e.getSeconds(),{unit:"second"}):as.s(e,t)},S:function(e,t){return as.S(e,t)},X:function(e,t,s){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ff(r);case"XXXX":case"XX":return tr(r);case"XXXXX":case"XXX":default:return tr(r,":")}},x:function(e,t,s){const r=e.getTimezoneOffset();switch(t){case"x":return ff(r);case"xxxx":case"xx":return tr(r);case"xxxxx":case"xxx":default:return tr(r,":")}},O:function(e,t,s){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+hf(r,":");case"OOOO":default:return"GMT"+tr(r,":")}},z:function(e,t,s){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+hf(r,":");case"zzzz":default:return"GMT"+tr(r,":")}},t:function(e,t,s){const r=Math.trunc(+e/1e3);return Ne(r,t.length)},T:function(e,t,s){return Ne(+e,t.length)}};function hf(e,t=""){const s=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?s+String(a):s+String(a)+t+Ne(i,2)}function ff(e,t){return e%60===0?(e>0?"-":"+")+Ne(Math.abs(e)/60,2):tr(e,t)}function tr(e,t=""){const s=e>0?"-":"+",r=Math.abs(e),a=Ne(Math.trunc(r/60),2),i=Ne(r%60,2);return s+a+t+i}const pf=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},vy=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Kw=(e,t)=>{const s=e.match(/(P+)(p+)?/)||[],r=s[1],a=s[2];if(!a)return pf(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",pf(r,t)).replace("{{time}}",vy(a,t))},Ww={p:vy,P:Kw},Vw=/^D+$/,Qw=/^Y+$/,Gw=["D","DD","YY","YYYY"];function Yw(e){return Vw.test(e)}function Jw(e){return Qw.test(e)}function Xw(e,t,s){const r=Zw(e,t,s);if(console.warn(r),Gw.includes(e))throw new RangeError(r)}function Zw(e,t,s){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ek=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nk=/^'([^]*?)'?$/,sk=/''/g,rk=/[a-zA-Z]/;function ak(e,t,s){var x,f,g,b;const r=gl(),a=r.locale??yy,i=r.firstWeekContainsDate??((f=(x=r.locale)==null?void 0:x.options)==null?void 0:f.firstWeekContainsDate)??1,l=r.weekStartsOn??((b=(g=r.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??0,o=et(e,s==null?void 0:s.in);if(!ZN(o))throw new RangeError("Invalid time value");let c=t.match(tk).map(y=>{const j=y[0];if(j==="p"||j==="P"){const k=Ww[j];return k(y,a.formatLong)}return y}).join("").match(ek).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const j=y[0];if(j==="'")return{isToken:!1,value:ik(y)};if(mf[j])return{isToken:!0,value:y};if(j.match(rk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(o,c));const d={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const j=y.value;(Jw(j)||Yw(j))&&Xw(j,t,String(e));const k=mf[j[0]];return k(o,j,a.localize,d)}).join("")}function ik(e){const t=e.match(nk);return t?t[1].replace(sk,"'"):e}function lk(e,t,s){const r=gl(),a=(s==null?void 0:s.locale)??r.locale??yy,i=2520,l=uo(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const o=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:l}),[c,d]=Cc(s==null?void 0:s.in,...l>0?[t,e]:[e,t]),x=lw(d,c),f=(Wo(d)-Wo(c))/1e3,g=Math.round((x-f)/60);let b;if(g<2)return s!=null&&s.includeSeconds?x<5?a.formatDistance("lessThanXSeconds",5,o):x<10?a.formatDistance("lessThanXSeconds",10,o):x<20?a.formatDistance("lessThanXSeconds",20,o):x<40?a.formatDistance("halfAMinute",0,o):x<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):g===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",g,o);if(g<45)return a.formatDistance("xMinutes",g,o);if(g<90)return a.formatDistance("aboutXHours",1,o);if(g<df){const y=Math.round(g/60);return a.formatDistance("aboutXHours",y,o)}else{if(g<i)return a.formatDistance("xDays",1,o);if(g<Ul){const y=Math.round(g/df);return a.formatDistance("xDays",y,o)}else if(g<Ul*2)return b=Math.round(g/Ul),a.formatDistance("aboutXMonths",b,o)}if(b=iw(d,c),b<12){const y=Math.round(g/Ul);return a.formatDistance("xMonths",y,o)}else{const y=b%12,j=Math.trunc(b/12);return y<3?a.formatDistance("aboutXYears",j,o):y<9?a.formatDistance("overXYears",j,o):a.formatDistance("almostXYears",j+1,o)}}function Vo(e,t){return lk(e,JN(e),t)}let Xs=[];const Gu=new Set;function hd(){Gu.forEach(e=>e())}const br={subscribe(e){return Gu.add(e),()=>{Gu.delete(e)}},getSnapshot(){return{notifications:Xs,unreadCount:Xs.filter(e=>!e.read).length}},push(e){Xs=[e,...Xs].slice(0,20),hd()},markAllRead(){Xs=Xs.map(e=>({...e,read:!0})),hd()},clear(){Xs=[],hd()}};function ok(){const[e,t]=m.useState(()=>br.getSnapshot());return m.useEffect(()=>br.subscribe(()=>t(br.getSnapshot())),[]),e}function ck({type:e}){switch(e){case"run-complete":return n.jsx(Ue,{size:13,className:"text-emerald-500 flex-shrink-0"});case"run-error":return n.jsx(ut,{size:13,className:"text-red-500 flex-shrink-0"});case"healing":return n.jsx(Be,{size:13,className:"text-amber-500 flex-shrink-0"});case"git":return n.jsx(Pr,{size:13,className:"text-blue-500 flex-shrink-0"});default:return n.jsx(Ku,{size:13,className:"text-content-tertiary flex-shrink-0"})}}function dk(){const[e,t]=m.useState(!1),{notifications:s,unreadCount:r}=ok(),a=m.useRef(null),i=Pn();return m.useEffect(()=>{if(!e)return;function l(o){a.current&&!a.current.contains(o.target)&&t(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e]),n.jsxs("div",{className:"relative",ref:a,children:[n.jsxs("button",{type:"button",onClick:()=>t(l=>!l),className:C("relative p-2 rounded-lg transition-all duration-200",e?"bg-accent-muted text-accent":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":"Notifications",title:"Notifications",children:[n.jsx(Ku,{size:16}),r>0&&n.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:r>9?"9+":r})]}),e&&n.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 bg-surface border border-border rounded-xl shadow-modal z-50 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-surface-inset/50",children:[n.jsx("span",{className:"text-xs font-semibold text-content",children:"Notifications"}),n.jsxs("div",{className:"flex items-center gap-1",children:[r>0&&n.jsx("button",{type:"button",onClick:()=>br.markAllRead(),className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",title:"Mark all read",children:n.jsx(Dg,{size:12})}),n.jsx("button",{type:"button",onClick:()=>br.clear(),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",title:"Clear all",children:n.jsx(fn,{size:12})})]})]}),n.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-border/50",children:s.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[n.jsx(Ku,{size:20,className:"text-content-tertiary/40"}),n.jsx("p",{className:"text-xs text-content-tertiary",children:"No notifications"})]}):s.map(l=>n.jsxs("div",{className:C("flex items-start gap-2.5 px-3 py-2.5 transition-colors",!l.read&&"bg-accent-muted/20",l.link&&"cursor-pointer hover:bg-surface-inset/50"),onClick:()=>{l.link&&(t(!1),i(l.link))},children:[n.jsx("div",{className:"mt-0.5",children:n.jsx(ck,{type:l.type})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:C("text-xs leading-relaxed",l.read?"text-content-secondary":"text-content font-medium"),children:l.message}),n.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:Vo(new Date(l.timestamp),{addSuffix:!0})})]}),l.link&&n.jsx(Ka,{size:10,className:"text-content-tertiary/60 flex-shrink-0 mt-0.5"}),!l.read&&n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent flex-shrink-0 mt-1.5"})]},l.id))})]})]})}function uk(){const e=ie(),t=Pn(),[s,r]=m.useState(!1),a=m.useRef(null),{data:i}=ke({queryKey:["config"],queryFn:()=>_a.get(),staleTime:3e4}),l=Y({mutationFn:d=>{var f;const x=(f=i==null?void 0:i.profiles)==null?void 0:f.find(g=>g.name===d);if(!x)throw new Error("Profile not found");return _a.update({activeProfile:x.name,environment:x.environment,baseUrl:x.baseUrl,browsers:x.browsers,...x.headless!==void 0?{headless:x.headless}:{}})},onSuccess:()=>{e.invalidateQueries({queryKey:["config"]}),r(!1)}});m.useEffect(()=>{const d=x=>{a.current&&!a.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);const o=(i==null?void 0:i.profiles)??[];if(o.length===0)return null;const c=(i==null?void 0:i.activeProfile)??(i==null?void 0:i.environment)??"env";return n.jsxs("div",{ref:a,className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>r(d=>!d),className:"flex items-center gap-1.5 text-xs border border-border rounded-lg px-2.5 py-1.5 text-content-secondary hover:bg-surface-inset transition-colors",children:[n.jsx(zr,{size:12,className:"text-accent flex-shrink-0"}),n.jsx("span",{className:"hidden sm:inline max-w-[100px] truncate",children:c}),n.jsx(Tt,{size:11,className:"text-content-tertiary"})]}),s&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 w-52 bg-surface border border-border rounded-xl shadow-elevated z-50 overflow-hidden",children:[n.jsx("div",{className:"px-3 py-2 border-b border-border",children:n.jsx("p",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Environment Profiles"})}),n.jsx("div",{className:"py-1",children:o.map(d=>n.jsxs("button",{type:"button",onClick:()=>l.mutate(d.name),className:C("w-full text-left px-3 py-2 text-xs hover:bg-surface-inset transition-colors flex items-center justify-between gap-2",(i==null?void 0:i.activeProfile)===d.name&&"text-accent font-semibold"),children:[n.jsx("span",{className:"truncate",children:d.name}),n.jsx("span",{className:"text-[9px] text-content-tertiary flex-shrink-0",children:d.environment})]},d.name))}),n.jsx("div",{className:"border-t border-border px-3 py-2",children:n.jsxs("button",{type:"button",onClick:()=>{r(!1),t("/settings#profiles")},className:"flex items-center gap-1 text-[10px] text-content-tertiary hover:text-accent transition-colors",children:[n.jsx(Ia,{size:10})," Manage profiles"]})})]})]})}const xk={anthropic:"Anthropic",bedrock:"Bedrock",openai:"OpenAI",google:"Google","azure-openai":"Azure OpenAI",ollama:"Ollama",unknown:"AI"};function mk({title:e,onMenuClick:t}){const{data:s}=ke({queryKey:["ai-provider"],queryFn:()=>_a.getAiProvider(),staleTime:6e4,retry:!1}),{panelOpen:r}=Sc(),{data:a}=fm(),{theme:i,toggle:l}=WN(),o=xk[(s==null?void 0:s.provider)??""]??(s==null?void 0:s.provider)??"...",c=(s==null?void 0:s.model)??"...",d=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);return n.jsxs("header",{className:"h-14 bg-surface border-b border-border flex items-center px-5 gap-3 flex-shrink-0",children:[n.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg hover:bg-surface-inset text-content-tertiary lg:hidden transition-colors","aria-label":"Toggle sidebar",children:n.jsx(bN,{size:18})}),n.jsx("h1",{className:"text-sm font-semibold text-content tracking-tight flex-1",children:e}),s&&n.jsxs("div",{className:"hidden sm:flex items-center gap-1.5 text-xs bg-surface-inset border border-border rounded-lg px-3 py-1.5",children:[n.jsx(rN,{size:13,className:"text-accent flex-shrink-0"}),n.jsx("span",{className:"font-medium text-content-secondary",children:o}),n.jsx("span",{className:"text-content-tertiary/50",children:"/"}),n.jsx("span",{className:"text-content-tertiary truncate max-w-[140px]",children:c})]}),n.jsx(uk,{}),n.jsx(dk,{}),n.jsx("button",{type:"button",onClick:l,className:C("p-2 rounded-lg transition-all duration-200",i==="dark"?"bg-surface-inset text-amber-400 hover:bg-surface-overlay":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary"),"aria-label":i==="dark"?"Switch to light mode":"Switch to dark mode",title:i==="dark"?"Light mode":"Dark mode",children:i==="dark"?n.jsx(PN,{size:16}):n.jsx(jN,{size:16})}),n.jsxs("button",{type:"button",onClick:()=>Pe.togglePanel(),className:C("relative flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-200",r?"bg-accent-muted text-accent border border-accent/20":"text-content-tertiary hover:bg-surface-inset hover:text-content-secondary border border-transparent"),"aria-label":"Toggle Git panel",title:"Git Control Center",children:[n.jsx(Pr,{size:14}),n.jsx("span",{className:"hidden sm:inline",children:"Git"}),d>0&&n.jsx("span",{className:"absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full bg-amber-500 text-white text-[9px] font-bold flex items-center justify-center ring-2 ring-surface",children:d>9?"9+":d})]})]})}function ne({variant:e="primary",size:t="md",loading:s=!1,children:r,className:a,disabled:i,...l}){return n.jsxs("button",{...l,disabled:i||s,className:C("inline-flex items-center justify-center gap-2 font-medium rounded-lg transition-all duration-150","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1",{"bg-gradient-to-b from-accent to-accent-dark text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-accent":e==="primary","bg-surface border border-border text-content-secondary hover:bg-surface-inset hover:text-content hover:border-border-strong focus-visible:ring-accent":e==="secondary","text-content-secondary hover:bg-surface-inset hover:text-content focus-visible:ring-accent/40":e==="ghost","bg-gradient-to-b from-red-500 to-red-600 text-white shadow-sm hover:shadow-md hover:brightness-110 focus-visible:ring-red-500":e==="danger","px-2.5 py-1.5 text-xs gap-1.5":t==="sm","px-4 py-2 text-sm":t==="md","px-5 py-2.5 text-sm":t==="lg","opacity-40 cursor-not-allowed pointer-events-none":i||s},a),children:[s&&n.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",children:[n.jsx("circle",{className:"opacity-20",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),n.jsx("path",{className:"opacity-80",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),r]})}function Va(e){const t=m.useRef(null),s=m.useRef(e);s.current=e;const r=m.useCallback(()=>{var i;if(((i=t.current)==null?void 0:i.readyState)===WebSocket.OPEN)return;const a=new WebSocket(LN);t.current=a,a.onmessage=l=>{try{const o=JSON.parse(l.data),c=s.current[o.event];c&&c(o.data)}catch{}},a.onclose=()=>{setTimeout(r,3e3)},a.onerror=()=>{a.close()}},[]);m.useEffect(()=>(r(),()=>{var a;(a=t.current)==null||a.close()}),[r])}let Qo={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map};const Yu=new Set;function jy(){Yu.forEach(e=>e())}function ai(e){Qo=e(Qo),jy()}const fd={subscribe(e){return Yu.add(e),()=>{Yu.delete(e)}},getSnapshot(){return Qo},reset(){Qo={isRunning:!1,runId:null,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map},jy()}};function pm(){const e=m.useSyncExternalStore(fd.subscribe,fd.getSnapshot),t=m.useCallback(o=>{const c=o;ai(()=>({isRunning:!0,runId:c.runId,currentBrowser:null,currentCase:null,currentStep:null,completed:null,error:null,activeCases:new Map}))},[]),s=m.useCallback(o=>{const c=o;ai(d=>{const x=new Map(d.activeCases);return x.set(c.caseId,c.caseName),{...d,isRunning:!0,currentBrowser:c.browser??d.currentBrowser,currentCase:c,currentStep:null,activeCases:x}})},[]),r=m.useCallback(o=>{ai(c=>({...c,isRunning:!0,currentStep:o}))},[]),a=m.useCallback(o=>{ai(c=>({...c,isRunning:!1,completed:o,currentCase:null,currentStep:null}))},[]),i=m.useCallback(o=>{const c=o;ai(d=>({...d,isRunning:!1,error:c.error}))},[]);Va({"run:start":t,"run:case":s,"run:step":r,"run:complete":a,"run:error":i});const l=m.useCallback(()=>{fd.reset()},[]);return{...e,reset:l}}function pd(e,t){Va({[e]:t})}function gf({data:e,maxHeight:t=32}){const s=Math.max(...e.map(r=>r.value),1);return n.jsx("div",{className:"flex items-end gap-[3px]",style:{height:t},children:e.map((r,a)=>n.jsx("div",{className:C("w-[6px] rounded-full transition-all duration-500",r.color),style:{height:`${Math.max(r.value/s*100,6)}%`}},a))})}function hk({rate:e,hasData:t=!1,size:s=80}){const a=(s-6)/2,i=2*Math.PI*a,l=i-e/100*i,o=t?"#ef4444":"var(--color-border)";return n.jsxs("div",{className:"relative",style:{width:s,height:s},children:[n.jsxs("svg",{width:s,height:s,className:"-rotate-90",children:[n.jsx("circle",{cx:s/2,cy:s/2,r:a,fill:"none",stroke:o,strokeWidth:6}),n.jsx("circle",{cx:s/2,cy:s/2,r:a,fill:"none",stroke:"#10b981",strokeWidth:6,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,className:"transition-all duration-1000 ease-out"})]}),n.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:n.jsxs("span",{className:"text-lg font-bold text-content tabular-nums",children:[e,"%"]})})]})}function fk({status:e}){const t={passed:"bg-emerald-500",failed:"bg-red-500",partial:"bg-amber-500",running:"bg-blue-500 animate-pulse",skipped:"bg-slate-400"};return n.jsx("span",{className:C("w-2 h-2 rounded-full flex-shrink-0",t[e]??"bg-slate-400")})}function pk(e,t){return e.filter(s=>{var r;return(r=s.suiteIds)==null?void 0:r.includes(t)}).slice(-7).map(s=>({value:s.totalTests>0?Math.round(s.passed/s.totalTests*100):0,color:s.failed>0?"bg-red-400":"bg-emerald-400"}))}function gk(){const e=Pn(),{data:t=[],isLoading:s}=ke({queryKey:["reports"],queryFn:()=>qo.list(20)}),{data:r=[],isLoading:a}=ke({queryKey:["suites"],queryFn:()=>Ar.list()}),{data:i}=ke({queryKey:["healing-stats"],queryFn:()=>Hn.stats(),staleTime:3e4,retry:!1}),l=pm(),o=s||a,c=t[0],d=r.reduce((w,N)=>w+(N.caseCount??0),0),x=r.filter(w=>(w.type??"ui")==="ui"),f=r.filter(w=>(w.type??"ui")==="api"),g=x.reduce((w,N)=>w+(N.caseCount??0),0),b=f.reduce((w,N)=>w+(N.caseCount??0),0),y=t.reduce((w,N)=>w+N.passed,0),j=t.reduce((w,N)=>w+N.failed,0),k=t.reduce((w,N)=>w+N.skipped,0),h=y+j>0?Math.round(y/(y+j)*100):0,u=y+j+k,p=t.filter(w=>w.duration).length>0?Math.round(t.filter(w=>w.duration).reduce((w,N)=>w+(N.duration??0),0)/t.filter(w=>w.duration).length/1e3):0,v=[...t].reverse().map(w=>({value:w.passed+w.failed+w.skipped,color:w.status==="passed"?"bg-emerald-400":w.status==="failed"?"bg-red-400":"bg-amber-400"}));return o?n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4",children:[n.jsx("div",{className:"h-7 w-48 rounded-lg skeleton-shimmer"}),n.jsx("div",{className:"h-4 w-72 rounded-lg skeleton-shimmer mt-2"})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8",children:[n.jsx("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[1,2,3,4].map(w=>n.jsx("div",{className:"h-28 rounded-2xl skeleton-shimmer"},w))}),n.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(w=>n.jsx("div",{className:"h-64 rounded-2xl skeleton-shimmer"},w))})]})]}):n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsxs("div",{className:"flex-shrink-0 px-8 pt-6 pb-4 flex items-end justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-content tracking-tight",children:"Dashboard"}),n.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Test automation health at a glance"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(ne,{size:"sm",variant:"secondary",onClick:()=>e("/run"),children:[n.jsx(Rt,{size:13})," Run Tests"]}),n.jsxs(ne,{size:"sm",onClick:()=>e("/story"),children:[n.jsx(Ot,{size:13})," Generate"]})]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-8 pb-8 space-y-5",children:[l.isRunning&&n.jsx("div",{className:"rounded-2xl border border-accent/25 bg-gradient-to-r from-accent/[0.06] via-accent/[0.03] to-transparent p-4 animate-fade-in",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative w-8 h-8 flex-shrink-0",children:[n.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-accent/20"}),n.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin"})]}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"text-sm font-semibold text-content",children:"Run in progress..."}),l.currentCase&&n.jsxs("p",{className:"text-xs text-content-secondary truncate mt-0.5",children:[l.currentCase.caseName,l.currentStep&&` › ${l.currentStep.instruction}`]})]}),n.jsxs(ne,{size:"sm",variant:"ghost",onClick:()=>e("/run"),children:["View ",n.jsx(ir,{size:12})]})]})}),l.completed&&!l.isRunning&&(()=>{const w=l.completed,N=w.failed===0&&w.passed>0,P=w.failed>0,E=N?{border:"border-emerald-200/50",bg:"bg-gradient-to-r from-emerald-50/80 to-transparent",icon:"text-emerald-500",title:"text-emerald-800",subtitle:"text-emerald-600",label:"All tests passed"}:P?{border:"border-red-200/50",bg:"bg-gradient-to-r from-red-50/80 to-transparent",icon:"text-red-500",title:"text-red-800",subtitle:"text-red-600",label:"Completed with failures"}:{border:"border-amber-200/50",bg:"bg-gradient-to-r from-amber-50/80 to-transparent",icon:"text-amber-500",title:"text-amber-800",subtitle:"text-amber-600",label:"Run completed"},_=N?Ue:P?ut:Yt;return n.jsx("div",{className:C("rounded-2xl border p-4 animate-fade-in",E.border,E.bg),children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(_,{size:20,className:C(E.icon,"flex-shrink-0")}),n.jsxs("div",{children:[n.jsx("p",{className:C("text-sm font-semibold",E.title),children:E.label}),n.jsxs("p",{className:C("text-xs mt-0.5",E.subtitle),children:[w.passed," passed / ",w.failed," failed / ",w.skipped," skipped"]})]})]}),n.jsx(ne,{variant:"secondary",size:"sm",onClick:()=>e("/reports"),children:"View Report"})]})})})(),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:n.jsx(pl,{size:18,className:"text-indigo-500"})}),n.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Coverage"})]}),n.jsxs("div",{className:"mt-4",children:[n.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:r.length}),n.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"test suites"})]}),n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(oa,{size:11,className:"text-blue-500"}),n.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[x.length," UI"]}),n.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",g,")"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(wN,{size:11,className:"text-purple-500"}),n.jsxs("span",{className:"text-[11px] text-content-secondary font-medium",children:[f.length," API"]}),n.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["(",b,")"]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider mb-3",children:"Pass Rate"}),n.jsx(hk,{rate:t.length>0?h:0,hasData:y+j>0}),n.jsx("p",{className:"text-[11px] text-content-tertiary mt-2",children:y+j>0?`${y} of ${y+j} cases passed`:"no runs yet"})]}),n.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-50 border border-teal-100 flex items-center justify-center",children:n.jsx(nN,{size:18,className:"text-teal-500"})}),n.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Execution"})]}),n.jsxs("div",{className:"mt-4",children:[n.jsx("p",{className:"text-3xl font-extrabold text-content tabular-nums tracking-tight",children:u}),n.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"tests executed"})]}),n.jsxs("div",{className:"mt-3 pt-3 border-t border-border-muted grid grid-cols-3 gap-2",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Ue,{size:10,className:"text-emerald-500"}),n.jsx("span",{className:"text-[11px] font-semibold text-emerald-600 tabular-nums",children:y})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ut,{size:10,className:"text-red-500"}),n.jsx("span",{className:"text-[11px] font-semibold text-red-500 tabular-nums",children:j})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Nc,{size:10,className:"text-content-tertiary"}),n.jsx("span",{className:"text-[11px] font-semibold text-content-tertiary tabular-nums",children:k})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border bg-surface p-5 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-50 border border-amber-100 flex items-center justify-center",children:n.jsx(Be,{size:18,className:"text-amber-500"})}),n.jsx("span",{className:"text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Insights"})]}),n.jsxs("div",{className:"mt-4 space-y-2.5",children:[n.jsx("div",{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Avg Duration"}),n.jsx("span",{className:"text-sm font-bold text-content tabular-nums",children:p>0?`${p}s`:"—"})]})}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Self-Healed"}),n.jsx("span",{className:"text-sm font-bold text-emerald-600 tabular-nums",children:(i==null?void 0:i.accepted)??0})]})}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[11px] text-content-tertiary",children:"Pending Review"}),n.jsx("span",{className:C("text-sm font-bold tabular-nums",((i==null?void 0:i.pending)??0)>0?"text-amber-500":"text-content-tertiary"),children:(i==null?void 0:i.pending)??0})]})})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[n.jsxs("div",{className:"lg:col-span-2 rounded-2xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg bg-accent-muted flex items-center justify-center",children:n.jsx(MN,{size:14,className:"text-accent"})}),n.jsx("h2",{className:"text-sm font-semibold text-content",children:"Recent Runs"})]}),t.length>0&&n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(gf,{data:v,maxHeight:24}),n.jsxs("button",{onClick:()=>e("/reports"),className:"text-xs text-accent font-medium hover:underline flex items-center gap-0.5",children:["View all ",n.jsx(ir,{size:11})]})]})]}),t.length===0?n.jsxs("div",{className:"px-5 py-12 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-2xl bg-surface-inset flex items-center justify-center mx-auto mb-3",children:n.jsx(Cn,{size:20,className:"text-content-tertiary"})}),n.jsx("p",{className:"text-sm font-medium text-content-secondary",children:"No runs yet"}),n.jsx("p",{className:"text-xs text-content-tertiary mt-1 mb-4",children:"Execute your first test run to see results here"}),n.jsxs(ne,{size:"sm",onClick:()=>e("/run"),children:[n.jsx(Rt,{size:12})," Start a Run"]})]}):n.jsxs("div",{className:"divide-y divide-border-muted",children:[n.jsxs("div",{className:"grid grid-cols-[1fr_100px_140px_80px_60px] px-5 py-2 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:[n.jsx("span",{children:"Run ID"}),n.jsx("span",{children:"Status"}),n.jsx("span",{children:"Results"}),n.jsx("span",{children:"Duration"}),n.jsx("span",{className:"text-right",children:"Time"})]}),t.slice(0,6).map(w=>{const N=w.passed+w.failed+w.skipped,P=N>0?Math.round(w.passed/N*100):0;return n.jsxs("div",{onClick:()=>e("/reports"),className:"grid grid-cols-[1fr_100px_140px_80px_60px] items-center px-5 py-3 hover:bg-surface-inset cursor-pointer transition-colors group",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx(fk,{status:w.status}),n.jsx("span",{className:"text-xs font-mono text-content-secondary truncate",children:w.runId.slice(0,10)})]}),n.jsx("div",{children:n.jsx("span",{className:C("text-[10px] font-semibold px-2 py-0.5 rounded-md uppercase tracking-wide",w.status==="passed"?"bg-emerald-50 text-emerald-700":w.status==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-700"),children:w.status})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"flex-1 h-1.5 bg-surface-inset rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-emerald-400 rounded-full transition-all duration-500",style:{width:`${P}%`}})}),n.jsxs("span",{className:"text-[11px] text-content-secondary tabular-nums w-12 text-right",children:[w.passed,"/",N]})]}),n.jsx("span",{className:"text-[11px] text-content-tertiary tabular-nums",children:w.duration?`${(w.duration/1e3).toFixed(1)}s`:"—"}),n.jsx("span",{className:"text-[10px] text-content-tertiary text-right",children:Vo(new Date(w.startedAt),{addSuffix:!1})})]},w.runId)})]})]}),n.jsxs("div",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border bg-surface overflow-hidden flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg bg-indigo-50 border border-indigo-100 flex items-center justify-center",children:n.jsx(Ji,{size:14,className:"text-indigo-500"})}),n.jsx("h2",{className:"text-sm font-semibold text-content",children:"Test Suites"})]}),n.jsxs("span",{className:"text-[10px] font-semibold text-content-tertiary bg-surface-inset px-2 py-0.5 rounded-md",children:[d," cases"]})]}),r.length===0?n.jsxs("div",{className:"px-5 py-8 text-center",children:[n.jsx("p",{className:"text-sm text-content-tertiary mb-3",children:"No suites yet"}),n.jsx(ne,{size:"sm",onClick:()=>e("/tests"),children:"Create Suite"})]}):n.jsx("ul",{className:"divide-y divide-border-muted max-h-[200px] overflow-y-auto",children:r.map(w=>n.jsxs("li",{onClick:()=>e("/tests"),className:"flex items-center justify-between px-5 py-2.5 hover:bg-surface-inset cursor-pointer transition-colors group",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"text-sm text-content font-medium truncate",children:w.name}),n.jsx("span",{className:C("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",(w.type??"ui")==="api"?"bg-purple-50 text-purple-600":"bg-blue-50 text-blue-600"),children:(w.type??"ui").toUpperCase()})]}),n.jsxs("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:[w.caseCount??0," cases"]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx(gf,{data:pk(t,w.id),maxHeight:24}),n.jsx(ir,{size:13,className:"text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity"})]})]},w.id))})]}),n.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:[{label:"Smart Tests",icon:Ot,to:"/story",gradient:"from-violet-500 to-indigo-600"},{label:"Self-Healing",icon:Uo,to:"/healing",gradient:"from-rose-500 to-pink-600"},{label:"Variables",icon:xm,to:"/variables",gradient:"from-teal-500 to-cyan-600"},{label:"Reports",icon:Cn,to:"/reports",gradient:"from-amber-500 to-orange-600"}].map(({label:w,icon:N,to:P,gradient:E})=>n.jsxs("button",{type:"button",onClick:()=>e(P),className:"group relative overflow-hidden rounded-xl border border-border bg-surface px-3.5 py-3 hover:border-border-strong hover:shadow-card transition-all duration-200 flex items-center gap-3",children:[n.jsx("div",{className:C("w-8 h-8 rounded-lg bg-gradient-to-br flex items-center justify-center flex-shrink-0",E),children:n.jsx(N,{size:14,className:"text-white"})}),n.jsx("p",{className:"text-xs font-semibold text-content group-hover:text-accent transition-colors",children:w})]},P))})]})]}),c&&n.jsx("div",{className:"rounded-2xl border border-border bg-surface px-6 py-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:C("w-10 h-10 rounded-xl flex items-center justify-center",c.status==="passed"?"bg-emerald-50 border border-emerald-100":c.status==="failed"?"bg-red-50 border border-red-100":"bg-amber-50 border border-amber-100"),children:c.status==="passed"?n.jsx(Ue,{size:18,className:"text-emerald-500"}):c.status==="failed"?n.jsx(Yt,{size:18,className:"text-red-500"}):n.jsx(lf,{size:18,className:"text-amber-500"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Last Run"}),n.jsxs("p",{className:"text-sm font-bold text-content mt-0.5",children:[c.passed," passed, ",c.failed," failed",c.skipped>0&&`, ${c.skipped} skipped`]})]})]}),n.jsxs("div",{className:"flex items-center gap-6 text-xs text-content-tertiary",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Or,{size:12}),n.jsx("span",{children:Vo(new Date(c.startedAt),{addSuffix:!0})})]}),c.duration&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(lf,{size:12}),n.jsxs("span",{children:[(c.duration/1e3).toFixed(1),"s"]})]}),n.jsx("div",{className:"flex items-center gap-1.5 font-mono",children:n.jsxs("span",{children:["#",c.runId.slice(0,8)]})}),n.jsxs(ne,{size:"sm",variant:"ghost",onClick:()=>e("/reports"),children:["Details ",n.jsx(ir,{size:11})]})]})]})})]})]})}function zn({open:e,title:t="Confirm Delete",message:s,confirmLabel:r="Delete",onConfirm:a,onCancel:i}){return m.useEffect(()=>{if(!e)return;const l=o=>{o.key==="Escape"&&i(),o.key==="Enter"&&(o.preventDefault(),a())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,i]),e?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:i}),n.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 p-6 animate-scale-in border border-border",children:[n.jsxs("div",{className:"flex items-start gap-3.5",children:[n.jsx("div",{className:"flex-shrink-0 w-10 h-10 rounded-xl bg-red-50 border border-red-200/50 flex items-center justify-center",children:n.jsx(Yt,{size:18,className:"text-red-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h3",{className:"text-sm font-semibold text-content",children:t}),n.jsx("p",{className:"mt-1 text-sm text-content-secondary leading-relaxed",children:s})]})]}),n.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2.5",children:[n.jsx(ne,{variant:"secondary",size:"sm",onClick:i,children:"Cancel"}),n.jsx(ne,{variant:"danger",size:"sm",onClick:a,children:r})]})]})]}):null}function Mn(){const[e,t]=m.useState({open:!1,message:"",onConfirm:()=>{}}),s=m.useCallback((i,l)=>{t({open:!0,message:i,onConfirm:l})},[]),r=m.useCallback(()=>{t(i=>({...i,open:!1}))},[]),a=m.useCallback(()=>{e.onConfirm(),t(i=>({...i,open:!1}))},[e.onConfirm]);return{modalProps:{open:e.open,message:e.message,onConfirm:a,onCancel:r},confirmDelete:s}}const yk=[{id:"all",label:"All"},{id:"auth",label:"Auth"},{id:"crud",label:"CRUD"},{id:"navigation",label:"Navigation"},{id:"form",label:"Form"},{id:"api",label:"API"}],bk={auth:"bg-violet-50 text-violet-600",crud:"bg-blue-50 text-blue-600",navigation:"bg-teal-50 text-teal-600",form:"bg-orange-50 text-orange-600",api:"bg-purple-50 text-purple-600"};function vk({open:e,onClose:t,suiteId:s,onCreated:r}){const[a,i]=m.useState("all"),[l,o]=m.useState(null),{data:c=[],isLoading:d}=ke({queryKey:["templates"],queryFn:()=>BN.list(),enabled:e}),x=Y({mutationFn:b=>$s.create(s,{name:b.name,description:b.description,steps:b.steps.map((y,j)=>({...y,id:crypto.randomUUID(),order:j+1}))}),onSuccess:()=>{O.success("Test case created from template"),r(),t()},onError:b=>{O.error(b.message),o(null)}}),f=b=>{o(b.id),x.mutate(b)},g=a==="all"?c:c.filter(b=>b.category===a);return e?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:n.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:b=>b.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-bold text-content",children:"Test Case Templates"}),n.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Start from a pre-built template"})]}),n.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:n.jsx(Se,{size:14})})]}),n.jsx("div",{className:"flex gap-1 px-5 py-2.5 border-b border-border flex-shrink-0 overflow-x-auto",children:yk.map(b=>n.jsx("button",{type:"button",onClick:()=>i(b.id),className:C("px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors flex-shrink-0",a===b.id?"bg-accent text-white":"text-content-secondary hover:bg-surface-inset"),children:b.label},b.id))}),n.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:d?n.jsx("div",{className:"grid grid-cols-2 gap-3",children:[1,2,3,4].map(b=>n.jsx("div",{className:"h-28 rounded-xl skeleton-shimmer"},b))}):g.length===0?n.jsx("div",{className:"py-12 text-center",children:n.jsx("p",{className:"text-sm text-content-tertiary",children:"No templates in this category"})}):n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:g.map(b=>n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-4 flex flex-col gap-3 hover:border-border-strong hover:shadow-card transition-all",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg bg-surface-inset flex items-center justify-center flex-shrink-0",children:n.jsx(mn,{size:13,className:"text-content-secondary"})}),n.jsx("div",{className:"min-w-0",children:n.jsx("p",{className:"text-sm font-bold text-content truncate",children:b.name})})]}),n.jsx("span",{className:C("text-[9px] px-1.5 py-0.5 rounded font-bold uppercase flex-shrink-0",bk[b.category]??"bg-surface-inset text-content-tertiary"),children:b.category})]}),n.jsx("p",{className:"text-xs text-content-secondary leading-relaxed",children:b.description}),n.jsxs("div",{className:"flex items-center justify-between mt-auto",children:[n.jsxs("span",{className:"text-[10px] text-content-tertiary",children:[b.steps.length," step",b.steps.length!==1?"s":""]}),n.jsx("button",{type:"button",onClick:()=>f(b),disabled:x.isPending,className:C("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",l===b.id?"bg-emerald-50 text-emerald-600 border border-emerald-200":"bg-accent/10 text-accent hover:bg-accent/20",x.isPending&&"opacity-50 cursor-not-allowed"),children:l===b.id?n.jsxs(n.Fragment,{children:[n.jsx(Ue,{size:11})," Creating..."]}):"Use Template"})]})]},b.id))})})]})}):null}function Ny(){return ke({queryKey:["suites"],queryFn:()=>Ar.list()})}function jk(){const e=ie();return Y({mutationFn:Ar.create,onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),O.success("Suite created")},onError:t=>O.error(t.message)})}function wy(){const e=ie();return Y({mutationFn:({id:t,data:s})=>Ar.update(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),O.success("Suite updated")},onError:t=>O.error(t.message)})}function Nk(){const e=ie();return Y({mutationFn:Ar.delete,onSuccess:()=>{e.invalidateQueries({queryKey:["suites"]}),O.success("Suite deleted")},onError:t=>O.error(t.message)})}function wk(e){return ke({queryKey:["cases",e],queryFn:()=>$s.list(e),enabled:!!e})}function kk(e,t){return ke({queryKey:["cases",e,t],queryFn:()=>$s.get(e,t),enabled:!!e&&!!t})}function yf(e){const t=ie();return Y({mutationFn:s=>$s.create(e,s),onSuccess:()=>{t.invalidateQueries({queryKey:["cases",e]}),O.success("Test case created")},onError:s=>O.error(s.message)})}function Sk(e){const t=ie();return Y({mutationFn:({caseId:s,data:r})=>$s.update(e,s,r),onSuccess:(s,{caseId:r})=>{t.invalidateQueries({queryKey:["cases",e]}),t.invalidateQueries({queryKey:["cases",e,r]}),O.success("Test case updated")},onError:s=>O.error(s.message)})}function Ck(e){const t=ie();return Y({mutationFn:s=>$s.delete(e,s),onSuccess:()=>{t.invalidateQueries({queryKey:["cases",e]}),O.success("Test case deleted")},onError:s=>O.error(s.message)})}function Ek(e,t){const s=ie();return Y({mutationFn:r=>Lr.add(e,t,r),onSuccess:()=>{s.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>O.error(r.message)})}function Pk(e,t){const s=ie();return Y({mutationFn:({stepId:r,instruction:a,timeout:i,stepType:l,retries:o,mockUrl:c,mockResponse:d,mockStatus:x,runAudit:f})=>Lr.update(e,t,r,{instruction:a,timeout:i,stepType:l,retries:o,mockUrl:c,mockResponse:d,mockStatus:x,runAudit:f}),onSuccess:()=>{s.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>O.error(r.message)})}function zk(e,t){const s=ie();return Y({mutationFn:r=>Lr.reorder(e,t,r),onSuccess:()=>{s.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>O.error(r.message)})}function Mk(e,t){const s=ie();return Y({mutationFn:r=>Lr.delete(e,t,r),onSuccess:()=>{s.invalidateQueries({queryKey:["cases",e,t]})},onError:r=>O.error(r.message)})}function Tk(e,t){const s=ie();return Y({mutationFn:r=>Lr.generate(e,t,r),onSuccess:()=>{s.invalidateQueries({queryKey:["cases",e,t]}),O.success("Code generated")},onError:r=>O.error(r.message)})}function Rk(e,t){const s=ie();return Y({mutationFn:()=>Lr.generateAll(e,t),onSuccess:r=>{s.invalidateQueries({queryKey:["cases",e,t]}),O.success(`Generated code for ${r.generated} step(s)`)},onError:r=>O.error(r.message)})}const el=new Map,Ju=new Set;function ky(){for(const e of Ju)e()}function gd(){return"all"}function yd(e){return`suite:${e}`}function bd(e,t){return`case:${e}:${t}`}function vd(e,t){el.set(e,{op:t,startedAt:Date.now()}),ky()}function jd(e){el.delete(e),ky()}function Nd(e){var t;return((t=el.get(e))==null?void 0:t.op)??null}function Ok(){const e=new Map,t=new Map;let s=null;for(const[r,a]of el)r==="all"?s=a.op:r.startsWith("suite:")?e.set(r.slice(6),a.op):r.startsWith("case:")&&t.set(r.slice(5),a.op);return{allOp:s,busySuites:e,busyCases:t,activeCount:el.size}}function Dk(e){return Ju.add(e),()=>{Ju.delete(e)}}const Ze={startAll:e=>vd(gd(),e),finishAll:()=>jd(gd()),startSuite:(e,t)=>vd(yd(e),t),finishSuite:e=>jd(yd(e)),startCase:(e,t,s)=>vd(bd(e,t),s),finishCase:(e,t)=>jd(bd(e,t)),isAllBusy:()=>Nd(gd()),isSuiteBusy:e=>Nd(yd(e)),isCaseBusy:(e,t)=>Nd(bd(e,t)),getSnapshot:Ok,subscribe:Dk};function yl(e,t){var s;if(e.failed>0){const r=e.results.filter(a=>a.action==="failed");O.error(`${t}: ${e.failed} failed — ${((s=r[0])==null?void 0:s.error)??"Unknown error"}`)}else if(e.created>0||e.synced>0){const r=[];e.created>0&&r.push(`${e.created} created`),e.synced>0&&r.push(`${e.synced} synced`),e.skipped>0&&r.push(`${e.skipped} skipped`),O.success(`Xray: ${r.join(", ")}`)}else e.skipped>0&&O.success(`Xray: ${e.skipped} already up to date`)}function Ak(){return ke({queryKey:["xray","status"],queryFn:()=>Fr.status(),retry:1,staleTime:1e4})}function Sy(e){return ke({queryKey:["xray","status",e],queryFn:()=>Fr.suiteStatus(e),enabled:!!e,retry:1,staleTime:1e4})}function Lk(){const e=ie();return Y({mutationFn:()=>(Ze.startAll("create"),Fr.createAll()),onSuccess:t=>{Ze.finishAll(),e.invalidateQueries({queryKey:["xray"]}),yl(t,"Create in Xray")},onError:t=>{Ze.finishAll(),O.error(`Xray create failed: ${t.message}`)}})}function Cy(){const e=ie();return Y({mutationFn:t=>(Ze.startSuite(t,"create"),Fr.createSuite(t)),onSuccess:(t,s)=>{Ze.finishSuite(s),e.invalidateQueries({queryKey:["xray"]}),yl(t,"Create Suite")},onError:(t,s)=>{Ze.finishSuite(s),O.error(`Xray create failed: ${t.message}`)}})}function Ey(){const e=ie();return Y({mutationFn:({suiteId:t,caseId:s})=>(Ze.startCase(t,s,"create"),Fr.createCase(t,s)),onSuccess:(t,{suiteId:s,caseId:r})=>{Ze.finishCase(s,r),e.invalidateQueries({queryKey:["xray"]}),yl(t,"Create Case")},onError:(t,{suiteId:s,caseId:r})=>{Ze.finishCase(s,r),O.error(`Xray create failed: ${t.message}`)}})}function Ik(){const e=ie();return Y({mutationFn:t=>(Ze.startSuite(t,"sync"),Fr.syncSuite(t)),onSuccess:(t,s)=>{Ze.finishSuite(s),e.invalidateQueries({queryKey:["xray"]}),yl(t,"Sync Suite")},onError:(t,s)=>{Ze.finishSuite(s),O.error(`Xray sync failed: ${t.message}`)}})}function Py(){const e=ie();return Y({mutationFn:({suiteId:t,caseId:s})=>(Ze.startCase(t,s,"sync"),Fr.syncCase(t,s)),onSuccess:(t,{suiteId:s,caseId:r})=>{Ze.finishCase(s,r),e.invalidateQueries({queryKey:["xray"]}),yl(t,"Sync Case")},onError:(t,{suiteId:s,caseId:r})=>{Ze.finishCase(s,r),O.error(`Xray sync failed: ${t.message}`)}})}function zy({code:e,maxLines:t,className:s}){const[r,a]=m.useState(!1),i=async()=>{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)},l=!e.trim();return n.jsxs("div",{className:C("relative rounded-xl bg-[#0d1117] text-slate-300 ring-1 ring-white/5 overflow-hidden",s),children:[!l&&n.jsx("button",{type:"button",onClick:()=>void i(),className:C("absolute top-2.5 right-2.5 p-1.5 rounded-md transition-all duration-150",r?"bg-emerald-500/20 text-emerald-400":"text-slate-500 hover:text-slate-300 hover:bg-white/10"),title:"Copy code",children:r?n.jsx(He,{size:13}):n.jsx(cm,{size:13})}),n.jsx("pre",{className:C("p-4 text-xs font-mono leading-relaxed overflow-x-auto",t&&`line-clamp-${t}`),style:t?{maxHeight:`${t*1.5}rem`,overflow:"auto"}:void 0,children:n.jsx("code",{children:l?"// No code generated yet":e})})]})}const Fk={"not-created":{bg:"bg-surface-inset",text:"text-content-tertiary",dot:"bg-content-tertiary",border:"border-border",label:"Not Created"},created:{bg:"bg-emerald-50",text:"text-emerald-700",dot:"bg-emerald-500",border:"border-emerald-200/60",label:"Created"},synced:{bg:"bg-emerald-50/60",text:"text-emerald-600",dot:"bg-emerald-400",border:"border-emerald-200/60",label:"Synced"},"update-pending":{bg:"bg-amber-50",text:"text-amber-700",dot:"bg-amber-500",border:"border-amber-200/60",label:"Update Pending"}};function gm({status:e,xrayKey:t}){const s=Fk[e];return n.jsxs("span",{className:C("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[10px] font-semibold whitespace-nowrap border tracking-wide",s.bg,s.text,s.border),children:[n.jsx("span",{className:C("w-1.5 h-1.5 rounded-full flex-shrink-0",s.dot)}),s.label,t&&n.jsxs("span",{className:"text-[9px] opacity-60 truncate max-w-[80px]",title:t,children:["(",t,")"]})]})}const _k={"not-created":{icon:mm,label:"Push to Xray",title:"Create in Xray",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-600",iconHover:"hover:bg-emerald-50"},"update-pending":{icon:um,label:"Sync Xray",title:"Sync changes to Xray",btnClass:"bg-gradient-to-b from-amber-500 to-amber-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-amber-500",iconHover:"hover:bg-amber-50"},created:{icon:Ue,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"},synced:{icon:Ue,label:"Synced with Xray",title:"Up to date -- click to re-sync",btnClass:"bg-gradient-to-b from-emerald-500 to-emerald-600 hover:brightness-110 text-white shadow-sm",iconClass:"text-emerald-500",iconHover:"hover:bg-emerald-50"}};function tl({status:e,onClick:t,busy:s=!1,variant:r="full",label:a}){const i=_k[e],l=i.icon,o=a??i.label;return r==="icon"?n.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),t()},title:s?"Processing...":i.title,className:C("p-1.5 rounded-lg transition-all duration-150",s?"cursor-wait opacity-50":C(i.iconClass,i.iconHover)),children:s?n.jsx(ce,{size:14,className:"animate-spin text-accent"}):n.jsx(l,{size:14})}):n.jsxs("button",{type:"button",onClick:()=>t(),title:s?"Processing...":i.title,className:C("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150",s?"bg-surface-inset text-content-tertiary cursor-wait":i.btnClass),children:[s?n.jsx(ce,{size:13,className:"animate-spin"}):n.jsx(l,{size:13}),s?"Processing...":o]})}function $k(e){return ke({queryKey:["hooks",e],queryFn:()=>Ir.get(e),enabled:!!e})}function Uk(e){const t=ie();return Y({mutationFn:({hookType:s,instruction:r,order:a})=>Ir.addStep(e,s,{instruction:r,order:a}),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:s=>O.error(s.message)})}function Bk(e){const t=ie();return Y({mutationFn:({hookType:s,stepId:r,instruction:a,timeout:i})=>Ir.updateStep(e,s,r,{instruction:a,timeout:i}),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:s=>O.error(s.message)})}function Hk(e){const t=ie();return Y({mutationFn:({hookType:s,stepId:r})=>Ir.deleteStep(e,s,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:s=>O.error(s.message)})}function qk(e){const t=ie();return Y({mutationFn:({hookType:s,stepIds:r})=>Ir.reorderSteps(e,s,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]})},onError:s=>O.error(s.message)})}function Kk(e){const t=ie();return Y({mutationFn:({hookType:s,stepId:r})=>Ir.generateStep(e,s,r),onSuccess:()=>{t.invalidateQueries({queryKey:["hooks",e]}),O.success("Hook step code generated")},onError:s=>O.error(s.message)})}function Wk(e){const t=ie();return Y({mutationFn:s=>Ir.generateAll(e,s),onSuccess:s=>{t.invalidateQueries({queryKey:["hooks",e]}),O.success(`Generated code for ${s.generated} hook step(s)`)},onError:s=>O.error(s.message)})}const Vk=[{type:"before_all",label:"Before All",desc:"Runs once before all test cases in the suite",icon:n.jsx(dN,{size:16}),color:"text-emerald-600"},{type:"before_each",label:"Before Each",desc:"Runs before every test case",icon:n.jsx(Nc,{size:16}),color:"text-blue-600"},{type:"after_each",label:"After Each",desc:"Runs after every test case",icon:n.jsx(SN,{size:16}),color:"text-amber-600"},{type:"after_all",label:"After All",desc:"Runs once after all test cases in the suite",icon:n.jsx(uN,{size:16}),color:"text-red-500"}];function Qk({suiteId:e,open:t,onClose:s}){const{data:r,isLoading:a}=$k(e);return t?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:s}),n.jsxs("div",{className:"relative w-full max-w-3xl max-h-[85vh] bg-surface rounded-xl shadow-2xl flex flex-col overflow-hidden mx-4",children:[n.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border bg-gradient-to-r from-slate-50 to-white",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Hooks"}),n.jsx("p",{className:"text-xs text-content-tertiary mt-0.5",children:"Lifecycle hooks run setup/teardown around your test cases (Playwright hooks)"})]}),n.jsx("button",{onClick:s,className:"p-1.5 rounded-lg hover:bg-surface-inset transition-colors text-content-tertiary hover:text-content-secondary",children:n.jsx(Se,{size:18})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:a?n.jsx("div",{className:"flex items-center justify-center py-16",children:n.jsx(ce,{size:24,className:"animate-spin text-accent"})}):Vk.map(i=>n.jsx(Gk,{suiteId:e,hookType:i.type,label:i.label,description:i.desc,icon:i.icon,color:i.color,steps:(r==null?void 0:r[i.type])??[]},i.type))})]})]}):null}function Gk({suiteId:e,hookType:t,label:s,description:r,icon:a,color:i,steps:l}){const[o,c]=m.useState(l.length>0),[d,x]=m.useState(""),[f,g]=m.useState(""),[b,y]=m.useState(null),[j,k]=m.useState(""),[h,u]=m.useState(new Set),[p,v]=m.useState(null),[w,N]=m.useState(null),P=Uk(e),E=Hk(e),{modalProps:_,confirmDelete:D}=Mn(),G=qk(e),J=Bk(e),se=Kk(e),M=Wk(e),F=()=>{d.trim()&&(P.mutate({hookType:t,instruction:d.trim()}),x(""))},ee=A=>{g(A),se.mutate({hookType:t,stepId:A},{onSettled:()=>g("")})},ae=()=>{M.mutate(t)},z=A=>{if(!p||p===A){v(null),N(null);return}const te=l.map(xe=>xe.id),B=te.indexOf(p),de=te.indexOf(A);B<0||de<0||(te.splice(B,1),te.splice(de,0,p),G.mutate({hookType:t,stepIds:te}),v(null),N(null))},K=A=>{y(A.id),k(A.instruction)},T=A=>{var te;j.trim()&&j!==((te=l.find(B=>B.id===A))==null?void 0:te.instruction)&&J.mutate({hookType:t,stepId:A,instruction:j.trim()}),y(null)},W=l.filter(A=>{var te;return!((te=A.generatedCode)!=null&&te.trim())}).length;return n.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(!o),className:"w-full flex items-center gap-3 px-4 py-3 bg-surface-inset hover:bg-surface-inset transition-colors text-left",children:[o?n.jsx(Tt,{size:14,className:"text-content-tertiary"}):n.jsx(Zt,{size:14,className:"text-content-tertiary"}),n.jsx("span",{className:C("flex-shrink-0",i),children:a}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"text-sm font-semibold text-content-secondary",children:s}),n.jsx("span",{className:"text-[10px] text-content-tertiary ml-2",children:r})]}),n.jsxs("span",{className:C("text-[10px] font-semibold px-2 py-0.5 rounded-full",l.length>0?"bg-accent/10 text-accent":"bg-slate-200 text-content-tertiary"),children:[l.length," step",l.length!==1?"s":""]})]}),o&&n.jsxs("div",{className:"border-t border-border bg-surface",children:[l.length===0?n.jsx("div",{className:"px-4 py-6 text-center",children:n.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — add one below"})}):n.jsx("div",{className:"divide-y divide-slate-100",children:l.map((A,te)=>n.jsxs("div",{draggable:!0,onDragStart:()=>v(A.id),onDragOver:B=>{B.preventDefault(),N(A.id)},onDragLeave:()=>N(null),onDrop:()=>z(A.id),onDragEnd:()=>{v(null),N(null)},className:C("flex items-start gap-2 px-4 py-2.5 group transition-colors",w===A.id&&"bg-accent/5 border-l-2 border-accent",p===A.id&&"opacity-40"),children:[n.jsx("div",{className:"pt-0.5 cursor-grab text-content-tertiary opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx(vc,{size:12})}),n.jsx("span",{className:"text-[10px] font-bold text-content-tertiary pt-0.5 w-4 flex-shrink-0",children:te+1}),n.jsxs("div",{className:"flex-1 min-w-0",children:[b===A.id?n.jsx("input",{autoFocus:!0,className:"w-full text-xs border border-accent rounded px-2 py-1 focus:outline-none focus:ring-1 focus:ring-accent",value:j,onChange:B=>k(B.target.value),onBlur:()=>T(A.id),onKeyDown:B=>{B.key==="Enter"&&T(A.id),B.key==="Escape"&&y(null)}}):n.jsxs("p",{className:"text-xs text-content-secondary cursor-pointer hover:text-accent transition-colors flex items-center gap-1.5",onClick:()=>K(A),title:"Click to edit",children:[A.instruction,A.generatedCode&&!h.has(A.id)&&n.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-green-400 flex-shrink-0",title:"Code generated"})]}),A.generatedCode&&h.has(A.id)&&n.jsx("div",{className:"mt-1",children:n.jsx(zy,{code:A.generatedCode,maxLines:6})})]}),n.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[A.generatedCode&&n.jsx("button",{title:h.has(A.id)?"Hide code":"Show code",onClick:()=>u(B=>{const de=new Set(B);return de.has(A.id)?de.delete(A.id):de.add(A.id),de}),className:C("p-1 rounded transition-colors",h.has(A.id)?"text-content-secondary bg-slate-100":"text-content-tertiary hover:bg-surface-inset"),children:n.jsx(Ag,{size:12})}),n.jsx("button",{title:"Generate code",onClick:()=>ee(A.id),disabled:f===A.id,className:"p-1 rounded hover:bg-purple-50 text-purple-500 transition-colors",children:f===A.id?n.jsx(ce,{size:12,className:"animate-spin"}):n.jsx(Fa,{size:12})}),n.jsx("button",{title:"Delete step",onClick:()=>D("Delete this hook step? This cannot be undone.",()=>E.mutate({hookType:t,stepId:A.id})),className:"p-1 rounded hover:bg-red-50 text-red-400 transition-colors",children:n.jsx(fn,{size:12})})]})]},A.id))}),n.jsxs("div",{className:"px-4 py-3 border-t border-slate-100 bg-surface-inset/50 flex items-center gap-2",children:[n.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent placeholder:text-content-tertiary",value:d,onChange:A=>x(A.target.value),onKeyDown:A=>{A.key==="Enter"&&F()},placeholder:"Add a step (e.g. Navigate to login page)"}),n.jsxs("button",{type:"button",onClick:F,disabled:!d.trim()||P.isPending,className:C("inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors",d.trim()?"bg-accent text-white hover:bg-accent/90":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[P.isPending?n.jsx(ce,{size:11,className:"animate-spin"}):n.jsx(En,{size:11}),"Add"]}),l.length>0&&W>0&&n.jsxs("button",{type:"button",onClick:ae,disabled:M.isPending,className:"inline-flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium bg-purple-600 text-white hover:bg-purple-700 transition-colors",children:[M.isPending?n.jsx(ce,{size:11,className:"animate-spin"}):n.jsx(Fa,{size:11}),"Generate All (",W,")"]})]})]}),n.jsx(zn,{..._})]})}const Yk=[{token:"{{FAKE_FIRST_NAME}}",label:"First Name",example:"Alice"},{token:"{{FAKE_LAST_NAME}}",label:"Last Name",example:"Smith"},{token:"{{FAKE_AGE}}",label:"Age (18–80)",example:"34"},{token:"{{FAKE_EMAIL}}",label:"Email Address",example:"alice.smith123@example.com"},{token:"{{FAKE_PHONE}}",label:"Phone Number",example:"415-782-3901"},{token:"{{FAKE_PASSWORD}}",label:"Password",example:"Xk9#mP2$qL"}];function Jk({onInsert:e}){const[t,s]=m.useState(!1),[r,a]=m.useState("6"),i=m.useRef(null);m.useEffect(()=>{if(!t)return;const c=d=>{i.current&&!i.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[t]);const l=c=>{e(c),s(!1)},o=()=>{const c=Math.max(1,Math.min(20,parseInt(r,10)||6));l(`{{FAKE_NUMBER_${c}}}`)};return n.jsxs("div",{ref:i,className:"relative flex-shrink-0",children:[n.jsxs("button",{type:"button",onClick:()=>s(c=>!c),title:"Insert dynamic data token",className:C("inline-flex items-center justify-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium border transition-all duration-150 focus:outline-none",t?"bg-violet-600 text-white border-violet-700 ring-2 ring-violet-400 shadow-md":"bg-gradient-to-b from-violet-500 to-violet-600 text-white border-violet-700 shadow-sm hover:brightness-110 hover:shadow-md"),children:[n.jsx(Ot,{size:12}),n.jsx("span",{className:"hidden sm:inline",children:"Fake Data"}),n.jsx(Tt,{size:10,className:C("transition-transform",t&&"rotate-180")})]}),t&&n.jsxs("div",{className:"absolute top-full left-0 mt-1.5 z-50 w-72 rounded-xl border border-border bg-surface shadow-lg shadow-black/8 overflow-hidden animate-fade-in",children:[n.jsxs("div",{className:"px-3 py-2 bg-gradient-to-r from-violet-50 to-indigo-50 border-b border-border flex items-center gap-2",children:[n.jsx(Ot,{size:11,className:"text-violet-500"}),n.jsx("span",{className:"text-[10px] font-bold text-violet-700 uppercase tracking-wider",children:"Dynamic Data Tokens"})]}),n.jsxs("div",{className:"p-2",children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-1.5",children:"Person Details"}),n.jsx("div",{className:"space-y-0.5 max-h-[114px] overflow-y-auto",children:Yk.map(({token:c,label:d,example:x})=>n.jsxs("button",{type:"button",onClick:()=>l(c),className:"w-full flex items-center justify-between gap-2 px-2 py-1.5 rounded-lg hover:bg-violet-50 transition-colors group text-left",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-[11px] font-medium text-content group-hover:text-violet-700 truncate",children:d}),n.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate",children:c})]}),n.jsx("span",{className:"text-[9px] text-content-tertiary bg-surface-inset px-1.5 py-0.5 rounded font-mono flex-shrink-0",children:x})]},c))})]}),n.jsx("div",{className:"border-t border-border mx-2"}),n.jsxs("div",{className:"p-2",children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-1 mb-1.5 flex items-center gap-1",children:[n.jsx(Wg,{size:9})," Random Number"]}),n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 flex-1 bg-surface-inset rounded-lg px-2 py-1.5 border border-border",children:[n.jsx("span",{className:"text-[10px] text-content-tertiary",children:"Digits:"}),n.jsx("input",{type:"number",min:1,max:20,value:r,onChange:c=>a(c.target.value),onKeyDown:c=>c.key==="Enter"&&o(),className:"w-10 text-[11px] bg-transparent outline-none text-content font-mono tabular-nums"})]}),n.jsx("button",{type:"button",onClick:o,className:"flex-shrink-0 px-2.5 py-1.5 rounded-lg bg-violet-600 hover:bg-violet-700 text-white text-[10px] font-semibold transition-colors",children:"Insert"})]}),n.jsx("p",{className:"text-[9px] text-content-tertiary px-1 mt-1.5 font-mono",children:`→ {{FAKE_NUMBER_${Math.max(1,parseInt(r,10)||6)}}}`})]}),n.jsx("div",{className:"px-3 py-1.5 bg-surface-inset/60 border-t border-border",children:n.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Tokens resolve to fresh random values on every test run."})})]})]})}function Xk({selectedIds:e,suiteId:t,suites:s,onClear:r,onDeleted:a,onMoved:i}){const l=ie(),{modalProps:o,confirmDelete:c}=Mn(),[d,x]=m.useState(""),f=Y({mutationFn:()=>$s.bulkDelete(t,Array.from(e)),onSuccess:j=>{O.success(`Deleted ${j.deleted} case${j.deleted!==1?"s":""}`),l.invalidateQueries({queryKey:["cases",t]}),a(),r()},onError:j=>O.error(j.message)}),g=Y({mutationFn:j=>$s.bulkMove(t,Array.from(e),j),onSuccess:j=>{O.success(`Moved ${j.moved} case${j.moved!==1?"s":""}`),l.invalidateQueries({queryKey:["cases",t]}),i(),r(),x("")},onError:j=>O.error(j.message)}),b=s.filter(j=>j.id!==t),y=e.size;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"fixed bottom-0 left-[248px] right-0 z-30 bg-surface border-t border-border shadow-elevated px-5 py-3 flex items-center gap-3",children:[n.jsxs("span",{className:"text-sm font-semibold text-content flex-shrink-0",children:[y," case",y!==1?"s":""," selected"]}),n.jsx("button",{type:"button",onClick:()=>O("Coming soon",{icon:"🔜"}),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset transition-colors",children:"Run Selected"}),n.jsxs("button",{type:"button",onClick:()=>c(`Delete ${y} selected case${y!==1?"s":""}? This cannot be undone.`,()=>f.mutate()),disabled:f.isPending,className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border border-red-200 text-red-600 bg-red-50 hover:bg-red-100 transition-colors disabled:opacity-50",children:[n.jsx(fn,{size:12})," Delete Selected"]}),b.length>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(NN,{size:13,className:"text-content-tertiary flex-shrink-0"}),n.jsxs("select",{className:"text-xs border border-border rounded-lg px-2 py-1.5 bg-surface text-content-secondary focus:outline-none focus:ring-1 focus:ring-accent/30",value:d,onChange:j=>x(j.target.value),children:[n.jsx("option",{value:"",children:"Move to suite…"}),b.map(j=>n.jsx("option",{value:j.id,children:j.name},j.id))]}),d&&n.jsx("button",{type:"button",onClick:()=>g.mutate(d),disabled:g.isPending,className:"text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Move"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset transition-colors",children:n.jsx(Se,{size:14})})]}),n.jsx(zn,{...o})]})}function Zk({passRate:e,runs:t,flaky:s}){if(!s||t<3||e===1)return null;const r=Math.round(e*100);return n.jsx("span",{title:`Flaky: ${r}% pass rate over ${t} runs`,className:"inline-flex items-center gap-0.5 text-[8px] font-semibold px-1.5 py-0.5 rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 flex-shrink-0",children:"~flaky"})}function e5({open:e,onClose:t,suiteId:s,caseId:r,onInserted:a}){const i=ie(),[l,o]=m.useState(""),[c,d]=m.useState(!1),[x,f]=m.useState(""),[g,b]=m.useState(""),{data:y=[]}=ke({queryKey:["step-library"],queryFn:()=>ca.list()}),j=Y({mutationFn:u=>Lr.add(s,r,{instruction:u}),onSuccess:()=>{i.invalidateQueries({queryKey:["case",s,r]}),O.success("Step inserted"),a()},onError:u=>O.error(u.message)}),k=Y({mutationFn:()=>ca.create({name:x,instruction:g}),onSuccess:()=>{i.invalidateQueries({queryKey:["step-library"]}),O.success("Step saved to library"),d(!1),f(""),b("")},onError:u=>O.error(u.message)}),h=y.filter(u=>!l||u.name.toLowerCase().includes(l.toLowerCase())||u.instruction.toLowerCase().includes(l.toLowerCase())||u.tags.some(p=>p.toLowerCase().includes(l.toLowerCase())));return e?n.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-80 bg-surface border-l border-border shadow-xl z-40 flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Yi,{size:14,className:"text-accent"}),n.jsx("span",{className:"text-sm font-semibold text-content",children:"Step Library"})]}),n.jsx("button",{type:"button",onClick:t,className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:n.jsx(Se,{size:14})})]}),n.jsx("div",{className:"px-3 py-2 border-b border-border flex-shrink-0",children:n.jsxs("div",{className:"relative",children:[n.jsx(Mr,{size:12,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary"}),n.jsx("input",{type:"text",placeholder:"Search steps…",value:l,onChange:u=>o(u.target.value),className:"w-full pl-7 pr-3 py-1.5 text-xs border border-border rounded-lg bg-surface-inset focus:outline-none focus:ring-1 focus:ring-accent/30"})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto py-2 px-2 space-y-1",children:[h.length===0&&n.jsx("p",{className:"text-[11px] text-content-tertiary text-center py-6",children:y.length===0?"No steps in library yet":"No results"}),h.map(u=>n.jsx("div",{className:"border border-border rounded-lg p-2.5 hover:border-accent/30 hover:bg-surface-inset/50 transition-colors",children:n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs font-semibold text-content truncate",children:u.name}),n.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 line-clamp-2",children:u.instruction}),u.tags.length>0&&n.jsx("div",{className:"flex flex-wrap gap-0.5 mt-1",children:u.tags.map(p=>n.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:p},p))})]}),n.jsx("button",{type:"button",onClick:()=>j.mutate(u.instruction),disabled:j.isPending,className:"flex-shrink-0 text-[10px] px-2 py-1 rounded bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Insert"})]})},u.id))]}),n.jsx("div",{className:"border-t border-border p-3 flex-shrink-0",children:c?n.jsxs("div",{className:"space-y-2",children:[n.jsx("input",{type:"text",placeholder:"Step name",value:x,onChange:u=>f(u.target.value),className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),n.jsx("textarea",{placeholder:"Step instruction",value:g,onChange:u=>b(u.target.value),rows:2,className:"w-full px-2 py-1.5 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>k.mutate(),disabled:!x.trim()||!g.trim()||k.isPending,className:"flex-1 text-xs py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:"Save"}),n.jsx("button",{type:"button",onClick:()=>d(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}):n.jsxs("button",{type:"button",onClick:()=>d(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs py-2 rounded-lg border border-dashed border-border text-content-tertiary hover:text-content hover:border-accent/40 transition-colors",children:[n.jsx(En,{size:12})," Save current step to library"]})})]}):null}const ii=new Set,Wr=new Map;let is=null,li=null,oi=null;const Vr=new Map,ci=new Map,Xu=new Set;function Qr(){Xu.forEach(e=>e())}const yt={subscribe(e){return Xu.add(e),()=>Xu.delete(e)},getSnapshot(){return{runningCaseIds:ii,runningSuiteId:is,caseLastRun:Vr,suiteLastRun:ci}},startCase(e){ii.add(e),Qr()},startSuite(e){oi=e,is=e,Qr()},onRunStart(e){oi&&(li=e,oi=null)},onCaseRunning(e,t){Wr.has(e)||Wr.set(e,t)},onCaseDone(e,t,s){const r=e===li,a=Vr.get(t),i=r?(a==null?void 0:a.allureRunId)??e:e;Vr.set(t,{status:s,runId:e,allureRunId:i}),Qr()},onComplete(e,t){const s=Wr.get(e);s&&(ii.delete(s),Wr.delete(e)),ii.clear(),Wr.clear(),e===li&&is?ci.set(is,{...t,runId:e}):is&&ci.set(is,{...t,runId:e}),is=null,li=null,oi=null,Qr()},seedFromHistory(e){for(const t of e)for(const s of t.suites){ci.has(s.suiteId)||ci.set(s.suiteId,{passed:t.passed,failed:t.failed,skipped:t.skipped,runId:t.runId});const a=t.suites.reduce((i,l)=>i+l.cases.length,0)===1;for(const i of s.cases){const l=Vr.get(i.caseId);l?a&&!l.allureRunId&&Vr.set(i.caseId,{...l,allureRunId:t.runId}):Vr.set(i.caseId,{status:i.status,runId:t.runId,allureRunId:t.runId})}}Qr()},clear(){ii.clear(),Wr.clear(),is=null,li=null,oi=null,Qr()}};function Ec(){const[e,t]=m.useState(()=>yt.getSnapshot());return m.useEffect(()=>yt.subscribe(()=>t(yt.getSnapshot())),[]),e}function ym(){const[e,t]=m.useState(()=>Ze.getSnapshot());return m.useEffect(()=>Ze.subscribe(()=>t(Ze.getSnapshot())),[]),e}const My=["critical","high","medium","low"],Zu={critical:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-500/20 dark:ring-red-500/30",high:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 ring-orange-500/20 dark:ring-orange-500/30",medium:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-500/20 dark:ring-blue-500/30",low:"bg-surface-inset text-content-secondary ring-border"};function nl({tags:e,editable:t=!1,onAdd:s,onRemove:r}){const[a,i]=m.useState(""),l=()=>{const o=a.trim().toLowerCase().replace(/\s+/g,"-");if(!o||e.includes(o)){i("");return}s==null||s(o),i("")};return n.jsxs("div",{className:"flex flex-wrap gap-0.5 items-center",children:[e.map(o=>n.jsxs("span",{className:"inline-flex items-center gap-px px-1.5 py-px rounded bg-accent/8 text-accent text-[9px] font-medium ring-1 ring-accent/15 leading-tight",children:[o,t&&n.jsx("button",{type:"button",onClick:()=>r==null?void 0:r(o),children:n.jsx(Se,{size:8,className:"hover:text-red-500"})})]},o)),t&&n.jsx("input",{className:"text-[9px] border border-dashed border-border rounded bg-transparent outline-none w-14 px-1.5 py-px placeholder-content-tertiary focus:border-accent focus:ring-1 focus:ring-accent/20 transition-colors",placeholder:"+ tag",value:a,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),l())},onBlur:l}),!t&&e.length===0&&n.jsx("span",{className:"text-[10px] text-content-tertiary",children:"—"})]})}function wd(){const e=Ws(),t=Pn(),{suiteId:s="",caseId:r=""}=Yv(),a=r?"case-editor":s?"suite-detail":"suites",[i,l]=m.useState(""),[o,c]=m.useState("ui"),[d,x]=m.useState(""),{modalProps:f,confirmDelete:g}=Mn(),[b,y]=m.useState(""),[j,k]=m.useState(""),[h,u]=m.useState(""),{data:p=[],isLoading:v}=Ny();m.useEffect(()=>{var W;const T=(W=e.state)==null?void 0:W.openSuiteId;T&&p.length>0&&p.find(te=>te.id===T)&&t(`/tests/${T}`,{replace:!0})},[e.state,p]);const w=m.useMemo(()=>{const T=new Set;return p.forEach(W=>(W.tags??[]).forEach(A=>T.add(A))),Array.from(T).sort()},[p]),N=m.useMemo(()=>p.filter(T=>{const W=!b||T.name.toLowerCase().includes(b.toLowerCase())||(T.description??"").toLowerCase().includes(b.toLowerCase()),A=!j||(T.tags??[]).includes(j),te=T.type==="performance"?"audit":T.type??"ui";return W&&A&&(!h||te===h)}),[p,b,j,h]),P=p.find(T=>T.id===s),E=jk(),_=Nk(),{data:D=[]}=Ak(),G=Lk(),J=Cy(),se=ym(),M=Y({mutationFn:T=>Xi.start({test:T}),onError:T=>{yt.clear(),O.error(T.message)}}),F=Y({mutationFn:T=>Xi.start({suite:T}),onError:T=>{yt.clear(),O.error(T.message)}}),ee=T=>{yt.startCase(T),M.mutate(T),t("/run")},ae=T=>{yt.startSuite(T),F.mutate(T),t("/run")},z=()=>{i.trim()&&(E.mutate({name:i,type:o}),l(""))};if(v)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(ce,{size:20,className:"animate-spin text-accent"})});let K=null;if(a==="suites"){const T=p.filter(B=>(B.type??"ui")==="ui").length,W=p.filter(B=>(B.type??"ui")==="api").length,A=p.filter(B=>B.type==="audit"||B.type==="performance").length,te=p.reduce((B,de)=>B+(de.caseCount??0),0);K=n.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:n.jsx(Ji,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Test Suites"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Manage and organize your test automation"})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center gap-1.5",children:[{label:"Total",val:p.length,color:"bg-indigo-50 dark:bg-indigo-900/20 text-indigo-600 dark:text-indigo-400 ring-indigo-200 dark:ring-indigo-800"},{label:"UI",val:T,color:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"},{label:"API",val:W,color:"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800"},...A>0?[{label:"Audit",val:A,color:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"}]:[],{label:"Cases",val:te,color:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800"}].map(B=>n.jsxs("span",{className:C("inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1",B.color),children:[B.val," ",n.jsx("span",{className:"opacity-60 font-normal",children:B.label})]},B.label))}),n.jsx(tl,{status:"not-created",variant:"full",label:"Sync All",onClick:()=>G.mutate(),busy:se.allOp==="create"||se.allOp==="sync"})]})]}),n.jsxs("div",{className:"px-4 py-2 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[n.jsx("div",{className:"flex gap-0.5 flex-shrink-0 bg-surface-inset rounded-lg p-0.5",children:[["","All",p.length],["ui","UI",T],["api","API",W],...A>0?[["audit","⚡ Audit",A]]:[]].map(([B,de,xe])=>n.jsxs("button",{type:"button",onClick:()=>u(B),className:C("px-2 py-1 rounded-md text-[10px] font-semibold transition-all",h===B?"bg-surface text-accent shadow-sm ring-1 ring-border":"text-content-tertiary hover:text-content-secondary"),children:[de," ",n.jsx("span",{className:"opacity-60 ml-0.5",children:xe})]},B))}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Mr,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),n.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface placeholder-content-tertiary",placeholder:"Search suites…",value:b,onChange:B=>y(B.target.value)})]}),w.length>0&&n.jsxs("select",{value:j,onChange:B=>k(B.target.value),className:"text-xs border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[90px]",children:[n.jsx("option",{value:"",children:"All Tags"}),w.map(B=>n.jsx("option",{value:B,children:B},B))]}),(b||j||h)&&n.jsx("button",{type:"button",onClick:()=>{y(""),k(""),u("")},className:"p-1 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(Se,{size:12})}),n.jsx("div",{className:"w-px h-4 bg-border"}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[n.jsx("div",{className:"flex gap-0 bg-surface-inset rounded-lg p-0.5 ring-1 ring-border",children:["ui","api","audit"].map(B=>n.jsx("button",{type:"button",onClick:()=>c(B),className:C("px-2 py-1 rounded-md text-[9px] font-bold uppercase transition-all",o===B?B==="api"?"bg-violet-500 text-white shadow-sm":B==="audit"?"bg-amber-500 text-white shadow-sm":"bg-blue-500 text-white shadow-sm":"text-content-tertiary hover:text-content-secondary"),children:B==="audit"?"⚡":B},B))}),n.jsx("input",{className:"w-36 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New suite name…",value:i,onChange:B=>l(B.target.value),onKeyDown:B=>B.key==="Enter"&&z()}),n.jsxs(ne,{size:"sm",onClick:z,disabled:E.isPending,children:[n.jsx(En,{size:11})," Add"]})]})]})]}),p.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[n.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:n.jsx(pl,{size:20,className:"text-content-tertiary"})}),n.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No suites yet"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Create your first test suite using the toolbar above"})]}):N.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-10 gap-2",children:[n.jsx(qg,{size:16,className:"text-content-tertiary"}),n.jsx("p",{className:"text-xs text-content-tertiary",children:"No suites match filters"}),n.jsx("button",{onClick:()=>{y(""),k(""),u("")},className:"text-[10px] text-accent hover:underline",children:"Clear filters"})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2.5",children:N.map(B=>{var de,xe;return n.jsx(t5,{suite:B,xrayStatus:((de=D.find(ue=>ue.suiteId===B.id))==null?void 0:de.status)??"not-created",xrayKey:((xe=D.find(ue=>ue.suiteId===B.id))==null?void 0:xe.xrayTestSetId)??null,onOpen:()=>t(`/tests/${B.id}`),onRun:()=>ae(B.id),onDelete:()=>g(`Delete suite "${B.name}"? All cases and steps will be lost.`,()=>_.mutate(B.id)),onXrayAction:()=>J.mutate(B.id),isXrayBusy:se.busySuites.get(B.id)==="create"||se.busySuites.get(B.id)==="sync"||se.allOp==="create"||se.allOp==="sync"},B.id)})})]})})})}return a==="suite-detail"&&s&&(K=n.jsx(n5,{suiteId:s,suite:P,suites:p,newCaseName:d,onNewCaseNameChange:x,onOpenCase:T=>t(`/tests/${s}/cases/${T}`),onRunCase:T=>ee(T),onRunSuite:()=>ae(s),onBack:()=>t("/tests")})),a==="case-editor"&&s&&r&&(K=n.jsx(s5,{suiteId:s,caseId:r,suiteName:(P==null?void 0:P.name)??"",suiteType:(P==null?void 0:P.type)??"ui",onBack:()=>t(`/tests/${s}`),onRunCase:()=>ee(r)})),n.jsxs("div",{className:"flex-1 overflow-hidden relative flex flex-col",children:[K,n.jsx(zn,{...f})]})}function t5({suite:e,onOpen:t,onRun:s,onDelete:r,xrayStatus:a="not-created",xrayKey:i=null,onXrayAction:l,isXrayBusy:o=!1}){const{runningCaseIds:c,runningSuiteId:d,suiteLastRun:x}=Ec(),f=d===e.id,g=x.get(e.id),[b,y]=m.useState(!1),[j,k]=m.useState(e.name),[h,u]=m.useState(e.description??""),[p,v]=m.useState(e.tags??[]),[w,N]=m.useState(e.timeout?String(e.timeout):""),P=wy(),E=m.useRef(null),_=(e.type??"ui")==="api",D=e.type==="audit"||e.type==="performance";m.useEffect(()=>{var F;b&&((F=E.current)==null||F.focus())},[b]);const G=F=>{F.stopPropagation(),y(!0)},J=F=>{F==null||F.stopPropagation(),k(e.name),u(e.description??""),v(e.tags??[]),N(e.timeout?String(e.timeout):""),y(!1)},se=F=>{F==null||F.stopPropagation();const ee=w?parseInt(w,10):void 0;P.mutate({id:e.id,data:{name:j.trim()||e.name,description:h,tags:p,timeout:ee}},{onSuccess:()=>y(!1)})},M=F=>{F.key==="Enter"&&(F.preventDefault(),se()),F.key==="Escape"&&J()};return b?n.jsxs("div",{className:"rounded-xl border-2 border-accent/30 bg-accent/[0.02] p-3.5 space-y-2.5",onClick:F=>F.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:C("w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0",_?"bg-violet-100":"bg-blue-100"),children:n.jsx(mn,{size:11,className:_?"text-violet-600":"text-blue-600"})}),n.jsx("input",{ref:E,className:"flex-1 text-xs font-semibold border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:j,onChange:F=>k(F.target.value),onKeyDown:M,placeholder:"Suite name"})]}),n.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:h,onChange:F=>u(F.target.value),onKeyDown:M,placeholder:"Description (optional)"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-32 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:w,onChange:F=>N(F.target.value),onKeyDown:M,placeholder:"Timeout (ms)"}),n.jsx("span",{className:"text-[10px] text-content-tertiary",children:"ms timeout"}),n.jsx("div",{className:"ml-auto",children:n.jsx(nl,{tags:p,editable:!0,onAdd:F=>v(ee=>[...ee,F]),onRemove:F=>v(ee=>ee.filter(ae=>ae!==F))})})]}),n.jsxs("div",{className:"flex gap-1.5 justify-end pt-0.5",children:[n.jsxs(ne,{size:"sm",variant:"secondary",onClick:J,children:[n.jsx(Se,{size:10})," Cancel"]}),n.jsxs(ne,{size:"sm",onClick:se,loading:P.isPending,children:[n.jsx(He,{size:10})," Save"]})]})]}):n.jsxs("div",{className:"group rounded-xl border border-border bg-surface hover:border-accent/30 hover:shadow-sm hover:shadow-accent/5 cursor-pointer transition-all",onClick:t,children:[n.jsx("div",{className:"px-3.5 pt-3 pb-2",children:n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx("div",{className:C("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",_?"bg-gradient-to-br from-violet-100 to-purple-100 dark:from-violet-900/40 dark:to-purple-900/40":D?"bg-gradient-to-br from-amber-100 to-orange-100 dark:from-amber-900/40 dark:to-orange-900/40":"bg-gradient-to-br from-blue-100 to-indigo-100 dark:from-blue-900/40 dark:to-indigo-900/40"),children:n.jsx(mn,{size:14,className:_?"text-violet-600 dark:text-violet-400":D?"text-amber-600 dark:text-amber-400":"text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("p",{className:"text-xs font-bold text-content truncate",children:e.name}),D?n.jsxs("span",{className:"text-[7px] px-1 py-px rounded font-bold flex items-center gap-0.5 flex-shrink-0 ring-1 bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",children:[n.jsx(Be,{size:7})," Audit"]}):n.jsx("span",{className:C("text-[7px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",_?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:_?"API":"UI"})]}),e.description&&n.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5 leading-tight",children:e.description})]}),n.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",onClick:F=>F.stopPropagation(),children:[n.jsx("button",{type:"button",onClick:G,title:"Edit",className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:n.jsx(Dr,{size:11})}),n.jsx("button",{type:"button",onClick:F=>{F.stopPropagation(),r()},title:"Delete",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(fn,{size:11})})]})]})}),n.jsxs("div",{className:"px-3.5 py-2 border-t border-border/50 bg-surface-inset/30 rounded-b-xl flex items-center gap-2",onClick:F=>F.stopPropagation(),children:[n.jsxs("span",{className:"text-[9px] font-medium text-content-secondary tabular-nums",children:[e.caseCount??0," case",(e.caseCount??0)!==1?"s":""]}),(e.tags??[]).length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-px h-3 bg-border"}),n.jsx(nl,{tags:e.tags??[]})]}),n.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[n.jsx(gm,{status:a,xrayKey:i}),n.jsx(tl,{variant:"icon",status:a,onClick:()=>l==null?void 0:l(),busy:o})]}),n.jsx("div",{className:"w-px h-3 bg-border"}),f?n.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-teal-600 dark:text-teal-400 font-medium",children:[n.jsx(ce,{size:10,className:"animate-spin"})," Running"]}):n.jsxs("button",{type:"button",onClick:F=>{F.stopPropagation(),s()},className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md text-[9px] font-medium text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/20 transition-colors",title:"Run suite",children:[n.jsx(Rt,{size:10,strokeWidth:2.5})," Run"]}),n.jsx("button",{type:"button",disabled:!g,onClick:F=>{F.stopPropagation(),g&&window.open(`/allure/${g.runId}`,"_blank")},title:g?`Report: ${g.passed}p / ${g.failed}f`:"No report",className:C("p-1 rounded-md transition-colors",g?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary/50 cursor-not-allowed"),children:n.jsx(Cn,{size:11})}),n.jsx(Zt,{size:11,className:"text-content-tertiary/50"})]})]})}function n5({suiteId:e,suite:t,suites:s,newCaseName:r,onNewCaseNameChange:a,onOpenCase:i,onRunCase:l,onRunSuite:o,onBack:c}){const{runningCaseIds:d,runningSuiteId:x,caseLastRun:f}=Ec(),g=x===e,{data:b=[],isLoading:y}=wk(e),j=yf(e),k=Ck(e),h=yf(e),[u,p]=m.useState(!1),[v,w]=m.useState(!1),{modalProps:N,confirmDelete:P}=Mn(),[E,_]=m.useState(new Set),D=m.useRef(-1),{data:G}=ke({queryKey:["flakiness",e],queryFn:()=>HN.get(e),staleTime:6e4});m.useEffect(()=>{_(new Set),D.current=-1},[e]);const{data:J}=Sy(e),se=Cy(),M=Ey(),F=Ik(),ee=Py(),ae=ym(),z=()=>{((J==null?void 0:J.status)??"not-created")==="not-created"?se.mutate(e):F.mutate(e)},K=H=>{var fe;(((fe=J==null?void 0:J.cases.find(Re=>Re.caseId===H))==null?void 0:fe.status)??"not-created")==="not-created"?M.mutate({suiteId:e,caseId:H}):ee.mutate({suiteId:e,caseId:H})};m.useEffect(()=>{Xi.list(20).then(async H=>{const oe=await Promise.all(H.slice(0,10).map(fe=>Xi.get(fe.runId).catch(()=>null)));yt.seedFromHistory(oe.filter(fe=>fe!==null).map(fe=>({runId:fe.runId,passed:fe.passed,failed:fe.failed,skipped:fe.skipped,suites:fe.suites.map(Re=>({suiteId:Re.suiteId,cases:Re.cases.map(it=>({caseId:it.caseId,status:it.status}))}))})))}).catch(()=>{})},[e]);const[T,W]=m.useState(""),[A,te]=m.useState(new Set),[B,de]=m.useState(""),xe=A.size===0,ue=m.useMemo(()=>{const H=new Set;return b.forEach(oe=>(oe.tags??[]).forEach(fe=>H.add(fe))),Array.from(H).sort()},[b]),Ce=m.useMemo(()=>b.filter(H=>{const oe=!T||H.name.toLowerCase().includes(T.toLowerCase()),fe=A.size===0||(H.tags??[]).some(it=>A.has(it)),Re=!B||H.priority===B;return oe&&fe&&Re}),[b,T,A,B]),tt=!!(T||A.size>0||B),[en,mt]=m.useState(!1),[Bt,q]=m.useState((t==null?void 0:t.name)??""),[ht,Tn]=m.useState((t==null?void 0:t.description)??""),[at,tn]=m.useState((t==null?void 0:t.tags)??[]),[Qs,Gs]=m.useState(t!=null&&t.timeout?String(t.timeout):""),R=wy();m.useEffect(()=>{q((t==null?void 0:t.name)??""),Tn((t==null?void 0:t.description)??""),tn((t==null?void 0:t.tags)??[]),Gs(t!=null&&t.timeout?String(t.timeout):"")},[t==null?void 0:t.id]);const X=()=>{const H=Qs?parseInt(Qs,10):void 0;R.mutate({id:e,data:{name:Bt.trim()||(t==null?void 0:t.name),description:ht,tags:at,timeout:H}},{onSuccess:()=>mt(!1)})},be=H=>{H.key==="Enter"&&(H.preventDefault(),X()),H.key==="Escape"&&mt(!1)},Rn=()=>{r.trim()&&(j.mutate({name:r}),a(""))},Nt=H=>{h.mutate({name:`${H.name} (copy)`,description:H.description,priority:H.priority,tags:H.tags,steps:(H.steps??[]).map(oe=>({instruction:oe.instruction}))})},On=H=>`TC-${((t==null?void 0:t.name)??"TC").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TC"}-${String(H+1).padStart(3,"0")}`,nn=((t==null?void 0:t.type)??"ui")==="api",Ys=(t==null?void 0:t.type)==="audit"||(t==null?void 0:t.type)==="performance";return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsx("div",{className:"px-4 py-1.5 bg-surface-inset/30 border-b border-border/50",children:n.jsxs("nav",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary",children:[n.jsxs("button",{onClick:c,className:"hover:text-accent transition-colors flex items-center gap-1",children:[n.jsx(Kg,{size:10})," Suites"]}),n.jsx(Zt,{size:9}),n.jsx("span",{className:"text-content-secondary font-semibold",children:t==null?void 0:t.name})]})}),en?n.jsxs("div",{className:"px-4 py-3.5 space-y-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:C("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",nn?"bg-gradient-to-br from-violet-500 to-purple-600":"bg-gradient-to-br from-blue-500 to-indigo-600"),children:n.jsx(Ji,{size:13,className:"text-white"})}),n.jsx("input",{className:"flex-1 text-sm font-bold border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:Bt,onChange:H=>q(H.target.value),onKeyDown:be,placeholder:"Suite name",autoFocus:!0})]}),n.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:ht,onChange:H=>Tn(H.target.value),onKeyDown:be,placeholder:"Description"}),n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Or,{size:10,className:"text-content-tertiary"}),n.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-28 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface",value:Qs,onChange:H=>Gs(H.target.value),onKeyDown:be,placeholder:"Timeout ms"})]}),n.jsx("div",{className:"flex-1",children:n.jsx(nl,{tags:at,editable:!0,onAdd:H=>tn(oe=>[...oe,H]),onRemove:H=>tn(oe=>oe.filter(fe=>fe!==H))})}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsxs(ne,{size:"sm",variant:"secondary",onClick:()=>mt(!1),children:[n.jsx(Se,{size:10})," Cancel"]}),n.jsxs(ne,{size:"sm",onClick:X,loading:R.isPending,children:[n.jsx(He,{size:10})," Save"]})]})]})]}):n.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[n.jsx("div",{className:C("w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 shadow-sm",nn?"bg-gradient-to-br from-violet-500 to-purple-600 shadow-violet-500/20":Ys?"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20":"bg-gradient-to-br from-blue-500 to-indigo-600 shadow-blue-500/20"),children:n.jsx(Ji,{size:16,className:"text-white"})}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("h1",{className:"text-sm font-bold text-content truncate",children:t==null?void 0:t.name}),Ys?n.jsxs("span",{className:"text-[7px] px-1.5 py-px rounded font-bold flex items-center gap-0.5 ring-1 bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",children:[n.jsx(Be,{size:7})," Audit"]}):n.jsx("button",{type:"button",onClick:H=>{H.stopPropagation();const oe=nn?"ui":"api";R.mutate({id:e,data:{type:oe}})},title:"Toggle type",className:C("text-[7px] px-1.5 py-px rounded font-bold uppercase ring-1 cursor-pointer transition-colors",nn?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800 hover:bg-violet-100 dark:hover:bg-violet-900/30":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"),children:nn?"API":"UI"}),n.jsx("button",{type:"button",onClick:()=>mt(!0),className:"p-0.5 rounded text-content-tertiary hover:text-accent transition-colors",children:n.jsx(Dr,{size:10})})]}),ht&&n.jsx("p",{className:"text-[10px] text-content-tertiary truncate mt-0.5 leading-tight max-w-md",children:ht})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[g?n.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-teal-600 dark:text-teal-400 font-medium px-2 py-1 rounded-lg bg-teal-50 dark:bg-teal-900/20 ring-1 ring-teal-200 dark:ring-teal-800",children:[n.jsx(ce,{size:11,className:"animate-spin"})," Running…"]}):n.jsxs(ne,{size:"sm",onClick:o,className:"bg-teal-600 hover:bg-teal-700 text-white border-teal-600",children:[n.jsx(Rt,{size:10})," Run Suite"]}),n.jsxs(ne,{size:"sm",onClick:()=>p(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white border-indigo-600",children:[n.jsx(Ia,{size:10})," Hooks"]}),n.jsx(tl,{variant:"full",status:(J==null?void 0:J.status)??"not-created",label:"Sync",onClick:z,busy:ae.busySuites.get(e)==="create"||ae.busySuites.get(e)==="sync"||ae.allOp==="create"||ae.allOp==="sync"})]})]}),ue.length>0&&n.jsxs("div",{className:"px-4 py-1.5 border-t border-border/50 flex items-center gap-1.5 flex-wrap",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mr-0.5",children:"Tags"}),n.jsx("button",{type:"button",onClick:()=>te(new Set),className:C("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",xe?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset hover:bg-surface-inset/80 ring-1 ring-border"),children:"All"}),ue.map(H=>{const oe=A.has(H);return n.jsx("button",{type:"button",onClick:()=>{te(fe=>{const Re=new Set(fe);return oe?Re.delete(H):Re.add(H),Re})},className:C("text-[9px] px-2 py-0.5 rounded-md font-medium transition-all",oe||xe?"bg-accent/10 text-accent ring-1 ring-accent/30":"text-content-tertiary bg-surface-inset ring-1 ring-border hover:text-content-secondary"),children:H},H)})]}),n.jsxs("div",{className:"px-4 py-2 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1 min-w-[120px]",children:[n.jsx(Mr,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),n.jsx("input",{className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Search tests…",value:T,onChange:H=>W(H.target.value)})]}),n.jsxs("select",{value:B,onChange:H=>de(H.target.value),className:"text-xs border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface min-w-[90px]",children:[n.jsx("option",{value:"",children:"All Priority"}),My.map(H=>n.jsx("option",{value:H,className:"capitalize",children:H.charAt(0).toUpperCase()+H.slice(1)},H))]}),tt&&n.jsx("button",{type:"button",onClick:()=>{W(""),te(new Set),de("")},className:"p-1 rounded-lg text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(Se,{size:11})}),n.jsx("div",{className:"w-px h-4 bg-border"}),n.jsx("input",{className:"w-36 text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"New test case…",value:r,onChange:H=>a(H.target.value),onKeyDown:H=>H.key==="Enter"&&Rn()}),n.jsxs(ne,{size:"sm",onClick:Rn,disabled:j.isPending,children:[n.jsx(En,{size:10})," Add"]}),n.jsx(ne,{size:"sm",variant:"secondary",onClick:()=>w(!0),children:"From Template"}),n.jsx("span",{className:"text-[9px] text-content-tertiary ml-1 tabular-nums flex-shrink-0",children:tt?`${Ce.length}/${b.length}`:`${b.length} test${b.length!==1?"s":""}`})]})]}),y?n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ce,{size:18,className:"animate-spin text-accent"})}):b.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[n.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:n.jsx(pl,{size:20,className:"text-content-tertiary"})}),n.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No test cases yet"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first test case using the toolbar above"})]}):Ce.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-10 gap-2",children:[n.jsx(qg,{size:16,className:"text-content-tertiary"}),n.jsx("p",{className:"text-xs text-content-tertiary",children:"No tests match filters"}),n.jsx("button",{onClick:()=>{W(""),te(new Set),de("")},className:"text-[10px] text-accent hover:underline",children:"Clear filters"})]}):n.jsxs("div",{className:"space-y-1.5",children:[Ce.length>0&&n.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1",children:[n.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer",checked:E.size===Ce.length&&Ce.length>0,onChange:H=>{H.target.checked?_(new Set(Ce.map(oe=>oe.id))):_(new Set)}}),n.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Select all"})]}),Ce.map((H,oe)=>{const fe=H.steps.some(ve=>ve.stepType==="api"),Re=f.get(H.id),it=J==null?void 0:J.cases.find(ve=>ve.caseId===H.id),_r=(it==null?void 0:it.status)??"not-created",bl=ae.busyCases.get(`${e}:${H.id}`)==="create"||ae.busyCases.get(`${e}:${H.id}`)==="sync"||ae.busySuites.get(e)==="create"||ae.busySuites.get(e)==="sync"||ae.allOp==="create"||ae.allOp==="sync",ts=E.has(H.id),ns=G==null?void 0:G.cases.find(ve=>ve.caseId===H.id);return n.jsx("div",{className:C("group rounded-xl border bg-surface hover:border-accent/30 hover:shadow-sm hover:shadow-accent/5 cursor-pointer transition-all",ts?"border-accent/40 bg-accent/[0.02]":"border-border"),onClick:()=>i(H.id),children:n.jsxs("div",{className:"px-3.5 py-2.5 flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",className:"rounded border-border text-accent cursor-pointer flex-shrink-0",checked:ts,onClick:ve=>ve.stopPropagation(),onChange:ve=>{ve.stopPropagation(),_(Js=>{const Le=new Set(Js);return ve.target.checked?Le.add(H.id):Le.delete(H.id),D.current=oe,Le})},onClickCapture:ve=>{if(ve.shiftKey&&D.current>=0){ve.preventDefault();const Js=Math.min(D.current,oe),Le=Math.max(D.current,oe);_(zc=>{const vl=new Set(zc);return Ce.slice(Js,Le+1).forEach($r=>vl.add($r.id)),vl})}D.current=oe}}),n.jsx(vc,{size:11,className:"text-content-tertiary/40 group-hover:text-content-tertiary cursor-grab flex-shrink-0 transition-colors"}),n.jsx("span",{className:"text-[9px] font-mono text-accent font-semibold bg-accent/5 px-1.5 py-0.5 rounded ring-1 ring-accent/10 flex-shrink-0 tabular-nums",children:On(oe)}),n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[n.jsx("span",{className:"text-xs font-medium text-content truncate",children:H.name}),n.jsx("span",{className:C("text-[7px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",fe?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":Ys?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:fe?"API":Ys?"Audit":"UI"}),ns&&n.jsx(Zk,{passRate:ns.passRate,runs:ns.runs,flaky:ns.flaky})]}),n.jsxs("span",{className:"text-[9px] text-content-tertiary tabular-nums flex-shrink-0",children:[H.steps.length," step",H.steps.length!==1?"s":""]}),n.jsx("span",{className:C("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",Zu[H.priority]??Zu.low),children:H.priority}),(H.tags??[]).length>0&&n.jsx("div",{className:"flex-shrink-0",onClick:ve=>ve.stopPropagation(),children:n.jsx(nl,{tags:H.tags})}),(()=>{if(!Re)return n.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded ring-1 ring-border text-content-tertiary/60 flex-shrink-0",children:"Never"});const ve={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return n.jsx("span",{className:C("text-[8px] px-1.5 py-0.5 rounded capitalize ring-1 flex-shrink-0 font-medium",ve[Re.status]??"ring-border text-content-tertiary"),children:Re.status})})(),n.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:ve=>ve.stopPropagation(),children:[n.jsx(gm,{status:_r,xrayKey:it==null?void 0:it.xrayTestId}),n.jsx(tl,{variant:"icon",status:_r,onClick:()=>K(H.id),busy:bl})]}),n.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:ve=>ve.stopPropagation(),children:[d.has(H.id)?n.jsx(ce,{size:11,className:"animate-spin text-teal-600 dark:text-teal-400"}):n.jsx("button",{type:"button",onClick:()=>l(H.id),title:"Run",className:"p-1 rounded-md text-teal-600 dark:text-teal-400 hover:bg-teal-50 dark:hover:bg-teal-900/20 transition-colors",children:n.jsx(Rt,{size:11})}),n.jsx("button",{type:"button",disabled:!Re,onClick:()=>{Re&&window.open(`/allure/${Re.allureRunId}`,"_blank")},title:"Report",className:C("p-1 rounded-md transition-colors",Re?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary/40 cursor-not-allowed"),children:n.jsx(Cn,{size:11})}),n.jsx("button",{type:"button",onClick:ve=>{ve.stopPropagation(),Nt(H)},title:"Duplicate",className:"p-1 rounded-md text-content-tertiary hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors",children:n.jsx(cm,{size:11})}),n.jsx("button",{type:"button",onClick:ve=>{ve.stopPropagation(),P(`Delete "${H.name}"?`,()=>k.mutate(H.id))},title:"Delete",className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(fn,{size:10})})]}),n.jsx(Zt,{size:11,className:"text-content-tertiary/40 flex-shrink-0"})]})},H.id)})]})]})}),n.jsx(Qk,{suiteId:e,open:u,onClose:()=>p(!1)}),n.jsx(vk,{open:v,onClose:()=>w(!1),suiteId:e,onCreated:()=>{}}),n.jsx(zn,{...N}),E.size>0&&n.jsx(Xk,{selectedIds:E,suiteId:e,suites:s,onClear:()=>_(new Set),onDeleted:()=>_(new Set),onMoved:()=>_(new Set)})]})}function s5({suiteId:e,caseId:t,suiteName:s,suiteType:r,onBack:a,onRunCase:i}){const{runningCaseIds:l,caseLastRun:o}=Ec(),c=l.has(t),d=o.get(t),{data:x,isLoading:f}=kk(e,t),g=Sk(e),b=Ek(e,t),y=Pk(e,t),j=Mk(e,t),{modalProps:k,confirmDelete:h}=Mn(),u=zk(e,t),p=Tk(e,t),v=Rk(e,t),{data:w}=Sy(e),N=Ey(),P=Py(),E=w==null?void 0:w.cases.find(I=>I.caseId===t),_=ym(),D=()=>{((E==null?void 0:E.status)??"not-created")==="not-created"?N.mutate({suiteId:e,caseId:t}):P.mutate({suiteId:e,caseId:t})},[G,J]=m.useState(""),[se,M]=m.useState(!1),[F,ee]=m.useState(""),[ae,z]=m.useState("medium"),[K,T]=m.useState([]),[W,A]=m.useState(""),[te,B]=m.useState("none"),[de,xe]=m.useState(""),[ue,Ce]=m.useState(""),[tt,en]=m.useState(!1),[mt,Bt]=m.useState(!1),q=m.useRef(null),[ht,Tn]=m.useState(!1),[at,tn]=m.useState(""),[Qs,Gs]=m.useState(""),R=m.useRef(null),[X,be]=m.useState(null),[Rn,Nt]=m.useState(null),[On,nn]=m.useState("steps"),[Ys,H]=m.useState(!1),[oe,fe]=m.useState([]),[Re,it]=m.useState([]),[_r,bl]=m.useState(["performance","accessibility","seo"]),[ts,ns]=m.useState(""),[ve,Js]=m.useState("");m.useEffect(()=>{var he,re;if(!x)return;J(x.name),ee(x.description??""),z(x.priority??"medium"),T([...x.tags]),A(x.timeout?String(x.timeout):"");const I=x.dataSource;I?(B(I.type??"none"),xe(I.path??""),Ce(I.data?JSON.stringify(I.data,null,2):"")):(B("none"),xe(""),Ce("")),fe(((he=x.caseHooks)==null?void 0:he.before.map(pe=>({id:pe.id,instruction:pe.instruction})))??[]),it(((re=x.caseHooks)==null?void 0:re.after.map(pe=>({id:pe.id,instruction:pe.instruction})))??[]),bl(x.lighthouseCategories??["performance","accessibility","seo"]),Bt(!1),Tn(!1)},[x==null?void 0:x.id]);const Le=()=>{Bt(!0),Tn(!1)},zc=I=>{I.key==="Enter"&&(I.preventDefault(),$r())},vl=I=>{const he=R.current;if(!he){tn(Mc=>Mc+I);return}const re=he.selectionStart??at.length,pe=he.selectionEnd??at.length,Dt=at.slice(0,re)+I+at.slice(pe);tn(Dt),setTimeout(()=>{he.focus(),he.setSelectionRange(re+I.length,re+I.length)},0)},$r=async()=>{const I=W?parseInt(W,10):void 0;let he;if(te!=="none")if(he={type:te},te==="inline")try{he.data=JSON.parse(ue)}catch{}else he.path=de;const re={before:oe.map((pe,Dt)=>({...pe,order:Dt})),after:Re.map((pe,Dt)=>({...pe,order:Dt}))};await g.mutateAsync({caseId:t,data:{name:G,description:F,priority:ae,tags:K,timeout:I,dataSource:he,caseHooks:re,lighthouseCategories:_r}}),Bt(!1),Tn(!0)},Hy=async()=>{mt&&await $r(),i()},Sm=()=>{at.trim()&&(b.mutate({instruction:at}),tn(""))},qy=async I=>{Gs(I),await p.mutateAsync(I).finally(()=>Gs(""))},Cm=x?`TC-${(x.name||"").replace(/[^a-zA-Z]/g,"").slice(0,3).toUpperCase()||"TST"}-001`:"…";if(f||!x)return n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(ce,{size:18,className:"animate-spin text-accent"})});const ss=[...x.steps].sort((I,he)=>I.order-he.order),Ky=ss.some(I=>I.stepType==="api"),Em=r==="audit"||r==="performance";return n.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs("div",{className:"flex-shrink-0 bg-surface border-b border-border z-10",children:[n.jsxs("div",{className:"flex items-center gap-1.5 px-5 pt-2 pb-1 text-[10px] text-content-tertiary",children:[n.jsxs("button",{onClick:()=>window.location.assign("/tests"),className:"hover:text-accent flex items-center gap-1",children:[n.jsx(Kg,{size:10})," Suites"]}),n.jsx(Zt,{size:9}),n.jsx("button",{onClick:a,className:"hover:text-accent",children:s}),n.jsx(Zt,{size:9}),n.jsx("span",{className:"text-content-secondary font-semibold font-mono",children:Cm})]}),n.jsxs("div",{className:"px-5 pb-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:se?n.jsx("input",{ref:q,className:"flex-1 text-sm font-bold text-content bg-transparent border-b-2 border-accent outline-none p-0 pb-px",value:G,onChange:I=>{J(I.target.value),Le()},onBlur:()=>M(!1),onKeyDown:I=>{I.key==="Enter"&&M(!1),I.key==="Escape"&&(J((x==null?void 0:x.name)??""),M(!1))},autoFocus:!0}):n.jsxs("div",{className:"flex items-center gap-1.5 group min-w-0",children:[n.jsx("h1",{className:"text-sm font-bold text-content truncate",children:G||"Untitled Test Case"}),n.jsx("button",{type:"button",onClick:()=>{M(!0),setTimeout(()=>{var I;return(I=q.current)==null?void 0:I.focus()},0)},className:"p-0.5 rounded text-content-tertiary opacity-0 group-hover:opacity-100 hover:bg-surface-inset transition-all",children:n.jsx(Dr,{size:10})})]})}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[n.jsx(tl,{variant:"full",status:(E==null?void 0:E.status)??"not-created",onClick:D,busy:_.busyCases.get(`${e}:${t}`)==="create"||_.busyCases.get(`${e}:${t}`)==="sync"||_.busySuites.get(e)==="create"||_.busySuites.get(e)==="sync"||_.allOp==="create"||_.allOp==="sync"}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:$r,loading:g.isPending,disabled:!mt,children:[n.jsx(Gg,{size:10})," Save"]}),n.jsxs(ne,{size:"sm",onClick:Hy,loading:c,disabled:c,children:[!c&&n.jsx(Rt,{size:10})," ",c?"Running…":"Save & Run"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[n.jsx("span",{className:"px-1.5 py-px rounded text-[9px] font-mono font-bold bg-teal-50 dark:bg-teal-900/20 text-teal-700 dark:text-teal-400 ring-1 ring-teal-200 dark:ring-teal-800",children:Cm}),c?n.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-teal-600 dark:text-teal-400 font-medium",children:[n.jsx(ce,{size:9,className:"animate-spin"})," Running"]}):(()=>{if(!d)return n.jsx("span",{className:"text-[8px] px-1.5 py-px rounded ring-1 ring-border text-content-tertiary",children:"Never run"});const I={passed:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-600 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800",failed:"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 ring-red-200 dark:ring-red-800",skipped:"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"};return n.jsx("span",{className:C("text-[8px] px-1.5 py-px rounded capitalize ring-1",I[d.status]??"ring-border text-content-tertiary"),children:d.status})})(),n.jsx("button",{type:"button",disabled:!d,onClick:()=>{d&&window.open(`/allure/${d.allureRunId}`,"_blank")},className:C("p-0.5 rounded transition-colors",d?"text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20":"text-content-tertiary cursor-not-allowed"),children:n.jsx(Cn,{size:11})}),n.jsx(gm,{status:(E==null?void 0:E.status)??"not-created",xrayKey:E==null?void 0:E.xrayTestId}),n.jsx("div",{className:"w-px h-3.5 bg-border"}),n.jsx("div",{className:"flex items-center gap-1",children:My.map(I=>n.jsx("button",{type:"button",onClick:()=>{z(I),Le()},className:C("px-1.5 py-px rounded text-[8px] capitalize font-bold transition-all ring-1",ae===I?Zu[I]:"ring-transparent text-content-tertiary hover:ring-border"),children:I},I))}),n.jsx("div",{className:"w-px h-3.5 bg-border"}),n.jsx(nl,{tags:K,editable:!0,onAdd:I=>{T(he=>[...he,I]),Le()},onRemove:I=>{T(he=>he.filter(re=>re!==I)),Le()}}),n.jsx("div",{className:"w-px h-3.5 bg-border"}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Or,{size:9,className:"text-content-tertiary"}),n.jsx("input",{type:"number",min:1e3,step:1e3,className:"w-16 text-[9px] bg-transparent border-b border-dashed border-border px-1 py-px text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent tabular-nums",placeholder:"30000",value:W,onChange:I=>{A(I.target.value),Le()},onKeyDown:zc}),n.jsx("span",{className:"text-[8px] text-content-tertiary",children:"ms"})]}),n.jsx("div",{className:"w-px h-3.5 bg-border"}),n.jsxs("button",{type:"button",onClick:()=>en(I=>!I),className:C("flex items-center gap-1 text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors",tt?"text-accent bg-accent/5":"text-content-tertiary hover:text-content-secondary hover:bg-surface-inset"),children:[n.jsx(Ia,{size:9})," ",tt?"Less":"More",n.jsx(Tt,{size:8,className:C("transition-transform",tt&&"rotate-180")})]}),mt&&n.jsx("span",{className:"text-[8px] text-amber-500 dark:text-amber-400 font-bold ml-auto",children:"● Unsaved"}),ht&&!mt&&n.jsx("span",{className:"text-[8px] text-emerald-500 dark:text-emerald-400 font-bold ml-auto",children:"✓ Saved"})]})]}),tt&&n.jsxs("div",{className:"px-5 pb-3 pt-1 border-t border-border bg-surface-inset/30 animate-fade-in",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),n.jsx("textarea",{rows:2,className:"w-full text-xs text-content-secondary bg-surface rounded-lg border border-border outline-none resize-none focus:ring-2 focus:ring-accent/30 px-2.5 py-1.5",placeholder:"Add a description…",value:F,onChange:I=>{ee(I.target.value),Le()},onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),$r())}})]}),n.jsx("div",{children:n.jsx(r5,{type:te,filePath:de,inlineData:ue,onTypeChange:I=>{B(I),Le()},onFilePathChange:I=>{xe(I),Le()},onInlineChange:I=>{Ce(I),Le()}})})]}),Em&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50",children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-2 flex items-center gap-1.5",children:[n.jsx(Be,{size:9,className:"text-amber-500 dark:text-amber-400"})," Non-Functional Checks (Lighthouse)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[["performance","accessibility","seo"].map(I=>{const he={performance:"⚡ Performance",accessibility:"♿ Accessibility",seo:"🔍 SEO"},re=_r.includes(I);return n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[n.jsx("input",{type:"checkbox",checked:re,onChange:()=>{bl(pe=>re?pe.filter(Dt=>Dt!==I):[...pe,I]),Le()},className:"w-3 h-3 rounded accent-amber-600 cursor-pointer"}),n.jsx("span",{className:"text-[10px] text-content-secondary",children:he[I]})]},I)}),_r.length===0&&n.jsx("span",{className:"text-[9px] text-amber-600",children:"⚠ No checks selected — Lighthouse will be skipped"})]})]})]})]}),n.jsxs("div",{className:"flex-shrink-0 flex items-center gap-1 px-5 pt-2 pb-0 border-b border-border bg-surface",children:[n.jsx("button",{type:"button",onClick:()=>nn("steps"),className:C("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",On==="steps"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:"Steps"}),n.jsxs("button",{type:"button",onClick:()=>nn("hooks"),className:C("px-3 py-1.5 text-xs font-semibold rounded-t-lg transition-colors border-b-2",On==="hooks"?"border-accent text-accent":"border-transparent text-content-tertiary hover:text-content-secondary"),children:["Hooks",oe.length+Re.length>0&&n.jsx("span",{className:"ml-1 text-[9px] bg-accent/10 text-accent rounded px-1",children:oe.length+Re.length})]}),n.jsx("div",{className:"flex-1"}),n.jsxs("button",{type:"button",onClick:()=>H(!0),title:"Step Library",className:"flex items-center gap-1.5 text-[10px] text-content-tertiary hover:text-accent hover:bg-accent/5 px-2 py-1 rounded-lg transition-colors mb-1",children:[n.jsx(Yi,{size:11})," Library"]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto bg-surface-inset/20",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-3",children:[On==="hooks"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[n.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Before Hooks"}),n.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run before all steps"})]}),n.jsxs("div",{className:"p-3 space-y-1.5",children:[oe.map((I,he)=>n.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[n.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:he+1}),n.jsx("span",{className:"flex-1 text-content-secondary",children:I.instruction}),n.jsx("button",{type:"button",onClick:()=>{fe(re=>re.filter((pe,Dt)=>Dt!==he)),Le()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(Se,{size:11})})]},I.id)),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add before-hook instruction…",value:ts,onChange:I=>ns(I.target.value),onKeyDown:I=>{I.key==="Enter"&&ts.trim()&&(fe(he=>[...he,{id:crypto.randomUUID(),instruction:ts.trim()}]),ns(""),Le())}}),n.jsxs(ne,{size:"sm",onClick:()=>{ts.trim()&&(fe(I=>[...I,{id:crypto.randomUUID(),instruction:ts.trim()}]),ns(""),Le())},children:[n.jsx(En,{size:11})," Add"]})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2 border-b border-border bg-surface-inset/30",children:[n.jsx("h3",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"After Hooks"}),n.jsx("p",{className:"text-[9px] text-content-tertiary mt-0.5",children:"Run after all steps (always)"})]}),n.jsxs("div",{className:"p-3 space-y-1.5",children:[Re.map((I,he)=>n.jsxs("div",{className:"flex items-center gap-2 text-xs bg-surface-inset/50 rounded-lg px-3 py-2 border border-border",children:[n.jsx("span",{className:"text-content-tertiary font-mono text-[9px] w-4",children:he+1}),n.jsx("span",{className:"flex-1 text-content-secondary",children:I.instruction}),n.jsx("button",{type:"button",onClick:()=>{it(re=>re.filter((pe,Dt)=>Dt!==he)),Le()},className:"p-0.5 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(Se,{size:11})})]},I.id)),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("input",{className:"flex-1 text-xs border border-border rounded-lg px-3 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"Add after-hook instruction…",value:ve,onChange:I=>Js(I.target.value),onKeyDown:I=>{I.key==="Enter"&&ve.trim()&&(it(he=>[...he,{id:crypto.randomUUID(),instruction:ve.trim()}]),Js(""),Le())}}),n.jsxs(ne,{size:"sm",onClick:()=>{ve.trim()&&(it(I=>[...I,{id:crypto.randomUUID(),instruction:ve.trim()}]),Js(""),Le())},children:[n.jsx(En,{size:11})," Add"]})]})]})]})]}),On==="steps"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex gap-2 mb-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Be,{size:12,className:"absolute left-3 top-1/2 -translate-y-1/2 text-accent/50 pointer-events-none"}),n.jsx("input",{ref:R,className:"w-full text-xs border border-border rounded-lg pl-8 pr-3 py-2 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary shadow-xs",placeholder:"Describe a step in plain English and press Enter…",value:at,onChange:I=>tn(I.target.value),onKeyDown:I=>I.key==="Enter"&&Sm()})]}),n.jsx(Jk,{onInsert:vl}),n.jsxs(ne,{size:"sm",onClick:Sm,disabled:b.isPending,className:"border border-transparent",children:[n.jsx(En,{size:11})," Add Step"]}),n.jsxs(ne,{size:"sm",loading:v.isPending,onClick:()=>v.mutate(),className:"border border-transparent bg-gradient-to-b from-emerald-500 to-emerald-600 text-white hover:brightness-110 shadow-sm hover:shadow-md focus-visible:ring-emerald-500",children:[n.jsx(Fa,{size:11})," Generate All"]})]}),n.jsx("div",{className:"space-y-1.5",children:ss.length===0?n.jsxs("div",{className:"border border-dashed border-border rounded-xl py-10 text-center bg-surface",children:[n.jsx(Be,{size:20,className:"mx-auto text-content-tertiary/40 mb-2"}),n.jsx("p",{className:"text-xs text-content-tertiary",children:"No steps yet — type an instruction above and press Enter"}),n.jsxs("p",{className:"text-[10px] text-content-tertiary mt-1",children:["Or click ",n.jsx("span",{className:"font-semibold",children:"Generate All"})," to let AI write all steps"]})]}):ss.map((I,he)=>n.jsx(a5,{step:I,index:he,suiteId:e,caseId:t,caseIsApi:Ky,suiteIsAudit:Em,generating:Qs===I.id,isDragging:X===I.id,isDragOver:Rn===I.id,onDragStart:()=>be(I.id),onDragOver:()=>Nt(I.id),onDrop:()=>{if(!X||X===I.id){be(null),Nt(null);return}const re=ss.map(Mc=>Mc.id),pe=re.indexOf(X),Dt=re.indexOf(I.id);re.splice(pe,1),re.splice(Dt,0,X),u.mutate(re),be(null),Nt(null)},onDragEnd:()=>{be(null),Nt(null)},onDelete:re=>h("Delete this step?",()=>j.mutate(re)),onGenerate:re=>void qy(re),onSaveInstruction:(re,pe)=>y.mutate({stepId:re,instruction:pe}),onSaveTimeout:(re,pe)=>y.mutate({stepId:re,timeout:pe}),onSaveRetries:(re,pe)=>y.mutate({stepId:re,retries:pe??void 0}),onSaveStepType:(re,pe)=>y.mutate({stepId:re,stepType:pe}),onSaveMockUrl:(re,pe)=>y.mutate({stepId:re,mockUrl:pe}),onSaveMockResponse:(re,pe)=>y.mutate({stepId:re,mockResponse:pe}),onSaveMockStatus:(re,pe)=>y.mutate({stepId:re,mockStatus:pe}),onSaveRunAudit:(re,pe)=>y.mutate({stepId:re,runAudit:pe},{onSuccess:()=>O.success(pe?"⚡ Audit checkpoint set":"Audit checkpoint removed")})},I.id))}),ss.length>0&&n.jsxs("p",{className:"text-[9px] text-content-tertiary text-center mt-3",children:[ss.length," step",ss.length!==1?"s":""," · ",ss.filter(I=>{var he;return!!((he=I.generatedCode)!=null&&he.trim())}).length," with code"]})]})]})}),n.jsx(zn,{...k}),n.jsx(e5,{open:Ys,onClose:()=>H(!1),suiteId:e,caseId:t,onInserted:()=>H(!1)})]})}function r5({type:e,filePath:t,inlineData:s,onTypeChange:r,onFilePathChange:a,onInlineChange:i}){const[l,o]=m.useState([]),[c,d]=m.useState([]),[x,f]=m.useState(!1),[g,b]=m.useState(""),[y,j]=m.useState(!1),k=m.useRef(null);m.useEffect(()=>{Hr.list().then(o).catch(()=>{})},[]),m.useEffect(()=>{if((e==="json-file"||e==="csv-file")&&t){const v=t.replace(/^data\//,"");Hr.get(v).then(w=>{d(w.rows),b(w.raw)}).catch(()=>d([]))}else if(e==="inline"&&s)try{d(JSON.parse(s))}catch{d([])}else d([])},[e,t,s]);const h=async v=>{var N;const w=(N=v.target.files)==null?void 0:N[0];if(w){j(!0);try{const P=await w.text(),E=await Hr.upload(w.name,P);a(E.path),r(w.name.endsWith(".csv")?"csv-file":"json-file");const _=await Hr.list();o(_),O.success(`Uploaded ${w.name} (${E.rowCount} rows)`)}catch(P){O.error(P instanceof Error?P.message:"Upload failed")}finally{j(!1),v.target.value=""}}},u=async()=>{if((e==="json-file"||e==="csv-file")&&t){const v=t.replace(/^data\//,"");try{await Hr.update(v,g);const w=await Hr.get(v);d(w.rows),f(!1),O.success("Data file saved")}catch(w){O.error(w instanceof Error?w.message:"Save failed")}}else if(e==="inline"){i(g);try{d(JSON.parse(g))}catch{d([])}f(!1)}},p=c.length>0?Object.keys(c[0]):[];return n.jsxs("div",{children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1.5 flex items-center gap-1",children:[n.jsx(Lg,{size:9})," Data-Driven"]}),n.jsxs("div",{className:"flex items-center gap-1.5 mb-2 flex-wrap",children:[["none","inline","json-file","csv-file"].map(v=>n.jsx("button",{type:"button",onClick:()=>r(v),className:C("px-2 py-0.5 rounded-md text-[9px] font-semibold transition-all ring-1",e===v?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":"ring-border text-content-tertiary hover:bg-surface-inset"),children:v==="none"?"Off":v==="inline"?"Inline":v==="json-file"?"JSON":"CSV"},v)),(e==="json-file"||e==="csv-file")&&n.jsxs("select",{className:"max-w-[160px] text-[10px] border border-border rounded-md px-1.5 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent bg-surface-inset/50",value:t,onChange:v=>a(v.target.value),children:[n.jsx("option",{value:"",children:"Select file…"}),l.filter(v=>e==="csv-file"?v.type==="csv":v.type==="json").map(v=>n.jsx("option",{value:v.path,children:v.name},v.name))]}),e!=="none"&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>{var v;return(v=k.current)==null?void 0:v.click()},className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md ring-1 ring-dashed ring-violet-300 dark:ring-violet-700 text-[9px] font-semibold text-violet-600 dark:text-violet-400 hover:bg-violet-50 dark:hover:bg-violet-900/20 transition-colors",children:[y?n.jsx(ce,{size:9,className:"animate-spin"}):n.jsx(mm,{size:9})," Upload"]}),n.jsx("input",{ref:k,type:"file",accept:".json,.csv",onChange:h,className:"hidden"})]})]}),e==="inline"&&!x&&n.jsx("textarea",{className:"w-full h-14 text-[10px] font-mono border border-border rounded-lg px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 mb-2 bg-surface-inset/50",placeholder:'[{"email":"user1@test.com","password":"pass1"}]',value:s,onChange:v=>i(v.target.value)}),e!=="none"&&c.length>0&&!x&&n.jsxs("div",{className:"mb-2",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[c.length," row",c.length!==1?"s":""]}),n.jsxs("button",{type:"button",onClick:()=>{e==="inline"&&b(s),f(!0)},className:"text-[9px] text-violet-600 dark:text-violet-400 hover:text-violet-800 dark:hover:text-violet-300 font-semibold flex items-center gap-0.5",children:[n.jsx(Dr,{size:8})," Edit"]})]}),n.jsx("div",{className:"overflow-x-auto border border-border rounded-lg",children:n.jsxs("table",{className:"w-full text-[10px]",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-surface-inset border-b border-border",children:[n.jsx("th",{className:"px-2 py-1 text-left font-bold text-content-tertiary w-6",children:"#"}),p.map(v=>n.jsx("th",{className:"px-2 py-1 text-left font-bold text-violet-600 dark:text-violet-400",children:`{{${v}}}`},v))]})}),n.jsxs("tbody",{children:[c.slice(0,8).map((v,w)=>n.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-surface-inset/50",children:[n.jsx("td",{className:"px-2 py-0.5 text-content-tertiary tabular-nums",children:w+1}),p.map(N=>n.jsx("td",{className:"px-2 py-0.5 text-content-secondary font-mono",children:v[N]},N))]},w)),c.length>8&&n.jsx("tr",{children:n.jsxs("td",{colSpan:p.length+1,className:"px-2 py-1 text-center text-content-tertiary text-[9px] italic",children:["+",c.length-8," more"]})})]})]})})]}),x&&n.jsxs("div",{className:"mb-2",children:[n.jsx("textarea",{className:"w-full h-32 text-[10px] font-mono border border-violet-300 dark:border-violet-700 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-violet-300 dark:focus:ring-violet-700 bg-violet-50/20 dark:bg-violet-900/10 text-content",value:g,onChange:v=>b(v.target.value)}),n.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[n.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg bg-violet-600 text-white text-[10px] font-semibold hover:bg-violet-700",children:[n.jsx(He,{size:10})," Save"]}),n.jsxs("button",{type:"button",onClick:()=>f(!1),className:"flex items-center gap-0.5 px-2.5 py-1 rounded-lg border border-border text-[10px] text-content-secondary hover:bg-surface-inset",children:[n.jsx(Se,{size:10})," Cancel"]})]})]})]})}function a5({step:e,index:t,caseIsApi:s,suiteIsAudit:r,generating:a,isDragging:i,isDragOver:l,onDragStart:o,onDragOver:c,onDrop:d,onDragEnd:x,onDelete:f,onGenerate:g,onSaveInstruction:b,onSaveTimeout:y,onSaveRetries:j,onSaveStepType:k,onSaveMockUrl:h,onSaveMockResponse:u,onSaveMockStatus:p,onSaveRunAudit:v}){var Bt;const[w,N]=m.useState(!1),[P,E]=m.useState(!1),[_,D]=m.useState(e.instruction),[G,J]=m.useState(e.timeout?String(e.timeout):""),[se,M]=m.useState(e.retries!=null?String(e.retries):""),[F,ee]=m.useState(e.mockUrl??""),[ae,z]=m.useState(e.mockResponse??""),[K,T]=m.useState(e.mockStatus?String(e.mockStatus):"200"),W=m.useRef(null),[A,te]=m.useState(void 0),B=!!((Bt=e.generatedCode)!=null&&Bt.trim()),de=e.stepType==="mock",xe=!!e.runAudit,ue=A!==void 0?A:xe,Ce=A!==void 0&&A!==xe,tt=()=>{A!==void 0&&(v==null||v(e.id,A),te(void 0))},en=()=>te(void 0);m.useEffect(()=>{de&&N(!0)},[de]),m.useEffect(()=>{J(e.timeout?String(e.timeout):"")},[e.timeout]),m.useEffect(()=>{D(e.instruction)},[e.instruction]),m.useEffect(()=>{var q;P&&((q=W.current)==null||q.focus())},[P]);const mt=()=>{const q=_.trim();q&&q!==e.instruction&&b(e.id,q),E(!1)};return n.jsxs("div",{draggable:!0,onDragStart:q=>{q.dataTransfer.effectAllowed="move",o()},onDragOver:q=>{q.preventDefault(),c()},onDrop:q=>{q.preventDefault(),d()},onDragEnd:x,className:C("rounded-lg overflow-hidden transition-all",i?"opacity-40 ring-2 ring-accent":"ring-1 ring-border",l?"ring-2 ring-accent shadow-sm":""),children:[n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",children:[n.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 pt-0.5",children:[n.jsx(vc,{size:11,className:"text-content-tertiary hover:text-content-secondary cursor-grab active:cursor-grabbing"}),n.jsx("span",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-accent to-accent-dark text-white text-[9px] font-bold flex items-center justify-center",children:t+1})]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-start gap-1.5 flex-wrap",children:[P?n.jsx("input",{ref:W,className:"flex-1 text-xs text-content border border-accent/40 rounded-md px-2 py-0.5 focus:outline-none focus:ring-1 focus:ring-accent/30 min-w-0 bg-surface-inset/50",value:_,onChange:q=>D(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),mt()),q.key==="Escape"&&(D(e.instruction),E(!1))},onBlur:mt}):n.jsx("span",{className:"text-xs text-content font-medium flex-1",children:e.instruction}),n.jsx("span",{className:C("text-[8px] px-1 py-px rounded font-bold uppercase flex-shrink-0 ring-1",de?"bg-purple-50 dark:bg-purple-900/20 text-purple-600 dark:text-purple-400 ring-purple-200 dark:ring-purple-800":e.stepType==="api"||s?"bg-violet-50 dark:bg-violet-900/20 text-violet-600 dark:text-violet-400 ring-violet-200 dark:ring-violet-800":r?"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800":"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 ring-blue-200 dark:ring-blue-800"),children:de?"Mock":e.stepType==="api"||s?"API":r?"Audit":"UI"}),ue&&n.jsxs("span",{className:C("text-[8px] px-1 py-px rounded font-bold flex items-center gap-0.5 ring-1",Ce?"bg-amber-50 dark:bg-amber-900/20 text-amber-500 dark:text-amber-400 ring-amber-200 dark:ring-amber-800 opacity-60":"bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 ring-amber-200 dark:ring-amber-800"),children:[n.jsx(Be,{size:7}),Ce?"Audit*":"Audit"]}),e.lastHealed&&n.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-amber-50 text-amber-600 ring-1 ring-amber-200 font-bold",children:"healed"})]}),B&&!P&&n.jsx("p",{className:"text-[10px] text-content-tertiary mt-px",children:"Code generated ✓"})]}),n.jsxs("select",{value:e.stepType??"ui",onChange:q=>{q.target.value==="mock"&&N(!0),k==null||k(e.id,q.target.value)},className:"text-[10px] border border-border rounded-md px-1 py-0.5 bg-surface-inset/50 text-content-secondary focus:outline-none focus:border-accent flex-shrink-0",children:[n.jsx("option",{value:"ui",children:"UI"}),n.jsx("option",{value:"api",children:"API"}),n.jsx("option",{value:"mock",children:"Mock"})]}),n.jsx("input",{type:"number",min:0,max:5,step:1,className:"w-10 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"×",title:"Retries",value:se,onChange:q=>M(q.target.value),onBlur:()=>{const q=se.trim()?parseInt(se,10):null,ht=e.retries??null;q!==ht&&(j==null||j(e.id,q!=null&&q>=0?q:null))},onKeyDown:q=>{q.key==="Enter"&&q.target.blur()}}),n.jsx("input",{type:"number",min:100,step:100,className:"w-16 text-[10px] border border-border rounded-md px-1.5 py-0.5 text-content-secondary placeholder:text-content-tertiary focus:outline-none focus:border-accent flex-shrink-0 bg-surface-inset/50",placeholder:"ms",value:G,onChange:q=>J(q.target.value),onBlur:()=>{const q=G.trim()?parseInt(G,10):null,ht=e.timeout??null;q!==ht&&y(e.id,q&&q>0?q:null)},onKeyDown:q=>{q.key==="Enter"&&q.target.blur()}}),n.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[P?n.jsx("button",{type:"button",onClick:mt,className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:n.jsx(He,{size:12})}):n.jsx("button",{type:"button",onClick:()=>E(!0),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:n.jsx(Dr,{size:11})}),r&&!s&&e.stepType!=="api"&&e.stepType!=="mock"&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",title:ue?"Remove Lighthouse audit checkpoint":"Mark as Lighthouse audit checkpoint",onClick:q=>{q.stopPropagation(),te(!ue)},onMouseDown:q=>q.stopPropagation(),className:C("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-bold transition-all cursor-pointer select-none",ue?"text-amber-700 dark:text-amber-400 bg-amber-100 dark:bg-amber-900/30 hover:bg-amber-200 dark:hover:bg-amber-900/40 ring-1 ring-amber-300 dark:ring-amber-700":"text-content-tertiary hover:text-amber-600 dark:hover:text-amber-400 hover:bg-amber-50 dark:hover:bg-amber-900/20 ring-1 ring-transparent hover:ring-amber-200 dark:hover:ring-amber-800"),children:[n.jsx(Be,{size:9}),n.jsx("span",{children:"Audit"})]}),Ce&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",title:"Save audit change",onClick:q=>{q.stopPropagation(),tt()},onMouseDown:q=>q.stopPropagation(),className:"p-1 rounded-md text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-900/20 transition-colors",children:n.jsx(He,{size:11})}),n.jsx("button",{type:"button",title:"Cancel",onClick:q=>{q.stopPropagation(),en()},onMouseDown:q=>q.stopPropagation(),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(Se,{size:11})})]})]}),n.jsx("button",{type:"button",onClick:()=>g(e.id),disabled:a,className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors disabled:opacity-40",children:a?n.jsx(ce,{size:12,className:"animate-spin"}):n.jsx(Fa,{size:12})}),n.jsx("button",{type:"button",onClick:()=>f(e.id),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",children:n.jsx(fn,{size:11})}),n.jsx("button",{type:"button",onClick:()=>N(q=>!q),className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:w?n.jsx(Tt,{size:12}):n.jsx(Zt,{size:12})})]})]}),w&&n.jsxs("div",{className:"border-t border-border",children:[de&&n.jsxs("div",{className:"px-3 py-2.5 bg-violet-50/50 dark:bg-violet-900/10 space-y-1.5 border-b border-border",children:[n.jsx("p",{className:"text-[9px] font-bold text-violet-600 dark:text-violet-400 uppercase tracking-widest",children:"Mock Route"}),n.jsxs("div",{className:"flex gap-2 items-center",children:[n.jsx("input",{className:"flex-1 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"URL pattern, e.g. **/api/users",value:F,onChange:q=>ee(q.target.value),onBlur:()=>{F!==(e.mockUrl??"")&&(h==null||h(e.id,F))}}),n.jsx("input",{type:"number",className:"w-16 text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400",placeholder:"Status",value:K,onChange:q=>T(q.target.value),onBlur:()=>{const q=parseInt(K,10);!isNaN(q)&&q!==(e.mockStatus??200)&&(p==null||p(e.id,q))}})]}),n.jsx("textarea",{rows:3,className:"w-full text-[10px] border border-border rounded px-2 py-1 bg-surface focus:outline-none focus:border-violet-400 font-mono resize-none",placeholder:'{"key":"value"}',value:ae,onChange:q=>z(q.target.value),onBlur:()=>{ae!==(e.mockResponse??"")&&(u==null||u(e.id,ae))}})]}),B?n.jsx(zy,{code:e.generatedCode,maxLines:12,className:"rounded-none"}):n.jsxs("div",{className:"px-3 py-2.5 text-[10px] text-content-tertiary italic bg-surface-inset/30",children:["No code yet — click ",n.jsx(Fa,{size:9,className:"inline mb-0.5"})," to generate"]})]})]})}let Ht=null,di=!1;const ex=new Set;function ui(){ex.forEach(e=>e())}const dn={subscribe(e){return ex.add(e),()=>{ex.delete(e)}},getSnapshot(){return{job:Ht,showPopup:di}},start(e,t){const s=`gen-${Date.now()}`;return Ht={id:s,tab:e,label:t,status:"running",startedAt:Date.now()},di=!1,ui(),s},done(e,t){Ht&&(Ht={...Ht,status:"done",suiteId:e,suiteName:t},di=!0,ui())},error(e){Ht&&(Ht={...Ht,status:"error",error:e},ui())},dismissPopup(){di=!1,ui()},clear(){Ht=null,di=!1,ui()},isRunning(){return(Ht==null?void 0:Ht.status)==="running"}};function Ty(){const[e,t]=m.useState(()=>dn.getSnapshot());return m.useEffect(()=>dn.subscribe(()=>t(dn.getSnapshot())),[]),e}const i5=[{title:"Login Flow",story:"User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed."},{title:"E-Commerce Checkout",story:"User searches for a product, adds it to the cart, proceeds to checkout, and completes the purchase."},{title:"Admin Management",story:"Admin user creates a new account, assigns roles, and verifies the account appears in the user list."}],l5=/^(https?:\/\/.+\/(browse|issue)\/[A-Z][A-Z0-9_]+-\d+|https?:\/\/.+selectedIssue=[A-Z][A-Z0-9_]+-\d+|[A-Z][A-Z0-9_]+-\d+)$/i;function bf(e){return e.trim()?l5.test(e.trim()):!0}function vf(e){const t=e.trim();if(!t)return null;const s=t.match(/([A-Z][A-Z0-9_]+-\d+)/i);return s?s[1].toUpperCase():null}function o5(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const i=JSON.parse(t).map(l=>{if(typeof l=="string")return{story:l.trim()};if(typeof l=="object"&&l!==null&&"story"in l){const o=l;return{story:String(o.story).trim(),suiteName:o.suiteName,jiraUrl:o.jiraUrl}}return null}).filter(l=>l!==null&&l.story.length>=10);if(i.length>0)return i}catch{}const s=t.split(/\n\s*---+\s*\n/).map(a=>a.trim()).filter(Boolean);if(s.length>1)return s.map(a=>a.replace(/^\d+\.\s*/,"").trim()).filter(a=>a.length>=10).map(a=>({story:a}));const r=t.split(`
|
|
779
|
+
`).filter(a=>/^\d+[\.\)]\s/.test(a.trim()));return r.length>1?r.map(a=>a.replace(/^\d+[\.\)]\s*/,"").trim()).filter(a=>a.length>=10).map(a=>({story:a})):t.length>=10?[{story:t}]:[]}function kd({icon:e,title:t,desc:s,tag:r,active:a,gradient:i,onClick:l}){return n.jsxs("button",{type:"button",onClick:l,className:C("relative flex items-start gap-2.5 p-3 rounded-xl border-2 text-left transition-all duration-200 group flex-1 min-w-0",a?"border-accent bg-accent/[0.04] shadow-sm":"border-transparent bg-surface hover:bg-surface-inset/50 hover:border-border"),children:[a&&n.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-px w-8 h-[3px] rounded-full bg-gradient-to-r from-accent to-accent-light"}),n.jsx("div",{className:C("w-5 h-5 rounded flex items-center justify-center transition-all flex-shrink-0",a?i:"bg-surface-inset"),children:n.jsx(e,{size:14,className:a?"text-white":"text-content-tertiary",strokeWidth:1.8})}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:C("text-xs font-semibold transition-colors",a?"text-content":"text-content-secondary"),children:t}),r&&n.jsx("span",{className:C("text-[8px] font-bold uppercase tracking-wider px-1 py-px rounded",a?"bg-accent/10 text-accent":"bg-surface-inset text-content-tertiary"),children:r})]}),n.jsx("p",{className:"text-[10px] text-content-tertiary mt-px leading-snug truncate",children:s})]})]})}function jf({title:e,icon:t,children:s,defaultOpen:r=!1}){const[a,i]=m.useState(r);return n.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"w-full flex items-center justify-between px-4 py-3 bg-surface-inset/50 hover:bg-surface-inset transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(t,{size:13,className:"text-content-tertiary"}),n.jsx("span",{className:"text-xs font-semibold text-content-secondary",children:e})]}),n.jsx(Tt,{size:13,className:C("text-content-tertiary transition-transform duration-200",a&&"rotate-180")})]}),a&&n.jsx("div",{className:"px-4 py-3 border-t border-border bg-surface",children:s})]})}function c5({content:e,onClose:t}){const[s,r]=m.useState(!1);return n.jsxs("div",{className:C("rounded-xl border overflow-hidden transition-all animate-fade-in","border-indigo-200/50 bg-gradient-to-br from-indigo-50/40 via-surface to-violet-50/20"),children:[n.jsxs("div",{className:"px-3 pt-3 pb-1.5 space-y-1.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-100/80 text-indigo-700 text-xs font-bold",children:[n.jsx(Ka,{size:11})," ",e.issueKey]}),n.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:e.issueType}),n.jsx("span",{className:"px-2 py-0.5 rounded-md bg-surface-inset text-content-secondary text-[10px] font-semibold border border-border",children:e.status}),n.jsx("span",{className:"px-2 py-0.5 rounded-md bg-amber-50 text-amber-700 text-[10px] font-semibold border border-amber-200/50",children:e.priority})]}),n.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[n.jsx("button",{type:"button",onClick:()=>r(a=>!a),className:"text-indigo-500 hover:text-indigo-700 text-[10px] font-semibold px-2 py-1 rounded-md hover:bg-indigo-50 transition-colors",children:s?"Less":"More"}),n.jsx("button",{type:"button",onClick:t,className:"p-1 rounded-md text-content-tertiary hover:text-content-secondary hover:bg-surface-inset transition-colors",children:n.jsx(Se,{size:13})})]})]}),n.jsx("p",{className:"font-semibold text-content text-xs leading-relaxed",children:e.summary})]}),n.jsxs("div",{className:C("px-3 pb-3 space-y-1.5",s?"overflow-y-auto max-h-[200px]":""),children:[e.description&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Description"}),n.jsx("p",{className:C("text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",!s&&"line-clamp-3"),children:e.description})]}),e.acceptanceCriteria&&s&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Acceptance Criteria"}),n.jsx("p",{className:"text-xs text-content-secondary leading-relaxed whitespace-pre-wrap",children:e.acceptanceCriteria})]}),e.comments.length>0&&s&&n.jsxs("div",{children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Comments (",e.comments.length,")"]}),e.comments.map((a,i)=>n.jsx("p",{className:"text-xs text-content-secondary italic mt-1 whitespace-pre-wrap",children:a},i))]}),e.labels.length>0&&n.jsx("div",{className:"flex items-center gap-1 flex-wrap pt-1",children:e.labels.map(a=>n.jsx("span",{className:"px-2 py-0.5 rounded-full bg-surface-inset text-content-tertiary text-[9px] font-medium border border-border",children:a},a))})]})]})}function d5({pct:e,size:t=64,stroke:s=5}){const r=(t-s)/2,a=2*Math.PI*r,i=a-e/100*a;return n.jsxs("svg",{width:t,height:t,className:"-rotate-90",children:[n.jsx("circle",{cx:t/2,cy:t/2,r,fill:"none",stroke:"currentColor",strokeWidth:s,className:"text-surface-inset"}),n.jsx("circle",{cx:t/2,cy:t/2,r,fill:"none",stroke:"url(#prog-grad)",strokeWidth:s,strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:i,className:"transition-all duration-700 ease-out"}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"prog-grad",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"var(--color-accent)"}),n.jsx("stop",{offset:"100%",stopColor:"var(--color-accent-light, #818cf8)"})]})})]})}const u5={GET:"bg-blue-500/10 text-blue-600 ring-blue-500/20",POST:"bg-emerald-500/10 text-emerald-600 ring-emerald-500/20",PUT:"bg-amber-500/10 text-amber-600 ring-amber-500/20",DELETE:"bg-red-500/10 text-red-600 ring-red-500/20",PATCH:"bg-violet-500/10 text-violet-600 ring-violet-500/20"},x5=[{icon:Vg,label:"--- separator",example:`Story one
|
|
780
|
+
---
|
|
781
|
+
Story two`},{icon:yN,label:"Numbered",example:`1. Story one
|
|
782
|
+
2. Story two`},{icon:aN,label:"JSON",example:'[{"story":"…","suiteName":"Auth"}]'},{icon:mn,label:"CSV Upload",example:`story,suiteName
|
|
783
|
+
"Story","Auth"`}];function m5(){const[e,t]=m.useState("single"),s=Pn(),[r,a]=m.useState(""),[i,l]=m.useState(""),[,o]=m.useState(!1),[c,d]=m.useState(""),[x,f]=m.useState(null),[g,b]=m.useState(!0),[y,j]=m.useState(""),[k,h]=m.useState(3),[u,p]=m.useState([]),[v,w]=m.useState(null),[N,P]=m.useState(null),[E,_]=m.useState(null),[D,G]=m.useState(""),[J,se]=m.useState([]),M=m.useRef(null);m.useEffect(()=>{const R=o5(y),X=J.map(be=>({story:[be.summary,be.description,be.acceptanceCriteria].filter(Boolean).join(`
|
|
784
|
+
`),suiteName:be.summary,jiraUrl:be.issueKey}));p([...X,...R])},[y,J]);const[F,ee]=m.useState(""),[ae,z]=m.useState(""),[K,T]=m.useState(""),[W,A]=m.useState(null),[te,B]=m.useState(""),de=Y({mutationFn:R=>Br.fetchJira(R),onSuccess:R=>{f(R),b(!0),O.success(`Fetched ${R.issueKey}: ${R.summary}`)},onError:R=>{f(null),O.error(R.message)}}),xe=Y({mutationFn:R=>Br.fetchJira(R),onSuccess:R=>{if(J.some(X=>X.issueKey===R.issueKey)){O.error(`${R.issueKey} already added`);return}se(X=>[...X,R]),G(""),O.success(`Added ${R.issueKey}`)},onError:R=>{O.error(R.message)}}),ue=Y({mutationFn:()=>(dn.start("single",i||"Test Suite"),Br.generate(r,i||void 0,c||void 0)),onSuccess:R=>{o(!0),dn.done(R.suiteId,R.suiteName)},onError:R=>{dn.error(R.message),O.error(R.message)}}),Ce=Y({mutationFn:()=>Br.generateBulk(u,k),onSuccess:R=>O.success(`Processing ${R.total} stories…`),onError:R=>O.error(R.message)}),tt=Y({mutationFn:()=>Br.swaggerPreview(F),onSuccess:R=>{A(R),z(R.title?`${R.title} API Tests`:""),O.success(`Found ${R.totalEndpoints} endpoints`)},onError:R=>{A(null),O.error(R.message)}}),en=Y({mutationFn:()=>{dn.start("swagger",ae||"API Tests");const R=K.trim()?K.split(",").map(X=>X.trim()).filter(Boolean):void 0;return Br.generateFromSwagger(F,ae||void 0,R,te)},onSuccess:R=>{dn.done(R.suiteId,R.suiteName),O.success(`Generated ${R.endpointsFound} endpoint tests`)},onError:R=>{dn.error(R.message),O.error(R.message)}});pd("story:bulk-start",R=>{const X=R;_(X.jobId),w({jobId:X.jobId,total:X.total,completed:0,failed:0,currentIndex:0,currentStory:""}),P(null)}),pd("story:bulk-progress",R=>{const X=R;X.jobId===E&&w(X)}),pd("story:bulk-done",R=>{const X=R;X.jobId===E&&(P(X),w(null),X.failed===0?O.success(`All ${X.completed} suites generated!`):O.success(`${X.completed} done, ${X.failed} failed`))});const mt=R=>{var Rn;const X=(Rn=R.target.files)==null?void 0:Rn[0];if(!X)return;const be=new FileReader;be.onload=Nt=>{var nn;const On=(nn=Nt.target)==null?void 0:nn.result;if(X.name.endsWith(".csv")){const H=On.split(`
|
|
785
|
+
`).slice(1).map(oe=>oe.split(",").map(fe=>fe.replace(/^"|"$/g,"").trim())).filter(oe=>{var fe;return((fe=oe[0])==null?void 0:fe.length)>=10}).map(oe=>({story:oe[0],suiteName:oe[1]||void 0}));j(H.map((oe,fe)=>`${fe+1}. ${oe.story}`).join(`
|
|
786
|
+
`))}else j(On)},be.readAsText(X),R.target.value=""},Bt=v?Math.round((v.completed+v.failed)/v.total*100):0,q=Ce.isPending||v!==null&&N===null,ht=bf(c),Tn=vf(c),at=bf(D),tn=vf(D),Qs=R=>se(X=>X.filter(be=>be.issueKey!==R)),Gs=r.trim().length>=10||!!x&&!!c.trim();return n.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsx("div",{className:"flex items-center justify-between",children:n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-br from-violet-500 via-indigo-500 to-blue-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:n.jsx(Ot,{size:16,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-base font-bold text-content tracking-tight",children:"Smart Tests"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"AI-powered test generation from stories, Jira, or API specs"})]})]})}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 p-1 rounded-xl bg-surface border border-border shadow-xs",children:[n.jsx(kd,{icon:Fa,title:"Single Story",desc:"Describe one user journey — AI creates the full test suite",active:e==="single",gradient:"bg-gradient-to-br from-violet-500 to-indigo-600",onClick:()=>t("single")}),n.jsx(kd,{icon:pl,title:"Bulk Import",desc:"Generate multiple suites at once from text, JSON, CSV, or Jira",tag:"batch",active:e==="bulk",gradient:"bg-gradient-to-br from-amber-500 to-orange-600",onClick:()=>t("bulk")}),n.jsx(kd,{icon:Ag,title:"API Import",desc:"Import OpenAPI / Swagger specs to auto-generate API tests",tag:"api",active:e==="swagger",gradient:"bg-gradient-to-br from-emerald-500 to-teal-600",onClick:()=>t("swagger")})]}),e==="single"&&n.jsxs("div",{className:"grid grid-cols-5 gap-3 animate-fade-in",children:[n.jsxs("div",{className:"col-span-3 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:n.jsx(Bo,{size:14,className:"text-indigo-600"})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Jira Integration"}),n.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional"})]})]}),x&&!g&&n.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex items-center gap-1 text-[10px] text-indigo-600 hover:text-indigo-700 font-semibold",children:[n.jsx(Ig,{size:10})," Show ",x.issueKey]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{className:C("w-full rounded-xl px-3 py-2 text-xs transition-all border focus:outline-none focus:ring-2 placeholder-content-tertiary",c.trim()?ht?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30 focus:border-accent/50"),placeholder:"PROJ-123 or paste full Jira URL",value:c,onChange:R=>{d(R.target.value),R.target.value.trim()||f(null)}}),Tn&&ht&&n.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:Tn})]}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>de.mutate(c),loading:de.isPending,disabled:!c.trim()||!ht||de.isPending,children:[n.jsx(ad,{size:14})," Fetch"]})]}),c.trim()&&!ht&&n.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[n.jsx(Yt,{size:10})," Invalid format — use PROJ-123 or full Jira URL"]}),x&&g&&n.jsx(c5,{content:x,onClose:()=>b(!1)})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:n.jsx(mn,{size:14,className:"text-violet-600"})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-bold text-content",children:"User Story"}),x?n.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary font-medium",children:"Optional — Jira content used"}):n.jsx("span",{className:"ml-1 text-red-400 text-xs",children:"*"})]})]}),n.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 p-4 text-sm text-content leading-relaxed focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 resize-vertical min-h-[80px] placeholder-content-tertiary transition-all",rows:x?3:5,placeholder:x?"Add extra context or leave blank — Jira content is enough":`Describe the user journey you want to automate…
|
|
787
|
+
|
|
788
|
+
Example: User logs in with valid credentials, navigates to the dashboard, and verifies that the welcome message is displayed.`,value:r,onChange:R=>{a(R.target.value),o(!1)}})]}),n.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:n.jsxs("div",{className:"flex items-end gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("label",{className:"text-[11px] font-bold text-content mb-2 block",children:["Suite Name ",n.jsx("span",{className:"text-content-tertiary font-normal text-[10px]",children:"(AI auto-suggests if blank)"})]}),n.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:x?`e.g. ${x.summary}`:"e.g. Authentication Tests",value:i,onChange:R=>l(R.target.value)})]}),n.jsxs(ne,{onClick:()=>ue.mutate(),loading:ue.isPending,disabled:!Gs,children:[n.jsx(Ot,{size:14})," Generate Suite"]})]})})]}),n.jsxs("div",{className:"col-span-2 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Be,{size:13,className:"text-amber-500"}),n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Quick Start"})]}),n.jsx("div",{className:"space-y-2",children:i5.map((R,X)=>n.jsxs("button",{type:"button",onClick:()=>{a(R.story),o(!1)},className:"w-full text-left px-3 py-2 rounded-lg border border-border bg-surface-inset/30 hover:bg-accent/[0.04] hover:border-accent/30 transition-all group",children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-bold text-content group-hover:text-accent transition-colors",children:R.title}),n.jsx(sN,{size:11,className:"text-content-tertiary group-hover:text-accent transition-colors"})]}),n.jsx("p",{className:"text-[10px] text-content-tertiary leading-snug line-clamp-2",children:R.story})]},X))})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(rf,{size:13,className:"text-accent"}),n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Pro Tips"})]}),n.jsx("div",{className:"space-y-2",children:["Paste a Jira link to auto-fetch story details","Write in plain English — describe the full journey","Include expected outcomes for better assertions","Combine Jira + extra context for best results"].map((R,X)=>n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(ir,{size:9,className:"text-accent flex-shrink-0 mt-1"}),n.jsx("span",{className:"text-[11px] text-content-tertiary leading-relaxed",children:R})]},X))})]})]})]}),e==="bulk"&&n.jsxs("div",{className:"space-y-3 animate-fade-in",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-indigo-100 flex items-center justify-center",children:n.jsx(Bo,{size:14,className:"text-indigo-600"})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Fetch from Jira"}),n.jsx("span",{className:"ml-2 text-[10px] text-content-tertiary",children:"Paste URL → Fetch → repeat"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{className:C("w-full rounded-xl px-3.5 py-2 text-sm border transition-all focus:outline-none focus:ring-2 placeholder-content-tertiary",D.trim()?at?"border-indigo-300 focus:ring-indigo-300 bg-indigo-50/20":"border-red-300 focus:ring-red-300 bg-red-50/20":"border-border bg-surface-inset/50 focus:ring-accent/30"),placeholder:"PROJ-123 or Jira URL",value:D,onChange:R=>G(R.target.value),onKeyDown:R=>{R.key==="Enter"&&D.trim()&&at&&!xe.isPending&&!q&&xe.mutate(D)},disabled:q}),tn&&at&&n.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] font-mono font-bold text-indigo-600 bg-indigo-100 px-2 py-0.5 rounded-md",children:tn})]}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>xe.mutate(D),loading:xe.isPending,disabled:!D.trim()||!at||xe.isPending||q,children:[n.jsx(ad,{size:14})," Fetch"]})]}),D.trim()&&!at&&n.jsxs("p",{className:"text-[10px] text-red-500 flex items-center gap-1",children:[n.jsx(Yt,{size:10})," Invalid Jira URL format"]}),J.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1.5 pt-1",children:J.map(R=>n.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-indigo-50 border border-indigo-200/60 text-xs text-indigo-700 transition-all hover:shadow-sm",title:R.summary,children:[n.jsx(Ka,{size:9,className:"text-indigo-400"}),n.jsx("span",{className:"font-mono font-bold text-[10px]",children:R.issueKey}),n.jsx("span",{className:"max-w-[120px] truncate text-[10px]",children:R.summary}),!q&&n.jsx("button",{type:"button",onClick:()=>Qs(R.issueKey),className:"text-indigo-300 hover:text-red-500 transition-colors",children:n.jsx(Se,{size:10})})]},R.issueKey))})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-amber-100 flex items-center justify-center",children:n.jsx(mn,{size:14,className:"text-amber-600"})}),n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Supported Formats"})]}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:x5.map(({icon:R,label:X,example:be})=>n.jsxs("div",{className:"p-2.5 rounded-xl bg-surface-inset/50 border border-border",children:[n.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[n.jsx(R,{size:10,className:"text-content-tertiary"}),n.jsx("span",{className:"text-[10px] font-bold text-content-secondary",children:X})]}),n.jsx("pre",{className:"text-[9px] text-content-tertiary font-mono leading-relaxed whitespace-pre-wrap line-clamp-2",children:be})]},X))})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 bg-surface-inset/30 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-xs text-content-secondary",children:u.length>0?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-bold text-accent tabular-nums",children:u.length})," stories",J.length>0&&n.jsxs("span",{className:"text-content-tertiary ml-1",children:["(",J.length," Jira",u.length-J.length>0?` + ${u.length-J.length} manual`:"",")"]})]}):n.jsx("span",{className:"text-content-tertiary",children:"No stories yet"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Parallel"}),n.jsx("select",{className:"text-xs border border-border rounded-lg px-2 py-1 bg-surface focus:outline-none focus:ring-2 focus:ring-accent/30",value:k,onChange:R=>h(Number(R.target.value)),disabled:q,children:[1,2,3,4,5].map(R=>n.jsxs("option",{value:R,children:[R,"×"]},R))})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{ref:M,type:"file",accept:".txt,.csv,.json",className:"hidden",onChange:mt}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>{var R;return(R=M.current)==null?void 0:R.click()},disabled:q,children:[n.jsx(mm,{size:12})," Upload"]}),n.jsxs(ne,{size:"sm",onClick:()=>{P(null),Ce.mutate()},loading:Ce.isPending,disabled:u.length===0||q,children:[n.jsx(Be,{size:13})," Generate ",u.length>0?u.length:""," Suites"]})]})]}),n.jsxs("div",{className:"min-h-[220px]",children:[!q&&!N&&n.jsx("textarea",{className:"w-full h-[220px] p-4 text-xs text-content leading-relaxed focus:outline-none resize-none font-mono placeholder-content-tertiary bg-transparent",placeholder:`Paste your stories here…
|
|
789
|
+
|
|
790
|
+
Use --- separators, numbered lists, or JSON array format.
|
|
791
|
+
Or fetch from Jira above.`,value:y,onChange:R=>j(R.target.value),disabled:q}),q&&v&&n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx(d5,{pct:Bt,size:72,stroke:5}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsxs("span",{className:"text-sm font-bold text-content tabular-nums",children:[Bt,"%"]})})]}),n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"text-sm font-semibold text-content",children:"Generating suites…"}),n.jsxs("p",{className:"text-xs text-content-tertiary mt-1",children:[v.completed+v.failed," of ",v.total," complete"]})]}),n.jsx("div",{className:"flex gap-5",children:[["Total",v.total,"text-content"],["Done",v.completed,"text-emerald-600"],["Failed",v.failed,"text-red-500"]].map(([R,X,be])=>n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:`text-lg font-bold tabular-nums ${be}`,children:X}),n.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:R})]},String(R)))}),v.currentStory&&n.jsxs("div",{className:"max-w-md mx-auto flex items-start gap-2 p-3 bg-accent/5 rounded-xl border border-accent/10",children:[n.jsx(Be,{size:12,className:"text-accent flex-shrink-0 mt-0.5"}),n.jsxs("p",{className:"text-[11px] text-content-secondary line-clamp-2",children:[n.jsxs("span",{className:"font-semibold",children:["#",v.currentIndex+1,":"]})," ",v.currentStory]})]})]}),N&&n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[n.jsx("div",{className:C("w-10 h-10 rounded-xl flex items-center justify-center",N.failed===0?"bg-emerald-100":"bg-amber-100"),children:N.failed===0?n.jsx(Ue,{size:20,className:"text-emerald-600"}):n.jsx(Yt,{size:20,className:"text-amber-600"})}),n.jsxs("div",{className:"text-center",children:[n.jsxs("p",{className:"text-sm font-bold text-content",children:[N.completed," suites generated",N.failed>0?`, ${N.failed} failed`:" successfully"]}),n.jsx("p",{className:"text-xs text-content-tertiary mt-1",children:"Ready in Test Editor"})]}),n.jsx("div",{className:"flex gap-5",children:[["Total",N.total,"text-content"],["Generated",N.completed,"text-emerald-600"],["Failed",N.failed,"text-red-500"]].map(([R,X,be])=>n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:`text-lg font-bold tabular-nums ${be}`,children:X}),n.jsx("p",{className:"text-[9px] text-content-tertiary font-semibold uppercase tracking-wider",children:R})]},String(R)))}),N.failedItems.length>0&&n.jsx("div",{className:"w-full max-w-lg space-y-1.5 max-h-[140px] overflow-y-auto px-4",children:N.failedItems.map(R=>n.jsxs("div",{className:"flex items-start gap-2 p-2.5 bg-red-50/60 rounded-xl border border-red-200/40",children:[n.jsx(ut,{size:12,className:"text-red-500 flex-shrink-0 mt-0.5"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] text-red-700 font-medium line-clamp-1",children:R.story}),n.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:R.error})]})]},R.index))}),n.jsxs("div",{className:"flex gap-2 pt-2",children:[n.jsxs(ne,{size:"sm",onClick:()=>s("/tests"),children:["Open Test Editor ",n.jsx(Zt,{size:13})]}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>{P(null),j(""),se([])},children:[n.jsx(Se,{size:13})," Start Over"]})]})]})]})]})]}),e==="swagger"&&n.jsxs("div",{className:"space-y-3 animate-fade-in",children:[n.jsx("div",{className:"flex items-center gap-2.5 px-1",children:[{n:1,label:"Fetch Spec",done:!!W},{n:2,label:"Configure",done:!1},{n:3,label:"Generate",done:!1}].map((R,X,be)=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:C("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold transition-all",R.done?"bg-emerald-500 text-white":"bg-surface-inset text-content-tertiary border border-border"),children:R.done?n.jsx(Ue,{size:12}):R.n}),n.jsx("span",{className:C("text-xs font-semibold",R.done?"text-emerald-600":"text-content-tertiary"),children:R.label})]}),X<be.length-1&&n.jsx("div",{className:C("w-12 h-px",R.done?"bg-emerald-300":"bg-border")})]},R.n))}),n.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[n.jsxs("div",{className:"col-span-3 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-emerald-100 flex items-center justify-center",children:n.jsx(zr,{size:14,className:"text-emerald-600"})}),n.jsx("span",{className:"text-[11px] font-bold text-content",children:"API Specification URL"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{className:"flex-1 rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/50 placeholder-content-tertiary transition-all",placeholder:"https://api.example.com/v2/api-docs",value:F,onChange:R=>{ee(R.target.value),A(null)}}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>tt.mutate(),loading:tt.isPending,disabled:!F.trim()||tt.isPending,children:[n.jsx(ad,{size:14})," Fetch & Parse"]})]}),tt.isError&&n.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[n.jsx(ut,{size:13,className:"flex-shrink-0 mt-0.5"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium",children:tt.error.message}),n.jsx("p",{className:"text-[10px] text-red-400 mt-0.5",children:"Tip: Use the direct spec URL, not a portal page. Check DevTools → Network."})]})]})]}),n.jsxs("div",{className:"col-span-2 rounded-xl border border-border bg-surface p-3.5 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:"w-5 h-5 rounded bg-violet-100 flex items-center justify-center",children:n.jsx(mn,{size:14,className:"text-violet-600"})}),n.jsx("span",{className:"text-[11px] font-bold text-content",children:"Extra Requirements"}),n.jsx("span",{className:"text-[10px] text-content-tertiary",children:"Optional"})]}),n.jsx("textarea",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 resize-none placeholder-content-tertiary leading-relaxed",rows:3,placeholder:"e.g. Include Bearer auth, test 400/401/404 errors, validate response schemas…",value:te,onChange:R=>B(R.target.value)})]})]}),W&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-xl border border-emerald-200/50 bg-gradient-to-r from-emerald-50/40 via-surface to-teal-50/20 p-3.5 space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-6 h-6 rounded-lg bg-emerald-500 flex items-center justify-center",children:n.jsx(Ue,{size:13,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-bold text-content",children:W.title}),n.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:W.baseUrl})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-center px-3",children:[n.jsx("p",{className:"text-base font-bold text-emerald-600 tabular-nums",children:W.totalEndpoints}),n.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Endpoints"})]}),n.jsx("div",{className:"w-px h-6 bg-border"}),n.jsxs("div",{className:"text-center px-2",children:[n.jsx("p",{className:"text-base font-bold text-teal-600 tabular-nums",children:W.tags.length}),n.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Tags"})]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Jg,{size:11,className:"text-content-tertiary"}),n.jsx("span",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest",children:"Filter by tag"}),K.trim()&&n.jsx("button",{type:"button",onClick:()=>T(""),className:"text-[9px] text-accent hover:text-accent-dark font-semibold ml-1",children:"Clear all"})]}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:W.tags.map(R=>{const X=K.split(",").map(Nt=>Nt.trim()).filter(Boolean),be=X.includes(R),Rn=W.endpoints.filter(Nt=>Nt.tag===R).length;return n.jsxs("button",{type:"button",onClick:()=>{T(be?X.filter(Nt=>Nt!==R).join(", "):[...X,R].join(", "))},className:C("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1.5 rounded-lg border font-semibold transition-all",be?"bg-accent text-white border-accent shadow-sm shadow-accent/20":"bg-surface text-content-secondary border-border hover:border-accent/40"),children:[R,n.jsx("span",{className:C("text-[9px] px-1 py-px rounded font-bold",be?"bg-white/20 text-white":"bg-surface-inset text-content-tertiary"),children:Rn})]},R)})})]})]}),n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsx("div",{className:"max-h-[220px] overflow-y-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{className:"bg-surface-inset/50 sticky top-0 border-b border-border",children:n.jsxs("tr",{children:[n.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-20",children:"Method"}),n.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Path"}),n.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Summary"}),n.jsx("th",{className:"text-left px-4 py-2.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest w-16",children:"Tag"})]})}),n.jsx("tbody",{children:W.endpoints.filter(R=>K.trim()?K.split(",").map(X=>X.trim()).filter(Boolean).includes(R.tag):!0).map((R,X)=>n.jsxs("tr",{className:"border-t border-border-muted hover:bg-surface-inset/30 transition-colors",children:[n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:C("font-mono font-bold text-[10px] px-2 py-0.5 rounded-md ring-1",u5[R.method]||"bg-surface-inset text-content-secondary ring-border"),children:R.method})}),n.jsx("td",{className:"px-4 py-2.5 font-mono text-content-secondary text-[11px]",children:R.path}),n.jsx("td",{className:"px-4 py-2.5 text-content-tertiary truncate max-w-[240px]",children:R.summary}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-[9px] text-content-tertiary bg-surface-inset px-1.5 py-0.5 rounded",children:R.tag})})]},X))})]})})}),n.jsx("div",{className:"rounded-xl border border-border bg-surface p-3.5",children:n.jsxs("div",{className:"flex items-end gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-bold text-content mb-2 block",children:"Suite Name"}),n.jsx("input",{className:"w-full rounded-xl border border-border bg-surface-inset/50 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-accent/30 placeholder-content-tertiary",placeholder:"e.g. Payment API Tests",value:ae,onChange:R=>z(R.target.value)})]}),n.jsxs(ne,{onClick:()=>en.mutate(),loading:en.isPending,disabled:en.isPending,children:[n.jsx(Ot,{size:14})," Generate Suite"]})]})})]}),en.isError&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-red-50/60 border border-red-200/40 text-xs text-red-600",children:[n.jsx(ut,{size:14,className:"flex-shrink-0 mt-0.5"}),n.jsx("span",{className:"font-medium",children:en.error.message})]}),!W&&n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(jf,{title:"Supported Formats",icon:rf,defaultOpen:!0,children:n.jsx("div",{className:"space-y-1.5",children:["OpenAPI 3.x (JSON / YAML)","Swagger 2.0 (JSON / YAML)","Direct URL, Swagger UI, or /api-docs"].map(R=>n.jsxs("div",{className:"flex items-center gap-2 text-xs text-content-secondary",children:[n.jsx(Ue,{size:10,className:"text-emerald-500 flex-shrink-0"}),R]},R))})}),n.jsx(jf,{title:"Pro Tips",icon:Be,defaultOpen:!0,children:n.jsx("div",{className:"space-y-1.5",children:["Use the raw spec URL, not a portal page","Filter by tags to import only relevant endpoints","Generated steps use page.request API","Chained tests use context.setVariable"].map(R=>n.jsxs("div",{className:"flex items-start gap-2 text-xs text-content-secondary",children:[n.jsx(ir,{size:9,className:"text-accent flex-shrink-0 mt-0.5"}),R]},R))})})]})]})]})})})}function Go({checked:e,onChange:t,label:s,disabled:r}){return n.jsxs("label",{className:C("inline-flex items-center gap-2.5 cursor-pointer select-none",r&&"opacity-40 cursor-not-allowed"),children:[n.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:r,onClick:()=>t(!e),className:C("relative inline-flex h-[22px] w-10 items-center rounded-full transition-all duration-200","focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus:outline-none",e?"bg-gradient-to-r from-accent to-accent-dark":"bg-slate-200"),children:n.jsx("span",{className:C("inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200",e?"translate-x-[21px]":"translate-x-[3px]")})}),s&&n.jsx("span",{className:"text-sm text-content-secondary",children:s})]})}const h5=[{id:"github",label:"GitHub Actions"},{id:"gitlab",label:"GitLab CI"},{id:"jenkins",label:"Jenkins"}];function f5({open:e,onClose:t,runConfig:s}){var x,f,g,b;const[r,a]=m.useState("github"),[i,l]=m.useState(!1),o=Y({mutationFn:y=>UN.generate({platform:y,browsers:(s==null?void 0:s.browsers)??["chromium"],parallel:(s==null?void 0:s.parallel)??2,device:(s==null?void 0:s.device)||void 0}),onError:y=>O.error(y.message)});m.useEffect(()=>{e&&o.mutate(r)},[e,r]);const c=()=>{var y;(y=o.data)!=null&&y.yaml&&navigator.clipboard.writeText(o.data.yaml).then(()=>{l(!0),O.success("Copied to clipboard"),setTimeout(()=>l(!1),2e3)})},d=()=>{var h;if(!((h=o.data)!=null&&h.yaml))return;const y=new Blob([o.data.yaml],{type:"text/plain"}),j=URL.createObjectURL(y),k=document.createElement("a");k.href=j,k.download=o.data.filename??`${r}-ci.yml`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(j)};return e?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:n.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-2xl mx-4 overflow-hidden flex flex-col max-h-[85vh]",onClick:y=>y.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-sm font-bold text-content",children:"CI Config Generator"}),n.jsx("p",{className:"text-[11px] text-content-tertiary mt-0.5",children:"Generate configuration for your CI/CD pipeline"})]}),n.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors",children:n.jsx(Se,{size:14})})]}),n.jsx("div",{className:"flex border-b border-border px-5 flex-shrink-0",children:h5.map(y=>n.jsx("button",{type:"button",onClick:()=>a(y.id),className:C("px-4 py-2.5 text-xs font-semibold border-b-2 transition-colors -mb-px",r===y.id?"border-accent text-accent":"border-transparent text-content-secondary hover:text-content"),children:y.label},y.id))}),n.jsx("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:o.isPending?n.jsx("div",{className:"h-48 flex items-center justify-center",children:n.jsx("p",{className:"text-sm text-content-tertiary",children:"Generating..."})}):(x=o.data)!=null&&x.yaml?n.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-xs font-mono p-4 rounded-xl overflow-auto whitespace-pre leading-relaxed",children:o.data.yaml}):n.jsx("div",{className:"h-48 flex items-center justify-center",children:n.jsx("p",{className:"text-sm text-content-tertiary",children:"No config generated yet"})})}),n.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border bg-surface-inset/30 flex-shrink-0",children:[((f=o.data)==null?void 0:f.filename)&&n.jsx("span",{className:"text-[11px] text-content-tertiary font-mono",children:o.data.filename}),n.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[n.jsxs("button",{type:"button",onClick:c,disabled:!((g=o.data)!=null&&g.yaml),className:C("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors","border-border text-content-secondary hover:bg-surface-inset disabled:opacity-40"),children:[i?n.jsx(He,{size:12,className:"text-emerald-500"}):n.jsx(cm,{size:12}),i?"Copied!":"Copy"]}),n.jsxs("button",{type:"button",onClick:d,disabled:!((b=o.data)!=null&&b.yaml),className:C("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors","bg-accent text-white hover:brightness-110 disabled:opacity-40"),children:[n.jsx(bc,{size:12}),"Download"]})]})]})]})}):null}const Nf=500;let Yo=new Map,sl=new Map,vr=[],bm=0;const tx=new Set;function nx(){bm++,tx.forEach(e=>e())}let Jo={screenshot:null,screenshots:new Map,consoleLogs:[],consoleLogsByCase:new Map,activeCaseIds:[],_v:-1};function p5(){const e=vr[vr.length-1],t=e?Yo.get(e)??null:null,s=Array.from(sl.values()).flat().sort((r,a)=>r.timestamp-a.timestamp);return Jo={screenshot:t,screenshots:new Map(Yo),consoleLogs:s,consoleLogsByCase:new Map(sl),activeCaseIds:[...vr],_v:bm},Jo}const Sd={subscribe(e){return tx.add(e),()=>{tx.delete(e)}},getSnapshot(){return Jo._v!==bm?p5():Jo},reset(){Yo=new Map,sl=new Map,vr=[],nx()}};function Ry(){const e=m.useSyncExternalStore(Sd.subscribe,Sd.getSnapshot),t=m.useCallback(a=>{const i=a;Yo.set(i.caseId,i.image),vr.includes(i.caseId)||(vr=[...vr,i.caseId]),nx()},[]),s=m.useCallback(a=>{const i=a,o=[...sl.get(i.caseId)??[],...i.logs];o.length>Nf&&o.splice(0,o.length-Nf),sl.set(i.caseId,o),nx()},[]);Va({"run:screenshot":t,"run:console":s});const r=m.useCallback(()=>{Sd.reset()},[]);return{screenshot:e.screenshot,screenshots:e.screenshots,consoleLogs:e.consoleLogs,consoleLogsByCase:e.consoleLogsByCase,activeCaseIds:e.activeCaseIds,reset:r}}let us=[],sx=0;const rx=new Set;function ax(){sx++,rx.forEach(e=>e())}let Cd={steps:[],_v:-1};const Ed={subscribe(e){return rx.add(e),()=>{rx.delete(e)}},getSnapshot(){return Cd._v!==sx&&(Cd={steps:us,_v:sx}),Cd},reset(){us=[],ax()}};function Oy(){const e=m.useSyncExternalStore(Ed.subscribe,Ed.getSnapshot),t=m.useCallback(a=>{const i=a;i.status!=="running"&&(us=[...us,{...i,timestamp:Date.now()}],us.length>200&&(us=us.slice(-200)),ax())},[]),s=m.useCallback(()=>{us=[],ax()},[]);Va({"run:step":t,"run:start":s});const r=m.useCallback(()=>{Ed.reset()},[]);return{stepLogs:e.steps,reset:r}}function Dy(e){const[t,s]=m.useState(0),r=m.useRef(null);m.useEffect(()=>(e?(s(0),r.current=setInterval(()=>s(l=>l+1),1e3)):r.current&&(clearInterval(r.current),r.current=null),()=>{r.current&&clearInterval(r.current)}),[e]);const a=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${a}:${i}`}function Pc({browser:e,size:t=16,className:s=""}){const r=(e??"").toLowerCase();return r.includes("chromium")||r.includes("chrome")?n.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:s,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#4285F4"}),n.jsx("path",{d:"M24 14.4h16.97A22 22 0 0 0 24 2 22 22 0 0 0 5.56 33.6L14.08 19A11.6 11.6 0 0 1 24 14.4z",fill:"#EA4335"}),n.jsx("path",{d:"M14.08 19L5.56 33.6A22 22 0 0 0 24 46a22 22 0 0 0 8.52-1.7L24 30.4A11.6 11.6 0 0 1 14.08 19z",fill:"#34A853"}),n.jsx("path",{d:"M24 30.4l8.52 13.9A22 22 0 0 0 40.97 14.4H24a11.6 11.6 0 0 1 8.52 16z",fill:"#FBBC05"}),n.jsx("circle",{cx:"24",cy:"24",r:"8",fill:"white"}),n.jsx("circle",{cx:"24",cy:"24",r:"5.5",fill:"#4285F4"})]}):r.includes("firefox")?n.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:s,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"#FF9500"}),n.jsx("path",{d:"M38 16c-1-3-3.5-5.5-5-6.5.8 2 1 3.5.5 5-1-3-3-5-5.5-7.5-.5-.5-1-1-1-1.5 0-.2 0-.3-.2-.3-.1 0-.2.1-.2.2-3 5-1 9 .5 12-2-1-4.5-1-6.5 0-1-2-1-4.5 0-6.5-3 2-5 5-6 8-.2-.5-.3-1.5-.3-2-1.5 1.5-2.5 3.5-3 5.5A18 18 0 0 0 8 30c0 9 7.5 16 16 16s16-7 16-16c0-5-1-10-2-14z",fill:"#FF4500"}),n.jsx("path",{d:"M30 34c-1.5 1.5-4 2.5-6 2.5s-5-1-6.5-3A8 8 0 0 1 16 28c0-2.5 1.5-5 4-6 3-1.5 6-.5 8 1 2 1.5 3 4 3 6.5 0 1.5-.5 3-1 4.5z",fill:"#FFDC00"})]}):r.includes("webkit")||r.includes("safari")?n.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:s,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("circle",{cx:"24",cy:"24",r:"22",fill:"url(#safari-grad)"}),n.jsx("circle",{cx:"24",cy:"24",r:"18",fill:"white",fillOpacity:"0.15"}),n.jsx("circle",{cx:"24",cy:"24",r:"17",stroke:"white",strokeOpacity:"0.3",strokeWidth:"0.5",fill:"none"}),n.jsx("polygon",{points:"24,8 26,24 24,40 22,24",fill:"white",fillOpacity:"0.9"}),n.jsx("polygon",{points:"24,8 26,24 24,24",fill:"#FF3B30"}),n.jsx("polygon",{points:"24,40 22,24 24,24",fill:"#FF3B30"}),n.jsx("circle",{cx:"24",cy:"24",r:"2.5",fill:"white"}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"safari-grad",x1:"0",y1:"0",x2:"48",y2:"48",children:[n.jsx("stop",{offset:"0%",stopColor:"#00D4FF"}),n.jsx("stop",{offset:"100%",stopColor:"#0066FF"})]})})]}):n.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",className:s,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("circle",{cx:"24",cy:"24",r:"22",stroke:"#94a3b8",strokeWidth:"2",fill:"none"}),n.jsx("ellipse",{cx:"24",cy:"24",rx:"10",ry:"22",stroke:"#94a3b8",strokeWidth:"1.5",fill:"none"}),n.jsx("line",{x1:"2",y1:"24",x2:"46",y2:"24",stroke:"#94a3b8",strokeWidth:"1.5"}),n.jsx("line",{x1:"24",y1:"2",x2:"24",y2:"46",stroke:"#94a3b8",strokeWidth:"1.5"})]})}function vm(e){const t=(e??"").toLowerCase();return t.includes("chromium")||t.includes("chrome")?"Chromium":t.includes("firefox")?"Firefox":t.includes("webkit")||t.includes("safari")?"WebKit":e??"Browser"}const Ay=[{id:"desktop-1920",name:"Full HD (1920×1080)",category:"desktop",viewport:{width:1920,height:1080}},{id:"desktop-1440",name:"QHD (1440×900)",category:"desktop",viewport:{width:1440,height:900}},{id:"desktop-1366",name:"Laptop (1366×768)",category:"desktop",viewport:{width:1366,height:768}},{id:"desktop-1280",name:"Default (1280×720)",category:"desktop",viewport:{width:1280,height:720}},{id:"desktop-768",name:"Small Laptop (1024×768)",category:"desktop",viewport:{width:1024,height:768}}],Ly=[{id:"iphone-15-pro",name:"iPhone 15 Pro",category:"mobile",viewport:{width:393,height:852},playwrightDevice:"iPhone 15 Pro",recommendedBrowser:"webkit",dpr:3},{id:"iphone-15",name:"iPhone 15",category:"mobile",viewport:{width:390,height:844},playwrightDevice:"iPhone 15",recommendedBrowser:"webkit",dpr:3},{id:"iphone-14",name:"iPhone 14",category:"mobile",viewport:{width:390,height:844},playwrightDevice:"iPhone 14",recommendedBrowser:"webkit",dpr:3},{id:"iphone-se",name:"iPhone SE",category:"mobile",viewport:{width:375,height:667},playwrightDevice:"iPhone SE",recommendedBrowser:"webkit",dpr:2},{id:"pixel-7",name:"Pixel 7",category:"mobile",viewport:{width:412,height:915},playwrightDevice:"Pixel 7",recommendedBrowser:"chromium",dpr:2.625},{id:"pixel-5",name:"Pixel 5",category:"mobile",viewport:{width:393,height:851},playwrightDevice:"Pixel 5",recommendedBrowser:"chromium",dpr:2.75},{id:"galaxy-s9",name:"Galaxy S9+",category:"mobile",viewport:{width:320,height:658},playwrightDevice:"Galaxy S9+",recommendedBrowser:"chromium",dpr:4.5},{id:"galaxy-s8",name:"Galaxy S8",category:"mobile",viewport:{width:360,height:740},playwrightDevice:"Galaxy S8",recommendedBrowser:"chromium",dpr:3}],Iy=[{id:"ipad-pro-11",name:'iPad Pro 11"',category:"tablet",viewport:{width:834,height:1194},playwrightDevice:"iPad Pro 11",recommendedBrowser:"webkit",dpr:2},{id:"ipad-gen7",name:"iPad (gen 7)",category:"tablet",viewport:{width:810,height:1080},playwrightDevice:"iPad (gen 7)",recommendedBrowser:"webkit",dpr:2},{id:"ipad-mini",name:"iPad Mini",category:"tablet",viewport:{width:768,height:1024},playwrightDevice:"iPad Mini",recommendedBrowser:"webkit",dpr:2},{id:"galaxy-tab-s4",name:"Galaxy Tab S4",category:"tablet",viewport:{width:712,height:1138},playwrightDevice:"Galaxy Tab S4",recommendedBrowser:"chromium",dpr:2.25}],ix=[...Ay,...Ly,...Iy];function Fy(e){if(e)return ix.find(t=>t.playwrightDevice===e)??ix.find(t=>t.id===e)}const g5=[{mode:"all",label:"All Tests",desc:"Every suite & case",icon:EN},{mode:"suite",label:"By Suite",desc:"Specific test suite",icon:mn},{mode:"tag",label:"By Tag",desc:"Match by tag",icon:Jg},{mode:"test",label:"Single Test",desc:"One test by name",icon:mn}];function y5(e=60){const[t,s]=m.useState(e),r=m.useRef(!1),a=m.useCallback(i=>{i.preventDefault(),r.current=!0;const l=c=>{if(!r.current)return;const x=i.target.parentElement.getBoundingClientRect(),f=(c.clientX-x.left)/x.width*100;s(Math.max(30,Math.min(80,f)))},o=()=>{r.current=!1,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",l),window.addEventListener("mouseup",o)},[]);return{leftPct:t,onMouseDown:a}}function b5(e=55){const[t,s]=m.useState(e),r=m.useRef(!1),a=m.useCallback(i=>{i.preventDefault(),r.current=!0;const l=c=>{if(!r.current)return;const x=i.target.parentElement.getBoundingClientRect(),f=(c.clientY-x.top)/x.height*100;s(Math.max(25,Math.min(75,f)))},o=()=>{r.current=!1,window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",l),window.addEventListener("mouseup",o)},[]);return{topPct:t,onMouseDown:a}}const wf={log:"text-slate-300",info:"text-blue-400",warn:"text-amber-400",error:"text-red-400",debug:"text-slate-500",default:"text-slate-400"},kf={log:"text-slate-500",info:"text-blue-500",warn:"text-amber-500",error:"text-red-500",debug:"text-slate-600"};function v5(){const[e,t]=m.useState("all"),[s,r]=m.useState(""),[a,i]=m.useState(""),[l,o]=m.useState(""),[c,d]=m.useState(["chromium"]),[x,f]=m.useState(!0),[g,b]=m.useState(!1),[y,j]=m.useState(2),[k,h]=m.useState("only-on-failure"),[u,p]=m.useState("off"),[v,w]=m.useState("off"),[N,P]=m.useState(""),[E,_]=m.useState(!1),[D,G]=m.useState(!0),[J,se]=m.useState(!1),{data:M=[]}=ke({queryKey:["suites"],queryFn:()=>Ar.list()}),F=pm(),ee=Ry(),ae=Ec(),z=ae.runningSuiteId!==null||ae.runningCaseIds.size>0,K=E||F.isRunning||z,T=Dy(K),W=K||F.completed;m.useEffect(()=>{E&&(F.isRunning||F.completed)&&_(!1)},[E,F.isRunning,F.completed]);const A=Y({mutationFn:ue=>Xi.start(ue),onError:ue=>{_(!1),O.error(ue.message)}}),te=ue=>{d(Ce=>Ce.includes(ue)?Ce.length>1?Ce.filter(tt=>tt!==ue):Ce:[...Ce,ue])},B=()=>{F.reset(),ee.reset(),yt.clear(),_(!0);const ue={browsers:c,headed:x,noHealing:g,parallel:y,screenshot:k,video:u,trace:v};e==="all"&&(ue.all=!0),e==="suite"&&s&&(ue.suite=s),e==="tag"&&a&&(ue.tag=a),e==="test"&&l&&(ue.test=l),N&&(ue.device=N),A.mutate(ue)},de=()=>{F.reset(),ee.reset(),yt.clear()},xe=()=>{O.success("Browser is running in headed mode — check your taskbar")};return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[W?n.jsx(N5,{progress:F,live:ee,elapsed:T,runActive:K,onRunAgain:de,onOpenExternal:xe}):n.jsx(j5,{mode:e,setMode:t,suiteId:s,setSuiteId:r,tag:a,setTag:i,testName:l,setTestName:o,browsers:c,toggleBrowser:te,headed:x,setHeaded:f,noHealing:g,setNoHealing:b,parallel:y,setParallel:j,screenshot:k,setScreenshot:h,video:u,setVideo:p,trace:v,setTrace:w,device:N,setDevice:P,suites:M,runActive:K,optionsOpen:D,setOptionsOpen:G,onRun:B,submitting:E,onCiConfig:()=>se(!0)}),n.jsx(f5,{open:J,onClose:()=>se(!1),runConfig:{browsers:c,parallel:y,device:N||void 0}})]})}function j5(e){const{mode:t,setMode:s,suiteId:r,setSuiteId:a,tag:i,setTag:l,testName:o,setTestName:c,browsers:d,toggleBrowser:x,headed:f,setHeaded:g,noHealing:b,setNoHealing:y,parallel:j,setParallel:k,screenshot:h,setScreenshot:u,video:p,setVideo:v,trace:w,setTrace:N,device:P,setDevice:E,suites:_,runActive:D,onRun:G,submitting:J,onCiConfig:se}=e,[M,F]=m.useState("all"),ee=Fy(P||void 0),z=((ee==null?void 0:ee.category)==="mobile"||(ee==null?void 0:ee.category)==="tablet")&&!d.includes("chromium"),K=M==="all"?ix:M==="desktop"?Ay:M==="mobile"?Ly:Iy;return n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-emerald-500 to-cyan-600 flex items-center justify-center shadow-sm shadow-emerald-500/20",children:n.jsx(Rt,{size:17,className:"text-white translate-x-0.5"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Run Configuration"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and launch your test run"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ne,{size:"sm",variant:"secondary",onClick:se,children:"CI Config"}),n.jsxs(ne,{size:"sm",onClick:G,loading:J,disabled:D,children:[n.jsx(Rt,{size:10})," Start Run"]})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[n.jsxs("div",{className:"lg:col-span-3 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:n.jsx(Be,{size:10,className:"text-white"})}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Run Mode"})]}),n.jsxs("div",{className:"p-3 space-y-2.5",children:[n.jsx("div",{className:"grid grid-cols-2 gap-2",children:g5.map(({mode:T,label:W,desc:A,icon:te})=>n.jsxs("button",{type:"button",onClick:()=>!D&&s(T),disabled:D,className:C("flex items-start gap-2 p-2.5 rounded-lg border text-left transition-all",D&&"opacity-50 cursor-not-allowed",t===T?"border-accent bg-accent/5 ring-1 ring-accent/20":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[n.jsx(te,{size:12,className:C("flex-shrink-0 mt-0.5",t===T?"text-accent":"text-content-tertiary")}),n.jsxs("div",{children:[n.jsx("p",{className:C("text-[11px] font-semibold",t===T?"text-accent":"text-content-secondary"),children:W}),n.jsx("p",{className:"text-[9px] text-content-tertiary",children:A})]})]},T))}),t==="suite"&&!D&&n.jsxs("select",{value:r,onChange:T=>a(T.target.value),className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",children:[n.jsx("option",{value:"",children:"Select a suite..."}),_.map(T=>n.jsx("option",{value:T.name,children:T.name},T.id))]}),t==="tag"&&!D&&n.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. smoke",value:i,onChange:T=>l(T.target.value)}),t==="test"&&!D&&n.jsx("input",{className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"e.g. Login with valid credentials",value:o,onChange:T=>c(T.target.value)})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center",children:n.jsx(zr,{size:10,className:"text-white"})}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Browsers"})]}),n.jsx("div",{className:"p-3",children:n.jsx("div",{className:"flex gap-2 flex-wrap",children:ty.map(T=>n.jsxs("button",{type:"button",onClick:()=>!D&&x(T),disabled:D,className:C("flex items-center gap-1.5 px-3 py-1.5 rounded-lg border text-[11px] capitalize transition-all font-medium",D&&"opacity-50 cursor-not-allowed",d.includes(T)?"border-accent bg-accent/10 text-accent ring-1 ring-accent/20":"border-border text-content-secondary hover:border-slate-300"),children:[n.jsx(Pc,{browser:T,size:14}),vm(T)]},T))})})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-teal-500 to-cyan-600 flex items-center justify-center",children:n.jsx(gi,{size:10,className:"text-white"})}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Device Emulation"}),ee&&n.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-50 text-teal-600 ring-1 ring-teal-200 text-[9px] font-semibold",children:[ee.category==="mobile"?n.jsx(gi,{size:8}):ee.category==="tablet"?n.jsx(co,{size:8}):n.jsx(oa,{size:8}),ee.name]})]}),ee&&n.jsx("button",{type:"button",onClick:()=>E(""),disabled:D,className:"text-content-tertiary hover:text-content-secondary transition-colors disabled:opacity-50",title:"Clear device",children:n.jsx(Se,{size:12})})]}),n.jsxs("div",{className:"p-3 space-y-2.5",children:[z&&n.jsxs("div",{className:"flex items-start gap-2 px-2.5 py-2 rounded-lg bg-amber-50 border border-amber-200",children:[n.jsx(Yt,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),n.jsxs("p",{className:"text-[10px] text-amber-700 leading-relaxed",children:["Mobile/tablet emulation works best with ",n.jsx("strong",{children:"Chromium"}),". Touch events and mobile UA may not work correctly in Firefox or WebKit."]})]}),n.jsx("div",{className:"flex gap-1 p-0.5 bg-surface-inset rounded-lg",children:[{id:"all",label:"All",icon:null},{id:"desktop",label:"Desktop",icon:oa},{id:"mobile",label:"Mobile",icon:gi},{id:"tablet",label:"Tablet",icon:co}].map(({id:T,label:W,icon:A})=>n.jsxs("button",{type:"button",onClick:()=>F(T),disabled:D,className:C("flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-[9px] font-semibold transition-all disabled:opacity-50",M===T?"bg-surface shadow-sm text-content":"text-content-tertiary hover:text-content-secondary"),children:[A&&n.jsx(A,{size:9}),W]},T))}),n.jsxs("div",{className:"grid grid-cols-2 gap-1.5 max-h-44 overflow-y-auto pr-0.5",children:[(M==="all"||M==="desktop")&&n.jsxs("button",{type:"button",onClick:()=>!D&&E(""),disabled:D,className:C("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",P?"border-border hover:border-slate-300 hover:bg-surface-inset/30":"border-teal-400 bg-teal-50 ring-1 ring-teal-300"),children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(oa,{size:10,className:P?"text-content-tertiary":"text-teal-500"}),n.jsx("span",{className:C("text-[10px] font-semibold",P?"text-content-secondary":"text-teal-600"),children:"No Emulation"})]}),n.jsx("span",{className:"text-[9px] text-content-tertiary",children:"Use config viewport"})]}),K.map(T=>{const W=P===(T.playwrightDevice??T.id),A=T.category==="mobile"?gi:T.category==="tablet"?co:oa;return n.jsxs("button",{type:"button",onClick:()=>!D&&E(T.playwrightDevice??T.id),disabled:D,className:C("flex flex-col items-start gap-0.5 p-2 rounded-lg border text-left transition-all disabled:opacity-50",W?"border-teal-400 bg-teal-50 ring-1 ring-teal-300":"border-border hover:border-slate-300 hover:bg-surface-inset/30"),children:[n.jsxs("div",{className:"flex items-center gap-1 w-full",children:[n.jsx(A,{size:10,className:W?"text-teal-500":"text-content-tertiary"}),n.jsx("span",{className:C("text-[10px] font-semibold truncate flex-1",W?"text-teal-600":"text-content-secondary"),children:T.name}),T.recommendedBrowser&&T.category!=="desktop"&&n.jsx("span",{className:C("text-[8px] px-1 py-0.5 rounded font-medium flex-shrink-0",T.recommendedBrowser==="webkit"?"bg-slate-100 text-slate-500":"bg-blue-50 text-blue-500"),children:T.recommendedBrowser==="webkit"?"Safari":"Chrome"})]}),n.jsxs("span",{className:"text-[9px] text-content-tertiary",children:[T.viewport.width,"×",T.viewport.height,T.dpr?` @${T.dpr}x`:""]})]},T.id)})]})]})]})]}),n.jsxs("div",{className:"lg:col-span-2 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-slate-500 to-slate-700 flex items-center justify-center",children:n.jsx(Ia,{size:10,className:"text-white"})}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Options"})]}),n.jsxs("div",{className:"p-3 space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Headed mode"}),n.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Show browser window"})]}),n.jsx(Go,{checked:f,onChange:g,disabled:D})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(xm,{size:10,className:"text-amber-500"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Disable self-healing"}),n.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Skip AI healing"})]})]}),n.jsx(Go,{checked:b,onChange:y,disabled:D})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(xN,{size:10,className:"text-blue-500"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-medium text-content-secondary",children:"Parallel workers"}),n.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Concurrent cases"})]})]}),n.jsx("input",{type:"number",min:1,max:10,value:j,disabled:D,onChange:T=>k(Number(T.target.value)),className:"w-12 text-xs border border-border rounded-lg px-1.5 py-1 text-center focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:opacity-50 bg-surface"})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2 bg-surface-inset/50 border-b border-border flex items-center gap-2",children:[n.jsx("div",{className:"w-5 h-5 rounded-md bg-gradient-to-br from-pink-500 to-rose-600 flex items-center justify-center",children:n.jsx(Er,{size:10,className:"text-white"})}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Capture"})]}),n.jsx("div",{className:"p-3 space-y-2",children:[{label:"Screenshot",icon:Er,cls:"text-blue-400",val:h,set:u,opts:[["off","Off"],["on","Every test"],["only-on-failure","On failure"]]},{label:"Video",icon:kc,cls:"text-purple-400",val:p,set:v,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]},{label:"Trace",icon:Yg,cls:"text-emerald-400",val:w,set:N,opts:[["off","Off"],["on","Every test"],["on-first-retry","1st retry"],["retain-on-failure","On failure"]]}].map(({label:T,icon:W,cls:A,val:te,set:B,opts:de})=>n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-content-secondary min-w-0 flex-shrink-0 font-medium",children:[n.jsx(W,{size:11,className:A}),T]}),n.jsx("select",{value:te,disabled:D,onChange:xe=>B(xe.target.value),className:"flex-1 border border-border rounded-lg px-2 py-1 text-[10px] focus:outline-none focus:ring-1 focus:ring-accent/30 bg-surface disabled:opacity-50 min-w-0",children:de.map(([xe,ue])=>n.jsx("option",{value:xe,children:ue},xe))})]},T))})]}),n.jsxs(ne,{size:"lg",onClick:G,loading:J,disabled:D,className:"w-full",children:[n.jsx(Rt,{size:14})," Start Test Run"]})]})]})]})})}function N5({progress:e,live:t,elapsed:s,runActive:r,onRunAgain:a,onOpenExternal:i}){const{leftPct:l,onMouseDown:o}=y5(60),{topPct:c,onMouseDown:d}=b5(55),x=m.useRef(null),[f,g]=m.useState("steps"),{stepLogs:b}=Oy(),[y,j]=m.useState(null),k=t.activeCaseIds.length>1;m.useEffect(()=>{t.activeCaseIds.length>0&&!y&&j(t.activeCaseIds[0])},[t.activeCaseIds,y]);const h=k&&y?b.filter(p=>p.caseId===y):b,u=k&&y?t.consoleLogsByCase.get(y)??[]:t.consoleLogs;return m.useEffect(()=>{var p;(p=x.current)==null||p.scrollIntoView({behavior:"smooth"})},[h.length,u.length]),n.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[n.jsx(w5,{elapsed:s,runActive:r,progress:e,onRunAgain:a}),k?n.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative",style:{minHeight:0},children:[n.jsxs("div",{className:"overflow-y-auto bg-slate-900 flex flex-col",style:{height:`${c}%`},children:[n.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"}),n.jsxs("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:["Browser Previews — ",t.activeCaseIds.length," running"]})]}),n.jsx("button",{type:"button",onClick:i,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:n.jsx(Ka,{size:11})})]}),n.jsx("div",{className:"flex flex-col gap-0 flex-1",children:t.activeCaseIds.map((p,v)=>{const w=t.screenshots.get(p),N=e.activeCases.get(p)??p.slice(0,8),P=y===p,E=v===t.activeCaseIds.length-1;return n.jsxs("div",{className:C("flex flex-col cursor-pointer transition-all",!E&&"border-b border-slate-700",P&&"ring-inset ring-2 ring-accent"),onClick:()=>j(p),children:[n.jsxs("div",{className:C("flex items-center justify-between px-3 py-1.5 flex-shrink-0",P?"bg-accent/10 border-b border-accent/30":"bg-slate-800/60 border-b border-slate-700"),children:[n.jsxs("div",{className:"flex items-center gap-2",children:[e.currentBrowser&&n.jsx(Pc,{browser:e.currentBrowser,size:12}),n.jsx("span",{className:"text-[10px] font-mono text-slate-300 truncate max-w-xs",children:N})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[P&&n.jsx("span",{className:"text-[8px] font-semibold text-accent uppercase tracking-wider",children:"Selected"}),r&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"})]})]}),n.jsx("div",{className:"relative bg-slate-950 flex-1",children:w?n.jsx("img",{src:`data:image/jpeg;base64,${w}`,alt:N,className:"w-full h-auto object-contain"}):n.jsxs("div",{className:"h-32 flex items-center justify-center gap-2",children:[n.jsx(ce,{size:14,className:"text-slate-600 animate-spin"}),n.jsx("span",{className:"text-[10px] text-slate-600",children:"Waiting for screenshot..."})]})})]},p)})})]}),n.jsxs("div",{className:"flex-shrink-0 h-1.5 bg-slate-700 hover:bg-accent cursor-row-resize flex items-center justify-center transition-colors group relative",onMouseDown:d,children:[n.jsx("div",{className:"absolute inset-x-0 -top-1.5 -bottom-1.5"}),n.jsx("div",{className:"flex gap-0.5",children:n.jsx("div",{className:"w-4 h-0.5 rounded-full bg-slate-500 group-hover:bg-white transition-colors"})})]}),n.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{height:`${100-c}%`},children:[n.jsx("div",{className:"flex-shrink-0 flex items-center gap-1 px-2 py-1 bg-[#16172a] border-b border-slate-700 overflow-x-auto",children:t.activeCaseIds.map(p=>{const v=e.activeCases.get(p)??p.slice(0,8),w=y===p;return n.jsx("button",{type:"button",onClick:()=>j(p),className:C("px-2 py-0.5 rounded text-[8px] font-mono truncate max-w-[160px] transition-colors flex-shrink-0",w?"bg-accent/20 text-accent ring-1 ring-accent/30":"text-slate-500 hover:text-slate-300 hover:bg-slate-800"),children:v},p)})}),n.jsx(Cf,{tab:f,setTab:g,stepCount:h.length,logCount:u.length}),n.jsx(Ef,{tab:f,stepLogs:h,consoleLogs:u,endRef:x}),e.completed&&!r&&n.jsx("div",{className:"flex-shrink-0 border-t border-slate-700 p-3",children:n.jsx(Sf,{completed:e.completed,onRunAgain:a})})]})]}):n.jsxs("div",{className:"flex flex-1 overflow-hidden relative",style:{minHeight:0},children:[n.jsxs("div",{className:"flex flex-col bg-slate-900 overflow-hidden",style:{width:`${l}%`},children:[n.jsx(k5,{onOpenExternal:i,browser:e.currentBrowser}),n.jsxs("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",children:[t.screenshot?n.jsx("img",{src:`data:image/jpeg;base64,${t.screenshot}`,alt:"Browser",className:C("max-w-full max-h-full object-contain",e.completed&&!r&&"opacity-30")}):r?n.jsx(S5,{progress:e}):null,e.completed&&!r&&n.jsx("div",{className:C("w-full",t.screenshot?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"p-6"),children:n.jsx(Sf,{completed:e.completed,onRunAgain:a})}),n.jsx(C5,{step:e.currentStep})]})]}),n.jsx(E5,{onMouseDown:o}),n.jsxs("div",{className:"flex flex-col bg-[#1a1b26] overflow-hidden",style:{width:`${100-l}%`},children:[n.jsx(Cf,{tab:f,setTab:g,stepCount:h.length,logCount:u.length}),n.jsx(Ef,{tab:f,stepLogs:h,consoleLogs:u,endRef:x})]})]})]})}function Sf({completed:e,onRunAgain:t}){const s=e.failed===0;return n.jsxs("div",{className:C("w-full max-w-sm rounded-2xl border p-5 shadow-lg",s?"border-emerald-500/30 bg-emerald-950/80":"border-red-500/30 bg-red-950/80"),children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s?n.jsx(Ue,{size:22,className:"text-emerald-400 flex-shrink-0"}):n.jsx(ut,{size:22,className:"text-red-400 flex-shrink-0"}),n.jsxs("div",{children:[n.jsx("p",{className:C("text-sm font-bold",s?"text-emerald-300":"text-red-300"),children:s?"All tests passed!":"Run completed with failures"}),n.jsxs("p",{className:C("text-[10px]",s?"text-emerald-400/70":"text-red-400/70"),children:["Finished in ",Math.round(e.duration/1e3),"s"]})]})]}),n.jsx("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[{label:"Passed",value:e.passed,color:"text-emerald-400",bg:"bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",value:e.failed,color:"text-red-400",bg:"bg-red-500/10 ring-red-500/20"},{label:"Skipped",value:e.skipped,color:"text-slate-400",bg:"bg-slate-500/10 ring-slate-500/20"}].map(({label:r,value:a,color:i,bg:l})=>n.jsxs("div",{className:C("rounded-xl p-2.5 text-center ring-1",l),children:[n.jsx("p",{className:C("text-lg font-bold tabular-nums",i),children:a}),n.jsx("p",{className:"text-[8px] text-slate-400 uppercase tracking-wider",children:r})]},r))}),n.jsxs("button",{type:"button",onClick:t,className:"w-full flex items-center justify-center gap-2 py-2 rounded-xl ring-1 ring-slate-600 bg-slate-800 hover:bg-slate-700 transition-all text-xs font-medium text-slate-300 hover:text-white",children:[n.jsx(jc,{size:11})," Run Again"]})]})}function w5({elapsed:e,runActive:t,progress:s,onRunAgain:r}){var a;return n.jsxs("div",{className:"flex-shrink-0 px-4 py-2 bg-surface border-b border-border flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:C("w-7 h-7 rounded-lg flex items-center justify-center",t?"bg-gradient-to-br from-emerald-500 to-cyan-600":(a=s.completed)!=null&&a.failed?"bg-gradient-to-br from-red-500 to-rose-600":"bg-gradient-to-br from-emerald-500 to-green-600"),children:t?n.jsx(ce,{size:13,className:"text-white animate-spin"}):n.jsx(Ue,{size:13,className:"text-white"})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"text-xs font-bold text-content",children:t?"Running Tests":"Run Complete"}),t&&n.jsx("span",{className:"inline-flex items-center gap-1 text-[8px] font-semibold px-1.5 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 animate-pulse",children:"LIVE"})]}),s.currentCase&&t&&n.jsx("p",{className:"text-[9px] text-content-tertiary truncate max-w-xs",children:s.currentCase.caseName})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[!t&&s.completed&&n.jsxs("div",{className:"flex items-center gap-1.5 mr-2",children:[n.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[n.jsx(Ue,{size:8})," ",s.completed.passed]}),s.completed.failed>0&&n.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-semibold px-1.5 py-0.5 rounded ring-1 bg-red-50 text-red-600 ring-red-200",children:[n.jsx(ut,{size:8})," ",s.completed.failed]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-content-tertiary",children:[n.jsx(Or,{size:10}),n.jsx("p",{className:"text-xs font-mono font-bold text-content-secondary",children:e})]}),!t&&n.jsxs("button",{type:"button",onClick:r,className:"text-[10px] font-medium text-accent hover:text-accent-dark flex items-center gap-1 ml-1",children:[n.jsx(jc,{size:10})," New Run"]})]})]})}function k5({onOpenExternal:e,onToggleFullscreen:t,fullscreen:s,browser:r}){return n.jsxs("div",{className:"flex-shrink-0 h-8 bg-slate-800 border-b border-slate-700 flex items-center justify-between px-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),r?n.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[n.jsx(Pc,{browser:r,size:14}),n.jsx("span",{className:"text-[10px] font-semibold text-slate-300 uppercase tracking-wider",children:vm(r)})]}):n.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-2",children:"Browser Preview"})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[t&&n.jsx("button",{type:"button",onClick:t,title:s?"Exit fullscreen":"Fullscreen",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:s?n.jsx(vN,{size:11}):n.jsx(dm,{size:11})}),n.jsx("button",{type:"button",onClick:e,title:"Open in external browser",className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-700 transition-colors",children:n.jsx(Ka,{size:11})})]})]})}function S5({progress:e}){return n.jsxs("div",{className:"flex flex-col items-center gap-4 p-8 max-w-xs",children:[n.jsxs("div",{className:"w-48 h-32 rounded-xl bg-slate-800 border border-slate-700 overflow-hidden relative",children:[n.jsxs("div",{className:"h-5 bg-slate-750 border-b border-slate-700 flex items-center px-2 gap-1.5",children:[n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500/50"}),n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/50"}),n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500/50"})]}),n.jsx("div",{className:"flex-1 h-2.5 rounded bg-slate-700 ml-1"})]}),n.jsxs("div",{className:"p-2 space-y-1.5",children:[n.jsx("div",{className:"h-2 bg-slate-700 rounded w-3/4 animate-pulse"}),n.jsx("div",{className:"h-2 bg-slate-700 rounded w-1/2 animate-pulse",style:{animationDelay:"200ms"}}),n.jsx("div",{className:"h-2 bg-slate-700 rounded w-5/6 animate-pulse",style:{animationDelay:"400ms"}}),n.jsx("div",{className:"h-6 bg-accent/10 rounded mt-2 animate-pulse border border-accent/20",style:{animationDelay:"600ms"}})]}),n.jsx("div",{className:"absolute inset-x-0 h-0.5 bg-gradient-to-r from-transparent via-accent to-transparent opacity-60",style:{animation:"scan-line 2s ease-in-out infinite",top:"30%"}})]}),n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"text-xs font-semibold text-slate-300",children:e.currentCase?"Executing test...":"Launching browser..."}),e.currentCase&&n.jsx("p",{className:"text-[10px] text-slate-500 mt-1 truncate max-w-[200px]",children:e.currentCase.caseName})]}),n.jsx("div",{className:"flex items-center gap-1.5",children:[0,160,320].map(t=>n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-bounce",style:{animationDelay:`${t}ms`}},t))}),n.jsx("style",{children:`
|
|
792
|
+
@keyframes scan-line {
|
|
793
|
+
0%, 100% { top: 20%; opacity: 0; }
|
|
794
|
+
50% { top: 80%; opacity: 0.6; }
|
|
795
|
+
}
|
|
796
|
+
`})]})}function C5({step:e}){return e?n.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-4 py-3",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),n.jsx("p",{className:"text-[10px] text-white/80 truncate font-mono",children:e.instruction})]})}):null}function E5({onMouseDown:e}){return n.jsxs("div",{className:"flex-shrink-0 w-1.5 bg-slate-700 hover:bg-accent cursor-col-resize flex items-center justify-center transition-colors group relative",onMouseDown:e,children:[n.jsx("div",{className:"absolute inset-y-0 -left-1.5 -right-1.5"})," ",n.jsx(vc,{size:10,className:"text-slate-500 group-hover:text-white"})]})}function Cf({tab:e,setTab:t,stepCount:s,logCount:r}){return n.jsxs("div",{className:"flex-shrink-0 h-8 bg-[#1e1f2e] border-b border-slate-700 flex items-center px-1",children:[n.jsxs("button",{type:"button",onClick:()=>t("steps"),className:C("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",e==="steps"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[n.jsx(Rt,{size:9})," Steps",s>0&&n.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:s})]}),n.jsxs("button",{type:"button",onClick:()=>t("console"),className:C("flex items-center gap-1.5 px-3 h-full text-[10px] font-semibold uppercase tracking-wider border-b-2 transition-colors",e==="console"?"text-accent border-accent":"text-slate-500 border-transparent hover:text-slate-300"),children:[n.jsx(wc,{size:9})," Console",r>0&&n.jsx("span",{className:"text-[8px] ml-0.5 opacity-60",children:r})]})]})}function Ef({tab:e,stepLogs:t,consoleLogs:s,endRef:r}){return e==="steps"?n.jsxs("div",{className:"flex-1 overflow-y-auto text-[10px] px-3 py-2 space-y-0.5",children:[t.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[n.jsx(Rt,{size:18}),n.jsx("p",{className:"text-[10px]",children:"Steps will appear as they execute..."})]}):t.map((a,i)=>n.jsxs("div",{className:"flex items-start gap-2 py-1 px-2 rounded hover:bg-white/[0.02] -mx-1",children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.status==="passed"?n.jsx(Ue,{size:11,className:"text-emerald-400"}):a.status==="failed"?n.jsx(ut,{size:11,className:"text-red-400"}):n.jsx(Nc,{size:11,className:"text-slate-500"})}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("p",{className:C("font-mono truncate",a.status==="passed"?"text-slate-300":a.status==="failed"?"text-red-300":"text-slate-500"),children:a.instruction})}),n.jsxs("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:[a.duration,"ms"]})]},`${a.stepId}-${i}`)),n.jsx("div",{ref:r})]}):n.jsxs("div",{className:"flex-1 overflow-y-auto font-mono text-[10px] px-3 py-2 space-y-px",children:[s.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-slate-600",children:[n.jsx(wc,{size:18}),n.jsx("p",{className:"text-[10px]",children:"Console logs will appear here..."})]}):s.map((a,i)=>{const l=wf[a.type]??wf.default,o=kf[a.type]??kf.debug,c=new Date(a.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return n.jsxs("div",{className:"flex items-start gap-2 py-0.5 hover:bg-white/[0.02] rounded px-1 -mx-1",children:[n.jsx("span",{className:"text-slate-600 flex-shrink-0 tabular-nums",children:c}),n.jsx("span",{className:C("flex-shrink-0 uppercase text-[8px] font-bold w-9",o),children:a.type.slice(0,5)}),n.jsx("span",{className:C("break-all",l),children:a.text})]},i)}),n.jsx("div",{ref:r})]})}function _y({label:e,color:t,className:s}){return n.jsx("span",{className:C("inline-flex items-center px-2 py-0.5 rounded-md text-[11px] font-semibold tracking-wide",t??"bg-surface-inset text-content-secondary",s),children:e})}function jm({status:e}){const t={passed:"bg-emerald-50 text-emerald-700 border border-emerald-200/60",failed:"bg-red-50 text-red-700 border border-red-200/60",running:"bg-blue-50 text-blue-700 border border-blue-200/60",pending:"bg-slate-50 text-slate-600 border border-slate-200/60",skipped:"bg-amber-50 text-amber-700 border border-amber-200/60",partial:"bg-orange-50 text-orange-700 border border-orange-200/60"};return n.jsx(_y,{label:e,color:t[e]??"bg-slate-100 text-slate-600"})}function P5(e){switch(e){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";case"healed":return"bg-amber-500";default:return"bg-slate-400"}}function z5({steps:e,onSelect:t}){const s=e.filter(r=>r.screenshotPath);return s.length<2?null:n.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"thin"},children:s.map((r,a)=>{const i=Wa("screenshots",r.screenshotPath),l=r.healed?"healed":r.status;return n.jsxs("button",{type:"button",onClick:()=>t(i),className:"relative flex-shrink-0 rounded overflow-hidden border border-border hover:border-accent/50 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",style:{width:80,height:60},title:r.instruction,children:[n.jsx("img",{src:i,alt:`Step ${a+1}`,className:"w-full h-full object-cover"}),n.jsx("span",{className:"absolute top-0.5 left-0.5 bg-black/60 text-white text-[8px] font-bold px-1 py-px rounded leading-none",children:a+1}),n.jsx("span",{className:C("absolute bottom-1 right-1 w-2 h-2 rounded-full ring-1 ring-white/50",P5(l))})]},r.stepId)})})}function M5(e){if(e.healed)return"bg-amber-500";switch(e.status){case"passed":return"bg-emerald-500";case"failed":return"bg-red-500";case"skipped":return"bg-slate-500";default:return"bg-slate-400"}}function T5({steps:e}){const[t,s]=m.useState(null),r=e.reduce((i,l)=>i+(l.duration??0),0);if(r===0||e.length===0)return null;let a=0;return n.jsxs("div",{className:"px-3 py-2 border-t border-border bg-surface-inset/20",children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-wider mb-2",children:"Execution Timeline"}),n.jsx("div",{className:"relative h-5 bg-surface-inset rounded overflow-hidden",children:e.map((i,l)=>{const o=i.duration/r*100,c=a/r*100;return a+=i.duration,n.jsx("div",{className:C("absolute top-0 h-full transition-opacity hover:opacity-80 cursor-default",M5(i)),style:{left:`${c}%`,width:`${Math.max(o,.5)}%`},onMouseEnter:()=>s(`${i.instruction} — ${i.duration}ms`),onMouseLeave:()=>s(null)},i.stepId??l)})}),t&&n.jsx("p",{className:"text-[9px] text-content-secondary mt-1 truncate",children:t}),n.jsx("div",{className:"flex mt-1 relative",style:{height:14},children:(()=>{let i=0;return e.map((l,o)=>{const c=l.duration/r*100,d=i/r*100;i+=l.duration;const x=(l.instruction??"").slice(0,8);return n.jsx("div",{className:"absolute text-[8px] text-content-tertiary truncate overflow-hidden",style:{left:`${d}%`,width:`${Math.max(c,2)}%`,top:0},title:l.instruction,children:x},l.stepId??o)})})()})]})}function R5({stepId:e,currentScreenshotPath:t}){const{data:s,refetch:r}=ke({queryKey:["baseline",e],queryFn:()=>cf.get(e),enabled:!!e}),a=Y({mutationFn:()=>{if(!t)throw new Error("No screenshot available");return cf.capture(e,t)},onSuccess:()=>{O.success("Baseline saved"),r()},onError:o=>O.error(o.message)}),i=t?Wa("screenshots",t):null,l=s!=null&&s.hasBaseline?`${_N(e)}?t=${s.capturedAt??Date.now()}`:null;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Visual Regression"}),n.jsxs("div",{className:"flex items-center gap-2",children:[(s==null?void 0:s.hasBaseline)&&n.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-600 ring-1 ring-emerald-200 font-semibold",children:"Baseline set"}),t&&n.jsxs("button",{type:"button",onClick:()=>a.mutate(),disabled:a.isPending,className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:[n.jsx(Er,{size:9})," Set as Baseline"]})]})]}),n.jsxs("div",{className:"flex gap-3",children:[i&&n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Current"}),n.jsx("img",{src:i,alt:"Current screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),l&&n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-[8px] text-content-tertiary mb-1",children:"Baseline"}),n.jsx("img",{src:l,alt:"Baseline screenshot",className:"rounded border border-border max-h-32 object-contain"})]}),!l&&i&&n.jsx("div",{className:"flex-1 flex items-center justify-center border border-dashed border-border rounded-lg min-h-[80px]",children:n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No baseline set"})})]})]})}function Nm(e,t){if(t==null)return"na";switch(e){case"fcp":return t<1800?"good":t<3e3?"needs-improvement":"poor";case"lcp":return t<2500?"good":t<4e3?"needs-improvement":"poor";case"cls":return t<.1?"good":t<.25?"needs-improvement":"poor";case"ttfb":return t<800?"good":t<1800?"needs-improvement":"poor";case"tbt":return t<200?"good":t<600?"needs-improvement":"poor";case"si":return t<3400?"good":t<5800?"needs-improvement":"poor";case"tti":return t<3800?"good":t<7300?"needs-improvement":"poor";case"inp":return t<200?"good":t<500?"needs-improvement":"poor"}}const O5={good:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-400 ring-emerald-200 dark:ring-emerald-800","needs-improvement":"bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-400 ring-amber-200 dark:ring-amber-800",poor:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 ring-red-200 dark:ring-red-800",na:"bg-surface-inset text-content-tertiary ring-border"};function D5(e,t){return t==null?"—":e==="cls"?t.toFixed(3):t<1e3?`${Math.round(t)}ms`:`${(t/1e3).toFixed(2)}s`}function wm(e){return e==null?{ring:"ring-border",text:"text-content-tertiary",bg:"bg-surface-inset",label:"—"}:e>=90?{ring:"ring-emerald-300 dark:ring-emerald-700",text:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-50 dark:bg-emerald-900/20",label:"Good"}:e>=50?{ring:"ring-amber-300 dark:ring-amber-700",text:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-900/20",label:"Needs Work"}:{ring:"ring-red-300 dark:ring-red-700",text:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-900/20",label:"Poor"}}const km=[{key:"fcp",label:"FCP",desc:"First Contentful Paint"},{key:"lcp",label:"LCP",desc:"Largest Contentful Paint"},{key:"cls",label:"CLS",desc:"Cumulative Layout Shift"},{key:"ttfb",label:"TTFB",desc:"Time to First Byte"},{key:"tbt",label:"TBT",desc:"Total Blocking Time"},{key:"si",label:"SI",desc:"Speed Index"},{key:"tti",label:"TTI",desc:"Time to Interactive"},{key:"inp",label:"INP",desc:"Interaction to Next Paint"}];function Pf({metricKey:e,value:t}){const s=Nm(e,t),r=km.find(a=>a.key===e);return n.jsxs("div",{className:C("rounded-lg px-2 py-2 ring-1 text-center flex-1 min-w-[70px]",O5[s]),children:[n.jsx("p",{className:"text-[8px] font-bold uppercase tracking-widest opacity-60 mb-0.5",children:r.label}),n.jsx("p",{className:"text-xs font-bold tabular-nums leading-tight",children:D5(e,t)})]})}function Pd({score:e,label:t}){const s=wm(e),r=24,a=2*Math.PI*r,i=e!=null?e/100*a:0;return n.jsxs("div",{className:C("flex flex-col items-center justify-center rounded-xl px-3 py-2.5 ring-2 flex-1",s.bg,s.ring),children:[n.jsxs("div",{className:"relative w-14 h-14",children:[n.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 60 60",children:[n.jsx("circle",{cx:"30",cy:"30",r,fill:"none",stroke:"currentColor",strokeWidth:"5",className:"opacity-10"}),n.jsx("circle",{cx:"30",cy:"30",r,fill:"none",stroke:"currentColor",strokeWidth:"5",strokeDasharray:a,strokeDashoffset:a-i,strokeLinecap:"round",className:s.text})]}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("span",{className:C("text-base font-black tabular-nums",s.text),children:e??"—"})})]}),n.jsx("p",{className:C("text-[8px] font-bold mt-1 leading-tight",s.text),children:s.label}),n.jsx("p",{className:"text-[8px] text-content-tertiary mt-px text-center leading-tight",children:t})]})}function zf({audits:e,label:t,score:s}){if(!e||e.length===0)return null;const r=e.filter(c=>!c.passed&&!c.partial&&!c.na),a=e.filter(c=>!!c.partial),i=e.filter(c=>c.passed),l=e.filter(c=>!!c.na),o=wm(s);return n.jsxs("div",{className:"mt-2 space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n.jsxs("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest flex-1",children:[t," Audits"]}),s!=null&&n.jsx("span",{className:C("text-[9px] font-black px-1.5 py-0.5 rounded-md ring-1",o.bg,o.text,o.ring),children:s})]}),n.jsxs("div",{className:"space-y-0.5 max-h-48 overflow-y-auto pr-1",children:[r.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-red-600 dark:text-red-400 font-medium",children:[n.jsx(ut,{size:9,className:"text-red-500 flex-shrink-0 mt-px"}),n.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),a.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-amber-600 dark:text-amber-400 font-medium",children:[n.jsx(Yt,{size:9,className:"text-amber-500 flex-shrink-0 mt-px"}),n.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),l.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-content-tertiary",children:[n.jsx(cN,{size:9,className:"text-content-tertiary flex-shrink-0 mt-px"}),n.jsx("span",{className:"leading-tight",children:c.title})]},c.id)),i.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] text-emerald-600 dark:text-emerald-400",children:[n.jsx(Ue,{size:9,className:"text-emerald-500 flex-shrink-0 mt-px"}),n.jsx("span",{className:"leading-tight",children:c.title})]},c.id))]})]})}function A5(e,t){let s=0,r=0,a=0;if(t==="performance")for(const i of e)for(const{key:l}of km){const o=Nm(l,i[l]);o==="good"?s++:o==="needs-improvement"?r++:o==="poor"&&a++}else{const i=t==="accessibility"?"a11yAudits":"seoAudits",l=t==="accessibility"?"a11yScore":"seoScore";for(const o of e){const c=o[i]??[];s+=c.filter(x=>x.passed).length,r+=c.filter(x=>!!x.partial).length,a+=c.filter(x=>!x.passed&&!x.partial&&!x.na).length;const d=wm(o[l]);d.label==="Good"?s++:d.label==="Needs Work"?r++:d.label==="Poor"&&a++}}return{good:s,warn:r,poor:a}}function L5({caseName:e,pageLoads:t,focus:s="performance",onClose:r}){const[a,i]=m.useState(s),l=A5(t,a),o=a==="performance"?"metrics":a==="accessibility"?"a11y checks":"seo checks",c=[{key:"performance",label:"Performance",icon:n.jsx(Be,{size:10}),color:"text-violet-600 dark:text-violet-400",activeColor:"bg-violet-50 dark:bg-violet-900/20 text-violet-700 dark:text-violet-300 ring-violet-200 dark:ring-violet-700"},{key:"accessibility",label:"Accessibility",icon:n.jsx(qu,{size:10}),color:"text-blue-600 dark:text-blue-400",activeColor:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 ring-blue-200 dark:ring-blue-700"},{key:"seo",label:"SEO",icon:n.jsx(Mr,{size:10}),color:"text-emerald-600 dark:text-emerald-400",activeColor:"bg-emerald-50 dark:bg-emerald-900/20 text-emerald-700 dark:text-emerald-300 ring-emerald-200 dark:ring-emerald-700"}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 bg-black/30 z-40",onClick:r}),n.jsxs("div",{className:"fixed right-0 top-0 h-full w-[560px] max-w-full bg-surface shadow-2xl z-50 flex flex-col border-l border-border",children:[n.jsxs("div",{className:"border-b border-border bg-gradient-to-r from-violet-50 to-indigo-50 dark:from-violet-900/20 dark:to-indigo-900/20 flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",children:[n.jsx("div",{className:C("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",a==="performance"?"bg-violet-500":a==="accessibility"?"bg-blue-500":"bg-emerald-500"),children:a==="performance"?n.jsx(Be,{size:13,className:"text-white"}):a==="accessibility"?n.jsx(qu,{size:13,className:"text-white"}):n.jsx(Mr,{size:13,className:"text-white"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs font-bold text-content",children:"Lighthouse Audit"}),n.jsx("p",{className:"text-[10px] text-content-tertiary truncate",children:e})]}),n.jsx("button",{type:"button",onClick:r,className:"p-1.5 rounded-lg text-content-tertiary hover:text-content hover:bg-surface-inset transition-colors",children:n.jsx(Se,{size:14})})]}),n.jsx("div",{className:"flex gap-1 px-5 pb-0",children:c.map(d=>n.jsxs("button",{type:"button",onClick:()=>i(d.key),className:C("flex items-center gap-1.5 px-3 py-1.5 text-[10px] font-semibold rounded-t-lg border-b-2 transition-colors",a===d.key?"border-current "+d.color+" bg-surface/80":"border-transparent text-content-tertiary hover:text-content-secondary"),children:[d.icon," ",d.label]},d.key))})]}),l.good+l.warn+l.poor>0&&n.jsxs("div",{className:"px-5 py-2.5 border-b border-border bg-surface-inset/40 flex items-center gap-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest flex-shrink-0",children:["Overall ",n.jsxs("span",{className:"normal-case font-normal opacity-60",children:["(",o,")"]})]}),n.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[l.good>0&&n.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-700 dark:text-emerald-400 font-semibold",children:[n.jsx("span",{className:"text-emerald-500 text-[11px] leading-none",children:"●"}),l.good," ",a==="performance"?"Good":"Passed"]}),l.warn>0&&n.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-amber-700 dark:text-amber-400 font-semibold",children:[n.jsx("span",{className:"text-amber-400 text-[11px] leading-none",children:"●"}),l.warn," Needs Work"]}),l.poor>0&&n.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-700 dark:text-red-400 font-semibold",children:[n.jsx("span",{className:"text-red-500 text-[11px] leading-none",children:"●"}),l.poor," ",a==="performance"?"Poor":"Failed"]})]}),n.jsxs("p",{className:"text-[9px] text-content-tertiary",children:[t.length," page",t.length!==1?"s":""]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:t.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-40 text-center",children:[n.jsx(Be,{size:24,className:"text-content-tertiary mb-2 opacity-40"}),n.jsx("p",{className:"text-xs text-content-tertiary",children:"No page navigations recorded"}),n.jsx("p",{className:"text-[10px] text-content-tertiary mt-1 opacity-60",children:"Only available for Chromium browser runs"})]}):t.map((d,x)=>{var f,g;return n.jsxs("div",{className:"rounded-xl border border-border bg-surface shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/50 border-b border-border",children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-0.5",children:["Step ",d.stepIndex+1]}),n.jsx("p",{className:"text-[10px] text-content-secondary truncate mb-1",title:d.stepInstruction,children:d.stepInstruction}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(zr,{size:9,className:"text-indigo-400 dark:text-indigo-500 flex-shrink-0"}),n.jsx("p",{className:"text-[10px] font-mono text-indigo-600 dark:text-indigo-400 truncate font-medium",title:d.url,children:d.url})]})]}),d.lighthouseError?n.jsxs("div",{className:"px-4 py-3 flex items-start gap-2",children:[n.jsx(Yt,{size:12,className:"text-amber-500 flex-shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[10px] text-amber-700 dark:text-amber-400",children:d.lighthouseError})]}):n.jsxs("div",{className:"px-4 py-3 space-y-3",children:[a==="performance"&&n.jsxs(n.Fragment,{children:[n.jsx(Pd,{score:d.score,label:"Performance"}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("p",{className:"text-[8px] font-bold text-content-tertiary uppercase tracking-widest",children:"Core Web Vitals"}),n.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["fcp","lcp","cls","ttfb"].map(b=>n.jsx(Pf,{metricKey:b,value:d[b]},b))}),n.jsx("div",{className:"flex gap-1.5 flex-wrap",children:["tbt","si","tti","inp"].map(b=>n.jsx(Pf,{metricKey:b,value:d[b]},b))})]}),n.jsx("div",{className:"pt-1 border-t border-border/50 grid grid-cols-2 gap-x-4 gap-y-0.5",children:km.map(({key:b,label:y,desc:j})=>{const k=Nm(b,d[b]);return n.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary",children:[n.jsx("span",{className:C("text-[10px] leading-none flex-shrink-0",k==="good"?"text-emerald-500":k==="needs-improvement"?"text-amber-400":k==="poor"?"text-red-500":"text-slate-300"),children:"●"}),n.jsx("span",{className:"font-medium",children:y}),n.jsx("span",{className:"opacity-60 truncate",children:j})]},b)})})]}),a==="accessibility"&&n.jsxs(n.Fragment,{children:[n.jsx(Pd,{score:d.a11yScore,label:"Accessibility"}),(((f=d.a11yAudits)==null?void 0:f.length)??0)>0?n.jsx(zf,{audits:d.a11yAudits,label:"Accessibility",score:d.a11yScore}):n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No accessibility audit data available."})]}),a==="seo"&&n.jsxs(n.Fragment,{children:[n.jsx(Pd,{score:d.seoScore,label:"SEO"}),(((g=d.seoAudits)==null?void 0:g.length)??0)>0?n.jsx(zf,{audits:d.seoAudits,label:"SEO",score:d.seoScore}):n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No SEO audit data available."})]})]})]},x)})}),n.jsx("div",{className:"px-5 py-2.5 border-t border-border bg-surface-inset/30 flex-shrink-0",children:n.jsx("p",{className:"text-[9px] text-content-tertiary text-center",children:"Powered by Google Lighthouse · Desktop preset · Chromium only"})})]})]})}function I5({src:e,onClose:t}){return n.jsxs("div",{className:"fixed inset-0 bg-black/80 z-50 flex flex-col items-center justify-center p-4",onClick:t,children:[n.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",children:[n.jsx("a",{href:e,download:!0,onClick:s=>s.stopPropagation(),title:"Download",className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:n.jsx(bc,{size:14})}),n.jsx("button",{type:"button",onClick:t,className:"text-white/70 hover:text-white p-2 rounded-lg bg-surface/10 hover:bg-surface/20",children:n.jsx(Se,{size:14})})]}),n.jsx("img",{src:e,alt:"Screenshot",className:"max-w-full max-h-full rounded-lg shadow-2xl object-contain",onClick:s=>s.stopPropagation()}),n.jsx("p",{className:"text-white/40 text-[10px] mt-2",children:"Click outside to close"})]})}function F5({step:e,onScreenshot:t}){const[s,r]=m.useState(e.status==="failed"),a=e.screenshotPath?Wa("screenshots",e.screenshotPath):null,i=e.status==="passed"?n.jsx(Ue,{size:11,className:"text-emerald-500 flex-shrink-0"}):e.status==="failed"?n.jsx(ut,{size:11,className:"text-red-500 flex-shrink-0"}):n.jsx(Nc,{size:11,className:"text-content-tertiary flex-shrink-0"});return n.jsxs("div",{className:"border-t border-border/50 first:border-0",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-surface-inset/50 text-[10px] select-none transition-colors",onClick:()=>r(l=>!l),children:[i,n.jsx("span",{className:C("text-[8px] px-1 py-px rounded font-bold uppercase ring-1 flex-shrink-0",e.stepType==="api"?"bg-violet-50 text-violet-600 ring-violet-200":"bg-blue-50 text-blue-600 ring-blue-200"),children:e.stepType==="api"?"API":"UI"}),n.jsx("span",{className:C("flex-1 truncate text-[10px]",e.status==="failed"?"text-red-700 font-medium":"text-content-secondary"),children:e.instruction}),e.healed&&n.jsx("span",{className:"text-[8px] bg-amber-50 text-amber-600 px-1.5 py-0.5 rounded font-semibold ring-1 ring-amber-200 flex-shrink-0",children:"✦ healed"}),a&&n.jsx("button",{type:"button",title:"View screenshot",className:"text-content-tertiary hover:text-accent flex-shrink-0 p-0.5",onClick:l=>{l.stopPropagation(),t(a)},children:n.jsx(Er,{size:10})}),n.jsxs("span",{className:"text-content-tertiary w-10 text-right flex-shrink-0 tabular-nums text-[9px]",children:[e.duration,"ms"]}),s?n.jsx(oN,{size:10,className:"text-content-tertiary flex-shrink-0"}):n.jsx(Tt,{size:10,className:"text-content-tertiary flex-shrink-0"})]}),s&&n.jsxs("div",{className:"px-3 pb-2.5 pt-1 space-y-2 bg-surface-inset/30",children:[e.code&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Code"}),n.jsx("pre",{className:"text-[10px] font-mono bg-slate-900 text-slate-100 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:e.code})]}),e.error&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-red-500 uppercase tracking-widest mb-1",children:"Error"}),n.jsx("pre",{className:"text-[10px] text-red-700 bg-red-50 border border-red-100 rounded-lg p-2.5 font-mono whitespace-pre-wrap leading-relaxed",children:e.error})]}),e.healed&&e.healedCode&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-amber-600 uppercase tracking-widest mb-1",children:"Healed Code"}),n.jsx("pre",{className:"text-[10px] font-mono bg-amber-50 border border-amber-200 text-amber-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:e.healedCode})]}),e.apiRequest&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-violet-500 uppercase tracking-widest mb-1",children:"API Request"}),n.jsx("pre",{className:"text-[10px] font-mono bg-violet-50 border border-violet-100 text-violet-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`${e.apiRequest.method} ${e.apiRequest.url}${e.apiRequest.headers?`
|
|
797
|
+
Headers: `+JSON.stringify(e.apiRequest.headers,null,2):""}${e.apiRequest.body?`
|
|
798
|
+
Body: `+e.apiRequest.body:""}`})]}),e.apiResponse&&n.jsxs("div",{children:[n.jsxs("p",{className:"text-[9px] font-bold text-indigo-500 uppercase tracking-widest mb-1",children:["API Response — ",e.apiResponse.status," ",e.apiResponse.statusText," (",e.apiResponse.duration,"ms)"]}),n.jsx("pre",{className:"text-[10px] font-mono bg-indigo-50 border border-indigo-100 text-indigo-900 rounded-lg p-2.5 overflow-x-auto whitespace-pre-wrap leading-relaxed max-h-48 overflow-y-auto",children:e.apiResponse.body?e.apiResponse.body.slice(0,2e3):"(empty body)"})]}),a&&n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:"Screenshot"}),n.jsxs("div",{className:"relative group inline-block",children:[n.jsx("img",{src:a,alt:"Step screenshot",className:"rounded-lg border border-border max-w-full max-h-40 object-contain cursor-zoom-in hover:opacity-95 transition-opacity",onClick:()=>t(a)}),n.jsx("button",{type:"button",onClick:()=>t(a),title:"Fullscreen",className:"absolute top-1.5 right-1.5 bg-black/50 text-white p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",children:n.jsx(dm,{size:10})})]}),n.jsx("div",{className:"mt-2",children:n.jsx(R5,{stepId:e.stepId,currentScreenshotPath:e.screenshotPath})})]})]})]})}function _5({videoPath:e}){const t=Wa("videos",e);return n.jsxs("div",{className:"border-t border-border bg-black",children:[n.jsxs("div",{className:"px-3 pt-2 pb-1 flex items-center justify-between",children:[n.jsxs("p",{className:"text-[10px] font-medium text-content-tertiary flex items-center gap-1.5",children:[n.jsx(kc,{size:10})," Recording"]}),n.jsxs("a",{href:t,download:!0,title:"Download video",className:"text-[10px] text-content-tertiary hover:text-accent flex items-center gap-1",children:[n.jsx(bc,{size:10})," Download"]})]}),n.jsx("video",{src:t,controls:!0,playsInline:!0,className:"w-full max-h-64 bg-black"})]})}function $5({tracePath:e}){const t=e.replace(/\\/g,"/").split("/").pop()??"",s=Wa("traces",e),r=`/trace/index.html?trace=${encodeURIComponent(`${window.location.origin}${s}`)}`;return n.jsxs("div",{className:"border-t border-border px-3 py-2 flex items-center justify-between bg-violet-50/30",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Fg,{size:12,className:"text-violet-500 flex-shrink-0"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"Playwright Trace"}),n.jsx("p",{className:"text-[9px] text-content-tertiary font-mono truncate max-w-[200px]",children:t})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[n.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[10px] bg-violet-600 hover:bg-violet-700 text-white px-2 py-1 rounded-lg font-semibold transition-colors",children:[n.jsx(Rt,{size:9})," Open Viewer"]}),n.jsxs("a",{href:s,download:!0,title:"Download .zip",className:"inline-flex items-center gap-0.5 text-[10px] text-content-secondary hover:text-content px-1.5 py-1 border border-border rounded-lg hover:border-border transition-colors",children:[n.jsx(bc,{size:9})," .zip"]})]})]})}function U5({tc:e,suiteType:t,onScreenshot:s}){var b;const[r,a]=m.useState(e.status==="failed"),[i,l]=m.useState(!1),[o,c]=m.useState(null),d=e.steps.filter(y=>y.screenshotPath).length,x=e.steps.filter(y=>y.screenshotPath),g=(t==="audit"||t==="performance")&&(e.pageLoads??[]).some(y=>!y.lighthouseError&&(y.score!=null&&y.score<50||y.a11yScore!=null&&y.a11yScore<50||y.seoScore!=null&&y.seoScore<50));return n.jsxs("div",{className:C("border-t",g?"border-red-300 bg-red-50/30":"border-border/50"),children:[n.jsxs("div",{className:C("flex items-center gap-2 px-3 py-2 cursor-pointer select-none transition-colors",g?"hover:bg-red-50/50":"hover:bg-surface-inset/50"),onClick:()=>a(y=>!y),children:[r?n.jsx(Tt,{size:11,className:"text-content-tertiary flex-shrink-0"}):n.jsx(Zt,{size:11,className:"text-content-tertiary flex-shrink-0"}),n.jsx(jm,{status:e.status}),n.jsx("span",{className:"text-xs text-content font-medium flex-1 truncate",children:e.caseName}),n.jsxs("div",{className:"flex items-center gap-1.5",onClick:y=>y.stopPropagation(),children:[n.jsxs("button",{type:"button",title:"Toggle execution timeline",onClick:()=>l(y=>!y),className:C("flex items-center gap-0.5 text-[8px] px-1.5 py-0.5 rounded ring-1 transition-colors",i?"bg-indigo-100 text-indigo-600 ring-indigo-200":"bg-surface-inset text-content-tertiary ring-border hover:text-content-secondary"),children:[n.jsx(Cn,{size:8})," timeline"]}),(((b=e.pageLoads)==null?void 0:b.length)??0)>0&&(()=>{const y=e.pageLoads,j=y.some(u=>u.score!=null||u.fcp!=null),k=y.some(u=>{var p;return u.a11yScore!=null||(((p=u.a11yAudits)==null?void 0:p.length)??0)>0}),h=y.some(u=>{var p;return u.seoScore!=null||(((p=u.seoAudits)==null?void 0:p.length)??0)>0});return n.jsxs(n.Fragment,{children:[j&&n.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("performance")},title:"Page Speed (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200 font-semibold transition-colors flex-shrink-0",children:[n.jsx(Be,{size:9})," Speed"]}),k&&n.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("accessibility")},title:"Accessibility (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-blue-50 text-blue-600 hover:bg-blue-100 ring-1 ring-blue-200 font-semibold transition-colors flex-shrink-0",children:[n.jsx(qu,{size:9})," A11y"]}),h&&n.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),c("seo")},title:"SEO (Lighthouse)",className:"inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-600 hover:bg-emerald-100 ring-1 ring-emerald-200 font-semibold transition-colors flex-shrink-0",children:[n.jsx(Mr,{size:9})," SEO"]})]})})(),e.device&&(()=>{const y=Fy(e.device),j=(y==null?void 0:y.category)==="mobile"?gi:(y==null?void 0:y.category)==="tablet"?co:oa,k=(y==null?void 0:y.name)??e.device;return n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-teal-600 bg-teal-50 px-1.5 py-0.5 rounded ring-1 ring-teal-200 max-w-[90px] truncate",title:k,children:[n.jsx(j,{size:8})," ",k]})})(),d>0&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-content-secondary bg-surface-inset px-1.5 py-0.5 rounded ring-1 ring-border",children:[n.jsx(Er,{size:8})," ",d]}),e.videoPath&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-600 bg-blue-50 px-1.5 py-0.5 rounded ring-1 ring-blue-200",children:[n.jsx(kc,{size:8})," video"]}),e.tracePath&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-violet-600 bg-violet-50 px-1.5 py-0.5 rounded ring-1 ring-violet-200",children:[n.jsx(Fg,{size:8})," trace"]}),n.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(e.duration/1e3).toFixed(1),"s"]})]})]}),r&&n.jsxs("div",{className:"bg-surface",children:[x.length>=2&&n.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[n.jsx("p",{className:"text-[10px] text-content-tertiary uppercase tracking-wider mb-2",children:"Screenshot Filmstrip"}),n.jsx(z5,{steps:e.steps,onSelect:s})]}),i&&n.jsx(T5,{steps:e.steps}),e.steps.map(y=>n.jsx(F5,{step:y,onScreenshot:s},y.stepId)),e.videoPath&&n.jsx(_5,{videoPath:e.videoPath}),e.tracePath&&n.jsx($5,{tracePath:e.tracePath})]}),o&&n.jsx(L5,{caseName:e.caseName,pageLoads:e.pageLoads??[],focus:o,onClose:()=>c(null)})]})}function B5({runId:e}){const[t,s]=m.useState(null),{data:r,isLoading:a}=ke({queryKey:["report",e],queryFn:()=>qo.get(e)});return a?n.jsx("div",{className:"flex items-center justify-center py-6",children:n.jsx(ce,{size:14,className:"animate-spin text-accent"})}):r?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-3.5 pb-3 space-y-2",children:r.suites.map(i=>n.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-inset/50 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(jm,{status:i.status}),n.jsx("span",{className:"text-xs font-semibold text-content",children:i.suiteName}),n.jsxs("span",{className:"text-[10px] text-content-tertiary",children:["· ",i.browser]})]}),n.jsxs("span",{className:"text-[10px] text-content-tertiary tabular-nums",children:[(i.duration/1e3).toFixed(1),"s"]})]}),i.cases.map(l=>n.jsx(U5,{tc:l,suiteType:i.suiteType,onScreenshot:s},l.caseId))]},i.suiteId))}),t&&n.jsx(I5,{src:t,onClose:()=>s(null)})]}):null}function H5(){const[e,t]=m.useState(""),{modalProps:s,confirmDelete:r}=Mn(),a=ie(),{data:i=[],isLoading:l}=ke({queryKey:["reports"],queryFn:()=>qo.list(30)}),o=Y({mutationFn:qo.delete,onSuccess:()=>{a.invalidateQueries({queryKey:["reports"]}),O.success("Report deleted")},onError:f=>O.error(f.message)}),c=i.reduce((f,g)=>f+g.passed,0),d=i.reduce((f,g)=>f+g.failed,0),x=i.reduce((f,g)=>f+g.skipped,0);return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-sm shadow-blue-500/20",children:n.jsx(Cn,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Reports"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Screenshots · Video · Trace Viewer · Run Logs"})]})]}),n.jsx("div",{className:"flex items-center gap-2",children:i.length>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[i.length," ",n.jsx("span",{className:"opacity-60 font-normal",children:"runs"})]}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200",children:[c," ",n.jsx("span",{className:"opacity-60 font-normal",children:"passed"})]}),n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-red-50 text-red-600 ring-red-200",children:[d," ",n.jsx("span",{className:"opacity-60 font-normal",children:"failed"})]}),x>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200",children:[x," ",n.jsx("span",{className:"opacity-60 font-normal",children:"skip"})]})]})})]})}),l&&n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ce,{size:18,className:"animate-spin text-accent"})}),!l&&i.length===0&&n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[n.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:n.jsx(Cn,{size:20,className:"text-content-tertiary"})}),n.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No runs yet"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure and start a run first. Enable screenshot, video, and trace in Settings."})]}),n.jsx("div",{className:"space-y-2",children:i.map(f=>{const g=e===f.runId;return n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden hover:border-accent/20 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-2.5 cursor-pointer hover:bg-surface-inset/30 select-none transition-colors",onClick:()=>t(b=>b===f.runId?"":f.runId),children:[g?n.jsx(Tt,{size:12,className:"text-content-tertiary flex-shrink-0"}):n.jsx(Zt,{size:12,className:"text-content-tertiary flex-shrink-0"}),n.jsx(jm,{status:f.status}),f.environment&&n.jsx("span",{className:"text-[8px] px-1.5 py-0.5 rounded font-bold uppercase ring-1 bg-emerald-50 text-emerald-600 ring-emerald-200 flex-shrink-0",children:f.environment}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("p",{className:"text-[10px] font-mono text-content-secondary",children:[f.runId.slice(0,12),"…"]}),n.jsxs("p",{className:"text-[9px] text-content-tertiary flex items-center gap-1 mt-0.5",children:[n.jsx(Or,{size:8}),ak(new Date(f.startedAt),"MMM d, HH:mm")," · ",Vo(new Date(f.startedAt),{addSuffix:!0})]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[10px] flex-shrink-0",children:[n.jsxs("span",{className:"text-emerald-600 font-semibold tabular-nums",children:[f.passed,"✓"]}),n.jsxs("span",{className:"text-red-500 font-semibold tabular-nums",children:[f.failed,"✗"]}),f.skipped>0&&n.jsxs("span",{className:"text-content-tertiary tabular-nums",children:[f.skipped,"skip"]}),n.jsx("div",{className:"w-px h-3 bg-border"}),n.jsx("span",{className:"text-content-tertiary tabular-nums",children:f.duration!=null?(f.duration/1e3).toFixed(1)+"s":"—"})]}),n.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",onClick:b=>b.stopPropagation(),children:[f.logFilePath&&n.jsx("a",{href:Wa("logs",f.logFilePath),target:"_blank",rel:"noopener noreferrer",title:"Run Log",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:n.jsx(mn,{size:13})}),n.jsx("a",{href:`/allure/${f.runId}`,target:"_blank",rel:"noopener noreferrer",title:"Allure Report",className:"p-1 rounded-md text-blue-500 hover:bg-blue-50 transition-colors",children:n.jsx(Cn,{size:13})}),n.jsx("button",{type:"button",title:"Delete",onClick:()=>r("Delete this report? This cannot be undone.",()=>o.mutate(f.runId)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:n.jsx(fn,{size:12})})]})]}),g&&n.jsx(B5,{runId:f.runId})]},f.runId)})})]})}),n.jsx(zn,{...s})]})}function q5(){const[e,t]=m.useState(""),[s,r]=m.useState(""),[a,i]=m.useState(!1),[l,o]=m.useState(new Set),[c,d]=m.useState(null),[x,f]=m.useState(""),[g,b]=m.useState(!1),{modalProps:y,confirmDelete:j}=Mn(),k=ie(),{data:h={},isLoading:u}=ke({queryKey:["variables"],queryFn:()=>od.getAll()}),p=Y({mutationFn:({key:M,value:F,secret:ee})=>od.set(M,ee?{value:F,secret:!0}:F),onSuccess:()=>{k.invalidateQueries({queryKey:["variables"]}),t(""),r(""),i(!1),d(null),O.success("Variable saved")},onError:M=>O.error(M.message)}),v=Y({mutationFn:od.delete,onSuccess:()=>{k.invalidateQueries({queryKey:["variables"]}),O.success("Variable deleted")},onError:M=>O.error(M.message)}),w=h._system,N=Object.entries(h).filter(([M])=>M!=="_system").map(([M,F])=>typeof F=="string"?{key:M,value:F,secret:!1}:{key:M,value:F.value,secret:!0}),P=N.filter(M=>M.secret).length,E=N.filter(M=>{var F;return(F=w==null?void 0:w[M.key])==null?void 0:F.readOnly}).length,_=M=>{o(F=>{const ee=new Set(F);return ee.has(M)?ee.delete(M):ee.add(M),ee})},D=()=>{if(e.trim()){if(e.trim()==="BASE_URL"){O.error("BASE_URL is managed in Settings → Environment");return}p.mutate({key:e.trim(),value:s,secret:a})}},G=M=>{d(M.key),f(M.value),b(M.secret)},J=()=>{c&&p.mutate({key:c,value:x,secret:g})},se=()=>{d(null),f(""),b(!1)};return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-teal-500 to-emerald-600 flex items-center justify-center shadow-sm shadow-teal-500/20",children:n.jsx(Lg,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Variables"}),n.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Global variables available in all tests as ","{{VARIABLE_NAME}}"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-surface-inset text-content-tertiary ring-border",children:[N.length," ",n.jsx("span",{className:"opacity-60 font-normal",children:"total"})]}),P>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-amber-50 text-amber-600 ring-amber-200",children:[n.jsx(id,{size:7})," ",P," ",n.jsx("span",{className:"opacity-60 font-normal",children:"secret"})]}),E>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-[9px] font-semibold px-2 py-0.5 rounded-md ring-1 bg-blue-50 text-blue-600 ring-blue-200",children:[n.jsx(Ho,{size:7})," ",E," ",n.jsx("span",{className:"opacity-60 font-normal",children:"system"})]})]})]}),n.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"relative",children:[n.jsx(af,{size:10,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),n.jsx("input",{className:"w-full text-xs font-mono uppercase tracking-wide border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"VARIABLE_NAME",value:e,onChange:M=>t(M.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_")),onKeyDown:M=>M.key==="Enter"&&D()})]})}),n.jsx("div",{className:"flex-[2] min-w-0",children:n.jsx("input",{type:a?"password":"text",className:"w-full text-xs border border-border rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface placeholder-content-tertiary",placeholder:"variable value",value:s,onChange:M=>r(M.target.value),onKeyDown:M=>M.key==="Enter"&&D()})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[n.jsx(Go,{checked:a,onChange:i}),n.jsx(id,{size:9})]}),n.jsxs(ne,{size:"sm",onClick:D,loading:p.isPending&&!c,disabled:!e.trim(),children:[n.jsx(En,{size:10})," Add"]})]})]})]}),n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:u?n.jsx("div",{className:"flex items-center justify-center py-12",children:n.jsx(ce,{size:18,className:"animate-spin text-accent"})}):N.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-14 gap-2.5",children:[n.jsx("div",{className:"w-11 h-11 rounded-xl bg-surface-inset flex items-center justify-center",children:n.jsx(af,{size:20,className:"text-content-tertiary"})}),n.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No variables yet"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Add your first variable using the toolbar above"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-[1fr_2fr_80px_80px] gap-2 px-3.5 py-2 bg-surface-inset/50 border-b border-border",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Key"}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Value"}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Type"}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest text-center",children:"Actions"})]}),n.jsx("div",{className:"max-h-[500px] overflow-y-auto divide-y divide-border/50",children:N.map(M=>{var z,K,T;const F=((z=w==null?void 0:w[M.key])==null?void 0:z.readOnly)===!0,ee=(T=(K=w==null?void 0:w[M.key])==null?void 0:K.environment)==null?void 0:T.toUpperCase(),ae=c===M.key;return n.jsxs("div",{className:C("grid grid-cols-[1fr_2fr_80px_80px] gap-2 px-3.5 py-2 items-center transition-colors",ae?"bg-accent/[0.02]":"hover:bg-surface-inset/40"),children:[n.jsx("span",{className:"text-[10px] font-mono text-accent font-medium truncate",children:`{{${M.key}}}`}),n.jsx("div",{className:"min-w-0",children:ae?n.jsx("input",{type:g?"password":"text",className:"w-full text-[10px] font-mono border border-accent/40 rounded-lg px-2 py-1 focus:outline-none focus:ring-2 focus:ring-accent/30 bg-surface",value:x,onChange:W=>f(W.target.value),onKeyDown:W=>{W.key==="Enter"&&J(),W.key==="Escape"&&se()},autoFocus:!0}):n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-[10px] font-mono text-content-secondary truncate",children:M.secret&&!l.has(M.key)?"••••••••":M.value}),M.secret&&n.jsx("button",{type:"button",onClick:()=>_(M.key),className:"text-content-tertiary hover:text-content-secondary flex-shrink-0 p-0.5",children:l.has(M.key)?n.jsx(mN,{size:9}):n.jsx(Ig,{size:9})})]})}),n.jsx("div",{className:"text-center",children:F?n.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[8px] bg-blue-50 text-blue-600 px-1.5 py-0.5 rounded ring-1 ring-blue-200 font-medium",children:[n.jsx(Ho,{size:7})," ",ee??"sys"]}):M.secret?n.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[8px] bg-amber-50 text-amber-600 px-1.5 py-0.5 rounded ring-1 ring-amber-200 font-medium",children:[n.jsx(id,{size:7})," secret"]}):n.jsx("span",{className:"text-[8px] text-content-tertiary",children:"plain"})}),n.jsx("div",{className:"flex items-center gap-0.5 justify-center",children:F?n.jsx("span",{className:"text-[8px] text-content-tertiary italic",children:"read-only"}):ae?n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:J,title:"Save",className:"p-1 rounded-md text-emerald-500 hover:bg-emerald-50 transition-colors",children:n.jsx(He,{size:11})}),n.jsx("button",{type:"button",onClick:se,title:"Cancel",className:"p-1 rounded-md text-content-tertiary hover:bg-surface-inset transition-colors",children:n.jsx(Se,{size:11})})]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>G(M),title:"Edit",className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",children:n.jsx(Dr,{size:10})}),n.jsx("button",{type:"button",title:"Delete",onClick:()=>j(`Delete "${M.key}"?`,()=>v.mutate(M.key)),className:"p-1 rounded-md text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors",children:n.jsx(fn,{size:10})})]})})]},M.key)})})]})})]})}),n.jsx(zn,{...y})]})}function $y({children:e,className:t,padding:s=!0}){return n.jsx("div",{className:C("bg-surface rounded-xl border border-border shadow-card transition-shadow duration-200",s&&"p-5",t),children:e})}const K5={blue:{bg:"bg-blue-50",border:"border-blue-200/60",value:"text-blue-600",icon:"text-blue-500",glow:"shadow-blue-100/50"},teal:{bg:"bg-teal-50",border:"border-teal-200/60",value:"text-teal-600",icon:"text-teal-500",glow:"shadow-teal-100/50"},green:{bg:"bg-green-50",border:"border-green-200/60",value:"text-green-600",icon:"text-green-500",glow:"shadow-green-100/50"},orange:{bg:"bg-orange-50",border:"border-orange-200/60",value:"text-orange-600",icon:"text-orange-500",glow:"shadow-orange-100/50"},rose:{bg:"bg-rose-50",border:"border-rose-200/60",value:"text-rose-500",icon:"text-rose-400",glow:"shadow-rose-100/50"},red:{bg:"bg-red-50",border:"border-red-200/60",value:"text-red-600",icon:"text-red-500",glow:"shadow-red-100/50"},purple:{bg:"bg-purple-50",border:"border-purple-200/60",value:"text-purple-600",icon:"text-purple-500",glow:"shadow-purple-100/50"}};function Bl({label:e,value:t,sub:s,color:r,icon:a}){const i=r?K5[r]:null;return n.jsxs("div",{className:C("rounded-xl border px-4 py-3.5 flex items-center gap-3.5 transition-all duration-200",i?`${i.bg} ${i.border}`:"bg-surface border-border"),children:[a&&n.jsx("div",{className:C("flex items-center justify-center w-9 h-9 rounded-lg flex-shrink-0",i?`${i.bg} ${i.icon}`:"bg-surface-inset text-content-tertiary"),children:a}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-content-tertiary leading-none",children:e}),n.jsx("p",{className:C("font-bold mt-1.5 leading-none",typeof t=="string"&&t.length>3?"text-sm":"text-lg",i?i.value:"text-content"),children:t}),s&&n.jsx("p",{className:"text-[11px] text-content-tertiary mt-1",children:s})]})]})}const W5={1:"Smart Retry",2:"AI Regeneration",3:"Multi-Selector",4:"Visual/SoM",5:"Decompose",6:"Manual"};function V5({event:e}){const t=ie(),{modalProps:s,confirmDelete:r}=Mn(),a=Y({mutationFn:()=>Hn.accept(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),O.success("Healing accepted — test file updated")},onError:o=>O.error(o.message)}),i=Y({mutationFn:()=>Hn.reject(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),O("Healing rejected")},onError:o=>O.error(o.message)}),l=Y({mutationFn:()=>Hn.delete(e.id),onSuccess:()=>{t.invalidateQueries({queryKey:["healing"]}),O.success("Event deleted")},onError:o=>O.error(o.message)});return n.jsxs(n.Fragment,{children:[n.jsxs($y,{className:"overflow-hidden",padding:!1,children:[n.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-inset flex items-center gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-content-secondary truncate",children:e.instruction}),n.jsxs("p",{className:"text-xs text-content-tertiary mt-0.5",children:["Case: ",e.caseId," · Level ",e.level,": ",W5[e.level]??"Unknown"]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx(_y,{label:e.status,color:e.status==="pending"?"bg-yellow-100 text-yellow-700":e.status==="accepted"?"bg-green-100 text-green-700":"bg-slate-100 text-content-secondary"}),n.jsx("button",{type:"button",onClick:()=>r("Delete this healing event? This cannot be undone.",()=>l.mutate()),disabled:l.isPending,className:"p-1 text-content-tertiary hover:text-red-500 transition-colors",title:"Delete event",children:n.jsx(fn,{size:13})})]})]}),n.jsxs("div",{className:"grid grid-cols-2 divide-x divide-border-muted",children:[n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"text-xs font-semibold text-red-500 mb-1",children:"Before (failed)"}),n.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-red-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:e.failedCode||"// (no code)"})]}),n.jsxs("div",{className:"p-3",children:[n.jsx("p",{className:"text-xs font-semibold text-green-600 mb-1",children:"After (healed)"}),n.jsx("pre",{className:"text-xs font-mono text-content-secondary bg-green-50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-all max-h-32",children:e.healedCode})]})]}),e.status==="pending"&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t border-border bg-surface-inset",children:[n.jsxs(ne,{size:"sm",onClick:()=>a.mutate(),loading:a.isPending,children:[n.jsx(He,{size:13})," Accept & Update File"]}),n.jsxs(ne,{variant:"secondary",size:"sm",onClick:()=>i.mutate(),loading:i.isPending,children:[n.jsx(Se,{size:13})," Reject"]})]})]}),n.jsx(zn,{...s})]})}function zd({title:e,events:t}){return n.jsxs("div",{className:"mb-8",children:[n.jsxs("h2",{className:"text-sm font-semibold text-content-secondary mb-3",children:[e," (",t.length,")"]}),n.jsx("div",{className:"space-y-3 max-h-[680px] overflow-y-auto pr-1",children:t.map(s=>n.jsx(V5,{event:s},s.id))})]})}function Q5(){const e=ie(),{modalProps:t,confirmDelete:s}=Mn(),{data:r=[],isLoading:a}=ke({queryKey:["healing","pending"],queryFn:()=>Hn.pending()}),{data:i}=ke({queryKey:["healing","stats"],queryFn:()=>Hn.stats()}),{data:l=[]}=ke({queryKey:["healing"],queryFn:()=>Hn.list()}),o=Y({mutationFn:Hn.acceptAll,onSuccess:y=>{e.invalidateQueries({queryKey:["healing"]}),O.success(`Accepted ${y.accepted} heal(s)`)},onError:y=>O.error(y.message)}),c=Y({mutationFn:Hn.deleteAll,onSuccess:y=>{e.invalidateQueries({queryKey:["healing"]}),O.success(`Cleared ${y.deleted} event(s)`)},onError:y=>O.error(y.message)}),d=(y,j)=>y.createdAt<j.createdAt?1:-1,x=[...r].sort(d),f=[...l.filter(y=>y.status==="accepted")].sort(d),g=[...l.filter(y=>y.status==="rejected")].sort(d),b=()=>{s("Delete all healing events? This cannot be undone.",()=>c.mutate())};return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-b border-border flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-xl font-bold text-content flex items-center gap-2",children:[n.jsx(Uo,{size:20,className:"text-accent"})," Self-Healing"]}),n.jsx("p",{className:"text-sm text-content-tertiary mt-0.5",children:"Review AI-generated fixes for broken test steps"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[l.length>0&&n.jsxs(ne,{variant:"secondary",onClick:b,loading:c.isPending,children:[n.jsx(zN,{size:14})," Delete All"]}),r.length>0&&n.jsxs(ne,{onClick:()=>o.mutate(),loading:o.isPending,children:[n.jsx(Dg,{size:15})," Accept All (",r.length,")"]})]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[i&&n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(Bl,{label:"Total Events",value:i.total,color:"blue"}),n.jsx(Bl,{label:"Pending Review",value:i.pending,color:"orange"}),n.jsx(Bl,{label:"Accepted",value:i.accepted,color:"green"}),n.jsx(Bl,{label:"Rejected",value:i.rejected,color:"purple"})]}),a&&n.jsx("p",{className:"text-sm text-content-tertiary text-center py-12",children:"Loading…"}),x.length>0&&n.jsx(zd,{title:"Pending Review",events:x}),!a&&r.length===0&&n.jsxs($y,{className:"text-center py-12 mb-6",children:[n.jsx(Uo,{size:32,className:"text-slate-200 mx-auto mb-3"}),n.jsx("p",{className:"text-content-secondary font-medium",children:"No pending heals"}),n.jsx("p",{className:"text-content-tertiary text-sm mt-1",children:"Self-healing events appear here when tests fail and AI generates a fix"})]}),f.length>0&&n.jsx(zd,{title:"Accepted",events:f}),g.length>0&&n.jsx(zd,{title:"Rejected",events:g})]}),n.jsx(zn,{...t})]})}function rn({label:e,hint:t,children:s}){return n.jsxs("div",{className:"flex items-start gap-4 py-2.5 border-b border-border/50 last:border-0",children:[n.jsxs("div",{className:"w-40 flex-shrink-0 pt-0.5",children:[n.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:e}),t&&n.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5 leading-relaxed",children:t})]}),n.jsx("div",{className:"flex-1 min-w-0",children:s})]})}function gn({label:e,hint:t,checked:s,onChange:r}){return n.jsxs("div",{className:"flex items-start gap-3 py-2.5 border-b border-border/50 last:border-0",children:[n.jsx("div",{className:"pt-0.5 flex-shrink-0",children:n.jsx(Go,{checked:s,onChange:r})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-semibold text-content-secondary",children:e}),t&&n.jsx("p",{className:"text-[10px] text-content-tertiary mt-0.5",children:t})]})]})}function ls({icon:e,iconBg:t,title:s,desc:r,children:a}){return n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2.5",children:[n.jsx("div",{className:C("w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 shadow-sm",t),children:n.jsx(e,{size:13,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xs font-bold text-content",children:s}),r&&n.jsx("p",{className:"text-[9px] text-content-tertiary",children:r})]})]}),n.jsx("div",{className:"px-4 py-1",children:a})]})}function xs(e){return n.jsx("input",{...e,className:C("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40",e.className)})}function yi({value:e,onChange:t,options:s,className:r}){return n.jsx("select",{value:e,onChange:a=>t(a.target.value),className:C("border border-border rounded-lg px-2.5 py-1.5 text-xs bg-surface text-content-secondary","focus:outline-none focus:ring-2 focus:ring-accent/30",r),children:s.map(a=>n.jsx("option",{value:a.value,children:a.label},a.value))})}const Md=[{label:"Standard (1280×720)",width:1280,height:720},{label:"Laptop (1366×768)",width:1366,height:768},{label:"Full HD (1920×1080)",width:1920,height:1080},{label:"Mobile (390×844)",width:390,height:844},{label:"Tablet (768×1024)",width:768,height:1024},{label:"Custom",width:0,height:0}];function G5({viewport:e,onChange:t}){const s=Md.find(i=>i.width===e.width&&i.height===e.height),r=(s==null?void 0:s.label)??"Custom",a=i=>{const l=Md.find(o=>o.label===i);l&&l.width!==0&&t({width:l.width,height:l.height})};return n.jsx(rn,{label:"Viewport",hint:"Browser window size",children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(yi,{className:"w-44",value:r,onChange:a,options:Md.map(i=>({value:i.label,label:i.label}))}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(xs,{type:"number",className:"w-16",value:e.width,min:320,onChange:i=>t({...e,width:Number(i.target.value)})}),n.jsx("span",{className:"text-content-tertiary text-[10px]",children:"×"}),n.jsx(xs,{type:"number",className:"w-16",value:e.height,min:240,onChange:i=>t({...e,height:Number(i.target.value)})}),n.jsx("span",{className:"text-[9px] text-content-tertiary",children:"px"})]})]})})}function Y5(){var g,b,y,j,k,h,u,p,v,w;const e=ie(),{data:t,isLoading:s}=ke({queryKey:["config"],queryFn:()=>_a.get()}),[r,a]=m.useState({}),[i,l]=m.useState(!1),[o,c]=m.useState({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]});m.useEffect(()=>{t&&a(t)},[t]);const d=Y({mutationFn:()=>_a.update(r),onSuccess:()=>{e.invalidateQueries({queryKey:["config"]}),O.success("Settings saved")},onError:N=>O.error(N.message)}),x=(N,P)=>a(E=>({...E,[N]:P})),f=N=>{const P=r.browsers??[];x("browsers",P.includes(N)?P.length>1?P.filter(E=>E!==N):P:[...P,N])};return s||!r.healing||!r.reporting?n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(ce,{size:20,className:"animate-spin text-accent"})}):n.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center shadow-sm shadow-indigo-500/20",children:n.jsx(Ia,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Settings"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Configure Assuremind Studio"})]})]}),n.jsxs(ne,{size:"sm",onClick:()=>d.mutate(),loading:d.isPending,children:[n.jsx(Gg,{size:11})," Save Settings"]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 items-start",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs(ls,{icon:kN,iconBg:"bg-gradient-to-br from-indigo-500 to-violet-600 shadow-indigo-500/20",title:"Environment",desc:"Target environment & URLs",children:[n.jsx(rn,{label:"Active Environment",hint:"Where tests run against",children:n.jsx("div",{className:"flex gap-1 flex-wrap",children:["dev","stage","test","prod"].map(N=>n.jsx("button",{type:"button",onClick:()=>{var E;x("environment",N);const P=(E=r.environmentUrls)==null?void 0:E[N];P&&x("baseUrl",P)},className:C("px-2.5 py-1 rounded-lg text-[10px] font-semibold uppercase tracking-wide transition-all",r.environment===N?"bg-accent text-white shadow-sm shadow-accent/20":"text-content-tertiary hover:text-content-secondary bg-surface-inset ring-1 ring-border"),children:N},N))})}),n.jsx(rn,{label:"Environment URLs",hint:"Base URL per environment",children:n.jsx("div",{className:"space-y-1.5",children:["dev","stage","test","prod"].map(N=>{var P;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:C("w-11 text-[9px] font-bold uppercase text-center py-0.5 rounded",r.environment===N?"bg-accent/10 text-accent ring-1 ring-accent/20":"bg-surface-inset text-content-tertiary ring-1 ring-border"),children:N}),n.jsx(xs,{className:"flex-1",placeholder:`https://${N}.example.com`,value:((P=r.environmentUrls)==null?void 0:P[N])??"",onChange:E=>{const _={...r.environmentUrls??{dev:"",stage:"",test:"",prod:""},[N]:E.target.value};x("environmentUrls",_),r.environment===N&&x("baseUrl",E.target.value)}})]},N)})})}),n.jsx(rn,{label:"Base URL",hint:"Auto-resolved from active env",children:n.jsx(xs,{className:"w-full bg-surface-inset/50 text-content-tertiary cursor-not-allowed",placeholder:"http://localhost:3000",value:r.baseUrl??"",readOnly:!0,disabled:!0})})]}),n.jsxs(ls,{icon:Ia,iconBg:"bg-gradient-to-br from-slate-500 to-slate-700 shadow-slate-500/20",title:"Execution",desc:"Timeouts, retries & parallelism",children:[n.jsx(rn,{label:"Timeouts & Workers",hint:"Per-test limits",children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Timeout (ms)"}),n.jsx(xs,{type:"number",className:"w-24",value:r.timeout??3e4,onChange:N=>x("timeout",Number(N.target.value))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Retries"}),n.jsx(xs,{type:"number",min:0,max:5,className:"w-16",value:r.retries??1,onChange:N=>x("retries",Number(N.target.value))})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] text-content-tertiary mb-0.5",children:"Workers"}),n.jsx(xs,{type:"number",min:1,max:10,className:"w-16",value:r.parallel??2,onChange:N=>x("parallel",Number(N.target.value))})]})]})}),n.jsx(rn,{label:"Page load strategy",hint:"Playwright wait after each step",children:n.jsx(yi,{className:"w-full",value:r.pageLoad??"domcontentloaded",onChange:N=>x("pageLoad",N),options:[{value:"commit",label:"commit — first network response"},{value:"domcontentloaded",label:"domcontentloaded — DOM ready"},{value:"load",label:"load — full page load event"},{value:"networkidle",label:"networkidle — no network 500ms"}]})})]}),n.jsxs(ls,{icon:xm,iconBg:"bg-gradient-to-br from-amber-500 to-orange-600 shadow-amber-500/20",title:"Self-Healing",desc:"AI-powered selector recovery",children:[n.jsx(gn,{label:"Enable self-healing",hint:"Auto-fix broken selectors during runs",checked:((g=r.healing)==null?void 0:g.enabled)??!0,onChange:N=>x("healing",{...r.healing,enabled:N})}),n.jsx(rn,{label:"Max healing level",hint:"1 = retry only · 2 = AI regen · 3 = multi-selector · 4 = visual · 5 = decompose",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xs,{type:"number",min:1,max:5,className:"w-16",value:Math.min(((b=r.healing)==null?void 0:b.maxLevel)??5,5),onChange:N=>x("healing",{...r.healing,maxLevel:Number(N.target.value)})}),n.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(N=>{var P;return n.jsx("div",{className:C("w-4 h-1.5 rounded-full transition-colors",N<=Math.min(((P=r.healing)==null?void 0:P.maxLevel)??5,5)?"bg-amber-400":"bg-surface-inset")},N)})})]})}),n.jsx(gn,{label:"Auto-PR on CI heal",hint:"GitHub PR when selector healed in CI",checked:((y=r.healing)==null?void 0:y.autoPR)??!1,onChange:N=>x("healing",{...r.healing,autoPR:N})})]}),n.jsxs(ls,{icon:Cn,iconBg:"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-indigo-500/20",title:"Reporting",desc:"Output format & destinations",children:[n.jsx(gn,{label:"Allure report",hint:"Interactive HTML report with history & trends",checked:((j=r.reporting)==null?void 0:j.allure)??!0,onChange:N=>x("reporting",{...r.reporting,allure:N})}),n.jsx(gn,{label:"HTML report",hint:"Standalone summary saved to results/",checked:((k=r.reporting)==null?void 0:k.html)??!0,onChange:N=>x("reporting",{...r.reporting,html:N})}),n.jsx(gn,{label:"JSON report",hint:"Machine-readable run data",checked:((h=r.reporting)==null?void 0:h.json)??!0,onChange:N=>x("reporting",{...r.reporting,json:N})})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs(ls,{icon:zr,iconBg:"bg-gradient-to-br from-blue-500 to-cyan-600 shadow-blue-500/20",title:"General",desc:"Browser & display settings",children:[n.jsx(rn,{label:"Browsers",hint:"One or more browsers",children:n.jsx("div",{className:"flex gap-1 flex-wrap",children:ty.map(N=>n.jsx("button",{type:"button",onClick:()=>f(N),className:C("px-2.5 py-1 rounded-lg text-[10px] font-semibold capitalize transition-all",(r.browsers??[]).includes(N)?"bg-accent/10 text-accent ring-1 ring-accent/30":"text-content-tertiary bg-surface-inset ring-1 ring-border hover:text-content-secondary"),children:N},N))})}),n.jsx(gn,{label:"Headless mode",hint:"Run browsers without visible window",checked:r.headless??!0,onChange:N=>x("headless",N)}),n.jsx(G5,{viewport:r.viewport??{width:1280,height:720},onChange:N=>x("viewport",N)})]}),n.jsxs(ls,{icon:Er,iconBg:"bg-gradient-to-br from-pink-500 to-rose-600 shadow-pink-500/20",title:"Capture",desc:"Screenshots, video & traces",children:[n.jsx(rn,{label:"Screenshot",hint:"When to capture screenshots",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Er,{size:11,className:"text-pink-400 flex-shrink-0"}),n.jsx(yi,{className:"w-40",value:r.screenshot??"only-on-failure",onChange:N=>x("screenshot",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"only-on-failure",label:"On failure only"}]})]})}),n.jsx(rn,{label:"Video",hint:"When to record video",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(kc,{size:11,className:"text-violet-400 flex-shrink-0"}),n.jsx(yi,{className:"w-40",value:r.video??"off",onChange:N=>x("video",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})}),n.jsx(rn,{label:"Trace",hint:"Playwright trace for debugging",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Yg,{size:11,className:"text-emerald-400 flex-shrink-0"}),n.jsx(yi,{className:"w-40",value:r.trace??"on-first-retry",onChange:N=>x("trace",N),options:[{value:"off",label:"Off"},{value:"on",label:"Every test"},{value:"on-first-retry",label:"On first retry"},{value:"retain-on-failure",label:"On failure only"}]})]})})]}),n.jsxs(ls,{icon:Ot,iconBg:"bg-gradient-to-br from-purple-500 to-fuchsia-600 shadow-purple-500/20",title:"MCP Integration",desc:"AI-sighted code generation via Playwright MCP",children:[n.jsx(gn,{label:"Enable MCP",hint:"ON by default — AI sees real page elements during generation. Test execution is unaffected.",checked:((u=r.mcp)==null?void 0:u.enabled)??!0,onChange:N=>x("mcp",{...r.mcp,enabled:N})}),n.jsx(gn,{label:"Headless mode",hint:"Run MCP browser without visible window",checked:((p=r.mcp)==null?void 0:p.headless)??!0,onChange:N=>x("mcp",{...r.mcp,headless:N})}),n.jsx(gn,{label:"Act-then-script",hint:"Execute action via MCP first, then convert to script",checked:((v=r.mcp)==null?void 0:v.actThenScript)??!1,onChange:N=>x("mcp",{...r.mcp,actThenScript:N})}),n.jsx(gn,{label:"Proactive healing",hint:"Validate selectors against live page before test run",checked:((w=r.mcp)==null?void 0:w.proactiveHealing)??!1,onChange:N=>x("mcp",{...r.mcp,proactiveHealing:N})})]}),n.jsx(ls,{icon:zr,iconBg:"bg-gradient-to-br from-teal-500 to-cyan-600 shadow-teal-500/20",title:"Environment Profiles",desc:"Quick-switch presets for different environments",children:n.jsxs("div",{id:"profiles",className:"space-y-2",children:[(r.profiles??[]).length===0&&n.jsx("p",{className:"text-[10px] text-content-tertiary py-2",children:"No profiles defined. Add one below."}),(r.profiles??[]).map((N,P)=>n.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border/40 last:border-0",children:[n.jsx("span",{className:"text-xs font-medium text-content w-24 truncate",children:N.name}),n.jsx("span",{className:"text-[10px] text-content-tertiary w-14",children:N.environment}),n.jsx("span",{className:"text-[10px] text-content-tertiary flex-1 truncate",children:N.baseUrl}),n.jsx("button",{type:"button",onClick:()=>{const E=(r.profiles??[]).filter((_,D)=>D!==P);x("profiles",E)},className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50 transition-colors flex-shrink-0",children:n.jsx(fn,{size:11})})]},P)),i?n.jsxs("div",{className:"mt-2 p-3 rounded-lg border border-border bg-surface-alt space-y-2",children:[n.jsx("p",{className:"text-[10px] font-semibold text-content-secondary",children:"New Profile"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Name"}),n.jsx("input",{type:"text",value:o.name,onChange:N=>c(P=>({...P,name:N.target.value})),placeholder:"e.g. Staging",className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Environment"}),n.jsxs("select",{value:o.environment,onChange:N=>c(P=>({...P,environment:N.target.value})),className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent",children:[n.jsx("option",{value:"dev",children:"dev"}),n.jsx("option",{value:"stage",children:"stage"}),n.jsx("option",{value:"test",children:"test"}),n.jsx("option",{value:"prod",children:"prod"})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Base URL"}),n.jsx("input",{type:"url",value:o.baseUrl,onChange:N=>c(P=>({...P,baseUrl:N.target.value})),placeholder:"https://your-app.com",className:"w-full mt-0.5 px-2 py-1 text-[11px] rounded border border-border bg-surface focus:outline-none focus:ring-1 focus:ring-accent"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] text-content-tertiary uppercase tracking-wide",children:"Browsers"}),n.jsx("div",{className:"flex gap-3 mt-1",children:["chromium","firefox","webkit"].map(N=>n.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-content-secondary cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:o.browsers.includes(N),onChange:P=>c(E=>({...E,browsers:P.target.checked?[...E.browsers,N]:E.browsers.filter(_=>_!==N)})),className:"rounded"}),N]},N))})]}),n.jsxs("div",{className:"flex gap-2 pt-1",children:[n.jsx("button",{type:"button",onClick:()=>{if(!o.name.trim()){O.error("Profile name is required");return}if(!o.baseUrl.startsWith("http")){O.error("Base URL must start with http:// or https://");return}if(o.browsers.length===0){O.error("Select at least one browser");return}x("profiles",[...r.profiles??[],{name:o.name.trim(),environment:o.environment,baseUrl:o.baseUrl,browsers:o.browsers}]),c({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]}),l(!1)},className:"px-2.5 py-1 text-[10px] font-medium rounded bg-accent text-white hover:bg-accent-dark transition-colors",children:"Add"}),n.jsx("button",{type:"button",onClick:()=>{l(!1),c({name:"",environment:"stage",baseUrl:"",browsers:["chromium"]})},className:"px-2.5 py-1 text-[10px] rounded border border-border text-content-secondary hover:bg-surface-alt transition-colors",children:"Cancel"})]})]}):n.jsxs("button",{type:"button",onClick:()=>l(!0),className:"inline-flex items-center gap-1 text-[10px] text-accent hover:text-accent-dark py-1 transition-colors",children:[n.jsx(En,{size:11})," Add Profile"]})]})})]})]})]})})})}function J5(){const e=ie(),{modalProps:t,confirmDelete:s}=Mn(),[r,a]=m.useState(!1),[i,l]=m.useState(""),[o,c]=m.useState(""),[d,x]=m.useState(""),[f,g]=m.useState(null),[b,y]=m.useState({}),{data:j=[],isLoading:k}=ke({queryKey:["step-library"],queryFn:()=>ca.list()}),h=Y({mutationFn:()=>ca.create({name:i.trim(),instruction:o.trim(),tags:d.split(",").map(v=>v.trim()).filter(Boolean)}),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),O.success("Step created"),a(!1),l(""),c(""),x("")},onError:v=>O.error(v.message)}),u=Y({mutationFn:({id:v,data:w})=>ca.update(v,w),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),O.success("Step updated"),g(null)},onError:v=>O.error(v.message)}),p=Y({mutationFn:v=>ca.delete(v),onSuccess:()=>{e.invalidateQueries({queryKey:["step-library"]}),O.success("Step deleted")},onError:v=>O.error(v.message)});return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:[n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-4xl mx-auto px-5 py-4 space-y-3",children:[n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center shadow-sm shadow-violet-500/20",children:n.jsx(Yi,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Step Library"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Reusable step templates for your test cases"})]})]}),n.jsxs("button",{type:"button",onClick:()=>a(v=>!v),className:"inline-flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors",children:[n.jsx(En,{size:13})," Add Step"]})]})}),r&&n.jsxs("div",{className:"rounded-xl border border-accent/30 bg-surface p-4 space-y-2.5",children:[n.jsx("p",{className:"text-xs font-semibold text-content",children:"New Library Step"}),n.jsx("input",{type:"text",placeholder:"Name (e.g. Login as admin)",value:i,onChange:v=>l(v.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),n.jsx("textarea",{placeholder:"Instruction (e.g. Click the login button and fill in admin credentials)",value:o,onChange:v=>c(v.target.value),rows:3,className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}),n.jsx("input",{type:"text",placeholder:"Tags (comma-separated, optional)",value:d,onChange:v=>x(v.target.value),className:"w-full px-3 py-2 text-xs border border-border rounded-lg focus:outline-none focus:ring-1 focus:ring-accent/30"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>h.mutate(),disabled:!i.trim()||!o.trim()||h.isPending,className:"text-xs px-4 py-1.5 rounded-lg bg-accent text-white hover:brightness-110 transition-colors disabled:opacity-50",children:h.isPending?"Saving…":"Save"}),n.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-content-secondary hover:bg-surface-inset",children:"Cancel"})]})]}),k&&n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ce,{size:18,className:"animate-spin text-accent"})}),!k&&j.length===0&&!r&&n.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-surface flex flex-col items-center justify-center py-14 gap-2.5",children:[n.jsx(Yi,{size:24,className:"text-content-tertiary"}),n.jsx("p",{className:"text-xs font-medium text-content-secondary",children:"No steps in library"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:'Click "Add Step" to create your first reusable step template.'})]}),j.length>0&&n.jsx("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{className:"bg-surface-inset/50 border-b border-border",children:n.jsxs("tr",{children:[n.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Name"}),n.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Instruction"}),n.jsx("th",{className:"text-left px-4 py-2.5 text-[10px] font-semibold text-content-tertiary uppercase tracking-wider",children:"Tags"}),n.jsx("th",{className:"px-4 py-2.5 w-20"})]})}),n.jsx("tbody",{className:"divide-y divide-border",children:j.map(v=>n.jsxs("tr",{className:"hover:bg-surface-inset/30 transition-colors",children:[n.jsx("td",{className:"px-4 py-2.5 font-medium text-content",children:f===v.id?n.jsx("input",{type:"text",value:b.name??v.name,onChange:w=>y(N=>({...N,name:w.target.value})),className:"w-full px-2 py-1 border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-accent/30"}):v.name}),n.jsx("td",{className:"px-4 py-2.5 text-content-secondary max-w-xs",children:f===v.id?n.jsx("textarea",{value:b.instruction??v.instruction,onChange:w=>y(N=>({...N,instruction:w.target.value})),rows:2,className:"w-full px-2 py-1 border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-accent/30 resize-none"}):n.jsx("span",{className:"line-clamp-2",children:v.instruction})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"flex flex-wrap gap-0.5",children:v.tags.map(w=>n.jsx("span",{className:"text-[8px] px-1 py-px rounded bg-accent/8 text-accent ring-1 ring-accent/15",children:w},w))})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"flex items-center gap-1",children:f===v.id?n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>u.mutate({id:v.id,data:b}),className:"p-1 rounded text-emerald-600 hover:bg-emerald-50",children:n.jsx(He,{size:12})}),n.jsx("button",{type:"button",onClick:()=>g(null),className:"p-1 rounded text-content-tertiary hover:bg-surface-inset",children:n.jsx(Se,{size:12})})]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>{g(v.id),y({name:v.name,instruction:v.instruction,tags:v.tags})},className:"p-1 rounded text-content-tertiary hover:text-content hover:bg-surface-inset",children:n.jsx(Dr,{size:12})}),n.jsx("button",{type:"button",onClick:()=>s(`Delete "${v.name}"?`,()=>p.mutate(v.id)),className:"p-1 rounded text-content-tertiary hover:text-red-500 hover:bg-red-50",children:n.jsx(fn,{size:12})})]})})})]},v.id))})]})})]})}),n.jsx(zn,{...t})]})}const bi=[{id:"getting-started",title:"Getting Started",category:"Getting Started",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Assuremind Studio is an AI-powered test automation platform for web applications. It lets you describe tests in plain English, generate Playwright code automatically, and run them in the cloud or locally."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Prerequisites"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Node.js 18+"}),n.jsx("li",{children:"An AI provider API key (Anthropic, OpenAI, Google, or Azure)"}),n.jsx("li",{children:"A test target application URL"})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Quick Setup"}),n.jsx("pre",{className:"text-[11px] bg-surface-inset rounded-lg px-4 py-3 overflow-x-auto border border-border font-mono",children:`npm install
|
|
799
|
+
npm run build
|
|
800
|
+
npm start`}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Open ",n.jsx("code",{className:"text-accent",children:"http://localhost:4000"})," to access the Studio UI. The first run triggers the onboarding wizard."]})]})},{id:"configuration",title:"Configuration",category:"Getting Started",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Configuration is stored in ",n.jsx("code",{className:"text-accent",children:"tests/autotest.config.json"})," and editable from the Settings page."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Settings"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Field"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),n.jsx("tbody",{className:"text-content-secondary",children:[["baseUrl","Default URL for all test cases"],["environment","Active environment: dev | stage | test | prod"],["browsers","List of browsers: chromium, firefox, webkit"],["headless","Run browsers without a visible window"],["timeout","Global step timeout in ms (default 30000)"],["retries","Global retry count per step (default 0)"],["parallel","Number of parallel workers"],["screenshot","Screenshot mode: always | on-failure | never"]].map(([e,t])=>n.jsxs("tr",{className:"border-b border-border/50",children:[n.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:e}),n.jsx("td",{className:"py-1.5",children:t})]},e))})]})})]})},{id:"test-suites",title:"Test Suites",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Test Suites group related test cases. Each suite has a type (",n.jsx("strong",{children:"UI"}),", ",n.jsx("strong",{children:"API"}),", or ",n.jsx("strong",{children:"Audit"}),"), tags, and an optional timeout override."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Types"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Type"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),n.jsx("tbody",{className:"text-content-secondary",children:[["UI",'Standard Playwright browser automation. Steps show a blue "UI" badge. No Lighthouse.'],["API","API-only tests using HTTP request and assertion steps."],["Audit",'Full Playwright automation with Lighthouse non-functional checks (Performance, Accessibility, SEO). Steps show an amber "Audit" badge. Screenshot, video, and trace are disabled by default. Files stored in tests/audit/.']].map(([e,t])=>n.jsxs("tr",{className:"border-b border-border/50",children:[n.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent",children:e}),n.jsx("td",{className:"py-1.5",children:t})]},e))})]})}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Suite"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["Go to ",n.jsx("strong",{children:"Test Suites"})," in the sidebar."]}),n.jsxs("li",{children:["Click ",n.jsx("strong",{children:"+ New Suite"})," and enter a name."]}),n.jsxs("li",{children:["Select the suite type: ",n.jsx("strong",{children:"UI"}),", ",n.jsx("strong",{children:"API"}),", or ",n.jsx("strong",{children:"Audit"}),"."]}),n.jsx("li",{children:"Optionally set tags and timeout."})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Suite Actions"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Each suite supports inline rename, duplicate, delete, and direct run via the Run Configuration page."})]})},{id:"audit-suites",title:"Audit Suites",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Audit suites run exactly like UI suites (full Playwright automation) but add non-functional quality checks via Google Lighthouse for Performance, Accessibility, and SEO."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"⚡ Audit Flag on Steps"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["In Audit suites, each step has a ",n.jsx("strong",{children:"⚡ Audit"})," button. Clicking it marks that step as a Lighthouse checkpoint — when the step runs, Lighthouse audits ",n.jsx("code",{className:"text-accent",children:"page.url()"})," at that point. Confirm with ",n.jsx("strong",{children:"✓"})," to save or ",n.jsx("strong",{children:"✗"})," to cancel. If no steps are marked, Lighthouse is skipped entirely."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Non-Functional Checks"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Each test case in an Audit suite has a ",n.jsx("strong",{children:"Non-Functional Checks"})," section with three checkboxes:"]}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"⚡ Performance"})," — Lighthouse Performance score"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"♿ Accessibility"})," — Lighthouse Accessibility score"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"🔍 SEO"})," — Lighthouse SEO score"]})]}),n.jsx("p",{className:"text-sm text-content-secondary",children:"If all three are unchecked, Lighthouse is skipped for that case. A warning is shown if none are selected."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Score Thresholds"}),n.jsxs("div",{className:"flex gap-4 text-sm",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"test-cases",title:"Test Cases",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Test cases contain steps written in plain English. Each case has priority, tags, timeout, and optional data-driven configuration."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Writing Steps"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a case, type a step instruction in the input bar (e.g. ",n.jsx("em",{children:'"Click the Login button"'}),"), and press Enter. The step is saved immediately. Click ",n.jsx("strong",{children:"Generate All"})," to generate Playwright code for all steps at once."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Step Types"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"UI"})," — Playwright browser actions"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"API"})," — HTTP request/assertion steps"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Mock"})," — Intercept and stub network requests"]})]})]})},{id:"ai-generation",title:"AI Code Generation",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Assuremind uses your configured AI provider to convert natural-language instructions into executable Playwright code."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Write a step instruction in plain English."}),n.jsxs("li",{children:["Click the wand icon or ",n.jsx("strong",{children:"Generate All"}),"."]}),n.jsx("li",{children:"The AI generates strategy-specific Playwright code."}),n.jsx("li",{children:"Review the code by expanding the step row."})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Supported Providers"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Anthropic Claude, OpenAI GPT-4, Google Gemini, AWS Bedrock, Azure OpenAI, and Ollama (local). Configure via Settings → AI Provider."})]})},{id:"run-configuration",title:"Run Configuration",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"The Run Configuration page lets you select suites, browsers, and settings before executing a test run."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Options"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Select one or more suites to run"}),n.jsx("li",{children:"Override browsers, headless mode, and parallel count"}),n.jsx("li",{children:"Enable/disable video recording and tracing"}),n.jsx("li",{children:"Set retries and screenshot mode per run"})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Device Emulation"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["The ",n.jsx("strong",{children:"Device Emulation"})," section lets you emulate real mobile and tablet devices using Playwright's built-in device descriptors. Selecting a device applies the correct viewport, user-agent, device pixel ratio, and touch/mobile flags automatically."]}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2 mt-1",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Desktop"})," — Viewport-only presets (1920×1080, 1440×900, 1366×768, 1280×720, 1024×768). No mobile emulation."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Mobile"})," — iPhone 15 Pro/15/14/SE, Pixel 7/5, Galaxy S9+/S8. Full Playwright device descriptor including touch events and mobile UA. Chromium is recommended."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Tablet"})," — iPad Pro 11″, iPad (gen 7), iPad Mini, Galaxy Tab S4. Use WebKit or Chromium for best results."]})]}),n.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"A teal device badge appears on each case in the Reports page when the run used device emulation, making it easy to identify mobile vs desktop results at a glance."}),n.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700 mt-1",children:["⚠ Mobile and tablet device descriptors work best with ",n.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags."]}),n.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Live Progress"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Run progress is streamed via WebSocket. Status updates appear in real time on the case list and via toast notifications."}),n.jsx("h4",{className:"text-sm font-semibold text-content mt-2",children:"Running from CI/CD (CLI)"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Every option available in the UI is also available as a CLI flag:"}),n.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed mt-1",children:`# Run all tests in CI (headless, exit 1 on failure)
|
|
801
|
+
npx assuremind run --all --ci
|
|
802
|
+
|
|
803
|
+
# Filter by type, suite, tag, or test name
|
|
804
|
+
npx assuremind run --type ui --tag smoke
|
|
805
|
+
npx assuremind run --suite "Login Tests" --browser chromium firefox
|
|
806
|
+
|
|
807
|
+
# Device emulation in CI
|
|
808
|
+
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
809
|
+
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
810
|
+
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci`})]})},{id:"reports",title:"Reports",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Reports show step-level results with screenshots, error messages, Lighthouse scores (Audit suites), and visual regression baselines."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Report Features"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Per-step pass/fail status and error details"}),n.jsx("li",{children:"Screenshot filmstrip — click any thumbnail to enlarge"}),n.jsx("li",{children:"Execution timeline (Gantt view) per case"}),n.jsx("li",{children:"Visual baseline comparison with diff overlay"}),n.jsx("li",{children:"Allure integration for full HTML reports"})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Lighthouse Results (Audit Suites)"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["For Audit suite cases with Lighthouse data, three tab buttons appear on the case row: ",n.jsx("strong",{children:"⚡ Speed"})," (Performance), ",n.jsx("strong",{children:"♿ A11y"})," (Accessibility), and ",n.jsx("strong",{children:"🔍 SEO"}),". Case rows are highlighted red when any score is Poor (< 50)."]}),n.jsxs("div",{className:"flex gap-4 text-sm mt-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90+)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (< 50) — case FAILS"]})]}),n.jsx("p",{className:"text-sm text-content-secondary mt-1",children:"Allure reports for Audit cases include three separate HTML attachments: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."})]})},{id:"self-healing",title:"Self-Healing",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Self-healing automatically fixes broken selectors when UI changes cause test failures. Failed steps are re-generated using AI with updated selectors."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Max Level"})," — Healing aggressiveness (1–5)"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Daily Budget"})," — Max AI calls per day for healing"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Auto PR"})," — Automatically open a Git PR for healed steps"]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Healed Steps"}),n.jsx("p",{className:"text-sm text-content-secondary",children:'Steps that were healed show an amber "healed" badge in the case editor. View the full healing log in the Self-Healing page.'})]})},{id:"variables",title:"Variables",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Variables let you inject dynamic data into step instructions using ",n.jsx("code",{className:"text-accent",children:"{{variableName}}"})," tokens."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Types of Variables"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Static"})," — Fixed string values (e.g. credentials)"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Environment"})," — Per-environment overrides"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Faker"})," — Randomly generated test data (e.g. fake email)"]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Dynamic Data Picker"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Click the data picker icon next to the step input to insert variables, faker tokens, or environment values at the cursor position."})]})},{id:"git-control",title:"Git Control Center",category:"Core Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"The Git Control Center provides a visual interface for all Git operations — commit, push, pull, branch switching, and conflict resolution."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Operations"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Commit"})," — Stage and commit all changes with a message"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"AI Message"})," — Generate a commit message using AI"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Full Sync"})," — Commit + push in one click"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Conflict Resolution"})," — Visual diff and AI-assisted merge"]})]})]})},{id:"bulk-actions",title:"Bulk Actions",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Select multiple test cases and perform batch operations including delete and move-to-suite."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"How to Use"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Click the checkbox to the left of any test case row."}),n.jsxs("li",{children:["Hold ",n.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"Shift"})," and click another row to select a range."]}),n.jsx("li",{children:"The Bulk Action Bar appears at the bottom of the screen."}),n.jsxs("li",{children:["Choose ",n.jsx("strong",{children:"Delete"})," or ",n.jsx("strong",{children:"Move to Suite"}),"."]})]})]})},{id:"flakiness-tracker",title:"Flakiness Tracker",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"The Flakiness Tracker analyzes the last 20 runs for each test case and flags cases that intermittently pass and fail."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Flaky Badge"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Cases with a pass rate between 0% and 100% (and at least 3 runs) show an amber ",n.jsx("strong",{children:"~flaky"})," badge in the case list. Hover to see the exact pass rate."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Thresholds"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"A case is considered flaky when it has at least 3 recorded runs and its historical pass rate is between 1% and 99%."})]})},{id:"step-library",title:"Step Library",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"The Step Library stores reusable step templates that can be inserted into any test case with a single click."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Managing the Library"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",n.jsx("strong",{children:"Step Library"})," in the sidebar. Add steps with a name, instruction, and optional tags. Library steps are stored in ",n.jsx("code",{className:"text-accent",children:"tests/.step-library.json"}),"."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Inserting Steps"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case, click the ",n.jsx("strong",{children:"Library"})," button in the top-right of the steps area. Search for a step template and click ",n.jsx("strong",{children:"Insert"})," to add it to the current case."]})]})},{id:"environment-profiles",title:"Environment Profiles",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Environment Profiles let you save and switch between different test configurations (URL, browsers, environment) without manually editing settings."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating Profiles"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",n.jsx("strong",{children:"Settings → Environment Profiles"})," and click ",n.jsx("strong",{children:"Add Profile"}),". Enter a name, then configure the profile in the list."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Switching Profiles"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"The profile picker appears in the top bar. Click a profile name to instantly apply it, overriding the active environment and base URL for the next run."})]})},{id:"mcp-integration",title:"MCP Integration",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["MCP (Model Context Protocol) integration connects the AI code generator to a real Playwright browser via the official ",n.jsx("code",{className:"text-accent",children:"@playwright/mcp"})," server. Instead of guessing selectors blindly, the AI sees actual page elements through accessibility snapshots — boosting code generation accuracy from ~50-70% to ~90-95%."]}),n.jsxs("div",{className:"rounded-lg bg-purple-50 border border-purple-200 px-4 py-3 text-sm text-purple-800",children:[n.jsx("strong",{children:"Enabled by default"})," — MCP is ON for code generation and OFF for test execution. Your existing tests and CI/CD pipelines are unaffected."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["When you click ",n.jsx("strong",{children:"Generate Code"}),", the SmartRouter launches a headless Playwright browser via MCP."]}),n.jsxs("li",{children:["The browser navigates to your app's URL and takes an ",n.jsx("strong",{children:"accessibility snapshot"})," — a structured tree of all interactive elements (buttons, inputs, links, etc.)."]}),n.jsx("li",{children:"The snapshot is fed to the AI alongside the step instruction, so the AI sees exact element roles, names, and attributes."}),n.jsx("li",{children:"The AI generates Playwright code using real selectors from the live page — no guessing."})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Generation Strategies"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Strategy"}),n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Toggle"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),n.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["Snapshot-Driven","Enable MCP","AI sees live accessibility snapshot during generation. Zero overhead for cached/template steps."],["Act-then-Script","Act-then-script","AI plans MCP tool actions → executes them on the real browser → converts successful actions to Playwright code. Near-100% accuracy but higher latency."],["Proactive Healing","Proactive healing","Before a test run, MCP takes a fresh snapshot and validates every selector in generated code against the live page. Missing elements are flagged with suggestions."]].map(([e,t,s])=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-1.5 pr-4 font-medium text-content",children:e}),n.jsx("td",{className:"py-1.5 pr-4 font-mono text-accent text-[10px]",children:t}),n.jsx("td",{className:"py-1.5",children:s})]},e))})]})}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Settings"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Go to ",n.jsx("strong",{children:"Settings → MCP Integration"})," to configure:"]}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Enable MCP"})," — Master switch (ON by default). When off, falls back to blind generation."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Headless mode"})," — Run the MCP browser without a visible window (ON by default)."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Act-then-script"})," — Two-phase generation: execute first, then convert to code (OFF by default)."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Proactive healing"})," — Pre-run selector validation against the live page (OFF by default)."]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Fallback Behavior"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Every MCP call is wrapped in a silent try/catch. If the MCP server crashes, the browser fails to launch, or a snapshot times out, the system ",n.jsx("strong",{children:"automatically falls back to blind generation"})," — exactly how it worked before MCP. No test run will ever fail because of MCP."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Performance Impact"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Template steps (~60%)"})," — Zero MCP overhead (bypassed entirely)"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Cached steps (~20%)"})," — Zero MCP overhead (bypassed entirely)"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"AI-generated steps (~20%)"})," — +2-5s first page load, <500ms for subsequent snapshots on the same page"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Test execution"})," — Zero impact (MCP is never used during runs)"]})]})]})},{id:"per-step-retry",title:"Per-Step Retry",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Individual steps can be configured to retry on failure, independent of the global retry setting."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Configuration"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["In the case editor, each step row shows a small ",n.jsx("strong",{children:"×"})," number input next to the timeout. Enter a value from 0–5 to set the retry count for that step. The step-level value overrides the global setting."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Retry Behavior"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"On failure, the step is re-executed up to N times. If any attempt passes, the step is marked as passed. All retry attempts are logged in the step result."})]})},{id:"case-hooks",title:"Case-Level Hooks",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Before and After hooks run additional steps around a test case's main step sequence."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Hooks Tab"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Open a test case and click the ",n.jsx("strong",{children:"Hooks"})," tab (next to Steps). Add before-hooks that run before any steps, and after-hooks that always run even if steps fail."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Use Cases"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Before hook: Login, seed test data, navigate to start URL"}),n.jsx("li",{children:"After hook: Logout, clean up created records, capture diagnostics"})]})]})},{id:"network-mocking",title:"Network Mocking",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Mock steps intercept HTTP requests matching a URL pattern and return a custom response — without touching the real backend."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Creating a Mock Step"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["In the case editor, change the step type dropdown to ",n.jsx("strong",{children:"Mock"}),"."]}),n.jsx("li",{children:"Expand the step to reveal the Mock Route fields."}),n.jsxs("li",{children:["Enter the URL pattern (e.g. ",n.jsx("code",{className:"text-accent",children:"**/api/users"}),"), status code, and JSON body."]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Behavior"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"The mock route is active for the duration of that step and is removed immediately after. Subsequent steps run against the real network."})]})},{id:"audit-lighthouse",title:"Audit & Lighthouse",category:"New Features",content:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Audit suites"})," run full Playwright automation and trigger Google Lighthouse at steps explicitly marked with the ",n.jsx("strong",{children:"⚡ Audit"})," flag. Three categories are measured: Performance, Accessibility, and SEO."]}),n.jsxs("div",{className:"rounded-lg bg-violet-50 border border-violet-200 px-4 py-3 text-sm text-violet-800",children:[n.jsx("strong",{children:"Chromium only"}),' — Lighthouse uses Chrome DevTools Protocol (CDP). Firefox and WebKit runs will show a "not available" notice instead.']}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["Create an ",n.jsx("strong",{children:"Audit"})," suite in the Test Editor."]}),n.jsxs("li",{children:["Mark one or more steps with the ",n.jsx("strong",{children:"⚡ Audit"})," button to designate Lighthouse checkpoints."]}),n.jsxs("li",{children:["In the ",n.jsx("strong",{children:"Non-Functional Checks"})," section on each case, tick ⚡ Performance, ♿ Accessibility, and/or 🔍 SEO."]}),n.jsxs("li",{children:["Run the suite — Lighthouse audits ",n.jsx("code",{className:"text-accent",children:"page.url()"})," at each marked step."]}),n.jsx("li",{children:"Results are saved to the run report with color-coded scores."})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Collected Metrics"}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Performance Score",range:"0–100",good:"≥ 90",desc:"Overall Lighthouse score"},{label:"FCP",range:"ms",good:"< 1.8s",desc:"First Contentful Paint"},{label:"LCP",range:"ms",good:"< 2.5s",desc:"Largest Contentful Paint"},{label:"CLS",range:"score",good:"< 0.1",desc:"Cumulative Layout Shift"},{label:"TTFB",range:"ms",good:"< 800ms",desc:"Time to First Byte"},{label:"TBT",range:"ms",good:"< 200ms",desc:"Total Blocking Time"},{label:"Speed Index",range:"ms",good:"< 3.4s",desc:"Visual load speed"},{label:"TTI",range:"ms",good:"< 3.8s",desc:"Time to Interactive"},{label:"INP",range:"ms",good:"< 200ms",desc:"Interaction to Next Paint"}].map(e=>n.jsxs("div",{className:"rounded-lg border border-border bg-surface-inset/40 px-3 py-2",children:[n.jsx("p",{className:"text-xs font-bold text-content",children:e.label}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:e.desc}),n.jsxs("p",{className:"text-[10px] text-emerald-600 font-medium mt-0.5",children:["Good: ",e.good]})]},e.label))}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Viewing in Reports"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Open the Reports page and expand a completed Audit run."}),n.jsxs("li",{children:["Case rows with Lighthouse data show three tab buttons: ",n.jsx("strong",{children:"⚡ Speed"}),", ",n.jsx("strong",{children:"♿ A11y"}),", ",n.jsx("strong",{children:"🔍 SEO"}),"."]}),n.jsx("li",{children:"Click a tab to view the score and metrics for that category."}),n.jsx("li",{children:"Case rows are highlighted red when any score is Poor (< 50)."})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Allure Attachments"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Each Audit case produces three separate HTML attachments in the Allure report: Performance Report, Accessibility Report, and SEO Report. The Allure test status is set to FAILED if any score is below 50."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Color Thresholds"}),n.jsxs("div",{className:"flex gap-4 text-sm",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500 inline-block"})," Good (90–100)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-amber-400 inline-block"})," Needs Work (50–89)"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500 inline-block"})," Poor (0–49) — test FAILS"]})]})]})},{id:"visual-regression",title:"Visual Regression",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Visual regression testing compares step screenshots against saved baselines to detect unintended UI changes."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Setting a Baseline"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsx("li",{children:"Run a test case until steps have screenshots."}),n.jsx("li",{children:"Open the Reports page and expand a step."}),n.jsxs("li",{children:["Click ",n.jsx("strong",{children:"Set as Baseline"})," in the Baseline Panel."]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Comparing"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["After setting a baseline, subsequent runs show both the current screenshot and the baseline side-by-side. Baselines are stored in ",n.jsx("code",{className:"text-accent",children:"results/baselines/"}),"."]})]})},{id:"test-impact",title:"Test Impact Analysis",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Test Impact Analysis identifies which test cases might be affected by the current set of uncommitted file changes."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Running Analysis"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["Open the ",n.jsx("strong",{children:"Git Control Center"}),"."]}),n.jsxs("li",{children:["Expand the ",n.jsx("strong",{children:"Test Impact Analysis"})," section."]}),n.jsxs("li",{children:["Click ",n.jsx("strong",{children:"Analyze Impact"}),"."]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"How It Works"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"Changed file names and paths are compared against test case names, step instructions, and suite names. Matched cases are listed with the matched file as the reason."})]})},{id:"device-emulation",title:"Device Emulation",category:"New Features",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Device Emulation lets you test your application as it appears on real mobile phones and tablets, using Playwright's built-in device descriptor registry. No manual viewport tuning needed — the correct user-agent, device pixel ratio, viewport, touch events, and ",n.jsx("code",{className:"text-[10px] bg-surface-inset px-1 py-0.5 rounded",children:"isMobile"})," flag are all applied automatically."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using in Studio (Run Config)"}),n.jsxs("ol",{className:"list-decimal list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:["Go to the ",n.jsx("strong",{children:"Run Config"})," page."]}),n.jsxs("li",{children:["Find the ",n.jsx("strong",{children:"Device Emulation"})," card below the Browsers card."]}),n.jsxs("li",{children:["Use the tabs to filter by ",n.jsx("strong",{children:"All / Desktop / Mobile / Tablet"}),"."]}),n.jsx("li",{children:"Click a device card to select it — it highlights in teal."}),n.jsxs("li",{children:["Click ",n.jsx("strong",{children:"Start Run"})," — the device is applied to every case in the run."]}),n.jsxs("li",{children:["To clear, click the ",n.jsx("strong",{children:"×"})," in the card header or select ",n.jsx("strong",{children:"No Emulation"}),"."]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Using from CLI / CI"}),n.jsx("pre",{className:"bg-[#1e1e2e] text-[#cdd6f4] text-[10px] font-mono p-3 rounded-lg overflow-x-auto leading-relaxed",children:`# Mobile
|
|
811
|
+
npx assuremind run --all --device "iPhone 15 Pro" --browser chromium --ci
|
|
812
|
+
npx assuremind run --tag smoke --device "Pixel 7" --browser chromium --ci
|
|
813
|
+
|
|
814
|
+
# Tablet
|
|
815
|
+
npx assuremind run --all --device "iPad Pro 11" --browser webkit --ci
|
|
816
|
+
npx assuremind run --suite "Mobile" --device "Galaxy Tab S4" --browser chromium --ci
|
|
817
|
+
|
|
818
|
+
# Permanent default in autotest.config.ts
|
|
819
|
+
device: 'iPhone 15 Pro'`}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Devices"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Device"}),n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Category"}),n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Viewport"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Best Browser"})]})}),n.jsx("tbody",{className:"text-content-secondary divide-y divide-border/50",children:[["iPhone 15 Pro","Mobile","393×852","Chromium / WebKit"],["iPhone 15","Mobile","390×844","Chromium / WebKit"],["iPhone 14","Mobile","390×844","Chromium / WebKit"],["iPhone SE","Mobile","375×667","Chromium / WebKit"],["Pixel 7","Mobile","412×915","Chromium"],["Pixel 5","Mobile","393×851","Chromium"],["Galaxy S9+","Mobile","320×658","Chromium"],["Galaxy S8","Mobile","360×740","Chromium"],["iPad Pro 11","Tablet","834×1194","WebKit / Chromium"],["iPad (gen 7)","Tablet","810×1080","WebKit / Chromium"],["iPad Mini","Tablet","768×1024","WebKit / Chromium"],["Galaxy Tab S4","Tablet","712×1138","Chromium"]].map(([e,t,s,r])=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-1.5 pr-4 font-mono text-[10px]",children:e}),n.jsx("td",{className:"py-1.5 pr-4",children:t}),n.jsx("td",{className:"py-1.5 pr-4",children:s}),n.jsx("td",{className:"py-1.5",children:r})]},e))})]})}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"In Reports"}),n.jsx("p",{className:"text-sm text-content-secondary",children:"When a run uses device emulation, each case row in Reports shows a teal device badge (📱 phone / tablet icon) with the device name, so you can instantly tell mobile runs from desktop runs."}),n.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-3 py-2 text-[11px] text-amber-700",children:["⚠ Mobile and tablet device descriptors work best with ",n.jsx("strong",{children:"Chromium"}),". Firefox and WebKit do not fully support Playwright's mobile emulation flags (touch events, mobile UA)."]})]})},{id:"keyboard-shortcuts",title:"Keyboard Shortcuts",category:"Reference",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Press ",n.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px]",children:"?"})," anywhere in the app to open the shortcuts modal."]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Shortcut"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Action"})]})}),n.jsx("tbody",{className:"text-content-secondary",children:[["?","Show keyboard shortcuts"],["Ctrl+K / Cmd+K","Open search palette"],["Escape","Close modal / dialog"],["Enter (step input)","Add new step"],["Enter (case name)","Save case"],["Shift+Click (case row)","Range-select cases"]].map(([e,t])=>n.jsxs("tr",{className:"border-b border-border/50",children:[n.jsx("td",{className:"py-1.5 pr-4",children:n.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-surface-inset border border-border text-[10px] font-mono",children:e})}),n.jsx("td",{className:"py-1.5",children:t})]},e))})]})})]})},{id:"data-driven",title:"Data-Driven Testing",category:"Reference",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Test cases support data-driven execution — running the same case multiple times with different input data."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Data Sources"}),n.jsxs("ul",{className:"list-disc list-inside text-sm text-content-secondary space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Inline JSON"})," — Enter an array of objects directly in the editor"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"JSON File"})," — Reference a ",n.jsx("code",{className:"text-accent",children:".json"})," file in your project"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"CSV File"})," — Reference a ",n.jsx("code",{className:"text-accent",children:".csv"})," file with headers"]})]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Accessing Data"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Use ",n.jsx("code",{className:"text-accent",children:"{{row.fieldName}}"})," in step instructions to reference data columns. The case runs once per row."]})]})},{id:"faker-data",title:"Faker / Dynamic Data",category:"Reference",content:n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{children:"Faker tokens generate random, realistic test data at runtime. Use them to avoid hardcoded values in test steps."}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Available Tokens"}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:["faker.email","faker.name","faker.phone","faker.company","faker.uuid","faker.date","faker.number","faker.word"].map(e=>n.jsx("code",{className:"text-[10px] bg-surface-inset rounded px-2 py-0.5 border border-border text-accent font-mono",children:`{{${e}}}`},e))}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Usage"}),n.jsxs("p",{className:"text-sm text-content-secondary",children:["Type the token directly in a step instruction, or use the ",n.jsx("strong",{children:"Dynamic Data Picker"})," button next to the step input to insert tokens at the cursor position."]})]})},{id:"api-reference",title:"API Reference",category:"Reference",content:n.jsxs("div",{className:"space-y-3",children:[n.jsxs("p",{children:["Assuremind exposes a REST API at ",n.jsx("code",{className:"text-accent",children:"http://localhost:4000/api"})," for programmatic access."]}),n.jsx("h4",{className:"text-sm font-semibold text-content",children:"Key Endpoints"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-border",children:[n.jsx("th",{className:"text-left py-1.5 pr-4 font-semibold text-content-secondary",children:"Endpoint"}),n.jsx("th",{className:"text-left py-1.5 font-semibold text-content-secondary",children:"Description"})]})}),n.jsx("tbody",{className:"text-content-secondary font-mono",children:[["GET /suites","List all test suites"],["POST /suites","Create a suite"],["GET /suites/:id/cases","List cases in a suite"],["POST /suites/:id/cases","Create a test case"],["POST /run","Start a test run"],["GET /results","List run results"],["GET /flakiness","Get flakiness report"],["GET /step-library","List library steps"],["GET /git/impact","Run test impact analysis"]].map(([e,t])=>n.jsxs("tr",{className:"border-b border-border/50",children:[n.jsx("td",{className:"py-1.5 pr-4 text-accent text-[10px]",children:e}),n.jsx("td",{className:"py-1.5 font-sans",children:t})]},e))})]})})]})}],X5=Array.from(new Set(bi.map(e=>e.category)));function Z5(){const[e,t]=m.useState(bi[0].id),s=m.useRef({}),r=m.useRef(null);m.useEffect(()=>{const i=[];return bi.forEach(l=>{const o=s.current[l.id];if(!o)return;const c=new IntersectionObserver(([d])=>{d.isIntersecting&&t(l.id)},{root:r.current,rootMargin:"-20% 0px -60% 0px",threshold:0});c.observe(o),i.push(c)}),()=>i.forEach(l=>l.disconnect())},[]);const a=i=>{const l=s.current[i];if(l&&r.current){const o=r.current,c=l.offsetTop-24;o.scrollTo({top:c,behavior:"smooth"})}};return n.jsxs("div",{className:"flex h-full overflow-hidden bg-background",children:[n.jsx("aside",{className:"w-56 flex-shrink-0 border-r border-border bg-surface overflow-y-auto hidden lg:block",children:n.jsxs("div",{className:"px-4 py-4",children:[n.jsx("h2",{className:"text-[10px] font-bold text-content-tertiary uppercase tracking-widest mb-3",children:"Documentation"}),n.jsx("nav",{className:"space-y-0.5",children:X5.map(i=>n.jsxs("div",{className:"mb-3",children:[n.jsx("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest px-2 py-1",children:i}),bi.filter(l=>l.category===i).map(l=>n.jsx("button",{type:"button",onClick:()=>a(l.id),className:C("w-full text-left px-2 py-1.5 rounded-lg text-xs transition-colors",e===l.id?"bg-accent/8 text-accent font-semibold":"text-content-secondary hover:text-content hover:bg-surface-inset"),children:l.title},l.id))]},i))})]})}),n.jsx("div",{ref:r,className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"max-w-2xl mx-auto px-6 py-6 space-y-0",children:bi.map(i=>n.jsxs("section",{id:i.id,ref:l=>{l&&(s.current[i.id]=l)},className:"mb-10 scroll-mt-6",children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:i.category}),n.jsx("h2",{className:"text-base font-bold text-content mt-0.5",children:i.title})]}),n.jsx("div",{className:"text-sm text-content-secondary leading-relaxed",children:i.content}),n.jsx("div",{className:"mt-8 border-b border-border"})]},i.id))})})]})}function eS(e){const t=new Date(e),s=Math.floor((Date.now()-t.getTime())/1e3);if(s<60)return`${s}s ago`;const r=Math.floor(s/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const tS={M:{icon:$g,color:"text-blue-500",bg:"bg-blue-50",ring:"ring-blue-200",label:"Modified"},A:{icon:Ug,color:"text-emerald-500",bg:"bg-emerald-50",ring:"ring-emerald-200",label:"Added"},D:{icon:_g,color:"text-red-500",bg:"bg-red-50",ring:"ring-red-200",label:"Deleted"},"?":{icon:Bg,color:"text-content-tertiary",bg:"bg-surface-inset",ring:"ring-border",label:"Untracked"}};function nS(){const{operationInProgress:e,logSteps:t,hasConflict:s,conflictFiles:r}=Sc(),{data:a,isLoading:i}=fm(),{data:l}=ny(),{data:o,refetch:c}=sy(20),d=ry(),x=ay(),f=iy(),g=ly(),b=oy(),y=cy(),[j,k]=m.useState(""),[h,u]=m.useState(!0),[p,v]=m.useState(!1),[w,N]=m.useState(!0),[P,E]=m.useState(!1),[_,D]=m.useState(!1),{data:G,isFetching:J,refetch:se}=ke({queryKey:["git-impact"],queryFn:()=>Ke.impact(),enabled:_,staleTime:0}),M=m.useRef(null),F=!!e,ee=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);m.useEffect(()=>{var z;(z=M.current)==null||z.scrollIntoView({behavior:"smooth"})},[t.length]);const ae=()=>{j.trim()?b.mutate(j):y.mutate(void 0,{onSuccess:z=>{k(z.message),b.mutate(z.message)}})};return n.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-surface-inset/30",children:n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsxs("div",{className:"max-w-5xl mx-auto px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3 flex items-center gap-3 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:n.jsx(Pr,{size:17,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-sm font-bold text-content",children:"Git Control Center"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Commit, push, pull and resolve conflicts"})]})]}),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"relative flex-shrink-0",children:[n.jsxs("button",{onClick:()=>v(!p),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[n.jsx(Pr,{size:12,className:"text-accent flex-shrink-0"}),n.jsx("span",{className:"max-w-[160px] truncate",children:(a==null?void 0:a.branch)??"..."}),n.jsx(Tt,{size:11,className:C("transition-transform text-content-tertiary",p&&"rotate-180")})]}),p&&l&&n.jsxs("div",{className:"absolute top-full right-0 mt-1 w-56 bg-surface border border-border rounded-xl shadow-lg z-20 max-h-56 overflow-y-auto",children:[n.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),l.all.map(z=>n.jsx("button",{onClick:()=>{v(!1),z!==(a==null?void 0:a.branch)&&d.mutate(z)},className:C("w-full text-left px-3 py-1.5 text-xs hover:bg-surface-inset transition-colors",z===(a==null?void 0:a.branch)&&"font-semibold text-accent bg-accent/5"),children:z},z)),l.remote.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),l.remote.map(z=>n.jsx("button",{onClick:()=>{v(!1),d.mutate(z.replace(/^origin\//,""))},className:"w-full text-left px-3 py-1.5 text-xs text-content-secondary hover:bg-surface-inset",children:z},z))]})]})]}),n.jsxs("span",{className:C("inline-flex items-center gap-1.5 text-[10px] px-2.5 py-1 rounded-lg font-semibold ring-1",a!=null&&a.conflicted.length?"bg-red-50 text-red-600 ring-red-200":a!=null&&a.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[n.jsx("span",{className:C("w-1.5 h-1.5 rounded-full",a!=null&&a.conflicted.length?"bg-red-500":a!=null&&a.isClean?"bg-emerald-500":"bg-amber-500")}),i?"Loading…":a!=null&&a.conflicted.length?"Conflict":a!=null&&a.isClean?"Clean":`${ee} pending`]}),a&&(a.ahead>0||a.behind>0)&&n.jsxs("span",{className:"text-[10px] text-content-tertiary font-mono tabular-nums",children:[a.ahead>0&&n.jsxs("span",{className:"text-emerald-600",children:["↑",a.ahead]}),a.ahead>0&&a.behind>0&&" ",a.behind>0&&n.jsxs("span",{className:"text-amber-600",children:["↓",a.behind]})]})]}),n.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset/40 border-t border-border flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(pa,{size:11,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),n.jsx("input",{type:"text",value:j,onChange:z=>k(z.target.value),placeholder:"Commit message…",className:"w-full text-xs border border-border rounded-lg pl-7 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface placeholder-content-tertiary",onKeyDown:z=>{z.key==="Enter"&&j.trim()&&x.mutate(j)}})]}),n.jsx("button",{onClick:()=>y.mutate(void 0,{onSuccess:z=>k(z.message)}),disabled:y.isPending,title:"AI commit message",className:"p-1.5 rounded-lg border border-border bg-surface text-violet-500 hover:bg-violet-50 hover:border-violet-200 transition-colors flex-shrink-0 disabled:opacity-50",children:y.isPending?n.jsx(ce,{size:12,className:"animate-spin"}):n.jsx(Ot,{size:12})}),n.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-content-tertiary cursor-pointer select-none flex-shrink-0",children:[n.jsx("input",{type:"checkbox",checked:h,onChange:z=>u(z.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Rebase"]}),n.jsx("div",{className:"w-px h-5 bg-border"}),n.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[n.jsx(ql,{icon:n.jsx(pa,{size:11}),label:"Commit",onClick:()=>j.trim()&&x.mutate(j),disabled:F||!j.trim(),loading:e==="commit"}),n.jsx(ql,{icon:n.jsx(Og,{size:11}),label:"Push",onClick:()=>g.mutate(),disabled:F,loading:e==="push"}),n.jsx(ql,{icon:n.jsx(Rg,{size:11}),label:"Pull",onClick:()=>f.mutate(h),disabled:F,loading:e==="pull"}),n.jsx(ql,{icon:n.jsx(Qg,{size:11}),label:"Full Sync",onClick:ae,disabled:F,loading:e==="full-sync",primary:!0})]})]})]}),s&&n.jsx(sS,{conflictFiles:r}),!s&&n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3",children:[n.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),ee>0&&n.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:ee})]}),ee>0&&n.jsx("div",{className:"flex items-center gap-2",children:[{type:"M",count:(a==null?void 0:a.modified.length)??0,color:"text-blue-500"},{type:"A",count:(a==null?void 0:a.added.length)??0,color:"text-emerald-500"},{type:"D",count:(a==null?void 0:a.deleted.length)??0,color:"text-red-500"},{type:"?",count:(a==null?void 0:a.untracked.length)??0,color:"text-content-tertiary"}].filter(z=>z.count>0).map(z=>n.jsxs("span",{className:C("text-[9px] font-mono font-bold",z.color),children:[z.type,z.count]},z.type))})]}),n.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:ee===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[n.jsx(He,{size:18,className:"text-emerald-400"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):n.jsxs("div",{className:"px-1.5 py-1",children:[a==null?void 0:a.modified.map(z=>n.jsx(Hl,{file:z,type:"M"},`M-${z}`)),a==null?void 0:a.added.map(z=>n.jsx(Hl,{file:z,type:"A"},`A-${z}`)),a==null?void 0:a.deleted.map(z=>n.jsx(Hl,{file:z,type:"D"},`D-${z}`)),a==null?void 0:a.untracked.map(z=>n.jsx(Hl,{file:z,type:"?"},`?-${z}`))]})})]}),n.jsxs("div",{className:"lg:col-span-3 rounded-xl border border-border bg-surface overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[n.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Commit History"}),n.jsx("button",{onClick:()=>c(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:n.jsx(um,{size:11})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto max-h-[400px]",children:!o||o.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center py-10 gap-1.5",children:[n.jsx(pa,{size:18,className:"text-content-tertiary/40"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):n.jsxs("div",{className:"relative px-3.5 py-2",children:[n.jsx("div",{className:"absolute left-[22px] top-4 bottom-4 w-px bg-border"}),n.jsx("div",{className:"space-y-0.5",children:o.map((z,K)=>n.jsxs("div",{className:"flex items-start gap-2.5 relative group py-1.5 rounded-lg hover:bg-surface-inset/50 px-1 -mx-1 transition-colors",children:[n.jsx("div",{className:C("mt-1 w-3 h-3 rounded-full border-2 flex-shrink-0 z-[1]",K===0?"border-accent bg-accent/20":"border-border bg-surface")}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-content font-medium leading-snug truncate",title:z.message,children:z.message}),n.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-content-tertiary mt-0.5",children:[n.jsx("code",{className:"font-mono text-accent/70 text-[9px]",children:z.shortHash}),n.jsxs("span",{className:"flex items-center gap-0.5",children:[n.jsx(Xg,{size:8})," ",z.author]}),n.jsxs("span",{className:"flex items-center gap-0.5",children:[n.jsx(Or,{size:8})," ",eS(z.date)]})]})]})]},z.hash))})]})})]})]}),n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("button",{onClick:()=>E(!P),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Be,{size:12,className:"text-amber-500"}),n.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Test Impact Analysis"}),G&&G.impactedCases.length>0&&n.jsxs("span",{className:"text-[9px] font-bold text-amber-600 bg-amber-50 px-1.5 py-px rounded ring-1 ring-amber-200",children:[G.impactedCases.length," impacted"]})]}),n.jsx(Tt,{size:11,className:C("text-content-tertiary transition-transform",P&&"rotate-180")})]}),P&&n.jsxs("div",{className:"border-t border-border px-3.5 py-3",children:[n.jsx("p",{className:"text-[10px] text-content-tertiary mb-3",children:"Finds test cases that may be affected by uncommitted file changes."}),n.jsxs("button",{onClick:()=>{D(!0),setTimeout(()=>se(),0)},disabled:J,className:"flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg bg-amber-500 text-white hover:bg-amber-600 transition-colors disabled:opacity-50 mb-3",children:[J?n.jsx(ce,{size:12,className:"animate-spin"}):n.jsx(Be,{size:12}),"Analyze Impact"]}),G&&n.jsxs(n.Fragment,{children:[G.changedFiles.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Changed Files (",G.changedFiles.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-1",children:G.changedFiles.map(z=>n.jsx("span",{className:"text-[9px] font-mono bg-surface-inset px-2 py-0.5 rounded border border-border text-content-secondary",children:z},z))})]}),G.impactedCases.length===0?n.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-emerald-600 bg-emerald-50 rounded-lg px-3 py-2",children:[n.jsx(He,{size:12})," No test cases appear to be impacted by current changes."]}):n.jsxs("div",{children:[n.jsxs("p",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest mb-1",children:["Impacted Cases (",G.impactedCases.length,")"]}),n.jsx("div",{className:"space-y-1",children:G.impactedCases.map(z=>n.jsxs("div",{className:"flex items-start gap-2 text-[10px] bg-amber-50 rounded-lg px-3 py-2 border border-amber-200",children:[n.jsx(Yt,{size:11,className:"text-amber-500 mt-px flex-shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"font-semibold text-content",children:z.caseName}),n.jsxs("p",{className:"text-content-tertiary",children:[z.suiteName," · ",z.reason]})]})]},z.caseId))})]})]})]})]}),t.length>0&&n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("button",{onClick:()=>N(!w),className:"w-full px-3.5 py-2 border-b border-border flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wc,{size:12,className:"text-content-tertiary"}),n.jsx("h2",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Execution Log"}),n.jsxs("span",{className:"text-[9px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:[t.length," step",t.length!==1?"s":""]}),e&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] text-blue-500 font-medium",children:[n.jsx(ce,{size:9,className:"animate-spin"})," ",e]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:z=>{z.stopPropagation(),Pe.clearLogs()},className:"text-[9px] text-content-tertiary hover:text-red-500 px-1.5 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),n.jsx(Tt,{size:11,className:C("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&n.jsx("div",{className:"px-3.5 py-2 max-h-[200px] overflow-y-auto bg-surface-inset/20",children:n.jsxs("div",{className:"space-y-1",children:[t.map((z,K)=>n.jsxs("div",{className:"flex items-start gap-2 text-[10px] py-0.5",children:[z.status==="running"&&n.jsx(ce,{size:11,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),z.status==="done"&&n.jsx(He,{size:11,className:"mt-px text-emerald-500 flex-shrink-0"}),z.status==="error"&&n.jsx(ut,{size:11,className:"mt-px text-red-500 flex-shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:C("font-medium",z.status==="error"?"text-red-600":"text-content-secondary"),children:z.step}),z.message&&n.jsxs("span",{className:C("ml-1.5 font-normal",z.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",z.message]})]})]},K)),n.jsx("div",{ref:M})]})})]})]})})})}function sS({conflictFiles:e}){const t=dy(),s=uy(),r=xy(),a=my(),[i,l]=m.useState({}),o=h=>i[h]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},c=(h,u)=>l(p=>({...p,[h]:{...o(h),...u}})),d=async h=>{c(h,{loading:!0});try{const u=await Ke.conflictContent(h);c(h,{ours:u.ours,theirs:u.theirs,merged:u.ours,loading:!1})}catch{c(h,{ours:"(error)",theirs:"(error)",loading:!1})}},x=async h=>{let p=o(h).ours;p||(p=(await Ke.conflictContent(h)).ours),c(h,{loading:!0}),t.mutate({filePath:h,content:p},{onSuccess:()=>c(h,{resolved:!0,loading:!1})})},f=async h=>{let p=o(h).theirs;p||(p=(await Ke.conflictContent(h)).theirs),c(h,{loading:!0}),t.mutate({filePath:h,content:p},{onSuccess:()=>c(h,{resolved:!0,loading:!1})})},g=async h=>{let u=o(h);u.ours||(await d(h),u=o(h)),c(h,{mode:"ai",loading:!0}),s.mutate({filePath:h,ours:u.ours,theirs:u.theirs},{onSuccess:p=>c(h,{merged:p.resolved,loading:!1}),onError:()=>c(h,{loading:!1})})},b=async h=>{o(h).ours||await d(h),c(h,{mode:"manual"})},y=h=>{const u=o(h);c(h,{loading:!0}),t.mutate({filePath:h,content:u.merged},{onSuccess:()=>c(h,{resolved:!0,loading:!1,mode:"none"})})},j=e.every(h=>o(h).resolved),k=e.filter(h=>o(h).resolved).length;return n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50/80 overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg bg-red-100 flex items-center justify-center flex-shrink-0",children:n.jsx(Yt,{size:15,className:"text-red-500"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xs font-bold text-red-800",children:"Merge Conflict Detected"}),n.jsxs("p",{className:"text-[10px] text-red-600",children:[k,"/",e.length," file",e.length>1?"s":""," resolved"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsxs("button",{onClick:()=>a.mutate(),disabled:a.isPending,className:"flex items-center gap-1 px-2.5 py-1.5 text-[10px] font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[n.jsx(jc,{size:10}),a.isPending?"Aborting…":"Abort"]}),n.jsxs("button",{onClick:()=>r.mutate(),disabled:!j||r.isPending,className:C("flex items-center gap-1 px-3 py-1.5 text-[10px] font-semibold rounded-lg transition-colors",j?"bg-emerald-600 hover:bg-emerald-700 text-white shadow-sm shadow-emerald-500/20":"bg-surface-inset text-content-tertiary cursor-not-allowed ring-1 ring-border"),children:[n.jsx(He,{size:10}),r.isPending?"Continuing…":"Continue Rebase"]})]})]}),n.jsx("div",{className:"h-0.5 bg-red-100",children:n.jsx("div",{className:"h-full bg-emerald-500 transition-all",style:{width:`${e.length>0?k/e.length*100:0}%`}})})]}),e.map(h=>{const u=o(h);return n.jsxs("div",{className:"rounded-xl border border-border bg-surface overflow-hidden",children:[n.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Hg,{size:13,className:u.resolved?"text-emerald-500":"text-amber-500"}),n.jsx("code",{className:"text-xs font-mono text-content-secondary",children:h}),u.resolved&&n.jsxs("span",{className:"text-[9px] text-emerald-600 bg-emerald-50 px-1.5 py-0.5 rounded-md flex items-center gap-0.5 font-semibold ring-1 ring-emerald-200",children:[n.jsx(He,{size:9})," Resolved"]})]}),!u.resolved&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Kl,{label:"Keep Local",onClick:()=>x(h),loading:u.loading&&u.mode==="none"}),n.jsx(Kl,{label:"Accept Incoming",onClick:()=>f(h),loading:u.loading&&u.mode==="none"}),n.jsx(Kl,{label:"Manual",onClick:()=>b(h)}),n.jsx(Kl,{label:"AI Resolve",onClick:()=>g(h),loading:u.loading&&u.mode==="ai",icon:n.jsx(Ot,{size:9}),accent:!0})]})]}),u.mode!=="none"&&!u.resolved&&n.jsx("div",{className:"p-3.5",children:u.loading&&!u.ours?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ce,{size:16,className:"animate-spin text-content-tertiary"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mb-1 block",children:"Local (Ours)"}),n.jsx("textarea",{value:u.ours,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-widest mb-1 block",children:"Incoming (Theirs)"}),n.jsx("textarea",{value:u.theirs,readOnly:!0,rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest mb-1 block",children:"Merged Output (editable)"}),n.jsx("textarea",{value:u.merged,onChange:p=>c(h,{merged:p.target.value}),rows:12,className:"w-full text-[10px] font-mono p-2.5 border border-emerald-200 rounded-lg bg-emerald-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-emerald-300"})]}),n.jsx("div",{className:"flex justify-end mt-2.5",children:n.jsxs("button",{onClick:()=>y(h),disabled:u.loading,className:"flex items-center gap-1 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-[10px] font-semibold rounded-lg transition-colors disabled:opacity-50 shadow-sm shadow-emerald-500/20",children:[u.loading?n.jsx(ce,{size:10,className:"animate-spin"}):n.jsx(He,{size:10}),"Mark as Resolved"]})})]})})]},h)})]})}function Hl({file:e,type:t}){const s=tS[t],r=s.icon;return n.jsxs("div",{className:"flex items-center gap-2 py-1 px-2 rounded-lg hover:bg-surface-inset/60 group transition-colors",children:[n.jsx("div",{className:C("w-5 h-5 rounded flex items-center justify-center flex-shrink-0",s.bg),children:n.jsx(r,{size:10,className:s.color})}),n.jsx("span",{className:C("text-[10px] font-mono truncate flex-1",s.color),title:e,children:e}),n.jsx("span",{className:C("text-[8px] px-1.5 py-px rounded font-medium ring-1",s.bg,s.color,s.ring),children:s.label})]})}function ql({icon:e,label:t,onClick:s,disabled:r,loading:a,primary:i}){return n.jsxs("button",{onClick:s,disabled:r,className:C("flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[10px] font-semibold transition-all",i?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",r&&"opacity-50 cursor-not-allowed",a&&"cursor-wait"),children:[a?n.jsx(ce,{size:11,className:"animate-spin"}):e,t]})}function Kl({label:e,onClick:t,loading:s,icon:r,accent:a}){return n.jsxs("button",{onClick:t,disabled:s,className:C("flex items-center gap-0.5 px-2 py-1 text-[9px] font-medium rounded-lg transition-colors",a?"bg-violet-50 text-violet-600 hover:bg-violet-100 ring-1 ring-violet-200":"bg-surface-inset text-content-secondary hover:bg-surface-inset/80 ring-1 ring-border",s&&"opacity-60 cursor-wait"),children:[s?n.jsx(ce,{size:9,className:"animate-spin"}):r,e]})}function rS(e){const t=new Date(e),s=Math.floor((Date.now()-t.getTime())/1e3);if(s<60)return`${s}s ago`;const r=Math.floor(s/60);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}const aS={M:{icon:$g,color:"text-blue-500",bg:"bg-blue-50",label:"M"},A:{icon:Ug,color:"text-emerald-500",bg:"bg-emerald-50",label:"A"},D:{icon:_g,color:"text-red-500",bg:"bg-red-50",label:"D"},"?":{icon:Bg,color:"text-content-tertiary",bg:"bg-surface-inset",label:"?"}};function iS(){var G,J,se;const{panelOpen:e,operationInProgress:t,logSteps:s,hasConflict:r}=Sc(),{data:a,isLoading:i}=fm(),{data:l}=ny(),{data:o,refetch:c}=sy(15),d=ry(),x=ay(),f=iy(),g=ly(),b=oy(),y=cy(),[j,k]=m.useState(""),[h,u]=m.useState(!0),[p,v]=m.useState(!1),[w,N]=m.useState(!0),P=m.useRef(null),E=!!t,_=((a==null?void 0:a.modified.length)??0)+((a==null?void 0:a.added.length)??0)+((a==null?void 0:a.deleted.length)??0)+((a==null?void 0:a.untracked.length)??0);m.useEffect(()=>{var M;(M=P.current)==null||M.scrollIntoView({behavior:"smooth"})},[s.length]);const D=()=>{j.trim()?b.mutate(j):y.mutate(void 0,{onSuccess:M=>{k(M.message),b.mutate(M.message)}})};return n.jsxs(n.Fragment,{children:[e&&n.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-[1px] transition-opacity",onClick:()=>Pe.closePanel()}),n.jsxs("div",{className:C("fixed top-0 right-0 h-full z-50 w-[400px] max-w-[90vw] bg-surface border-l border-border shadow-2xl","flex flex-col transition-transform duration-300 ease-in-out",e?"translate-x-0":"translate-x-full"),children:[n.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-border bg-surface flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-orange-500 to-rose-600 flex items-center justify-center shadow-sm shadow-orange-500/20",children:n.jsx(Pr,{size:13,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xs font-bold text-content",children:"Git Control"}),n.jsx("p",{className:"text-[9px] text-content-tertiary",children:"Quick operations"})]})]}),n.jsx("button",{onClick:()=>Pe.closePanel(),className:"p-1 rounded-lg hover:bg-surface-inset text-content-tertiary hover:text-content-secondary transition-colors",children:n.jsx(Se,{size:14})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r&&n.jsxs("div",{className:"mx-3 mt-3 px-3 py-2 bg-red-50 border border-red-200 rounded-lg flex items-center gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),n.jsx("span",{className:"text-[10px] text-red-700 font-medium",children:"Merge conflict — open full Git page to resolve"})]}),n.jsx("div",{className:"px-3.5 py-2.5 border-b border-border",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsxs("button",{onClick:()=>v(!p),className:"w-full flex items-center justify-between gap-2 px-2.5 py-1.5 rounded-lg bg-surface-inset hover:bg-surface-inset/80 border border-border text-xs font-medium text-content-secondary transition-colors",children:[n.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[n.jsx(Pr,{size:11,className:"text-accent flex-shrink-0"}),(a==null?void 0:a.branch)??"..."]}),n.jsx(Tt,{size:10,className:C("transition-transform text-content-tertiary",p&&"rotate-180")})]}),p&&l&&n.jsxs("div",{className:"absolute top-full left-0 right-0 mt-1 bg-surface border border-border rounded-xl shadow-lg z-10 max-h-48 overflow-y-auto",children:[n.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Local"}),l.all.map(M=>n.jsx("button",{onClick:()=>{v(!1),M!==(a==null?void 0:a.branch)&&d.mutate(M)},className:C("w-full text-left px-2.5 py-1.5 text-[10px] hover:bg-surface-inset transition-colors",M===(a==null?void 0:a.branch)&&"font-semibold text-accent bg-accent/5"),children:M},M)),l.remote.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-2.5 py-1 text-[9px] font-bold text-content-tertiary uppercase tracking-widest border-t border-border",children:"Remote"}),l.remote.map(M=>n.jsx("button",{onClick:()=>{v(!1),d.mutate(M.replace(/^origin\//,""))},className:"w-full text-left px-2.5 py-1.5 text-[10px] text-content-secondary hover:bg-surface-inset",children:M},M))]})]})]}),n.jsxs("span",{className:C("inline-flex items-center gap-1.5 text-[9px] px-2 py-1 rounded-lg font-semibold ring-1 flex-shrink-0",(G=a==null?void 0:a.conflicted)!=null&&G.length?"bg-red-50 text-red-600 ring-red-200":a!=null&&a.isClean?"bg-emerald-50 text-emerald-600 ring-emerald-200":"bg-amber-50 text-amber-600 ring-amber-200"),children:[n.jsx("span",{className:C("w-1.5 h-1.5 rounded-full",(J=a==null?void 0:a.conflicted)!=null&&J.length?"bg-red-500":a!=null&&a.isClean?"bg-emerald-500":"bg-amber-500")}),i?"…":(se=a==null?void 0:a.conflicted)!=null&&se.length?"Conflict":a!=null&&a.isClean?"Clean":`${_} pending`]}),a&&(a.ahead>0||a.behind>0)&&n.jsxs("span",{className:"text-[9px] text-content-tertiary font-mono tabular-nums flex-shrink-0",children:[a.ahead>0&&n.jsxs("span",{className:"text-emerald-600",children:["↑",a.ahead]}),a.behind>0&&n.jsxs("span",{className:"text-amber-600 ml-0.5",children:["↓",a.behind]})]})]})}),n.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Changes"}),_>0&&n.jsx("span",{className:"text-[9px] font-bold text-accent bg-accent/8 px-1.5 py-px rounded ring-1 ring-accent/15",children:_})]}),_>0&&n.jsx("div",{className:"flex items-center gap-1.5",children:[{type:"M",count:(a==null?void 0:a.modified.length)??0,color:"text-blue-500"},{type:"A",count:(a==null?void 0:a.added.length)??0,color:"text-emerald-500"},{type:"D",count:(a==null?void 0:a.deleted.length)??0,color:"text-red-500"},{type:"?",count:(a==null?void 0:a.untracked.length)??0,color:"text-content-tertiary"}].filter(M=>M.count>0).map(M=>n.jsxs("span",{className:C("text-[8px] font-mono font-bold",M.color),children:[M.type,M.count]},M.type))})]}),_===0?n.jsxs("div",{className:"flex items-center gap-1.5 py-2",children:[n.jsx(He,{size:12,className:"text-emerald-400"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"Working tree clean"})]}):n.jsxs("div",{className:"space-y-px max-h-[150px] overflow-y-auto",children:[a==null?void 0:a.modified.map(M=>n.jsx(Wl,{file:M,type:"M"},`M-${M}`)),a==null?void 0:a.added.map(M=>n.jsx(Wl,{file:M,type:"A"},`A-${M}`)),a==null?void 0:a.deleted.map(M=>n.jsx(Wl,{file:M,type:"D"},`D-${M}`)),a==null?void 0:a.untracked.map(M=>n.jsx(Wl,{file:M,type:"?"},`?-${M}`))]})]}),n.jsxs("div",{className:"px-3.5 py-2.5 border-b border-border space-y-2.5",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(pa,{size:10,className:"absolute left-2 top-1/2 -translate-y-1/2 text-content-tertiary pointer-events-none"}),n.jsx("input",{type:"text",value:j,onChange:M=>k(M.target.value),placeholder:"Commit message…",className:"w-full text-[10px] border border-border rounded-lg pl-6 pr-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent/40 bg-surface-inset/50 placeholder-content-tertiary",onKeyDown:M=>{M.key==="Enter"&&j.trim()&&x.mutate(j)}})]}),n.jsx("button",{onClick:()=>y.mutate(void 0,{onSuccess:M=>k(M.message)}),disabled:y.isPending,title:"AI commit message",className:"p-1.5 rounded-lg border border-border bg-surface text-violet-500 hover:bg-violet-50 hover:border-violet-200 transition-colors flex-shrink-0 disabled:opacity-50",children:y.isPending?n.jsx(ce,{size:10,className:"animate-spin"}):n.jsx(Ot,{size:10})})]}),n.jsxs("label",{className:"flex items-center gap-1.5 text-[9px] text-content-tertiary cursor-pointer select-none",children:[n.jsx("input",{type:"checkbox",checked:h,onChange:M=>u(M.target.checked),className:"rounded border-border text-accent focus:ring-accent w-3 h-3"}),"Pull latest (rebase) before commit"]}),n.jsxs("div",{className:"grid grid-cols-4 gap-1",children:[n.jsx(Vl,{icon:n.jsx(pa,{size:10}),label:"Commit",onClick:()=>j.trim()&&x.mutate(j),disabled:E||!j.trim(),loading:t==="commit"}),n.jsx(Vl,{icon:n.jsx(Og,{size:10}),label:"Push",onClick:()=>g.mutate(),disabled:E,loading:t==="push"}),n.jsx(Vl,{icon:n.jsx(Rg,{size:10}),label:"Pull",onClick:()=>f.mutate(h),disabled:E,loading:t==="pull"}),n.jsx(Vl,{icon:n.jsx(Qg,{size:10}),label:"Sync",onClick:D,disabled:E,loading:t==="full-sync",primary:!0})]}),n.jsx("p",{className:"text-[8px] text-content-tertiary text-center",children:"Sync: pull --rebase → stage → commit → push"})]}),s.length>0&&n.jsxs("div",{className:"border-b border-border",children:[n.jsxs("button",{onClick:()=>N(!w),className:"w-full px-3.5 py-2 flex items-center justify-between hover:bg-surface-inset/30 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(wc,{size:10,className:"text-content-tertiary"}),n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"Log"}),n.jsx("span",{className:"text-[8px] font-medium text-content-tertiary bg-surface-inset px-1.5 py-px rounded ring-1 ring-border",children:s.length}),t&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] text-blue-500 font-medium",children:[n.jsx(ce,{size:8,className:"animate-spin"})," ",t]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:M=>{M.stopPropagation(),Pe.clearLogs()},className:"text-[8px] text-content-tertiary hover:text-red-500 px-1 py-0.5 rounded hover:bg-red-50 transition-colors",children:"Clear"}),n.jsx(Tt,{size:10,className:C("text-content-tertiary transition-transform",w&&"rotate-180")})]})]}),w&&n.jsx("div",{className:"px-3.5 pb-2.5 max-h-[150px] overflow-y-auto",children:n.jsxs("div",{className:"space-y-0.5",children:[s.map((M,F)=>n.jsxs("div",{className:"flex items-start gap-1.5 text-[9px] py-0.5",children:[M.status==="running"&&n.jsx(ce,{size:9,className:"mt-px text-blue-500 animate-spin flex-shrink-0"}),M.status==="done"&&n.jsx(He,{size:9,className:"mt-px text-emerald-500 flex-shrink-0"}),M.status==="error"&&n.jsx(ut,{size:9,className:"mt-px text-red-500 flex-shrink-0"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("span",{className:C("font-medium",M.status==="error"?"text-red-600":"text-content-secondary"),children:M.step}),M.message&&n.jsxs("span",{className:C("ml-1 font-normal",M.status==="error"?"text-red-400":"text-content-tertiary"),children:["— ",M.message]})]})]},F)),n.jsx("div",{ref:P})]})})]}),n.jsxs("div",{className:"px-3.5 py-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[9px] font-bold text-content-tertiary uppercase tracking-widest",children:"History"}),n.jsx("button",{onClick:()=>c(),className:"p-1 rounded-md text-content-tertiary hover:text-accent hover:bg-accent/5 transition-colors",title:"Refresh",children:n.jsx(um,{size:10})})]}),!o||o.length===0?n.jsxs("div",{className:"flex items-center gap-1.5 py-3",children:[n.jsx(pa,{size:12,className:"text-content-tertiary/40"}),n.jsx("p",{className:"text-[10px] text-content-tertiary",children:"No commits yet"})]}):n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-[5px] top-2 bottom-2 w-px bg-border"}),n.jsx("div",{className:"space-y-0.5",children:o.map((M,F)=>n.jsxs("div",{className:"flex items-start gap-2 relative py-1 rounded-lg hover:bg-surface-inset/50 px-0.5 -mx-0.5 transition-colors",children:[n.jsx("div",{className:C("mt-1.5 w-[9px] h-[9px] rounded-full border-[1.5px] flex-shrink-0 z-[1]",F===0?"border-accent bg-accent/20":"border-border bg-surface")}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-[10px] text-content font-medium leading-snug truncate",title:M.message,children:M.message}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[8px] text-content-tertiary mt-0.5",children:[n.jsx("code",{className:"font-mono text-accent/70",children:M.shortHash}),n.jsxs("span",{className:"flex items-center gap-0.5",children:[n.jsx(Xg,{size:7})," ",M.author]}),n.jsxs("span",{className:"flex items-center gap-0.5",children:[n.jsx(Or,{size:7})," ",rS(M.date)]})]})]})]},M.hash))})]})]})]})]})]})}function Wl({file:e,type:t}){const s=aS[t],r=s.icon;return n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md hover:bg-surface-inset/60 transition-colors",children:[n.jsx("div",{className:C("w-4 h-4 rounded flex items-center justify-center flex-shrink-0",s.bg),children:n.jsx(r,{size:9,className:s.color})}),n.jsx("span",{className:C("text-[9px] font-mono truncate flex-1",s.color),title:e,children:e})]})}function Vl({icon:e,label:t,onClick:s,disabled:r,loading:a,primary:i}){return n.jsxs("button",{onClick:s,disabled:r,className:C("flex flex-col items-center justify-center gap-0.5 px-2 py-1.5 rounded-lg text-[9px] font-semibold transition-all",i?"bg-accent hover:bg-accent-dark text-white shadow-sm shadow-accent/20":"bg-surface hover:bg-surface-inset text-content-secondary border border-border",r&&"opacity-50 cursor-not-allowed",a&&"cursor-wait"),children:[a?n.jsx(ce,{size:10,className:"animate-spin"}):e,t]})}function lS(){const e=Pn(),t=Ws(),s=pm(),r=Ry(),{stepLogs:a}=Oy(),i=s.isRunning,l=Dy(i),[o,c]=m.useState(!1),[d,x]=m.useState(!1),[f,g]=m.useState(!1),b=t.pathname==="/run";m.useEffect(()=>{i&&!f&&(c(!0),x(!1))},[i,f]),m.useEffect(()=>{i&&g(!1)},[s.runId]);const y=()=>{c(!1),g(!0)},j=()=>{c(!1),g(!0),e("/run")};return!o&&!i&&!s.completed||!o||b?null:d?n.jsx(oS,{runActive:i,elapsed:l,completed:s.completed,onExpand:()=>x(!1),onClose:y}):n.jsx(cS,{progress:s,live:r,elapsed:l,runActive:i,stepLogs:a,onMinimise:()=>x(!0),onClose:y,onGoToRunConfig:j})}function oS({runActive:e,elapsed:t,completed:s,onExpand:r,onClose:a}){return n.jsxs("div",{className:"fixed bottom-4 right-4 z-[9999] flex items-center gap-2 bg-slate-900 rounded-full px-3 py-1.5 shadow-2xl border border-slate-700 cursor-pointer hover:bg-slate-800 transition-colors",onClick:r,children:[e?n.jsxs(n.Fragment,{children:[n.jsx(ce,{size:12,className:"text-emerald-400 animate-spin"}),n.jsx("span",{className:"text-[10px] font-semibold text-white",children:"Running"}),n.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:t})]}):s?n.jsxs(n.Fragment,{children:[s.failed>0?n.jsx(ut,{size:12,className:"text-red-400"}):n.jsx(Ue,{size:12,className:"text-emerald-400"}),n.jsxs("span",{className:"text-[10px] font-semibold text-white",children:[s.passed,"✓ ",s.failed>0&&`${s.failed}✗`]})]}):null,n.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),a()},className:"p-0.5 rounded-full hover:bg-slate-700 text-slate-500 hover:text-white transition-colors",children:n.jsx(Se,{size:10})})]})}function cS({progress:e,live:t,elapsed:s,runActive:r,stepLogs:a,onMinimise:i,onClose:l,onGoToRunConfig:o}){var h;const c=m.useRef(null),[d,x]=m.useState(null),f=m.useRef(!1),g=m.useRef({x:0,y:0}),b=m.useRef(null);m.useEffect(()=>{var u;(u=b.current)==null||u.scrollIntoView({behavior:"smooth"})},[a.length]);const y=m.useCallback(u=>{u.preventDefault(),f.current=!0;const p=c.current,v=(d==null?void 0:d.x)??(p?p.getBoundingClientRect().left:window.innerWidth-400),w=(d==null?void 0:d.y)??(p?p.getBoundingClientRect().top:window.innerHeight-400);g.current={x:u.clientX-v,y:u.clientY-w};const N=E=>{f.current&&x({x:Math.max(0,Math.min(window.innerWidth-200,E.clientX-g.current.x)),y:Math.max(0,Math.min(window.innerHeight-60,E.clientY-g.current.y))})},P=()=>{f.current=!1,window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",P)};window.addEventListener("mousemove",N),window.addEventListener("mouseup",P)},[d]),j=!!t.screenshot,k=e.completed;return n.jsxs("div",{ref:c,className:"fixed z-[9999] w-[340px] rounded-xl bg-slate-900 border border-slate-700 shadow-2xl overflow-hidden flex flex-col",style:d?{left:d.x,top:d.y,maxHeight:420}:{bottom:16,right:16,maxHeight:420},children:[n.jsxs("div",{className:"flex-shrink-0 flex items-center justify-between px-3 py-2 bg-slate-800 border-b border-slate-700 cursor-move select-none",onMouseDown:y,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(fN,{size:12,className:"text-slate-500"}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-amber-500/80"}),n.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500/80"})]}),e.currentBrowser&&n.jsx(Pc,{browser:e.currentBrowser,size:14,className:"ml-1"}),n.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider ml-1",children:e.currentBrowser?vm(e.currentBrowser):r?"Browser Preview":"Run Complete"}),r&&n.jsx("span",{className:"text-[8px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-400 animate-pulse",children:"LIVE"})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),o()},title:"Open in Run Config (full view)",className:"p-1.5 rounded text-slate-300 hover:text-accent hover:bg-slate-600 transition-colors",onMouseDown:u=>u.stopPropagation(),children:n.jsx(dm,{size:14})}),n.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),i()},title:"Minimise",className:"p-1.5 rounded text-slate-300 hover:text-white hover:bg-slate-600 transition-colors",onMouseDown:u=>u.stopPropagation(),children:n.jsx(Vg,{size:14})}),n.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),l()},title:"Close",className:"p-1.5 rounded text-slate-300 hover:text-red-400 hover:bg-slate-600 transition-colors",onMouseDown:u=>u.stopPropagation(),children:n.jsx(Se,{size:14})})]})]}),n.jsxs("div",{className:"relative bg-slate-950 flex items-center justify-center overflow-hidden",style:{minHeight:120,maxHeight:180},children:[j&&n.jsx("img",{src:`data:image/jpeg;base64,${t.screenshot}`,alt:"Browser",className:C("w-full h-auto object-contain",k&&!r&&"opacity-30"),style:{maxHeight:180}}),!j&&r&&n.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[n.jsxs("div",{className:"w-12 h-8 rounded-lg bg-slate-800 border border-slate-700 overflow-hidden relative",children:[n.jsxs("div",{className:"h-2 bg-slate-750 border-b border-slate-700 flex items-center px-1 gap-0.5",children:[n.jsx("div",{className:"w-1 h-1 rounded-full bg-red-500/50"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/50"}),n.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/50"})]}),n.jsxs("div",{className:"p-1 space-y-0.5",children:[n.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-3/4 animate-pulse"}),n.jsx("div",{className:"h-0.5 bg-slate-700 rounded w-1/2 animate-pulse"})]})]}),n.jsx("p",{className:"text-[9px] text-slate-500",children:"Waiting for screenshots..."}),n.jsx("div",{className:"flex gap-1",children:[0,120,240].map(u=>n.jsx("div",{className:"w-1 h-1 rounded-full bg-accent animate-bounce",style:{animationDelay:`${u}ms`}},u))})]}),k&&!r&&n.jsx("div",{className:C("w-full",j?"absolute inset-0 flex items-center justify-center bg-black/50 backdrop-blur-sm":"py-4 px-6"),children:n.jsxs("div",{className:C(j?"px-5 py-4":""),children:[n.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[k.failed===0?n.jsx(Ue,{size:18,className:"text-emerald-400"}):n.jsx(ut,{size:18,className:"text-red-400"}),n.jsxs("div",{children:[n.jsx("p",{className:C("text-xs font-bold",k.failed===0?"text-emerald-300":"text-red-300"),children:k.failed===0?"All tests passed!":"Completed with failures"}),n.jsxs("p",{className:"text-[9px] text-slate-400",children:[Math.round(k.duration/1e3),"s elapsed"]})]})]}),n.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:[{label:"Passed",v:k.passed,c:"text-emerald-400 bg-emerald-500/10 ring-emerald-500/20"},{label:"Failed",v:k.failed,c:"text-red-400 bg-red-500/10 ring-red-500/20"},{label:"Skipped",v:k.skipped,c:"text-slate-400 bg-slate-500/10 ring-slate-500/20"}].map(({label:u,v:p,c:v})=>n.jsxs("div",{className:C("rounded-lg p-2 text-center ring-1",v),children:[n.jsx("p",{className:"text-sm font-bold tabular-nums",children:p}),n.jsx("p",{className:"text-[7px] uppercase tracking-wider text-slate-500",children:u})]},u))})]})}),r&&e.currentStep&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent px-3 py-2",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-400 animate-pulse flex-shrink-0"}),n.jsx("p",{className:"text-[8px] text-white/70 truncate font-mono",children:e.currentStep.instruction})]})})]}),n.jsxs("div",{className:"flex-shrink-0 border-t border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1 bg-slate-800/50",children:[n.jsx("div",{className:"flex items-center gap-2",children:r?n.jsxs(n.Fragment,{children:[n.jsx(ce,{size:9,className:"text-emerald-400 animate-spin"}),n.jsx("span",{className:"text-[9px] text-slate-300 font-medium truncate max-w-[180px]",children:((h=e.currentCase)==null?void 0:h.caseName)??"Starting..."})]}):n.jsxs("span",{className:"text-[9px] text-slate-400",children:[a.length," step",a.length!==1&&"s"," executed"]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[9px] font-mono text-slate-500",children:s}),n.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-[8px] font-semibold text-accent hover:text-accent-light transition-colors",title:"Open full view in Run Config",children:[n.jsx(Ka,{size:8})," Full View"]})]})]}),a.length>0&&n.jsxs("div",{className:"max-h-[72px] overflow-y-auto px-2 py-1 space-y-px",children:[a.slice(-5).map((u,p)=>n.jsxs("div",{className:"flex items-center gap-1.5 py-px text-[8px]",children:[u.status==="passed"?n.jsx(Ue,{size:8,className:"text-emerald-400 flex-shrink-0"}):u.status==="failed"?n.jsx(ut,{size:8,className:"text-red-400 flex-shrink-0"}):n.jsx(Rt,{size:8,className:"text-slate-600 flex-shrink-0"}),n.jsx("span",{className:C("truncate flex-1 font-mono",u.status==="passed"?"text-slate-400":u.status==="failed"?"text-red-300":"text-slate-600"),children:u.instruction}),n.jsxs("span",{className:"text-slate-600 tabular-nums flex-shrink-0",children:[u.duration,"ms"]})]},`${u.stepId}-${p}`)),n.jsx("div",{ref:b})]})]})]})}function dS(){const{hasConflict:e,conflictFiles:t}=Sc(),s=dy(),r=uy(),a=xy(),i=my(),[l,o]=m.useState({});if(!e||t.length===0)return null;const c=h=>l[h]??{mode:"none",ours:"",theirs:"",merged:"",resolved:!1,loading:!1},d=(h,u)=>o(p=>({...p,[h]:{...c(h),...u}})),x=async h=>{d(h,{loading:!0});try{const u=await Ke.conflictContent(h);d(h,{ours:u.ours,theirs:u.theirs,merged:u.ours,loading:!1})}catch{d(h,{ours:"(error loading)",theirs:"(error loading)",loading:!1})}},f=async h=>{let p=c(h).ours;p||(p=(await Ke.conflictContent(h)).ours),d(h,{loading:!0}),s.mutate({filePath:h,content:p},{onSuccess:()=>d(h,{resolved:!0,loading:!1})})},g=async h=>{let p=c(h).theirs;p||(p=(await Ke.conflictContent(h)).theirs),d(h,{loading:!0}),s.mutate({filePath:h,content:p},{onSuccess:()=>d(h,{resolved:!0,loading:!1})})},b=async h=>{let u=c(h);u.ours||(await x(h),u=c(h)),d(h,{mode:"ai",loading:!0}),r.mutate({filePath:h,ours:u.ours,theirs:u.theirs},{onSuccess:p=>d(h,{merged:p.resolved,loading:!1}),onError:()=>d(h,{loading:!1})})},y=async h=>{c(h).ours||await x(h),d(h,{mode:"manual"})},j=h=>{const u=c(h);d(h,{loading:!0}),s.mutate({filePath:h,content:u.merged},{onSuccess:()=>d(h,{resolved:!0,loading:!1,mode:"none"})})},k=t.every(h=>c(h).resolved);return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-surface rounded-2xl shadow-2xl w-full max-w-4xl mx-4 max-h-[90vh] flex flex-col overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-100 bg-red-50 flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Yt,{size:20,className:"text-red-500"}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-bold text-red-800",children:"Merge Conflict Detected"}),n.jsxs("p",{className:"text-xs text-red-600",children:[t.length," file",t.length>1?"s":""," with conflicts"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>i.mutate(),disabled:i.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-red-600 bg-surface border border-red-200 rounded-lg hover:bg-red-50 transition-colors disabled:opacity-50",children:[n.jsx(jc,{size:11}),i.isPending?"Aborting...":"Abort Rebase"]}),n.jsxs("button",{onClick:()=>a.mutate(),disabled:!k||a.isPending,className:C("flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-lg transition-colors",k?"bg-green-600 hover:bg-green-700 text-white":"bg-slate-200 text-content-tertiary cursor-not-allowed"),children:[n.jsx(He,{size:11}),a.isPending?"Continuing...":"Continue Rebase"]}),n.jsx("button",{onClick:()=>Pe.clearConflict(),className:"p-1.5 rounded hover:bg-red-100 text-red-400 transition-colors",children:n.jsx(Se,{size:16})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:t.map(h=>{const u=c(h);return n.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2.5 bg-surface-inset border-b border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Hg,{size:14,className:u.resolved?"text-green-500":"text-amber-500"}),n.jsx("code",{className:"text-xs font-mono text-content-secondary",children:h}),u.resolved&&n.jsxs("span",{className:"text-[10px] text-green-600 bg-green-100 px-2 py-0.5 rounded-full flex items-center gap-1 font-medium",children:[n.jsx(He,{size:9})," Resolved"]})]}),!u.resolved&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Ql,{label:"Keep Local",onClick:()=>f(h),loading:u.loading&&u.mode==="none"}),n.jsx(Ql,{label:"Accept Incoming",onClick:()=>g(h),loading:u.loading&&u.mode==="none"}),n.jsx(Ql,{label:"Manual",onClick:()=>y(h)}),n.jsx(Ql,{label:"AI Resolve",onClick:()=>b(h),loading:u.loading&&u.mode==="ai",icon:n.jsx(Ot,{size:9}),accent:!0})]})]}),u.mode!=="none"&&!u.resolved&&n.jsx("div",{className:"p-4",children:u.loading&&!u.ours?n.jsx("div",{className:"flex items-center justify-center py-6",children:n.jsx(ce,{size:18,className:"animate-spin text-content-tertiary"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-wider mb-1 block",children:"Local (Ours)"}),n.jsx("textarea",{value:u.ours,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-blue-200 rounded-lg bg-blue-50/50 resize-y focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-orange-600 uppercase tracking-wider mb-1 block",children:"Incoming (Theirs)"}),n.jsx("textarea",{value:u.theirs,readOnly:!0,rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-orange-200 rounded-lg bg-orange-50/50 resize-y focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-bold text-green-600 uppercase tracking-wider mb-1 block",children:"Merged Output (editable)"}),n.jsx("textarea",{value:u.merged,onChange:p=>d(h,{merged:p.target.value}),rows:10,className:"w-full text-[11px] font-mono p-2.5 border border-green-200 rounded-lg bg-green-50/50 resize-y focus:outline-none focus:ring-2 focus:ring-green-300"})]}),n.jsx("div",{className:"flex justify-end mt-2",children:n.jsxs("button",{onClick:()=>j(h),disabled:u.loading,className:"flex items-center gap-1.5 px-4 py-1.5 bg-green-600 hover:bg-green-700 text-white text-xs font-medium rounded-lg transition-colors disabled:opacity-50",children:[u.loading?n.jsx(ce,{size:12,className:"animate-spin"}):n.jsx(He,{size:12}),"Mark as Resolved"]})})]})})]},h)})})]})})}function Ql({label:e,onClick:t,loading:s,icon:r,accent:a}){return n.jsxs("button",{onClick:t,disabled:s,className:C("flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-lg transition-colors",a?"bg-purple-100 text-purple-700 hover:bg-purple-200":"bg-slate-100 text-content-secondary hover:bg-slate-200",s&&"opacity-60 cursor-wait"),children:[s?n.jsx(ce,{size:9,className:"animate-spin"}):r,e]})}function uS(e){m.useEffect(()=>{function t(s){const r=s.target;if(!(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement))for(const a of e){const i=s.key===a.key,l=!!a.ctrl,o=!!a.meta,c=!!a.shift,d=l?s.ctrlKey:!s.ctrlKey,x=o?s.metaKey:!s.metaKey,f=c?s.shiftKey:!s.shiftKey,g=(()=>{if(l||o){const b=l?s.ctrlKey:!0,y=o?s.metaKey:!0,j=c?s.shiftKey:!s.shiftKey;return l&&!o&&s.metaKey||o&&!l&&s.ctrlKey?!1:b&&y&&j}return d&&x&&f})();if(i&&g){s.preventDefault(),a.action();return}}}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e])}const xS=[{keys:["?"],description:"Show keyboard shortcuts"},{keys:["Ctrl","K"],description:"Search (Cmd+K)"},{keys:["Esc"],description:"Close modal / cancel"}];function mS({open:e,onClose:t}){return m.useEffect(()=>{if(!e)return;function s(r){r.key==="Escape"&&t()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:t,children:n.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-lg mx-4 overflow-hidden",onClick:s=>s.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[n.jsx("h2",{className:"text-sm font-bold text-content",children:"Keyboard Shortcuts"}),n.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-lg text-content-tertiary hover:bg-surface-inset hover:text-content transition-colors","aria-label":"Close",children:n.jsx(Se,{size:14})})]}),n.jsx("div",{className:"px-5 py-4 grid grid-cols-2 gap-x-6 gap-y-3",children:xS.map(s=>n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsx("span",{className:"text-xs text-content-secondary",children:s.description}),n.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:s.keys.map(r=>n.jsx("kbd",{className:"inline-flex items-center justify-center px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold bg-surface-inset border border-border text-content-secondary min-w-[22px]",children:r},r))})]},s.description))}),n.jsx("div",{className:"px-5 py-3 border-t border-border bg-surface-inset/30",children:n.jsxs("p",{className:"text-[10px] text-content-tertiary",children:["Press ",n.jsx("kbd",{className:"inline-flex items-center justify-center px-1 py-px rounded text-[9px] font-mono bg-surface-inset border border-border text-content-tertiary",children:"Esc"})," or click outside to close"]})})]})}):null}const hS={suite:"Suites",case:"Cases",step:"Steps"},fS={name:"name",description:"description",tag:"tag",instruction:"instruction"};function pS({type:e}){return e==="suite"?n.jsx(pl,{size:13,className:"text-indigo-500 flex-shrink-0"}):e==="case"?n.jsx(mn,{size:13,className:"text-blue-500 flex-shrink-0"}):n.jsx(Wg,{size:13,className:"text-teal-500 flex-shrink-0"})}function gS({open:e,onClose:t}){const s=Pn(),[r,a]=m.useState(""),[i,l]=m.useState(""),[o,c]=m.useState(-1),d=m.useRef(null);m.useEffect(()=>{const k=setTimeout(()=>l(r),300);return()=>clearTimeout(k)},[r]),m.useEffect(()=>{e&&(a(""),l(""),c(-1),setTimeout(()=>{var k;return(k=d.current)==null?void 0:k.focus()},50))},[e]);const{data:x=[]}=ke({queryKey:["search",i],queryFn:()=>$N.search(i),enabled:i.trim().length>1,staleTime:0}),f={suite:x.filter(k=>k.type==="suite"),case:x.filter(k=>k.type==="case"),step:x.filter(k=>k.type==="step")},g=x,b=k=>{k.type==="suite"?s(`/tests/${k.suiteId}`):k.type==="case"?s(`/tests/${k.suiteId}/cases/${k.caseId}`):s(`/tests/${k.suiteId}/cases/${k.caseId}`),t()},y=k=>{k.key==="ArrowDown"?(k.preventDefault(),c(h=>Math.min(h+1,g.length-1))):k.key==="ArrowUp"?(k.preventDefault(),c(h=>Math.max(h-1,-1))):k.key==="Enter"&&o>=0&&g[o]?(k.preventDefault(),b(g[o])):k.key==="Escape"&&t()};if(!e)return null;let j=-1;return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm pt-[15vh]",onClick:t,children:n.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-xl mx-4 overflow-hidden",onClick:k=>k.stopPropagation(),children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[n.jsx(Mr,{size:15,className:"text-content-tertiary flex-shrink-0"}),n.jsx("input",{ref:d,type:"text",placeholder:"Search suites, cases, steps...",value:r,onChange:k=>{a(k.target.value),c(-1)},onKeyDown:y,className:"flex-1 text-sm bg-transparent text-content placeholder-content-tertiary outline-none"}),r&&n.jsx("button",{type:"button",onClick:()=>{a(""),l("")},className:"p-1 rounded text-content-tertiary hover:text-content transition-colors",children:n.jsx(Se,{size:13})}),n.jsx("kbd",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded border border-border bg-surface-inset text-content-tertiary",children:"Esc"})]}),n.jsx("div",{className:"overflow-y-auto max-h-[50vh]",children:i.trim().length<2?n.jsx("div",{className:"px-5 py-8 text-center",children:n.jsx("p",{className:"text-sm text-content-tertiary",children:"Type at least 2 characters to search"})}):x.length===0?n.jsx("div",{className:"px-5 py-8 text-center",children:n.jsxs("p",{className:"text-sm text-content-tertiary",children:['No results for "',i,'"']})}):n.jsx("div",{className:"py-1",children:["suite","case","step"].map(k=>{const h=f[k];return h.length===0?null:n.jsxs("div",{children:[n.jsx("div",{className:"px-4 py-1.5 text-[10px] font-bold text-content-tertiary uppercase tracking-wider bg-surface-inset/50",children:hS[k]}),h.map(u=>{j++;const v=o===j;return n.jsxs("button",{type:"button",onClick:()=>b(u),className:C("w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors",v?"bg-accent/10":"hover:bg-surface-inset"),children:[n.jsx(pS,{type:u.type}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium text-content truncate",children:u.type==="step"?u.instruction:u.type==="case"?u.caseName:u.suiteName}),n.jsx("span",{className:C("text-[9px] px-1.5 py-0.5 rounded font-semibold uppercase flex-shrink-0",u.matchedOn==="name"?"bg-accent/10 text-accent":u.matchedOn==="tag"?"bg-purple-50 text-purple-600":"bg-surface-inset text-content-tertiary"),children:fS[u.matchedOn]})]}),n.jsxs("p",{className:"text-[11px] text-content-tertiary truncate mt-0.5",children:[u.type!=="suite"&&`${u.suiteName}`,u.type==="step"&&u.caseName&&` › ${u.caseName}`]})]}),n.jsx(ir,{size:11,className:C("text-content-tertiary transition-opacity flex-shrink-0",v?"opacity-100":"opacity-0")})]},`${u.suiteId}-${u.caseId??""}-${u.stepId??""}`)})]},k)})})}),x.length>0&&n.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-surface-inset/30 flex items-center gap-3 text-[10px] text-content-tertiary",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↑↓"})," navigate"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"px-1 py-px rounded border border-border bg-surface font-mono",children:"↵"})," select"]})]})]})})}const Uy="assuremind_onboarding_done";function Td(){localStorage.setItem(Uy,"true")}function yS(){const{data:e=[],isLoading:t}=Ny(),[s,r]=m.useState(0),[a,i]=m.useState(""),[l,o]=m.useState(""),c=Pn(),d=!!localStorage.getItem(Uy),x=Y({mutationFn:b=>_a.update({baseUrl:b}),onError:b=>O.error(b.message)}),f=Y({mutationFn:b=>Ar.create({name:b,type:"ui"}),onSuccess:()=>{Td(),c("/tests")},onError:b=>O.error(b.message)});if(t||e.length>0||d)return null;const g=[0,1,2].map(b=>n.jsx("span",{className:`w-2 h-2 rounded-full transition-colors ${b===s?"bg-accent":"bg-border"}`},b));return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-surface rounded-2xl border border-border shadow-modal w-full max-w-md mx-4 overflow-hidden",children:[s===0&&n.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-accent to-accent-dark flex items-center justify-center shadow-lg",children:n.jsx(Be,{size:28,className:"text-white"})}),n.jsxs("div",{className:"text-center",children:[n.jsx("h2",{className:"text-lg font-bold text-content",children:"Welcome to Assuremind Studio"}),n.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"AI-powered test automation that writes, runs, and self-heals your tests. Let's get you set up in just a few steps."})]}),n.jsx("div",{className:"flex items-center gap-2 mt-2",children:g}),n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(ne,{onClick:()=>r(1),className:"w-full",children:"Get Started"}),n.jsx("button",{type:"button",onClick:()=>{Td()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),s===1&&n.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-lg",children:n.jsx(zr,{size:28,className:"text-white"})}),n.jsxs("div",{className:"text-center",children:[n.jsx("h2",{className:"text-lg font-bold text-content",children:"Set your Base URL"}),n.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"This is the URL of the application you want to test."})]}),n.jsx("input",{type:"url",placeholder:"https://your-app.example.com",value:a,onChange:b=>i(b.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all"}),n.jsx("div",{className:"flex items-center gap-2",children:g}),n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsx(ne,{onClick:async()=>{a&&await x.mutateAsync(a),r(2)},loading:x.isPending,className:"w-full",children:"Next"}),n.jsx("button",{type:"button",onClick:()=>{Td()},className:"text-xs text-content-tertiary hover:text-content-secondary transition-colors py-1",children:"Skip for now"})]})]}),s===2&&n.jsxs("div",{className:"flex flex-col items-center px-8 py-8 gap-4",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-lg",children:n.jsx(hN,{size:28,className:"text-white"})}),n.jsxs("div",{className:"text-center",children:[n.jsx("h2",{className:"text-lg font-bold text-content",children:"Create your first test suite"}),n.jsx("p",{className:"text-sm text-content-secondary mt-2 leading-relaxed",children:"Give your first test suite a name. You can add test cases to it right after."})]}),n.jsx("input",{type:"text",placeholder:"e.g. Login flow",value:l,onChange:b=>o(b.target.value),className:"w-full px-3 py-2 rounded-lg border border-border bg-surface-inset text-sm text-content placeholder:text-content-tertiary outline-none focus:ring-2 focus:ring-accent/40 focus:border-accent transition-all",onKeyDown:b=>{b.key==="Enter"&&l.trim()&&f.mutate(l.trim())}}),n.jsx("div",{className:"flex items-center gap-2",children:g}),n.jsx(ne,{onClick:()=>{l.trim()&&f.mutate(l.trim())},loading:f.isPending,disabled:!l.trim(),className:"w-full",children:"Create Suite & Continue"})]})]})})}const bS={AI_NOT_CONFIGURED:{icon:n.jsx(Ot,{size:20,className:"text-indigo-500"}),iconBg:"bg-indigo-50 border-indigo-200/50 dark:bg-indigo-900/30 dark:border-indigo-700/50",title:"AI Provider Setup Required",description:"To use AI-powered features like test generation, code generation, and self-healing, you need to configure an AI provider and its API key.",envVars:[{name:"AI_PROVIDER",example:"openai | anthropic | google | azure-openai | bedrock | ..."},{name:"<PROVIDER>_API_KEY",example:"sk-... (your provider API key)"}]},JIRA_NOT_CONFIGURED:{icon:n.jsx(Bo,{size:20,className:"text-blue-500"}),iconBg:"bg-blue-50 border-blue-200/50 dark:bg-blue-900/30 dark:border-blue-700/50",title:"Jira Integration Setup Required",description:"To fetch Jira issues and enrich test generation with Jira stories, you need to configure your Jira credentials.",envVars:[{name:"JIRA_BASE_URL",example:"https://your-domain.atlassian.net"},{name:"JIRA_EMAIL",example:"your-email@company.com"},{name:"JIRA_API_TOKEN",example:"your-jira-api-token"}]},XRAY_NOT_CONFIGURED:{icon:n.jsx(Bo,{size:20,className:"text-emerald-500"}),iconBg:"bg-emerald-50 border-emerald-200/50 dark:bg-emerald-900/30 dark:border-emerald-700/50",title:"Xray Integration Setup Required",description:"To sync test suites and cases with Jira Xray, you need to configure both Jira credentials and the Xray project key.",envVars:[{name:"JIRA_BASE_URL",example:"https://your-domain.atlassian.net"},{name:"JIRA_EMAIL",example:"your-email@company.com"},{name:"JIRA_API_TOKEN",example:"your-jira-api-token"},{name:"XRAY_PROJECT_KEY",example:"PROJ"}]}};function vS(){const{activeModal:e}=IN();if(m.useEffect(()=>{if(!e)return;const s=r=>{r.key==="Escape"&&yr.dismiss()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e]),!e)return null;const t=bS[e];return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-fade-in",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>yr.dismiss()}),n.jsxs("div",{className:"relative bg-surface rounded-2xl shadow-modal w-full max-w-md mx-4 overflow-hidden border border-border animate-scale-in",children:[n.jsxs("div",{className:"flex items-start gap-3.5 p-6 pb-4",children:[n.jsx("div",{className:`flex-shrink-0 w-11 h-11 rounded-xl border flex items-center justify-center ${t.iconBg}`,children:t.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h3",{className:"text-base font-semibold text-content",children:t.title}),n.jsx("p",{className:"mt-1.5 text-sm text-content-secondary leading-relaxed",children:t.description})]})]}),n.jsxs("div",{className:"mx-6 mb-4 rounded-xl bg-surface-inset border border-border p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Ho,{size:14,className:"text-content-tertiary"}),n.jsx("span",{className:"text-xs font-semibold text-content-secondary uppercase tracking-wider",children:"Add to your .env file"})]}),n.jsx("div",{className:"space-y-2",children:t.envVars.map(s=>n.jsxs("div",{className:"font-mono text-xs",children:[n.jsx("span",{className:"text-accent font-semibold",children:s.name}),n.jsx("span",{className:"text-content-tertiary",children:"="}),n.jsx("span",{className:"text-content-secondary",children:s.example})]},s.name))})]}),n.jsxs("div",{className:"mx-6 mb-5 text-xs text-content-tertiary leading-relaxed",children:["After updating your ",n.jsx("code",{className:"px-1 py-0.5 rounded bg-surface-inset text-content-secondary",children:".env"})," file, restart the Studio server for changes to take effect."]}),n.jsx("div",{className:"flex items-center justify-end gap-2.5 px-6 pb-6",children:n.jsx(ne,{variant:"secondary",size:"sm",onClick:()=>yr.dismiss(),children:"Close"})})]})]})}function jS(){const{job:e,showPopup:t}=Ty(),s=Pn();return!t||!e||e.status!=="done"?null:n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm animate-fade-in",children:n.jsxs("div",{className:"bg-surface rounded-2xl shadow-modal w-full max-w-sm mx-4 overflow-hidden border border-border animate-scale-in",children:[n.jsxs("div",{className:"flex flex-col items-center pt-8 pb-5 px-6 bg-gradient-to-b from-emerald-50/80 to-surface",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl bg-emerald-100 border border-emerald-200/50 flex items-center justify-center mb-3",children:n.jsx(Ue,{size:28,className:"text-emerald-500"})}),n.jsx("h2",{className:"text-lg font-bold text-content",children:"Suite Generated!"}),e.suiteName&&n.jsx("span",{className:"mt-2 px-3 py-1 rounded-lg bg-accent-muted text-accent text-xs font-semibold",children:e.suiteName}),n.jsx("p",{className:"text-sm text-content-secondary text-center mt-2.5 leading-relaxed",children:"Your test suite has been created. Open the Test Editor to review and run the generated test cases."})]}),n.jsxs("div",{className:"flex flex-col gap-2.5 px-6 pb-6",children:[n.jsxs("button",{type:"button",onClick:()=>{dn.dismissPopup(),s("/tests",{state:{openSuiteId:e.suiteId}})},className:"w-full py-2.5 rounded-xl bg-gradient-to-b from-accent to-accent-dark text-white font-semibold text-sm hover:brightness-110 transition-all flex items-center justify-center gap-2 shadow-sm",children:[n.jsx(Zt,{size:16})," Open Test Cases"]}),n.jsx("button",{type:"button",onClick:()=>dn.dismissPopup(),className:"w-full py-2.5 rounded-xl border border-border text-content-secondary font-medium text-sm hover:bg-surface-inset transition-colors",children:"Stay on this page"})]})]})})}function NS(){const{job:e}=Ty(),[t,s]=m.useState(null),r=m.useRef(null),a=m.useRef(null);m.useEffect(()=>{(e==null?void 0:e.status)==="running"&&s(null)},[e==null?void 0:e.id]);const i=m.useCallback(d=>{d.preventDefault();const x=a.current;if(!x)return;x.setPointerCapture(d.pointerId);const f=x.getBoundingClientRect();r.current={startX:d.clientX,startY:d.clientY,origX:f.left,origY:f.top}},[]),l=m.useCallback(d=>{if(!r.current)return;const x=a.current;if(!x)return;const f=d.clientX-r.current.startX,g=d.clientY-r.current.startY,b=r.current.origX+f,y=r.current.origY+g,j=window.innerWidth-x.offsetWidth,k=window.innerHeight-x.offsetHeight;s({x:Math.max(0,Math.min(b,j)),y:Math.max(0,Math.min(y,k))})},[]),o=m.useCallback(()=>{r.current=null},[]);if(!e||e.status!=="running")return null;const c=t?{left:t.x,top:t.y,right:"auto",bottom:"auto"}:{right:24,bottom:80};return n.jsxs("div",{ref:a,onPointerDown:i,onPointerMove:l,onPointerUp:o,style:{...c,position:"fixed",zIndex:40,touchAction:"none",cursor:"grab",userSelect:"none"},className:"flex items-center gap-2.5 px-4 py-2.5 rounded-xl bg-gradient-to-r from-accent to-accent-dark text-white shadow-elevated text-xs font-semibold animate-pulse",children:[n.jsx(ce,{size:14,className:"animate-spin"}),"Generating: ",e.label]})}function wS(){return Va({"run:start":e=>{yt.onRunStart(e.runId)},"run:case":e=>{const t=e;t.status==="running"&&yt.onCaseRunning(t.runId,t.caseId)},"run:case:done":e=>{const t=e;yt.onCaseDone(t.runId,t.caseId,t.status)},"run:complete":e=>{const t=e;yt.onComplete(t.runId,{passed:t.passed,failed:t.failed,skipped:t.skipped});const s=t.passed+t.failed+t.skipped;t.failed>0?O.error(`Run complete — ${t.passed}/${s} passed, ${t.failed} failed`):O.success(`Run complete — ${t.passed}/${s} passed`),br.push({id:crypto.randomUUID(),type:"run-complete",message:`Run complete — ${t.passed} passed, ${t.failed} failed`,timestamp:Date.now(),read:!1,link:"/reports"})},"run:error":e=>{const t=e;yt.clear(),O.error(`Run error: ${t.error??"unknown"}`),br.push({id:crypto.randomUUID(),type:"run-error",message:`Run error: ${t.error??"unknown"}`,timestamp:Date.now(),read:!1,link:"/reports"})}}),null}function kS(){return Va({"git:log":e=>{Pe.addLogStep(e)},"git:conflict":e=>{const t=e;Pe.setConflict(t.files)},"git:operation-done":()=>{Pe.finishOperation()}}),null}const SS={"/":"Dashboard","/tests":"Test Suites","/story":"Smart Tests","/run":"Run Configuration","/reports":"Reports","/variables":"Variables","/healing":"Self-Healing","/git":"Git Control Center","/settings":"Settings","/library":"Step Library","/docs":"Documentation"};function CS(){const e=Ws();return e.pathname.startsWith("/tests")?"Test Suites":SS[e.pathname]??"Assuremind Studio"}function ES(){const{collapsed:e,mobileOpen:t,toggle:s}=AN(),r=CS(),[a,i]=m.useState(!1),[l,o]=m.useState(!1);return uS([{key:"?",description:"Show shortcuts",action:()=>i(!0)},{key:"Escape",description:"Close modal",action:()=>{i(!1),o(!1)}},{key:"k",ctrl:!0,description:"Search (Cmd+K)",action:()=>o(!0)},{key:"k",meta:!0,description:"Search (Cmd+K)",action:()=>o(!0)}]),n.jsxs("div",{className:"flex h-full overflow-hidden",children:[n.jsx(wS,{}),n.jsx(kS,{}),n.jsx(DN,{collapsed:e,onToggle:s,mobileOpen:t}),n.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[n.jsx(mk,{title:r,onMenuClick:s}),n.jsx("main",{className:"flex flex-col flex-1 overflow-hidden bg-background",children:n.jsxs(xj,{children:[n.jsx(wt,{path:"/",element:n.jsx(gk,{})}),n.jsx(wt,{path:"/tests",element:n.jsx(wd,{})}),n.jsx(wt,{path:"/tests/:suiteId",element:n.jsx(wd,{})}),n.jsx(wt,{path:"/tests/:suiteId/cases/:caseId",element:n.jsx(wd,{})}),n.jsx(wt,{path:"/story",element:n.jsx(m5,{})}),n.jsx(wt,{path:"/run",element:n.jsx(v5,{})}),n.jsx(wt,{path:"/reports",element:n.jsx(H5,{})}),n.jsx(wt,{path:"/variables",element:n.jsx(q5,{})}),n.jsx(wt,{path:"/healing",element:n.jsx(Q5,{})}),n.jsx(wt,{path:"/git",element:n.jsx(nS,{})}),n.jsx(wt,{path:"/settings",element:n.jsx(Y5,{})}),n.jsx(wt,{path:"/library",element:n.jsx(J5,{})}),n.jsx(wt,{path:"/docs",element:n.jsx(Z5,{})})]})})]}),n.jsx(mS,{open:a,onClose:()=>i(!1)}),n.jsx(gS,{open:l,onClose:()=>o(!1)})]})}function PS(){return n.jsxs(n.Fragment,{children:[n.jsx(ES,{}),n.jsx(iS,{}),n.jsx(dS,{}),n.jsx(jS,{}),n.jsx(NS,{}),n.jsx(lS,{}),n.jsx(yS,{}),n.jsx(vS,{}),n.jsx(X2,{position:"bottom-right",toastOptions:{style:{fontSize:"13px",borderRadius:"12px",padding:"10px 16px",boxShadow:"0 4px 16px -2px rgb(0 0 0 / 0.08), 0 2px 6px -2px rgb(0 0 0 / 0.04)"}}})]})}const zS=new Xj({defaultOptions:{queries:{retry:1,staleTime:1e4,refetchOnWindowFocus:!1}}}),By=document.getElementById("root");if(!By)throw new Error("Root element not found");Z0(By).render(n.jsx(m.StrictMode,{children:n.jsx(vj,{children:n.jsx(Zj,{client:zS,children:n.jsx(PS,{})})})}));
|