@nickduy/agent-studio 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function hd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},co={},Jm={exports:{}},ke={};/**
1
+ function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ym={exports:{}},ho={},Jm={exports:{}},ke={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var xl=Symbol.for("react.element"),Aj=Symbol.for("react.portal"),Lj=Symbol.for("react.fragment"),Ij=Symbol.for("react.strict_mode"),Dj=Symbol.for("react.profiler"),Mj=Symbol.for("react.provider"),zj=Symbol.for("react.context"),_j=Symbol.for("react.forward_ref"),$j=Symbol.for("react.suspense"),Oj=Symbol.for("react.memo"),Fj=Symbol.for("react.lazy"),nf=Symbol.iterator;function Uj(e){return e===null||typeof e!="object"?null:(e=nf&&e[nf]||e["@@iterator"],typeof e=="function"?e:null)}var Xm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zm=Object.assign,eg={};function ni(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Xm}ni.prototype.isReactComponent={};ni.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")};ni.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tg(){}tg.prototype=ni.prototype;function fd(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Xm}var pd=fd.prototype=new tg;pd.constructor=fd;Zm(pd,ni.prototype);pd.isPureReactComponent=!0;var rf=Array.isArray,ng=Object.prototype.hasOwnProperty,md={current:null},rg={key:!0,ref:!0,__self:!0,__source:!0};function sg(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)ng.call(t,r)&&!rg.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:xl,type:e,key:l,ref:a,props:i,_owner:md.current}}function Bj(e,t){return{$$typeof:xl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gd(e){return typeof e=="object"&&e!==null&&e.$$typeof===xl}function Hj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var sf=/\/+/g;function Ho(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Hj(""+e.key):t.toString(36)}function da(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case xl:case Aj:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Ho(a,0):r,rf(i)?(n="",e!=null&&(n=e.replace(sf,"$&/")+"/"),da(i,t,n,"",function(c){return c})):i!=null&&(gd(i)&&(i=Bj(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(sf,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",rf(e))for(var o=0;o<e.length;o++){l=e[o];var u=r+Ho(l,o);a+=da(l,t,n,u,i)}else if(u=Uj(e),typeof u=="function")for(e=u.call(e),o=0;!(l=e.next()).done;)l=l.value,u=r+Ho(l,o++),a+=da(l,t,n,u,i);else if(l==="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 a}function $l(e,t,n){if(e==null)return e;var r=[],i=0;return da(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Wj(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Rt={current:null},ha={transition:null},Vj={ReactCurrentDispatcher:Rt,ReactCurrentBatchConfig:ha,ReactCurrentOwner:md};function ig(){throw Error("act(...) is not supported in production builds of React.")}ke.Children={map:$l,forEach:function(e,t,n){$l(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $l(e,function(){t++}),t},toArray:function(e){return $l(e,function(t){return t})||[]},only:function(e){if(!gd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Component=ni;ke.Fragment=Lj;ke.Profiler=Dj;ke.PureComponent=fd;ke.StrictMode=Ij;ke.Suspense=$j;ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vj;ke.act=ig;ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Zm({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=md.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)ng.call(t,u)&&!rg.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:xl,type:e.type,key:i,ref:l,props:r,_owner:a}};ke.createContext=function(e){return e={$$typeof:zj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mj,_context:e},e.Consumer=e};ke.createElement=sg;ke.createFactory=function(e){var t=sg.bind(null,e);return t.type=e,t};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:_j,render:e}};ke.isValidElement=gd;ke.lazy=function(e){return{$$typeof:Fj,_payload:{_status:-1,_result:e},_init:Wj}};ke.memo=function(e,t){return{$$typeof:Oj,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=ha.transition;ha.transition={};try{e()}finally{ha.transition=t}};ke.unstable_act=ig;ke.useCallback=function(e,t){return Rt.current.useCallback(e,t)};ke.useContext=function(e){return Rt.current.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e){return Rt.current.useDeferredValue(e)};ke.useEffect=function(e,t){return Rt.current.useEffect(e,t)};ke.useId=function(){return Rt.current.useId()};ke.useImperativeHandle=function(e,t,n){return Rt.current.useImperativeHandle(e,t,n)};ke.useInsertionEffect=function(e,t){return Rt.current.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return Rt.current.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return Rt.current.useMemo(e,t)};ke.useReducer=function(e,t,n){return Rt.current.useReducer(e,t,n)};ke.useRef=function(e){return Rt.current.useRef(e)};ke.useState=function(e){return Rt.current.useState(e)};ke.useSyncExternalStore=function(e,t,n){return Rt.current.useSyncExternalStore(e,t,n)};ke.useTransition=function(){return Rt.current.useTransition()};ke.version="18.3.1";Jm.exports=ke;var j=Jm.exports;const Qj=hd(j),qj=Km({__proto__:null,default:Qj},[j]);/**
9
+ */var xl=Symbol.for("react.element"),Aj=Symbol.for("react.portal"),Ij=Symbol.for("react.fragment"),Dj=Symbol.for("react.strict_mode"),Mj=Symbol.for("react.profiler"),zj=Symbol.for("react.provider"),_j=Symbol.for("react.context"),$j=Symbol.for("react.forward_ref"),Oj=Symbol.for("react.suspense"),Fj=Symbol.for("react.memo"),Uj=Symbol.for("react.lazy"),nf=Symbol.iterator;function Bj(e){return e===null||typeof e!="object"?null:(e=nf&&e[nf]||e["@@iterator"],typeof e=="function"?e:null)}var Xm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zm=Object.assign,eg={};function ri(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Xm}ri.prototype.isReactComponent={};ri.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")};ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tg(){}tg.prototype=ri.prototype;function pd(e,t,n){this.props=e,this.context=t,this.refs=eg,this.updater=n||Xm}var md=pd.prototype=new tg;md.constructor=pd;Zm(md,ri.prototype);md.isPureReactComponent=!0;var rf=Array.isArray,ng=Object.prototype.hasOwnProperty,gd={current:null},rg={key:!0,ref:!0,__self:!0,__source:!0};function sg(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)ng.call(t,r)&&!rg.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:xl,type:e,key:l,ref:a,props:i,_owner:gd.current}}function Hj(e,t){return{$$typeof:xl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xd(e){return typeof e=="object"&&e!==null&&e.$$typeof===xl}function Wj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var sf=/\/+/g;function Vo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wj(""+e.key):t.toString(36)}function da(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case xl:case Aj:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Vo(a,0):r,rf(i)?(n="",e!=null&&(n=e.replace(sf,"$&/")+"/"),da(i,t,n,"",function(c){return c})):i!=null&&(xd(i)&&(i=Hj(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(sf,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",rf(e))for(var o=0;o<e.length;o++){l=e[o];var u=r+Vo(l,o);a+=da(l,t,n,u,i)}else if(u=Bj(e),typeof u=="function")for(e=u.call(e),o=0;!(l=e.next()).done;)l=l.value,u=r+Vo(l,o++),a+=da(l,t,n,u,i);else if(l==="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 a}function $l(e,t,n){if(e==null)return e;var r=[],i=0;return da(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Vj(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Rt={current:null},ha={transition:null},Qj={ReactCurrentDispatcher:Rt,ReactCurrentBatchConfig:ha,ReactCurrentOwner:gd};function ig(){throw Error("act(...) is not supported in production builds of React.")}ke.Children={map:$l,forEach:function(e,t,n){$l(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $l(e,function(){t++}),t},toArray:function(e){return $l(e,function(t){return t})||[]},only:function(e){if(!xd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Component=ri;ke.Fragment=Ij;ke.Profiler=Mj;ke.PureComponent=pd;ke.StrictMode=Dj;ke.Suspense=Oj;ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qj;ke.act=ig;ke.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Zm({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=gd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)ng.call(t,u)&&!rg.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:xl,type:e.type,key:i,ref:l,props:r,_owner:a}};ke.createContext=function(e){return e={$$typeof:_j,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zj,_context:e},e.Consumer=e};ke.createElement=sg;ke.createFactory=function(e){var t=sg.bind(null,e);return t.type=e,t};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:$j,render:e}};ke.isValidElement=xd;ke.lazy=function(e){return{$$typeof:Uj,_payload:{_status:-1,_result:e},_init:Vj}};ke.memo=function(e,t){return{$$typeof:Fj,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=ha.transition;ha.transition={};try{e()}finally{ha.transition=t}};ke.unstable_act=ig;ke.useCallback=function(e,t){return Rt.current.useCallback(e,t)};ke.useContext=function(e){return Rt.current.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e){return Rt.current.useDeferredValue(e)};ke.useEffect=function(e,t){return Rt.current.useEffect(e,t)};ke.useId=function(){return Rt.current.useId()};ke.useImperativeHandle=function(e,t,n){return Rt.current.useImperativeHandle(e,t,n)};ke.useInsertionEffect=function(e,t){return Rt.current.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return Rt.current.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return Rt.current.useMemo(e,t)};ke.useReducer=function(e,t,n){return Rt.current.useReducer(e,t,n)};ke.useRef=function(e){return Rt.current.useRef(e)};ke.useState=function(e){return Rt.current.useState(e)};ke.useSyncExternalStore=function(e,t,n){return Rt.current.useSyncExternalStore(e,t,n)};ke.useTransition=function(){return Rt.current.useTransition()};ke.version="18.3.1";Jm.exports=ke;var j=Jm.exports;const qj=fd(j),Gj=Km({__proto__:null,default:qj},[j]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Gj=j,Kj=Symbol.for("react.element"),Yj=Symbol.for("react.fragment"),Jj=Object.prototype.hasOwnProperty,Xj=Gj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Zj={key:!0,ref:!0,__self:!0,__source:!0};function lg(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Jj.call(t,r)&&!Zj.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Kj,type:e,key:l,ref:a,props:i,_owner:Xj.current}}co.Fragment=Yj;co.jsx=lg;co.jsxs=lg;Ym.exports=co;var s=Ym.exports,ag={exports:{}},Yt={},og={exports:{}},ug={};/**
17
+ */var Kj=j,Yj=Symbol.for("react.element"),Jj=Symbol.for("react.fragment"),Xj=Object.prototype.hasOwnProperty,Zj=Kj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ew={key:!0,ref:!0,__self:!0,__source:!0};function lg(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Xj.call(t,r)&&!ew.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Yj,type:e,key:l,ref:a,props:i,_owner:Zj.current}}ho.Fragment=Jj;ho.jsx=lg;ho.jsxs=lg;Ym.exports=ho;var s=Ym.exports,ag={exports:{}},Yt={},og={exports:{}},ug={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(H,X){var S=H.length;H.push(X);e:for(;0<S;){var ae=S-1>>>1,O=H[ae];if(0<i(O,X))H[ae]=X,H[S]=O,S=ae;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var X=H[0],S=H.pop();if(S!==X){H[0]=S;e:for(var ae=0,O=H.length,C=O>>>1;ae<C;){var F=2*(ae+1)-1,Z=H[F],oe=F+1,B=H[oe];if(0>i(Z,S))oe<O&&0>i(B,Z)?(H[ae]=B,H[oe]=S,ae=oe):(H[ae]=Z,H[F]=S,ae=F);else if(oe<O&&0>i(B,S))H[ae]=B,H[oe]=S,ae=oe;else break e}}return X}function i(H,X){var S=H.sortIndex-X.sortIndex;return S!==0?S:H.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],h=1,d=null,f=3,m=!1,p=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(H){for(var X=n(c);X!==null;){if(X.callback===null)r(c);else if(X.startTime<=H)r(c),X.sortIndex=X.expirationTime,t(u,X);else break;X=n(c)}}function b(H){if(g=!1,v(H),!p)if(n(u)!==null)p=!0,Q(E);else{var X=n(c);X!==null&&J(b,X.startTime-H)}}function E(H,X){p=!1,g&&(g=!1,x(T),T=-1),m=!0;var S=f;try{for(v(X),d=n(u);d!==null&&(!(d.expirationTime>X)||H&&!P());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,f=d.priorityLevel;var O=ae(d.expirationTime<=X);X=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),v(X)}else r(u);d=n(u)}if(d!==null)var C=!0;else{var F=n(c);F!==null&&J(b,F.startTime-X),C=!1}return C}finally{d=null,f=S,m=!1}}var k=!1,L=null,T=-1,D=5,N=-1;function P(){return!(e.unstable_now()-N<D)}function A(){if(L!==null){var H=e.unstable_now();N=H;var X=!0;try{X=L(!0,H)}finally{X?z():(k=!1,L=null)}}else k=!1}var z;if(typeof y=="function")z=function(){y(A)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,I=U.port2;U.port1.onmessage=A,z=function(){I.postMessage(null)}}else z=function(){w(A,0)};function Q(H){L=H,k||(k=!0,z())}function J(H,X){T=w(function(){H(e.unstable_now())},X)}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(H){H.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,Q(E))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var X=3;break;default:X=f}var S=f;f=X;try{return H()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var S=f;f=H;try{return X()}finally{f=S}},e.unstable_scheduleCallback=function(H,X,S){var ae=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?ae+S:ae):S=ae,H){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=S+O,H={id:h++,callback:X,priorityLevel:H,startTime:S,expirationTime:O,sortIndex:-1},S>ae?(H.sortIndex=S,t(c,H),n(u)===null&&H===n(c)&&(g?(x(T),T=-1):g=!0,J(b,S-ae))):(H.sortIndex=O,t(u,H),p||m||(p=!0,Q(E))),H},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(H){var X=f;return function(){var S=f;f=X;try{return H.apply(this,arguments)}finally{f=S}}}})(ug);og.exports=ug;var ew=og.exports;/**
25
+ */(function(e){function t(H,X){var S=H.length;H.push(X);e:for(;0<S;){var ae=S-1>>>1,O=H[ae];if(0<i(O,X))H[ae]=X,H[S]=O,S=ae;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var X=H[0],S=H.pop();if(S!==X){H[0]=S;e:for(var ae=0,O=H.length,N=O>>>1;ae<N;){var F=2*(ae+1)-1,Z=H[F],oe=F+1,B=H[oe];if(0>i(Z,S))oe<O&&0>i(B,Z)?(H[ae]=B,H[oe]=S,ae=oe):(H[ae]=Z,H[F]=S,ae=F);else if(oe<O&&0>i(B,S))H[ae]=B,H[oe]=S,ae=oe;else break e}}return X}function i(H,X){var S=H.sortIndex-X.sortIndex;return S!==0?S:H.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var u=[],c=[],h=1,d=null,f=3,m=!1,p=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(H){for(var X=n(c);X!==null;){if(X.callback===null)r(c);else if(X.startTime<=H)r(c),X.sortIndex=X.expirationTime,t(u,X);else break;X=n(c)}}function b(H){if(g=!1,v(H),!p)if(n(u)!==null)p=!0,Q(E);else{var X=n(c);X!==null&&J(b,X.startTime-H)}}function E(H,X){p=!1,g&&(g=!1,x(T),T=-1),m=!0;var S=f;try{for(v(X),d=n(u);d!==null&&(!(d.expirationTime>X)||H&&!L());){var ae=d.callback;if(typeof ae=="function"){d.callback=null,f=d.priorityLevel;var O=ae(d.expirationTime<=X);X=e.unstable_now(),typeof O=="function"?d.callback=O:d===n(u)&&r(u),v(X)}else r(u);d=n(u)}if(d!==null)var N=!0;else{var F=n(c);F!==null&&J(b,F.startTime-X),N=!1}return N}finally{d=null,f=S,m=!1}}var k=!1,R=null,T=-1,D=5,C=-1;function L(){return!(e.unstable_now()-C<D)}function A(){if(R!==null){var H=e.unstable_now();C=H;var X=!0;try{X=R(!0,H)}finally{X?z():(k=!1,R=null)}}else k=!1}var z;if(typeof y=="function")z=function(){y(A)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,I=U.port2;U.port1.onmessage=A,z=function(){I.postMessage(null)}}else z=function(){w(A,0)};function Q(H){R=H,k||(k=!0,z())}function J(H,X){T=w(function(){H(e.unstable_now())},X)}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(H){H.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,Q(E))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var X=3;break;default:X=f}var S=f;f=X;try{return H()}finally{f=S}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var S=f;f=H;try{return X()}finally{f=S}},e.unstable_scheduleCallback=function(H,X,S){var ae=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?ae+S:ae):S=ae,H){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=S+O,H={id:h++,callback:X,priorityLevel:H,startTime:S,expirationTime:O,sortIndex:-1},S>ae?(H.sortIndex=S,t(c,H),n(u)===null&&H===n(c)&&(g?(x(T),T=-1):g=!0,J(b,S-ae))):(H.sortIndex=O,t(u,H),p||m||(p=!0,Q(E))),H},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(H){var X=f;return function(){var S=f;f=X;try{return H.apply(this,arguments)}finally{f=S}}}})(ug);og.exports=ug;var tw=og.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ function Km(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var tw=j,Kt=ew;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var cg=new Set,Ki={};function is(e,t){Ws(e,t),Ws(e+"Capture",t)}function Ws(e,t){for(Ki[e]=t,e=0;e<t.length;e++)cg.add(t[e])}var Bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bu=Object.prototype.hasOwnProperty,nw=/^[: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]*$/,lf={},af={};function rw(e){return Bu.call(af,e)?!0:Bu.call(lf,e)?!1:nw.test(e)?af[e]=!0:(lf[e]=!0,!1)}function sw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function iw(e,t,n,r){if(t===null||typeof t>"u"||sw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function At(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wt[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wt[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wt[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wt[e]=new At(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){wt[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wt[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wt[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wt[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wt[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var xd=/[\-:]([a-z])/g;function yd(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(xd,yd);wt[t]=new At(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(xd,yd);wt[t]=new At(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(xd,yd);wt[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wt[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});wt.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wt[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function vd(e,t,n,r){var i=wt.hasOwnProperty(t)?wt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iw(t,n,i,r)&&(n=null),r||i===null?rw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Qn=tw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ol=Symbol.for("react.element"),Ss=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),jd=Symbol.for("react.strict_mode"),Hu=Symbol.for("react.profiler"),dg=Symbol.for("react.provider"),hg=Symbol.for("react.context"),wd=Symbol.for("react.forward_ref"),Wu=Symbol.for("react.suspense"),Vu=Symbol.for("react.suspense_list"),kd=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),fg=Symbol.for("react.offscreen"),of=Symbol.iterator;function pi(e){return e===null||typeof e!="object"?null:(e=of&&e[of]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Object.assign,Wo;function Ri(e){if(Wo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wo=t&&t[1]||""}return`
34
- `+Wo+e}var Vo=!1;function Qo(e,t){if(!e||Vo)return"";Vo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
33
+ */var nw=j,Kt=tw;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var cg=new Set,Ki={};function as(e,t){Vs(e,t),Vs(e+"Capture",t)}function Vs(e,t){for(Ki[e]=t,e=0;e<t.length;e++)cg.add(t[e])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wu=Object.prototype.hasOwnProperty,rw=/^[: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]*$/,lf={},af={};function sw(e){return Wu.call(af,e)?!0:Wu.call(lf,e)?!1:rw.test(e)?af[e]=!0:(lf[e]=!0,!1)}function iw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lw(e,t,n,r){if(t===null||typeof t>"u"||iw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Lt(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wt[e]=new Lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wt[t]=new Lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wt[e]=new Lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wt[e]=new Lt(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){wt[e]=new Lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wt[e]=new Lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wt[e]=new Lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wt[e]=new Lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wt[e]=new Lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var yd=/[\-:]([a-z])/g;function vd(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(yd,vd);wt[t]=new Lt(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(yd,vd);wt[t]=new Lt(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(yd,vd);wt[t]=new Lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!1,!1)});wt.xlinkHref=new Lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function jd(e,t,n,r){var i=wt.hasOwnProperty(t)?wt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lw(t,n,i,r)&&(n=null),r||i===null?sw(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qn=nw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ol=Symbol.for("react.element"),Ns=Symbol.for("react.portal"),Cs=Symbol.for("react.fragment"),wd=Symbol.for("react.strict_mode"),Vu=Symbol.for("react.profiler"),dg=Symbol.for("react.provider"),hg=Symbol.for("react.context"),kd=Symbol.for("react.forward_ref"),Qu=Symbol.for("react.suspense"),qu=Symbol.for("react.suspense_list"),bd=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),fg=Symbol.for("react.offscreen"),of=Symbol.iterator;function pi(e){return e===null||typeof e!="object"?null:(e=of&&e[of]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Object.assign,Qo;function Ri(e){if(Qo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qo=t&&t[1]||""}return`
34
+ `+Qo+e}var qo=!1;function Go(e,t){if(!e||qo)return"";qo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
35
  `),l=r.stack.split(`
36
36
  `),a=i.length-1,o=l.length-1;1<=a&&0<=o&&i[a]!==l[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==l[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==l[o]){var u=`
37
- `+i[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{Vo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ri(e):""}function lw(e){switch(e.tag){case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 2:case 15:return e=Qo(e.type,!1),e;case 11:return e=Qo(e.type.render,!1),e;case 1:return e=Qo(e.type,!0),e;default:return""}}function Qu(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 Ns:return"Fragment";case Ss:return"Portal";case Hu:return"Profiler";case jd:return"StrictMode";case Wu:return"Suspense";case Vu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hg:return(e.displayName||"Context")+".Consumer";case dg:return(e._context.displayName||"Context")+".Provider";case wd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kd:return t=e.displayName||null,t!==null?t:Qu(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return Qu(e(t))}catch{}}return null}function aw(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 Qu(t);case 8:return t===jd?"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 yr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ow(e){var t=pg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){e._valueTracker||(e._valueTracker=ow(e))}function mg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ta(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 qu(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gg(e,t){t=t.checked,t!=null&&vd(e,"checked",t,!1)}function Gu(e,t){gg(e,t);var n=yr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ku(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ku(e,t.type,yr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ku(e,t,n){(t!=="number"||Ta(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ai=Array.isArray;function _s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+yr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Yu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function df(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Ai(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yr(n)}}function xg(e,t){var n=yr(t.value),r=yr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function hf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function yg(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 Ju(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?yg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ul,vg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ul=Ul||document.createElement("div"),Ul.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ul.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mi={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},uw=["Webkit","ms","Moz","O"];Object.keys(Mi).forEach(function(e){uw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mi[t]=Mi[e]})});function jg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mi.hasOwnProperty(e)&&Mi[e]?(""+t).trim():t+"px"}function wg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=jg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cw=Ge({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 Xu(e,t){if(t){if(cw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Zu(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 ec=null;function bd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tc=null,$s=null,Os=null;function ff(e){if(e=jl(e)){if(typeof tc!="function")throw Error(K(280));var t=e.stateNode;t&&(t=go(t),tc(e.stateNode,e.type,t))}}function kg(e){$s?Os?Os.push(e):Os=[e]:$s=e}function bg(){if($s){var e=$s,t=Os;if(Os=$s=null,ff(e),t)for(e=0;e<t.length;e++)ff(t[e])}}function Sg(e,t){return e(t)}function Ng(){}var qo=!1;function Cg(e,t,n){if(qo)return e(t,n);qo=!0;try{return Sg(e,t,n)}finally{qo=!1,($s!==null||Os!==null)&&(Ng(),bg())}}function Ji(e,t){var n=e.stateNode;if(n===null)return null;var r=go(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var nc=!1;if(Bn)try{var mi={};Object.defineProperty(mi,"passive",{get:function(){nc=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{nc=!1}function dw(e,t,n,r,i,l,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var zi=!1,Pa=null,Ra=!1,rc=null,hw={onError:function(e){zi=!0,Pa=e}};function fw(e,t,n,r,i,l,a,o,u){zi=!1,Pa=null,dw.apply(hw,arguments)}function pw(e,t,n,r,i,l,a,o,u){if(fw.apply(this,arguments),zi){if(zi){var c=Pa;zi=!1,Pa=null}else throw Error(K(198));Ra||(Ra=!0,rc=c)}}function ls(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Eg(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 pf(e){if(ls(e)!==e)throw Error(K(188))}function mw(e){var t=e.alternate;if(!t){if(t=ls(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return pf(i),e;if(l===r)return pf(i),t;l=l.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Tg(e){return e=mw(e),e!==null?Pg(e):null}function Pg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pg(e);if(t!==null)return t;e=e.sibling}return null}var Rg=Kt.unstable_scheduleCallback,mf=Kt.unstable_cancelCallback,gw=Kt.unstable_shouldYield,xw=Kt.unstable_requestPaint,tt=Kt.unstable_now,yw=Kt.unstable_getCurrentPriorityLevel,Sd=Kt.unstable_ImmediatePriority,Ag=Kt.unstable_UserBlockingPriority,Aa=Kt.unstable_NormalPriority,vw=Kt.unstable_LowPriority,Lg=Kt.unstable_IdlePriority,ho=null,An=null;function jw(e){if(An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot(ho,e,void 0,(e.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:bw,ww=Math.log,kw=Math.LN2;function bw(e){return e>>>=0,e===0?32:31-(ww(e)/kw|0)|0}var Bl=64,Hl=4194304;function Li(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 La(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Li(o):(l&=a,l!==0&&(r=Li(l)))}else a=n&~i,a!==0?r=Li(a):l!==0&&(r=Li(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gn(t),i=1<<n,r|=e[n],t&=~i;return r}function Sw(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 Nw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-gn(l),o=1<<a,u=i[a];u===-1?(!(o&n)||o&r)&&(i[a]=Sw(o,t)):u<=t&&(e.expiredLanes|=o),l&=~o}}function sc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ig(){var e=Bl;return Bl<<=1,!(Bl&4194240)&&(Bl=64),e}function Go(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gn(t),e[t]=n}function Cw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-gn(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Nd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var De=0;function Dg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mg,Cd,zg,_g,$g,ic=!1,Wl=[],cr=null,dr=null,hr=null,Xi=new Map,Zi=new Map,sr=[],Ew="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 gf(e,t){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":Xi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zi.delete(t.pointerId)}}function gi(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=jl(t),t!==null&&Cd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tw(e,t,n,r,i){switch(t){case"focusin":return cr=gi(cr,e,t,n,r,i),!0;case"dragenter":return dr=gi(dr,e,t,n,r,i),!0;case"mouseover":return hr=gi(hr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return Xi.set(l,gi(Xi.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,Zi.set(l,gi(Zi.get(l)||null,e,t,n,r,i)),!0}return!1}function Og(e){var t=Hr(e.target);if(t!==null){var n=ls(t);if(n!==null){if(t=n.tag,t===13){if(t=Eg(n),t!==null){e.blockedOn=t,$g(e.priority,function(){zg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ec=r,n.target.dispatchEvent(r),ec=null}else return t=jl(n),t!==null&&Cd(t),e.blockedOn=n,!1;t.shift()}return!0}function xf(e,t,n){fa(e)&&n.delete(t)}function Pw(){ic=!1,cr!==null&&fa(cr)&&(cr=null),dr!==null&&fa(dr)&&(dr=null),hr!==null&&fa(hr)&&(hr=null),Xi.forEach(xf),Zi.forEach(xf)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,ic||(ic=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,Pw)))}function el(e){function t(i){return xi(i,e)}if(0<Wl.length){xi(Wl[0],e);for(var n=1;n<Wl.length;n++){var r=Wl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(cr!==null&&xi(cr,e),dr!==null&&xi(dr,e),hr!==null&&xi(hr,e),Xi.forEach(t),Zi.forEach(t),n=0;n<sr.length;n++)r=sr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<sr.length&&(n=sr[0],n.blockedOn===null);)Og(n),n.blockedOn===null&&sr.shift()}var Fs=Qn.ReactCurrentBatchConfig,Ia=!0;function Rw(e,t,n,r){var i=De,l=Fs.transition;Fs.transition=null;try{De=1,Ed(e,t,n,r)}finally{De=i,Fs.transition=l}}function Aw(e,t,n,r){var i=De,l=Fs.transition;Fs.transition=null;try{De=4,Ed(e,t,n,r)}finally{De=i,Fs.transition=l}}function Ed(e,t,n,r){if(Ia){var i=lc(e,t,n,r);if(i===null)su(e,t,r,Da,n),gf(e,r);else if(Tw(i,e,t,n,r))r.stopPropagation();else if(gf(e,r),t&4&&-1<Ew.indexOf(e)){for(;i!==null;){var l=jl(i);if(l!==null&&Mg(l),l=lc(e,t,n,r),l===null&&su(e,t,r,Da,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else su(e,t,r,null,n)}}var Da=null;function lc(e,t,n,r){if(Da=null,e=bd(r),e=Hr(e),e!==null)if(t=ls(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Eg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Da=e,null}function Fg(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(yw()){case Sd:return 1;case Ag:return 4;case Aa:case vw:return 16;case Lg:return 536870912;default:return 16}default:return 16}}var lr=null,Td=null,pa=null;function Ug(){if(pa)return pa;var e,t=Td,n=t.length,r,i="value"in lr?lr.value:lr.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return pa=i.slice(e,1<r?1-r:void 0)}function ma(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 Vl(){return!0}function yf(){return!1}function Jt(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Vl:yf,this.isPropagationStopped=yf,this}return Ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vl)},persist:function(){},isPersistent:Vl}),t}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=Jt(ri),vl=Ge({},ri,{view:0,detail:0}),Lw=Jt(vl),Ko,Yo,yi,fo=Ge({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rd,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!==yi&&(yi&&e.type==="mousemove"?(Ko=e.screenX-yi.screenX,Yo=e.screenY-yi.screenY):Yo=Ko=0,yi=e),Ko)},movementY:function(e){return"movementY"in e?e.movementY:Yo}}),vf=Jt(fo),Iw=Ge({},fo,{dataTransfer:0}),Dw=Jt(Iw),Mw=Ge({},vl,{relatedTarget:0}),Jo=Jt(Mw),zw=Ge({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),_w=Jt(zw),$w=Ge({},ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ow=Jt($w),Fw=Ge({},ri,{data:0}),jf=Jt(Fw),Uw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bw={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"},Hw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ww(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hw[e])?!!t[e]:!1}function Rd(){return Ww}var Vw=Ge({},vl,{key:function(e){if(e.key){var t=Uw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rd,charCode:function(e){return e.type==="keypress"?ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qw=Jt(Vw),qw=Ge({},fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wf=Jt(qw),Gw=Ge({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rd}),Kw=Jt(Gw),Yw=Ge({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jw=Jt(Yw),Xw=Ge({},fo,{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}),Zw=Jt(Xw),e1=[9,13,27,32],Ad=Bn&&"CompositionEvent"in window,_i=null;Bn&&"documentMode"in document&&(_i=document.documentMode);var t1=Bn&&"TextEvent"in window&&!_i,Bg=Bn&&(!Ad||_i&&8<_i&&11>=_i),kf=" ",bf=!1;function Hg(e,t){switch(e){case"keyup":return e1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function n1(e,t){switch(e){case"compositionend":return Wg(t);case"keypress":return t.which!==32?null:(bf=!0,kf);case"textInput":return e=t.data,e===kf&&bf?null:e;default:return null}}function r1(e,t){if(Cs)return e==="compositionend"||!Ad&&Hg(e,t)?(e=Ug(),pa=Td=lr=null,Cs=!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 Bg&&t.locale!=="ko"?null:t.data;default:return null}}var s1={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 Sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!s1[e.type]:t==="textarea"}function Vg(e,t,n,r){kg(r),t=Ma(t,"onChange"),0<t.length&&(n=new Pd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $i=null,tl=null;function i1(e){nx(e,0)}function po(e){var t=Ps(e);if(mg(t))return e}function l1(e,t){if(e==="change")return t}var Qg=!1;if(Bn){var Xo;if(Bn){var Zo="oninput"in document;if(!Zo){var Nf=document.createElement("div");Nf.setAttribute("oninput","return;"),Zo=typeof Nf.oninput=="function"}Xo=Zo}else Xo=!1;Qg=Xo&&(!document.documentMode||9<document.documentMode)}function Cf(){$i&&($i.detachEvent("onpropertychange",qg),tl=$i=null)}function qg(e){if(e.propertyName==="value"&&po(tl)){var t=[];Vg(t,tl,e,bd(e)),Cg(i1,t)}}function a1(e,t,n){e==="focusin"?(Cf(),$i=t,tl=n,$i.attachEvent("onpropertychange",qg)):e==="focusout"&&Cf()}function o1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return po(tl)}function u1(e,t){if(e==="click")return po(t)}function c1(e,t){if(e==="input"||e==="change")return po(t)}function d1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:d1;function nl(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Bu.call(t,i)||!jn(e[i],t[i]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tf(e,t){var n=Ef(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function Gg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kg(){for(var e=window,t=Ta();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ta(e.document)}return t}function Ld(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 h1(e){var t=Kg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gg(n.ownerDocument.documentElement,n)){if(r!==null&&Ld(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Tf(n,l);var a=Tf(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var f1=Bn&&"documentMode"in document&&11>=document.documentMode,Es=null,ac=null,Oi=null,oc=!1;function Pf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oc||Es==null||Es!==Ta(r)||(r=Es,"selectionStart"in r&&Ld(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}),Oi&&nl(Oi,r)||(Oi=r,r=Ma(ac,"onSelect"),0<r.length&&(t=new Pd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Es)))}function Ql(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionend:Ql("Transition","TransitionEnd")},eu={},Yg={};Bn&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function mo(e){if(eu[e])return eu[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yg)return eu[e]=t[n];return e}var Jg=mo("animationend"),Xg=mo("animationiteration"),Zg=mo("animationstart"),ex=mo("transitionend"),tx=new Map,Rf="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 Sr(e,t){tx.set(e,t),is(t,[e])}for(var tu=0;tu<Rf.length;tu++){var nu=Rf[tu],p1=nu.toLowerCase(),m1=nu[0].toUpperCase()+nu.slice(1);Sr(p1,"on"+m1)}Sr(Jg,"onAnimationEnd");Sr(Xg,"onAnimationIteration");Sr(Zg,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(ex,"onTransitionEnd");Ws("onMouseEnter",["mouseout","mouseover"]);Ws("onMouseLeave",["mouseout","mouseover"]);Ws("onPointerEnter",["pointerout","pointerover"]);Ws("onPointerLeave",["pointerout","pointerover"]);is("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));is("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));is("onBeforeInput",["compositionend","keypress","textInput","paste"]);is("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));is("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));is("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),g1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ii));function Af(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,pw(r,t,void 0,e),e.currentTarget=null}function nx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==l&&i.isPropagationStopped())break e;Af(i,o,c),l=u}else for(a=0;a<r.length;a++){if(o=r[a],u=o.instance,c=o.currentTarget,o=o.listener,u!==l&&i.isPropagationStopped())break e;Af(i,o,c),l=u}}}if(Ra)throw e=rc,Ra=!1,rc=null,e}function Be(e,t){var n=t[fc];n===void 0&&(n=t[fc]=new Set);var r=e+"__bubble";n.has(r)||(rx(t,e,2,!1),n.add(r))}function ru(e,t,n){var r=0;t&&(r|=4),rx(n,e,r,t)}var ql="_reactListening"+Math.random().toString(36).slice(2);function rl(e){if(!e[ql]){e[ql]=!0,cg.forEach(function(n){n!=="selectionchange"&&(g1.has(n)||ru(n,!1,e),ru(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ql]||(t[ql]=!0,ru("selectionchange",!1,t))}}function rx(e,t,n,r){switch(Fg(t)){case 1:var i=Rw;break;case 4:i=Aw;break;default:i=Ed}n=i.bind(null,t,n,e),i=void 0,!nc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function su(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Hr(o),a===null)return;if(u=a.tag,u===5||u===6){r=l=a;continue e}o=o.parentNode}}r=r.return}Cg(function(){var c=l,h=bd(n),d=[];e:{var f=tx.get(e);if(f!==void 0){var m=Pd,p=e;switch(e){case"keypress":if(ma(n)===0)break e;case"keydown":case"keyup":m=Qw;break;case"focusin":p="focus",m=Jo;break;case"focusout":p="blur",m=Jo;break;case"beforeblur":case"afterblur":m=Jo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Dw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Kw;break;case Jg:case Xg:case Zg:m=_w;break;case ex:m=Jw;break;case"scroll":m=Lw;break;case"wheel":m=Zw;break;case"copy":case"cut":case"paste":m=Ow;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=wf}var g=(t&4)!==0,w=!g&&e==="scroll",x=g?f!==null?f+"Capture":null:f;g=[];for(var y=c,v;y!==null;){v=y;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,x!==null&&(b=Ji(y,x),b!=null&&g.push(sl(y,b,v)))),w)break;y=y.return}0<g.length&&(f=new m(f,p,null,n,h),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==ec&&(p=n.relatedTarget||n.fromElement)&&(Hr(p)||p[Hn]))break e;if((m||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?Hr(p):null,p!==null&&(w=ls(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=c),m!==p)){if(g=vf,b="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=wf,b="onPointerLeave",x="onPointerEnter",y="pointer"),w=m==null?f:Ps(m),v=p==null?f:Ps(p),f=new g(b,y+"leave",m,n,h),f.target=w,f.relatedTarget=v,b=null,Hr(h)===c&&(g=new g(x,y+"enter",p,n,h),g.target=v,g.relatedTarget=w,b=g),w=b,m&&p)t:{for(g=m,x=p,y=0,v=g;v;v=ys(v))y++;for(v=0,b=x;b;b=ys(b))v++;for(;0<y-v;)g=ys(g),y--;for(;0<v-y;)x=ys(x),v--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=ys(g),x=ys(x)}g=null}else g=null;m!==null&&Lf(d,f,m,g,!1),p!==null&&w!==null&&Lf(d,w,p,g,!0)}}e:{if(f=c?Ps(c):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var E=l1;else if(Sf(f))if(Qg)E=c1;else{E=o1;var k=a1}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=u1);if(E&&(E=E(e,c))){Vg(d,E,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Ku(f,"number",f.value)}switch(k=c?Ps(c):window,e){case"focusin":(Sf(k)||k.contentEditable==="true")&&(Es=k,ac=c,Oi=null);break;case"focusout":Oi=ac=Es=null;break;case"mousedown":oc=!0;break;case"contextmenu":case"mouseup":case"dragend":oc=!1,Pf(d,n,h);break;case"selectionchange":if(f1)break;case"keydown":case"keyup":Pf(d,n,h)}var L;if(Ad)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Cs?Hg(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Bg&&n.locale!=="ko"&&(Cs||T!=="onCompositionStart"?T==="onCompositionEnd"&&Cs&&(L=Ug()):(lr=h,Td="value"in lr?lr.value:lr.textContent,Cs=!0)),k=Ma(c,T),0<k.length&&(T=new jf(T,e,null,n,h),d.push({event:T,listeners:k}),L?T.data=L:(L=Wg(n),L!==null&&(T.data=L)))),(L=t1?n1(e,n):r1(e,n))&&(c=Ma(c,"onBeforeInput"),0<c.length&&(h=new jf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=L))}nx(d,t)})}function sl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ma(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=Ji(e,n),l!=null&&r.unshift(sl(e,l,i)),l=Ji(e,t),l!=null&&r.push(sl(e,l,i))),e=e.return}return r}function ys(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lf(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=Ji(n,l),u!=null&&a.unshift(sl(n,u,o))):i||(u=Ji(n,l),u!=null&&a.push(sl(n,u,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var x1=/\r\n?/g,y1=/\u0000|\uFFFD/g;function If(e){return(typeof e=="string"?e:""+e).replace(x1,`
38
- `).replace(y1,"")}function Gl(e,t,n){if(t=If(t),If(e)!==t&&n)throw Error(K(425))}function za(){}var uc=null,cc=null;function dc(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 hc=typeof setTimeout=="function"?setTimeout:void 0,v1=typeof clearTimeout=="function"?clearTimeout:void 0,Df=typeof Promise=="function"?Promise:void 0,j1=typeof queueMicrotask=="function"?queueMicrotask:typeof Df<"u"?function(e){return Df.resolve(null).then(e).catch(w1)}:hc;function w1(e){setTimeout(function(){throw e})}function iu(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),el(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);el(t)}function fr(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 Mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),Pn="__reactFiber$"+si,il="__reactProps$"+si,Hn="__reactContainer$"+si,fc="__reactEvents$"+si,k1="__reactListeners$"+si,b1="__reactHandles$"+si;function Hr(e){var t=e[Pn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hn]||n[Pn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mf(e);e!==null;){if(n=e[Pn])return n;e=Mf(e)}return t}e=n,n=e.parentNode}return null}function jl(e){return e=e[Pn]||e[Hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ps(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function go(e){return e[il]||null}var pc=[],Rs=-1;function Nr(e){return{current:e}}function He(e){0>Rs||(e.current=pc[Rs],pc[Rs]=null,Rs--)}function Ue(e,t){Rs++,pc[Rs]=e.current,e.current=t}var vr={},Ct=Nr(vr),zt=Nr(!1),Jr=vr;function Vs(e,t){var n=e.type.contextTypes;if(!n)return vr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function _t(e){return e=e.childContextTypes,e!=null}function _a(){He(zt),He(Ct)}function zf(e,t,n){if(Ct.current!==vr)throw Error(K(168));Ue(Ct,t),Ue(zt,n)}function sx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,aw(e)||"Unknown",i));return Ge({},n,r)}function $a(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vr,Jr=Ct.current,Ue(Ct,e),Ue(zt,zt.current),!0}function _f(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=sx(e,t,Jr),r.__reactInternalMemoizedMergedChildContext=e,He(zt),He(Ct),Ue(Ct,e)):He(zt),Ue(zt,n)}var _n=null,xo=!1,lu=!1;function ix(e){_n===null?_n=[e]:_n.push(e)}function S1(e){xo=!0,ix(e)}function Cr(){if(!lu&&_n!==null){lu=!0;var e=0,t=De;try{var n=_n;for(De=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}_n=null,xo=!1}catch(i){throw _n!==null&&(_n=_n.slice(e+1)),Rg(Sd,Cr),i}finally{De=t,lu=!1}}return null}var As=[],Ls=0,Oa=null,Fa=0,en=[],tn=0,Xr=null,$n=1,On="";function $r(e,t){As[Ls++]=Fa,As[Ls++]=Oa,Oa=e,Fa=t}function lx(e,t,n){en[tn++]=$n,en[tn++]=On,en[tn++]=Xr,Xr=e;var r=$n;e=On;var i=32-gn(r)-1;r&=~(1<<i),n+=1;var l=32-gn(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,$n=1<<32-gn(t)+i|n<<i|r,On=l+e}else $n=1<<l|n<<i|r,On=e}function Id(e){e.return!==null&&($r(e,1),lx(e,1,0))}function Dd(e){for(;e===Oa;)Oa=As[--Ls],As[Ls]=null,Fa=As[--Ls],As[Ls]=null;for(;e===Xr;)Xr=en[--tn],en[tn]=null,On=en[--tn],en[tn]=null,$n=en[--tn],en[tn]=null}var qt=null,Vt=null,Ve=!1,mn=null;function ax(e,t){var n=rn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $f(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,qt=e,Vt=fr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qt=e,Vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xr!==null?{id:$n,overflow:On}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,qt=e,Vt=null,!0):!1;default:return!1}}function mc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gc(e){if(Ve){var t=Vt;if(t){var n=t;if(!$f(e,t)){if(mc(e))throw Error(K(418));t=fr(n.nextSibling);var r=qt;t&&$f(e,t)?ax(r,n):(e.flags=e.flags&-4097|2,Ve=!1,qt=e)}}else{if(mc(e))throw Error(K(418));e.flags=e.flags&-4097|2,Ve=!1,qt=e}}}function Of(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qt=e}function Kl(e){if(e!==qt)return!1;if(!Ve)return Of(e),Ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!dc(e.type,e.memoizedProps)),t&&(t=Vt)){if(mc(e))throw ox(),Error(K(418));for(;t;)ax(e,t),t=fr(t.nextSibling)}if(Of(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vt=fr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vt=null}}else Vt=qt?fr(e.stateNode.nextSibling):null;return!0}function ox(){for(var e=Vt;e;)e=fr(e.nextSibling)}function Qs(){Vt=qt=null,Ve=!1}function Md(e){mn===null?mn=[e]:mn.push(e)}var N1=Qn.ReactCurrentBatchConfig;function vi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Yl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ff(e){var t=e._init;return t(e._payload)}function ux(e){function t(x,y){if(e){var v=x.deletions;v===null?(x.deletions=[y],x.flags|=16):v.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=xr(x,y),x.index=0,x.sibling=null,x}function l(x,y,v){return x.index=v,e?(v=x.alternate,v!==null?(v=v.index,v<y?(x.flags|=2,y):v):(x.flags|=2,y)):(x.flags|=1048576,y)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,y,v,b){return y===null||y.tag!==6?(y=fu(v,x.mode,b),y.return=x,y):(y=i(y,v),y.return=x,y)}function u(x,y,v,b){var E=v.type;return E===Ns?h(x,y,v.props.children,b,v.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===nr&&Ff(E)===y.type)?(b=i(y,v.props),b.ref=vi(x,y,v),b.return=x,b):(b=ka(v.type,v.key,v.props,null,x.mode,b),b.ref=vi(x,y,v),b.return=x,b)}function c(x,y,v,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=pu(v,x.mode,b),y.return=x,y):(y=i(y,v.children||[]),y.return=x,y)}function h(x,y,v,b,E){return y===null||y.tag!==7?(y=Kr(v,x.mode,b,E),y.return=x,y):(y=i(y,v),y.return=x,y)}function d(x,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=fu(""+y,x.mode,v),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ol:return v=ka(y.type,y.key,y.props,null,x.mode,v),v.ref=vi(x,null,y),v.return=x,v;case Ss:return y=pu(y,x.mode,v),y.return=x,y;case nr:var b=y._init;return d(x,b(y._payload),v)}if(Ai(y)||pi(y))return y=Kr(y,x.mode,v,null),y.return=x,y;Yl(x,y)}return null}function f(x,y,v,b){var E=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:o(x,y,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ol:return v.key===E?u(x,y,v,b):null;case Ss:return v.key===E?c(x,y,v,b):null;case nr:return E=v._init,f(x,y,E(v._payload),b)}if(Ai(v)||pi(v))return E!==null?null:h(x,y,v,b,null);Yl(x,v)}return null}function m(x,y,v,b,E){if(typeof b=="string"&&b!==""||typeof b=="number")return x=x.get(v)||null,o(y,x,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ol:return x=x.get(b.key===null?v:b.key)||null,u(y,x,b,E);case Ss:return x=x.get(b.key===null?v:b.key)||null,c(y,x,b,E);case nr:var k=b._init;return m(x,y,v,k(b._payload),E)}if(Ai(b)||pi(b))return x=x.get(v)||null,h(y,x,b,E,null);Yl(y,b)}return null}function p(x,y,v,b){for(var E=null,k=null,L=y,T=y=0,D=null;L!==null&&T<v.length;T++){L.index>T?(D=L,L=null):D=L.sibling;var N=f(x,L,v[T],b);if(N===null){L===null&&(L=D);break}e&&L&&N.alternate===null&&t(x,L),y=l(N,y,T),k===null?E=N:k.sibling=N,k=N,L=D}if(T===v.length)return n(x,L),Ve&&$r(x,T),E;if(L===null){for(;T<v.length;T++)L=d(x,v[T],b),L!==null&&(y=l(L,y,T),k===null?E=L:k.sibling=L,k=L);return Ve&&$r(x,T),E}for(L=r(x,L);T<v.length;T++)D=m(L,x,T,v[T],b),D!==null&&(e&&D.alternate!==null&&L.delete(D.key===null?T:D.key),y=l(D,y,T),k===null?E=D:k.sibling=D,k=D);return e&&L.forEach(function(P){return t(x,P)}),Ve&&$r(x,T),E}function g(x,y,v,b){var E=pi(v);if(typeof E!="function")throw Error(K(150));if(v=E.call(v),v==null)throw Error(K(151));for(var k=E=null,L=y,T=y=0,D=null,N=v.next();L!==null&&!N.done;T++,N=v.next()){L.index>T?(D=L,L=null):D=L.sibling;var P=f(x,L,N.value,b);if(P===null){L===null&&(L=D);break}e&&L&&P.alternate===null&&t(x,L),y=l(P,y,T),k===null?E=P:k.sibling=P,k=P,L=D}if(N.done)return n(x,L),Ve&&$r(x,T),E;if(L===null){for(;!N.done;T++,N=v.next())N=d(x,N.value,b),N!==null&&(y=l(N,y,T),k===null?E=N:k.sibling=N,k=N);return Ve&&$r(x,T),E}for(L=r(x,L);!N.done;T++,N=v.next())N=m(L,x,T,N.value,b),N!==null&&(e&&N.alternate!==null&&L.delete(N.key===null?T:N.key),y=l(N,y,T),k===null?E=N:k.sibling=N,k=N);return e&&L.forEach(function(A){return t(x,A)}),Ve&&$r(x,T),E}function w(x,y,v,b){if(typeof v=="object"&&v!==null&&v.type===Ns&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ol:e:{for(var E=v.key,k=y;k!==null;){if(k.key===E){if(E=v.type,E===Ns){if(k.tag===7){n(x,k.sibling),y=i(k,v.props.children),y.return=x,x=y;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===nr&&Ff(E)===k.type){n(x,k.sibling),y=i(k,v.props),y.ref=vi(x,k,v),y.return=x,x=y;break e}n(x,k);break}else t(x,k);k=k.sibling}v.type===Ns?(y=Kr(v.props.children,x.mode,b,v.key),y.return=x,x=y):(b=ka(v.type,v.key,v.props,null,x.mode,b),b.ref=vi(x,y,v),b.return=x,x=b)}return a(x);case Ss:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(x,y.sibling),y=i(y,v.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=pu(v,x.mode,b),y.return=x,x=y}return a(x);case nr:return k=v._init,w(x,y,k(v._payload),b)}if(Ai(v))return p(x,y,v,b);if(pi(v))return g(x,y,v,b);Yl(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,v),y.return=x,x=y):(n(x,y),y=fu(v,x.mode,b),y.return=x,x=y),a(x)):n(x,y)}return w}var qs=ux(!0),cx=ux(!1),Ua=Nr(null),Ba=null,Is=null,zd=null;function _d(){zd=Is=Ba=null}function $d(e){var t=Ua.current;He(Ua),e._currentValue=t}function xc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Us(e,t){Ba=e,zd=Is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(zd!==e)if(e={context:e,memoizedValue:t,next:null},Is===null){if(Ba===null)throw Error(K(308));Is=e,Ba.dependencies={lanes:0,firstContext:e}}else Is=Is.next=e;return t}var Wr=null;function Od(e){Wr===null?Wr=[e]:Wr.push(e)}function dx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Od(t)):(n.next=i.next,i.next=n),t.interleaved=n,Wn(e,r)}function Wn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rr=!1;function Fd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hx(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 Fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Te&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Wn(e,n)}return i=r.interleaved,i===null?(t.next=t,Od(r)):(t.next=i.next,i.next=t),r.interleaved=t,Wn(e,n)}function ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Nd(e,n)}}function Uf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ha(e,t,n,r){var i=e.updateQueue;rr=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?l=c:a.next=c,a=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=u))}if(l!==null){var d=i.baseState;a=0,h=c=u=null,o=l;do{var f=o.lane,m=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,g=o;switch(f=t,m=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(m,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(m,d,f):p,f==null)break e;d=Ge({},d,f);break e;case 2:rr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=m,u=d):h=h.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);es|=a,e.lanes=a,e.memoizedState=d}}function Bf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var wl={},Ln=Nr(wl),ll=Nr(wl),al=Nr(wl);function Vr(e){if(e===wl)throw Error(K(174));return e}function Ud(e,t){switch(Ue(al,t),Ue(ll,e),Ue(Ln,wl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ju(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ju(t,e)}He(Ln),Ue(Ln,t)}function Gs(){He(Ln),He(ll),He(al)}function fx(e){Vr(al.current);var t=Vr(Ln.current),n=Ju(t,e.type);t!==n&&(Ue(ll,e),Ue(Ln,n))}function Bd(e){ll.current===e&&(He(Ln),He(ll))}var Qe=Nr(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var au=[];function Hd(){for(var e=0;e<au.length;e++)au[e]._workInProgressVersionPrimary=null;au.length=0}var xa=Qn.ReactCurrentDispatcher,ou=Qn.ReactCurrentBatchConfig,Zr=0,qe=null,lt=null,ct=null,Va=!1,Fi=!1,ol=0,C1=0;function bt(){throw Error(K(321))}function Wd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Vd(e,t,n,r,i,l){if(Zr=l,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xa.current=e===null||e.memoizedState===null?R1:A1,e=n(r,i),Fi){l=0;do{if(Fi=!1,ol=0,25<=l)throw Error(K(301));l+=1,ct=lt=null,t.updateQueue=null,xa.current=L1,e=n(r,i)}while(Fi)}if(xa.current=Qa,t=lt!==null&&lt.next!==null,Zr=0,ct=lt=qe=null,Va=!1,t)throw Error(K(300));return e}function Qd(){var e=ol!==0;return ol=0,e}function En(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?qe.memoizedState=ct=e:ct=ct.next=e,ct}function on(){if(lt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=ct===null?qe.memoizedState:ct.next;if(t!==null)ct=t,lt=e;else{if(e===null)throw Error(K(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},ct===null?qe.memoizedState=ct=e:ct=ct.next=e}return ct}function ul(e,t){return typeof t=="function"?t(e):t}function uu(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,u=null,c=l;do{var h=c.lane;if((Zr&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=d,a=r):u=u.next=d,qe.lanes|=h,es|=h}c=c.next}while(c!==null&&c!==l);u===null?a=r:u.next=o,jn(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,qe.lanes|=l,es|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function cu(e){var t=on(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);jn(l,t.memoizedState)||(Mt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function px(){}function mx(e,t){var n=qe,r=on(),i=t(),l=!jn(r.memoizedState,i);if(l&&(r.memoizedState=i,Mt=!0),r=r.queue,qd(yx.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,cl(9,xx.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(K(349));Zr&30||gx(n,t,i)}return i}function gx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xx(e,t,n,r){t.value=n,t.getSnapshot=r,vx(t)&&jx(e)}function yx(e,t,n){return n(function(){vx(t)&&jx(e)})}function vx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function jx(e){var t=Wn(e,1);t!==null&&xn(t,e,1,-1)}function Hf(e){var t=En();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t.queue=e,e=e.dispatch=P1.bind(null,qe,e),[t.memoizedState,e]}function cl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function wx(){return on().memoizedState}function ya(e,t,n,r){var i=En();qe.flags|=e,i.memoizedState=cl(1|t,n,void 0,r===void 0?null:r)}function yo(e,t,n,r){var i=on();r=r===void 0?null:r;var l=void 0;if(lt!==null){var a=lt.memoizedState;if(l=a.destroy,r!==null&&Wd(r,a.deps)){i.memoizedState=cl(t,n,l,r);return}}qe.flags|=e,i.memoizedState=cl(1|t,n,l,r)}function Wf(e,t){return ya(8390656,8,e,t)}function qd(e,t){return yo(2048,8,e,t)}function kx(e,t){return yo(4,2,e,t)}function bx(e,t){return yo(4,4,e,t)}function Sx(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 Nx(e,t,n){return n=n!=null?n.concat([e]):null,yo(4,4,Sx.bind(null,t,e),n)}function Gd(){}function Cx(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ex(e,t){var n=on();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tx(e,t,n){return Zr&21?(jn(n,t)||(n=Ig(),qe.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=n)}function E1(e,t){var n=De;De=n!==0&&4>n?n:4,e(!0);var r=ou.transition;ou.transition={};try{e(!1),t()}finally{De=n,ou.transition=r}}function Px(){return on().memoizedState}function T1(e,t,n){var r=gr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rx(e))Ax(t,n);else if(n=dx(e,t,n,r),n!==null){var i=Tt();xn(n,e,r,i),Lx(n,t,r)}}function P1(e,t,n){var r=gr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rx(e))Ax(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,jn(o,a)){var u=t.interleaved;u===null?(i.next=i,Od(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=dx(e,t,i,r),n!==null&&(i=Tt(),xn(n,e,r,i),Lx(n,t,r))}}function Rx(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Ax(e,t){Fi=Va=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Nd(e,n)}}var Qa={readContext:an,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},R1={readContext:an,useCallback:function(e,t){return En().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:Wf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ya(4194308,4,Sx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return ya(4,2,e,t)},useMemo:function(e,t){var n=En();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=En();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=T1.bind(null,qe,e),[r.memoizedState,e]},useRef:function(e){var t=En();return e={current:e},t.memoizedState=e},useState:Hf,useDebugValue:Gd,useDeferredValue:function(e){return En().memoizedState=e},useTransition:function(){var e=Hf(!1),t=e[0];return e=E1.bind(null,e[1]),En().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qe,i=En();if(Ve){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ht===null)throw Error(K(349));Zr&30||gx(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Wf(yx.bind(null,r,l,e),[e]),r.flags|=2048,cl(9,xx.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=En(),t=ht.identifierPrefix;if(Ve){var n=On,r=$n;n=(r&~(1<<32-gn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ol++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=C1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},A1={readContext:an,useCallback:Cx,useContext:an,useEffect:qd,useImperativeHandle:Nx,useInsertionEffect:kx,useLayoutEffect:bx,useMemo:Ex,useReducer:uu,useRef:wx,useState:function(){return uu(ul)},useDebugValue:Gd,useDeferredValue:function(e){var t=on();return Tx(t,lt.memoizedState,e)},useTransition:function(){var e=uu(ul)[0],t=on().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1},L1={readContext:an,useCallback:Cx,useContext:an,useEffect:qd,useImperativeHandle:Nx,useInsertionEffect:kx,useLayoutEffect:bx,useMemo:Ex,useReducer:cu,useRef:wx,useState:function(){return cu(ul)},useDebugValue:Gd,useDeferredValue:function(e){var t=on();return lt===null?t.memoizedState=e:Tx(t,lt.memoizedState,e)},useTransition:function(){var e=cu(ul)[0],t=on().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1};function hn(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vo={isMounted:function(e){return(e=e._reactInternals)?ls(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=gr(e),l=Fn(r,i);l.payload=t,n!=null&&(l.callback=n),t=pr(e,l,i),t!==null&&(xn(t,e,i,r),ga(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=gr(e),l=Fn(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=pr(e,l,i),t!==null&&(xn(t,e,i,r),ga(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),r=gr(e),i=Fn(n,r);i.tag=2,t!=null&&(i.callback=t),t=pr(e,i,r),t!==null&&(xn(t,e,r,n),ga(t,e,r))}};function Vf(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!nl(n,r)||!nl(i,l):!0}function Ix(e,t,n){var r=!1,i=vr,l=t.contextType;return typeof l=="object"&&l!==null?l=an(l):(i=_t(t)?Jr:Ct.current,r=t.contextTypes,l=(r=r!=null)?Vs(e,i):vr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=vo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Qf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vo.enqueueReplaceState(t,t.state,null)}function vc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Fd(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=an(l):(l=_t(t)?Jr:Ct.current,i.context=Vs(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(yc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&vo.enqueueReplaceState(i,i.state,null),Ha(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ks(e,t){try{var n="",r=t;do n+=lw(r),r=r.return;while(r);var i=n}catch(l){i=`
37
+ `+i[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=o);break}}}finally{qo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ri(e):""}function aw(e){switch(e.tag){case 5:return Ri(e.type);case 16:return Ri("Lazy");case 13:return Ri("Suspense");case 19:return Ri("SuspenseList");case 0:case 2:case 15:return e=Go(e.type,!1),e;case 11:return e=Go(e.type.render,!1),e;case 1:return e=Go(e.type,!0),e;default:return""}}function Gu(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 Cs:return"Fragment";case Ns:return"Portal";case Vu:return"Profiler";case wd:return"StrictMode";case Qu:return"Suspense";case qu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hg:return(e.displayName||"Context")+".Consumer";case dg:return(e._context.displayName||"Context")+".Provider";case kd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bd:return t=e.displayName||null,t!==null?t:Gu(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return Gu(e(t))}catch{}}return null}function ow(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 Gu(t);case 8:return t===wd?"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 yr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uw(e){var t=pg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fl(e){e._valueTracker||(e._valueTracker=uw(e))}function mg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ta(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 Ku(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function uf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gg(e,t){t=t.checked,t!=null&&jd(e,"checked",t,!1)}function Yu(e,t){gg(e,t);var n=yr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ju(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ju(e,t.type,yr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ju(e,t,n){(t!=="number"||Ta(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Li=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+yr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Xu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function df(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Li(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yr(n)}}function xg(e,t){var n=yr(t.value),r=yr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function hf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function yg(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 Zu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?yg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ul,vg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ul=Ul||document.createElement("div"),Ul.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ul.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mi={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},cw=["Webkit","ms","Moz","O"];Object.keys(Mi).forEach(function(e){cw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mi[t]=Mi[e]})});function jg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mi.hasOwnProperty(e)&&Mi[e]?(""+t).trim():t+"px"}function wg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=jg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var dw=Ge({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 ec(e,t){if(t){if(dw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function tc(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 nc=null;function Sd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rc=null,Os=null,Fs=null;function ff(e){if(e=jl(e)){if(typeof rc!="function")throw Error(K(280));var t=e.stateNode;t&&(t=xo(t),rc(e.stateNode,e.type,t))}}function kg(e){Os?Fs?Fs.push(e):Fs=[e]:Os=e}function bg(){if(Os){var e=Os,t=Fs;if(Fs=Os=null,ff(e),t)for(e=0;e<t.length;e++)ff(t[e])}}function Sg(e,t){return e(t)}function Ng(){}var Ko=!1;function Cg(e,t,n){if(Ko)return e(t,n);Ko=!0;try{return Sg(e,t,n)}finally{Ko=!1,(Os!==null||Fs!==null)&&(Ng(),bg())}}function Ji(e,t){var n=e.stateNode;if(n===null)return null;var r=xo(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var sc=!1;if(Hn)try{var mi={};Object.defineProperty(mi,"passive",{get:function(){sc=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{sc=!1}function hw(e,t,n,r,i,l,a,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var zi=!1,Pa=null,Ra=!1,ic=null,fw={onError:function(e){zi=!0,Pa=e}};function pw(e,t,n,r,i,l,a,o,u){zi=!1,Pa=null,hw.apply(fw,arguments)}function mw(e,t,n,r,i,l,a,o,u){if(pw.apply(this,arguments),zi){if(zi){var c=Pa;zi=!1,Pa=null}else throw Error(K(198));Ra||(Ra=!0,ic=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Eg(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 pf(e){if(os(e)!==e)throw Error(K(188))}function gw(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return pf(i),e;if(l===r)return pf(i),t;l=l.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function Tg(e){return e=gw(e),e!==null?Pg(e):null}function Pg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pg(e);if(t!==null)return t;e=e.sibling}return null}var Rg=Kt.unstable_scheduleCallback,mf=Kt.unstable_cancelCallback,xw=Kt.unstable_shouldYield,yw=Kt.unstable_requestPaint,tt=Kt.unstable_now,vw=Kt.unstable_getCurrentPriorityLevel,Nd=Kt.unstable_ImmediatePriority,Lg=Kt.unstable_UserBlockingPriority,La=Kt.unstable_NormalPriority,jw=Kt.unstable_LowPriority,Ag=Kt.unstable_IdlePriority,fo=null,Ln=null;function ww(e){if(Ln&&typeof Ln.onCommitFiberRoot=="function")try{Ln.onCommitFiberRoot(fo,e,void 0,(e.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Sw,kw=Math.log,bw=Math.LN2;function Sw(e){return e>>>=0,e===0?32:31-(kw(e)/bw|0)|0}var Bl=64,Hl=4194304;function Ai(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 Aa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Ai(o):(l&=a,l!==0&&(r=Ai(l)))}else a=n&~i,a!==0?r=Ai(a):l!==0&&(r=Ai(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gn(t),i=1<<n,r|=e[n],t&=~i;return r}function Nw(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 Cw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-gn(l),o=1<<a,u=i[a];u===-1?(!(o&n)||o&r)&&(i[a]=Nw(o,t)):u<=t&&(e.expiredLanes|=o),l&=~o}}function lc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ig(){var e=Bl;return Bl<<=1,!(Bl&4194240)&&(Bl=64),e}function Yo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gn(t),e[t]=n}function Ew(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-gn(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Cd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ie=0;function Dg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mg,Ed,zg,_g,$g,ac=!1,Wl=[],cr=null,dr=null,hr=null,Xi=new Map,Zi=new Map,sr=[],Tw="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 gf(e,t){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":Xi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zi.delete(t.pointerId)}}function gi(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=jl(t),t!==null&&Ed(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Pw(e,t,n,r,i){switch(t){case"focusin":return cr=gi(cr,e,t,n,r,i),!0;case"dragenter":return dr=gi(dr,e,t,n,r,i),!0;case"mouseover":return hr=gi(hr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return Xi.set(l,gi(Xi.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,Zi.set(l,gi(Zi.get(l)||null,e,t,n,r,i)),!0}return!1}function Og(e){var t=Vr(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=Eg(n),t!==null){e.blockedOn=t,$g(e.priority,function(){zg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=oc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nc=r,n.target.dispatchEvent(r),nc=null}else return t=jl(n),t!==null&&Ed(t),e.blockedOn=n,!1;t.shift()}return!0}function xf(e,t,n){fa(e)&&n.delete(t)}function Rw(){ac=!1,cr!==null&&fa(cr)&&(cr=null),dr!==null&&fa(dr)&&(dr=null),hr!==null&&fa(hr)&&(hr=null),Xi.forEach(xf),Zi.forEach(xf)}function xi(e,t){e.blockedOn===t&&(e.blockedOn=null,ac||(ac=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,Rw)))}function el(e){function t(i){return xi(i,e)}if(0<Wl.length){xi(Wl[0],e);for(var n=1;n<Wl.length;n++){var r=Wl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(cr!==null&&xi(cr,e),dr!==null&&xi(dr,e),hr!==null&&xi(hr,e),Xi.forEach(t),Zi.forEach(t),n=0;n<sr.length;n++)r=sr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<sr.length&&(n=sr[0],n.blockedOn===null);)Og(n),n.blockedOn===null&&sr.shift()}var Us=qn.ReactCurrentBatchConfig,Ia=!0;function Lw(e,t,n,r){var i=Ie,l=Us.transition;Us.transition=null;try{Ie=1,Td(e,t,n,r)}finally{Ie=i,Us.transition=l}}function Aw(e,t,n,r){var i=Ie,l=Us.transition;Us.transition=null;try{Ie=4,Td(e,t,n,r)}finally{Ie=i,Us.transition=l}}function Td(e,t,n,r){if(Ia){var i=oc(e,t,n,r);if(i===null)lu(e,t,r,Da,n),gf(e,r);else if(Pw(i,e,t,n,r))r.stopPropagation();else if(gf(e,r),t&4&&-1<Tw.indexOf(e)){for(;i!==null;){var l=jl(i);if(l!==null&&Mg(l),l=oc(e,t,n,r),l===null&&lu(e,t,r,Da,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else lu(e,t,r,null,n)}}var Da=null;function oc(e,t,n,r){if(Da=null,e=Sd(r),e=Vr(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Eg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Da=e,null}function Fg(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(vw()){case Nd:return 1;case Lg:return 4;case La:case jw:return 16;case Ag:return 536870912;default:return 16}default:return 16}}var lr=null,Pd=null,pa=null;function Ug(){if(pa)return pa;var e,t=Pd,n=t.length,r,i="value"in lr?lr.value:lr.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return pa=i.slice(e,1<r?1-r:void 0)}function ma(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 Vl(){return!0}function yf(){return!1}function Jt(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Vl:yf,this.isPropagationStopped=yf,this}return Ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vl)},persist:function(){},isPersistent:Vl}),t}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=Jt(si),vl=Ge({},si,{view:0,detail:0}),Iw=Jt(vl),Jo,Xo,yi,po=Ge({},vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ld,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!==yi&&(yi&&e.type==="mousemove"?(Jo=e.screenX-yi.screenX,Xo=e.screenY-yi.screenY):Xo=Jo=0,yi=e),Jo)},movementY:function(e){return"movementY"in e?e.movementY:Xo}}),vf=Jt(po),Dw=Ge({},po,{dataTransfer:0}),Mw=Jt(Dw),zw=Ge({},vl,{relatedTarget:0}),Zo=Jt(zw),_w=Ge({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),$w=Jt(_w),Ow=Ge({},si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fw=Jt(Ow),Uw=Ge({},si,{data:0}),jf=Jt(Uw),Bw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hw={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"},Ww={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ww[e])?!!t[e]:!1}function Ld(){return Vw}var Qw=Ge({},vl,{key:function(e){if(e.key){var t=Bw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ld,charCode:function(e){return e.type==="keypress"?ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qw=Jt(Qw),Gw=Ge({},po,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wf=Jt(Gw),Kw=Ge({},vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ld}),Yw=Jt(Kw),Jw=Ge({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xw=Jt(Jw),Zw=Ge({},po,{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}),e1=Jt(Zw),t1=[9,13,27,32],Ad=Hn&&"CompositionEvent"in window,_i=null;Hn&&"documentMode"in document&&(_i=document.documentMode);var n1=Hn&&"TextEvent"in window&&!_i,Bg=Hn&&(!Ad||_i&&8<_i&&11>=_i),kf=" ",bf=!1;function Hg(e,t){switch(e){case"keyup":return t1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function r1(e,t){switch(e){case"compositionend":return Wg(t);case"keypress":return t.which!==32?null:(bf=!0,kf);case"textInput":return e=t.data,e===kf&&bf?null:e;default:return null}}function s1(e,t){if(Es)return e==="compositionend"||!Ad&&Hg(e,t)?(e=Ug(),pa=Pd=lr=null,Es=!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 Bg&&t.locale!=="ko"?null:t.data;default:return null}}var i1={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 Sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!i1[e.type]:t==="textarea"}function Vg(e,t,n,r){kg(r),t=Ma(t,"onChange"),0<t.length&&(n=new Rd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $i=null,tl=null;function l1(e){nx(e,0)}function mo(e){var t=Rs(e);if(mg(t))return e}function a1(e,t){if(e==="change")return t}var Qg=!1;if(Hn){var eu;if(Hn){var tu="oninput"in document;if(!tu){var Nf=document.createElement("div");Nf.setAttribute("oninput","return;"),tu=typeof Nf.oninput=="function"}eu=tu}else eu=!1;Qg=eu&&(!document.documentMode||9<document.documentMode)}function Cf(){$i&&($i.detachEvent("onpropertychange",qg),tl=$i=null)}function qg(e){if(e.propertyName==="value"&&mo(tl)){var t=[];Vg(t,tl,e,Sd(e)),Cg(l1,t)}}function o1(e,t,n){e==="focusin"?(Cf(),$i=t,tl=n,$i.attachEvent("onpropertychange",qg)):e==="focusout"&&Cf()}function u1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mo(tl)}function c1(e,t){if(e==="click")return mo(t)}function d1(e,t){if(e==="input"||e==="change")return mo(t)}function h1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:h1;function nl(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Wu.call(t,i)||!jn(e[i],t[i]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tf(e,t){var n=Ef(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function Gg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kg(){for(var e=window,t=Ta();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ta(e.document)}return t}function Id(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 f1(e){var t=Kg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gg(n.ownerDocument.documentElement,n)){if(r!==null&&Id(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Tf(n,l);var a=Tf(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var p1=Hn&&"documentMode"in document&&11>=document.documentMode,Ts=null,uc=null,Oi=null,cc=!1;function Pf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cc||Ts==null||Ts!==Ta(r)||(r=Ts,"selectionStart"in r&&Id(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}),Oi&&nl(Oi,r)||(Oi=r,r=Ma(uc,"onSelect"),0<r.length&&(t=new Rd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ts)))}function Ql(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionend:Ql("Transition","TransitionEnd")},nu={},Yg={};Hn&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function go(e){if(nu[e])return nu[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yg)return nu[e]=t[n];return e}var Jg=go("animationend"),Xg=go("animationiteration"),Zg=go("animationstart"),ex=go("transitionend"),tx=new Map,Rf="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 Sr(e,t){tx.set(e,t),as(t,[e])}for(var ru=0;ru<Rf.length;ru++){var su=Rf[ru],m1=su.toLowerCase(),g1=su[0].toUpperCase()+su.slice(1);Sr(m1,"on"+g1)}Sr(Jg,"onAnimationEnd");Sr(Xg,"onAnimationIteration");Sr(Zg,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(ex,"onTransitionEnd");Vs("onMouseEnter",["mouseout","mouseover"]);Vs("onMouseLeave",["mouseout","mouseover"]);Vs("onPointerEnter",["pointerout","pointerover"]);Vs("onPointerLeave",["pointerout","pointerover"]);as("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));as("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));as("onBeforeInput",["compositionend","keypress","textInput","paste"]);as("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));as("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));as("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),x1=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ii));function Lf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mw(r,t,void 0,e),e.currentTarget=null}function nx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==l&&i.isPropagationStopped())break e;Lf(i,o,c),l=u}else for(a=0;a<r.length;a++){if(o=r[a],u=o.instance,c=o.currentTarget,o=o.listener,u!==l&&i.isPropagationStopped())break e;Lf(i,o,c),l=u}}}if(Ra)throw e=ic,Ra=!1,ic=null,e}function Be(e,t){var n=t[mc];n===void 0&&(n=t[mc]=new Set);var r=e+"__bubble";n.has(r)||(rx(t,e,2,!1),n.add(r))}function iu(e,t,n){var r=0;t&&(r|=4),rx(n,e,r,t)}var ql="_reactListening"+Math.random().toString(36).slice(2);function rl(e){if(!e[ql]){e[ql]=!0,cg.forEach(function(n){n!=="selectionchange"&&(x1.has(n)||iu(n,!1,e),iu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ql]||(t[ql]=!0,iu("selectionchange",!1,t))}}function rx(e,t,n,r){switch(Fg(t)){case 1:var i=Lw;break;case 4:i=Aw;break;default:i=Td}n=i.bind(null,t,n,e),i=void 0,!sc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function lu(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Vr(o),a===null)return;if(u=a.tag,u===5||u===6){r=l=a;continue e}o=o.parentNode}}r=r.return}Cg(function(){var c=l,h=Sd(n),d=[];e:{var f=tx.get(e);if(f!==void 0){var m=Rd,p=e;switch(e){case"keypress":if(ma(n)===0)break e;case"keydown":case"keyup":m=qw;break;case"focusin":p="focus",m=Zo;break;case"focusout":p="blur",m=Zo;break;case"beforeblur":case"afterblur":m=Zo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Yw;break;case Jg:case Xg:case Zg:m=$w;break;case ex:m=Xw;break;case"scroll":m=Iw;break;case"wheel":m=e1;break;case"copy":case"cut":case"paste":m=Fw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=wf}var g=(t&4)!==0,w=!g&&e==="scroll",x=g?f!==null?f+"Capture":null:f;g=[];for(var y=c,v;y!==null;){v=y;var b=v.stateNode;if(v.tag===5&&b!==null&&(v=b,x!==null&&(b=Ji(y,x),b!=null&&g.push(sl(y,b,v)))),w)break;y=y.return}0<g.length&&(f=new m(f,p,null,n,h),d.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==nc&&(p=n.relatedTarget||n.fromElement)&&(Vr(p)||p[Wn]))break e;if((m||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=c,p=p?Vr(p):null,p!==null&&(w=os(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=c),m!==p)){if(g=vf,b="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=wf,b="onPointerLeave",x="onPointerEnter",y="pointer"),w=m==null?f:Rs(m),v=p==null?f:Rs(p),f=new g(b,y+"leave",m,n,h),f.target=w,f.relatedTarget=v,b=null,Vr(h)===c&&(g=new g(x,y+"enter",p,n,h),g.target=v,g.relatedTarget=w,b=g),w=b,m&&p)t:{for(g=m,x=p,y=0,v=g;v;v=vs(v))y++;for(v=0,b=x;b;b=vs(b))v++;for(;0<y-v;)g=vs(g),y--;for(;0<v-y;)x=vs(x),v--;for(;y--;){if(g===x||x!==null&&g===x.alternate)break t;g=vs(g),x=vs(x)}g=null}else g=null;m!==null&&Af(d,f,m,g,!1),p!==null&&w!==null&&Af(d,w,p,g,!0)}}e:{if(f=c?Rs(c):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var E=a1;else if(Sf(f))if(Qg)E=d1;else{E=u1;var k=o1}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=c1);if(E&&(E=E(e,c))){Vg(d,E,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Ju(f,"number",f.value)}switch(k=c?Rs(c):window,e){case"focusin":(Sf(k)||k.contentEditable==="true")&&(Ts=k,uc=c,Oi=null);break;case"focusout":Oi=uc=Ts=null;break;case"mousedown":cc=!0;break;case"contextmenu":case"mouseup":case"dragend":cc=!1,Pf(d,n,h);break;case"selectionchange":if(p1)break;case"keydown":case"keyup":Pf(d,n,h)}var R;if(Ad)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Es?Hg(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Bg&&n.locale!=="ko"&&(Es||T!=="onCompositionStart"?T==="onCompositionEnd"&&Es&&(R=Ug()):(lr=h,Pd="value"in lr?lr.value:lr.textContent,Es=!0)),k=Ma(c,T),0<k.length&&(T=new jf(T,e,null,n,h),d.push({event:T,listeners:k}),R?T.data=R:(R=Wg(n),R!==null&&(T.data=R)))),(R=n1?r1(e,n):s1(e,n))&&(c=Ma(c,"onBeforeInput"),0<c.length&&(h=new jf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=R))}nx(d,t)})}function sl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ma(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=Ji(e,n),l!=null&&r.unshift(sl(e,l,i)),l=Ji(e,t),l!=null&&r.push(sl(e,l,i))),e=e.return}return r}function vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Af(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,i?(u=Ji(n,l),u!=null&&a.unshift(sl(n,u,o))):i||(u=Ji(n,l),u!=null&&a.push(sl(n,u,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var y1=/\r\n?/g,v1=/\u0000|\uFFFD/g;function If(e){return(typeof e=="string"?e:""+e).replace(y1,`
38
+ `).replace(v1,"")}function Gl(e,t,n){if(t=If(t),If(e)!==t&&n)throw Error(K(425))}function za(){}var dc=null,hc=null;function fc(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 pc=typeof setTimeout=="function"?setTimeout:void 0,j1=typeof clearTimeout=="function"?clearTimeout:void 0,Df=typeof Promise=="function"?Promise:void 0,w1=typeof queueMicrotask=="function"?queueMicrotask:typeof Df<"u"?function(e){return Df.resolve(null).then(e).catch(k1)}:pc;function k1(e){setTimeout(function(){throw e})}function au(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),el(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);el(t)}function fr(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 Mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ii=Math.random().toString(36).slice(2),Pn="__reactFiber$"+ii,il="__reactProps$"+ii,Wn="__reactContainer$"+ii,mc="__reactEvents$"+ii,b1="__reactListeners$"+ii,S1="__reactHandles$"+ii;function Vr(e){var t=e[Pn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[Pn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mf(e);e!==null;){if(n=e[Pn])return n;e=Mf(e)}return t}e=n,n=e.parentNode}return null}function jl(e){return e=e[Pn]||e[Wn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function xo(e){return e[il]||null}var gc=[],Ls=-1;function Nr(e){return{current:e}}function He(e){0>Ls||(e.current=gc[Ls],gc[Ls]=null,Ls--)}function Ue(e,t){Ls++,gc[Ls]=e.current,e.current=t}var vr={},Ct=Nr(vr),zt=Nr(!1),Zr=vr;function Qs(e,t){var n=e.type.contextTypes;if(!n)return vr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function _t(e){return e=e.childContextTypes,e!=null}function _a(){He(zt),He(Ct)}function zf(e,t,n){if(Ct.current!==vr)throw Error(K(168));Ue(Ct,t),Ue(zt,n)}function sx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,ow(e)||"Unknown",i));return Ge({},n,r)}function $a(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vr,Zr=Ct.current,Ue(Ct,e),Ue(zt,zt.current),!0}function _f(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=sx(e,t,Zr),r.__reactInternalMemoizedMergedChildContext=e,He(zt),He(Ct),Ue(Ct,e)):He(zt),Ue(zt,n)}var $n=null,yo=!1,ou=!1;function ix(e){$n===null?$n=[e]:$n.push(e)}function N1(e){yo=!0,ix(e)}function Cr(){if(!ou&&$n!==null){ou=!0;var e=0,t=Ie;try{var n=$n;for(Ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$n=null,yo=!1}catch(i){throw $n!==null&&($n=$n.slice(e+1)),Rg(Nd,Cr),i}finally{Ie=t,ou=!1}}return null}var As=[],Is=0,Oa=null,Fa=0,tn=[],nn=0,es=null,On=1,Fn="";function Fr(e,t){As[Is++]=Fa,As[Is++]=Oa,Oa=e,Fa=t}function lx(e,t,n){tn[nn++]=On,tn[nn++]=Fn,tn[nn++]=es,es=e;var r=On;e=Fn;var i=32-gn(r)-1;r&=~(1<<i),n+=1;var l=32-gn(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,On=1<<32-gn(t)+i|n<<i|r,Fn=l+e}else On=1<<l|n<<i|r,Fn=e}function Dd(e){e.return!==null&&(Fr(e,1),lx(e,1,0))}function Md(e){for(;e===Oa;)Oa=As[--Is],As[Is]=null,Fa=As[--Is],As[Is]=null;for(;e===es;)es=tn[--nn],tn[nn]=null,Fn=tn[--nn],tn[nn]=null,On=tn[--nn],tn[nn]=null}var qt=null,Vt=null,Ve=!1,mn=null;function ax(e,t){var n=sn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $f(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,qt=e,Vt=fr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,qt=e,Vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=es!==null?{id:On,overflow:Fn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=sn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,qt=e,Vt=null,!0):!1;default:return!1}}function xc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yc(e){if(Ve){var t=Vt;if(t){var n=t;if(!$f(e,t)){if(xc(e))throw Error(K(418));t=fr(n.nextSibling);var r=qt;t&&$f(e,t)?ax(r,n):(e.flags=e.flags&-4097|2,Ve=!1,qt=e)}}else{if(xc(e))throw Error(K(418));e.flags=e.flags&-4097|2,Ve=!1,qt=e}}}function Of(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;qt=e}function Kl(e){if(e!==qt)return!1;if(!Ve)return Of(e),Ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fc(e.type,e.memoizedProps)),t&&(t=Vt)){if(xc(e))throw ox(),Error(K(418));for(;t;)ax(e,t),t=fr(t.nextSibling)}if(Of(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vt=fr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vt=null}}else Vt=qt?fr(e.stateNode.nextSibling):null;return!0}function ox(){for(var e=Vt;e;)e=fr(e.nextSibling)}function qs(){Vt=qt=null,Ve=!1}function zd(e){mn===null?mn=[e]:mn.push(e)}var C1=qn.ReactCurrentBatchConfig;function vi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function Yl(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ff(e){var t=e._init;return t(e._payload)}function ux(e){function t(x,y){if(e){var v=x.deletions;v===null?(x.deletions=[y],x.flags|=16):v.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=xr(x,y),x.index=0,x.sibling=null,x}function l(x,y,v){return x.index=v,e?(v=x.alternate,v!==null?(v=v.index,v<y?(x.flags|=2,y):v):(x.flags|=2,y)):(x.flags|=1048576,y)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function o(x,y,v,b){return y===null||y.tag!==6?(y=mu(v,x.mode,b),y.return=x,y):(y=i(y,v),y.return=x,y)}function u(x,y,v,b){var E=v.type;return E===Cs?h(x,y,v.props.children,b,v.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===nr&&Ff(E)===y.type)?(b=i(y,v.props),b.ref=vi(x,y,v),b.return=x,b):(b=ka(v.type,v.key,v.props,null,x.mode,b),b.ref=vi(x,y,v),b.return=x,b)}function c(x,y,v,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=gu(v,x.mode,b),y.return=x,y):(y=i(y,v.children||[]),y.return=x,y)}function h(x,y,v,b,E){return y===null||y.tag!==7?(y=Jr(v,x.mode,b,E),y.return=x,y):(y=i(y,v),y.return=x,y)}function d(x,y,v){if(typeof y=="string"&&y!==""||typeof y=="number")return y=mu(""+y,x.mode,v),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ol:return v=ka(y.type,y.key,y.props,null,x.mode,v),v.ref=vi(x,null,y),v.return=x,v;case Ns:return y=gu(y,x.mode,v),y.return=x,y;case nr:var b=y._init;return d(x,b(y._payload),v)}if(Li(y)||pi(y))return y=Jr(y,x.mode,v,null),y.return=x,y;Yl(x,y)}return null}function f(x,y,v,b){var E=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:o(x,y,""+v,b);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ol:return v.key===E?u(x,y,v,b):null;case Ns:return v.key===E?c(x,y,v,b):null;case nr:return E=v._init,f(x,y,E(v._payload),b)}if(Li(v)||pi(v))return E!==null?null:h(x,y,v,b,null);Yl(x,v)}return null}function m(x,y,v,b,E){if(typeof b=="string"&&b!==""||typeof b=="number")return x=x.get(v)||null,o(y,x,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ol:return x=x.get(b.key===null?v:b.key)||null,u(y,x,b,E);case Ns:return x=x.get(b.key===null?v:b.key)||null,c(y,x,b,E);case nr:var k=b._init;return m(x,y,v,k(b._payload),E)}if(Li(b)||pi(b))return x=x.get(v)||null,h(y,x,b,E,null);Yl(y,b)}return null}function p(x,y,v,b){for(var E=null,k=null,R=y,T=y=0,D=null;R!==null&&T<v.length;T++){R.index>T?(D=R,R=null):D=R.sibling;var C=f(x,R,v[T],b);if(C===null){R===null&&(R=D);break}e&&R&&C.alternate===null&&t(x,R),y=l(C,y,T),k===null?E=C:k.sibling=C,k=C,R=D}if(T===v.length)return n(x,R),Ve&&Fr(x,T),E;if(R===null){for(;T<v.length;T++)R=d(x,v[T],b),R!==null&&(y=l(R,y,T),k===null?E=R:k.sibling=R,k=R);return Ve&&Fr(x,T),E}for(R=r(x,R);T<v.length;T++)D=m(R,x,T,v[T],b),D!==null&&(e&&D.alternate!==null&&R.delete(D.key===null?T:D.key),y=l(D,y,T),k===null?E=D:k.sibling=D,k=D);return e&&R.forEach(function(L){return t(x,L)}),Ve&&Fr(x,T),E}function g(x,y,v,b){var E=pi(v);if(typeof E!="function")throw Error(K(150));if(v=E.call(v),v==null)throw Error(K(151));for(var k=E=null,R=y,T=y=0,D=null,C=v.next();R!==null&&!C.done;T++,C=v.next()){R.index>T?(D=R,R=null):D=R.sibling;var L=f(x,R,C.value,b);if(L===null){R===null&&(R=D);break}e&&R&&L.alternate===null&&t(x,R),y=l(L,y,T),k===null?E=L:k.sibling=L,k=L,R=D}if(C.done)return n(x,R),Ve&&Fr(x,T),E;if(R===null){for(;!C.done;T++,C=v.next())C=d(x,C.value,b),C!==null&&(y=l(C,y,T),k===null?E=C:k.sibling=C,k=C);return Ve&&Fr(x,T),E}for(R=r(x,R);!C.done;T++,C=v.next())C=m(R,x,T,C.value,b),C!==null&&(e&&C.alternate!==null&&R.delete(C.key===null?T:C.key),y=l(C,y,T),k===null?E=C:k.sibling=C,k=C);return e&&R.forEach(function(A){return t(x,A)}),Ve&&Fr(x,T),E}function w(x,y,v,b){if(typeof v=="object"&&v!==null&&v.type===Cs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Ol:e:{for(var E=v.key,k=y;k!==null;){if(k.key===E){if(E=v.type,E===Cs){if(k.tag===7){n(x,k.sibling),y=i(k,v.props.children),y.return=x,x=y;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===nr&&Ff(E)===k.type){n(x,k.sibling),y=i(k,v.props),y.ref=vi(x,k,v),y.return=x,x=y;break e}n(x,k);break}else t(x,k);k=k.sibling}v.type===Cs?(y=Jr(v.props.children,x.mode,b,v.key),y.return=x,x=y):(b=ka(v.type,v.key,v.props,null,x.mode,b),b.ref=vi(x,y,v),b.return=x,x=b)}return a(x);case Ns:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(x,y.sibling),y=i(y,v.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=gu(v,x.mode,b),y.return=x,x=y}return a(x);case nr:return k=v._init,w(x,y,k(v._payload),b)}if(Li(v))return p(x,y,v,b);if(pi(v))return g(x,y,v,b);Yl(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,v),y.return=x,x=y):(n(x,y),y=mu(v,x.mode,b),y.return=x,x=y),a(x)):n(x,y)}return w}var Gs=ux(!0),cx=ux(!1),Ua=Nr(null),Ba=null,Ds=null,_d=null;function $d(){_d=Ds=Ba=null}function Od(e){var t=Ua.current;He(Ua),e._currentValue=t}function vc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bs(e,t){Ba=e,_d=Ds=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function on(e){var t=e._currentValue;if(_d!==e)if(e={context:e,memoizedValue:t,next:null},Ds===null){if(Ba===null)throw Error(K(308));Ds=e,Ba.dependencies={lanes:0,firstContext:e}}else Ds=Ds.next=e;return t}var Qr=null;function Fd(e){Qr===null?Qr=[e]:Qr.push(e)}function dx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Fd(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vn(e,r)}function Vn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rr=!1;function Ud(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hx(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 Un(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Te&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vn(e,n)}return i=r.interleaved,i===null?(t.next=t,Fd(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vn(e,n)}function ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cd(e,n)}}function Uf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ha(e,t,n,r){var i=e.updateQueue;rr=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var u=o,c=u.next;u.next=null,a===null?l=c:a.next=c,a=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=u))}if(l!==null){var d=i.baseState;a=0,h=c=u=null,o=l;do{var f=o.lane,m=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,g=o;switch(f=t,m=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){d=p.call(m,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,f=typeof p=="function"?p.call(m,d,f):p,f==null)break e;d=Ge({},d,f);break e;case 2:rr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=m,u=d):h=h.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);ns|=a,e.lanes=a,e.memoizedState=d}}function Bf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var wl={},An=Nr(wl),ll=Nr(wl),al=Nr(wl);function qr(e){if(e===wl)throw Error(K(174));return e}function Bd(e,t){switch(Ue(al,t),Ue(ll,e),Ue(An,wl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zu(t,e)}He(An),Ue(An,t)}function Ks(){He(An),He(ll),He(al)}function fx(e){qr(al.current);var t=qr(An.current),n=Zu(t,e.type);t!==n&&(Ue(ll,e),Ue(An,n))}function Hd(e){ll.current===e&&(He(An),He(ll))}var Qe=Nr(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uu=[];function Wd(){for(var e=0;e<uu.length;e++)uu[e]._workInProgressVersionPrimary=null;uu.length=0}var xa=qn.ReactCurrentDispatcher,cu=qn.ReactCurrentBatchConfig,ts=0,qe=null,lt=null,ct=null,Va=!1,Fi=!1,ol=0,E1=0;function bt(){throw Error(K(321))}function Vd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Qd(e,t,n,r,i,l){if(ts=l,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,xa.current=e===null||e.memoizedState===null?L1:A1,e=n(r,i),Fi){l=0;do{if(Fi=!1,ol=0,25<=l)throw Error(K(301));l+=1,ct=lt=null,t.updateQueue=null,xa.current=I1,e=n(r,i)}while(Fi)}if(xa.current=Qa,t=lt!==null&&lt.next!==null,ts=0,ct=lt=qe=null,Va=!1,t)throw Error(K(300));return e}function qd(){var e=ol!==0;return ol=0,e}function En(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?qe.memoizedState=ct=e:ct=ct.next=e,ct}function un(){if(lt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=ct===null?qe.memoizedState:ct.next;if(t!==null)ct=t,lt=e;else{if(e===null)throw Error(K(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},ct===null?qe.memoizedState=ct=e:ct=ct.next=e}return ct}function ul(e,t){return typeof t=="function"?t(e):t}function du(e){var t=un(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,u=null,c=l;do{var h=c.lane;if((ts&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=d,a=r):u=u.next=d,qe.lanes|=h,ns|=h}c=c.next}while(c!==null&&c!==l);u===null?a=r:u.next=o,jn(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,qe.lanes|=l,ns|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hu(e){var t=un(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);jn(l,t.memoizedState)||(Mt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function px(){}function mx(e,t){var n=qe,r=un(),i=t(),l=!jn(r.memoizedState,i);if(l&&(r.memoizedState=i,Mt=!0),r=r.queue,Gd(yx.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,cl(9,xx.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(K(349));ts&30||gx(n,t,i)}return i}function gx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xx(e,t,n,r){t.value=n,t.getSnapshot=r,vx(t)&&jx(e)}function yx(e,t,n){return n(function(){vx(t)&&jx(e)})}function vx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function jx(e){var t=Vn(e,1);t!==null&&xn(t,e,1,-1)}function Hf(e){var t=En();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ul,lastRenderedState:e},t.queue=e,e=e.dispatch=R1.bind(null,qe,e),[t.memoizedState,e]}function cl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function wx(){return un().memoizedState}function ya(e,t,n,r){var i=En();qe.flags|=e,i.memoizedState=cl(1|t,n,void 0,r===void 0?null:r)}function vo(e,t,n,r){var i=un();r=r===void 0?null:r;var l=void 0;if(lt!==null){var a=lt.memoizedState;if(l=a.destroy,r!==null&&Vd(r,a.deps)){i.memoizedState=cl(t,n,l,r);return}}qe.flags|=e,i.memoizedState=cl(1|t,n,l,r)}function Wf(e,t){return ya(8390656,8,e,t)}function Gd(e,t){return vo(2048,8,e,t)}function kx(e,t){return vo(4,2,e,t)}function bx(e,t){return vo(4,4,e,t)}function Sx(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 Nx(e,t,n){return n=n!=null?n.concat([e]):null,vo(4,4,Sx.bind(null,t,e),n)}function Kd(){}function Cx(e,t){var n=un();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ex(e,t){var n=un();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tx(e,t,n){return ts&21?(jn(n,t)||(n=Ig(),qe.lanes|=n,ns|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=n)}function T1(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var r=cu.transition;cu.transition={};try{e(!1),t()}finally{Ie=n,cu.transition=r}}function Px(){return un().memoizedState}function P1(e,t,n){var r=gr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rx(e))Lx(t,n);else if(n=dx(e,t,n,r),n!==null){var i=Tt();xn(n,e,r,i),Ax(n,t,r)}}function R1(e,t,n){var r=gr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rx(e))Lx(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,jn(o,a)){var u=t.interleaved;u===null?(i.next=i,Fd(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=dx(e,t,i,r),n!==null&&(i=Tt(),xn(n,e,r,i),Ax(n,t,r))}}function Rx(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Lx(e,t){Fi=Va=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ax(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cd(e,n)}}var Qa={readContext:on,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},L1={readContext:on,useCallback:function(e,t){return En().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:Wf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ya(4194308,4,Sx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return ya(4,2,e,t)},useMemo:function(e,t){var n=En();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=En();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=P1.bind(null,qe,e),[r.memoizedState,e]},useRef:function(e){var t=En();return e={current:e},t.memoizedState=e},useState:Hf,useDebugValue:Kd,useDeferredValue:function(e){return En().memoizedState=e},useTransition:function(){var e=Hf(!1),t=e[0];return e=T1.bind(null,e[1]),En().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qe,i=En();if(Ve){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ht===null)throw Error(K(349));ts&30||gx(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Wf(yx.bind(null,r,l,e),[e]),r.flags|=2048,cl(9,xx.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=En(),t=ht.identifierPrefix;if(Ve){var n=Fn,r=On;n=(r&~(1<<32-gn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ol++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=E1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},A1={readContext:on,useCallback:Cx,useContext:on,useEffect:Gd,useImperativeHandle:Nx,useInsertionEffect:kx,useLayoutEffect:bx,useMemo:Ex,useReducer:du,useRef:wx,useState:function(){return du(ul)},useDebugValue:Kd,useDeferredValue:function(e){var t=un();return Tx(t,lt.memoizedState,e)},useTransition:function(){var e=du(ul)[0],t=un().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1},I1={readContext:on,useCallback:Cx,useContext:on,useEffect:Gd,useImperativeHandle:Nx,useInsertionEffect:kx,useLayoutEffect:bx,useMemo:Ex,useReducer:hu,useRef:wx,useState:function(){return hu(ul)},useDebugValue:Kd,useDeferredValue:function(e){var t=un();return lt===null?t.memoizedState=e:Tx(t,lt.memoizedState,e)},useTransition:function(){var e=hu(ul)[0],t=un().memoizedState;return[e,t]},useMutableSource:px,useSyncExternalStore:mx,useId:Px,unstable_isNewReconciler:!1};function hn(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function jc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jo={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=gr(e),l=Un(r,i);l.payload=t,n!=null&&(l.callback=n),t=pr(e,l,i),t!==null&&(xn(t,e,i,r),ga(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=gr(e),l=Un(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=pr(e,l,i),t!==null&&(xn(t,e,i,r),ga(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),r=gr(e),i=Un(n,r);i.tag=2,t!=null&&(i.callback=t),t=pr(e,i,r),t!==null&&(xn(t,e,r,n),ga(t,e,r))}};function Vf(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!nl(n,r)||!nl(i,l):!0}function Ix(e,t,n){var r=!1,i=vr,l=t.contextType;return typeof l=="object"&&l!==null?l=on(l):(i=_t(t)?Zr:Ct.current,r=t.contextTypes,l=(r=r!=null)?Qs(e,i):vr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function Qf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&jo.enqueueReplaceState(t,t.state,null)}function wc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ud(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=on(l):(l=_t(t)?Zr:Ct.current,i.context=Qs(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(jc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&jo.enqueueReplaceState(i,i.state,null),Ha(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Ys(e,t){try{var n="",r=t;do n+=aw(r),r=r.return;while(r);var i=n}catch(l){i=`
39
39
  Error generating stack: `+l.message+`
40
- `+l.stack}return{value:e,source:t,stack:i,digest:null}}function du(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function jc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var I1=typeof WeakMap=="function"?WeakMap:Map;function Dx(e,t,n){n=Fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ga||(Ga=!0,Rc=r),jc(e,t)},n}function Mx(e,t,n){n=Fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){jc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){jc(e,t),typeof r!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function qf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new I1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=q1.bind(null,e,t,n),t.then(e,e))}function Gf(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 Kf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Fn(-1,1),t.tag=2,pr(n,t,1))),n.lanes|=1),e)}var D1=Qn.ReactCurrentOwner,Mt=!1;function Et(e,t,n,r){t.child=e===null?cx(t,null,n,r):qs(t,e.child,n,r)}function Yf(e,t,n,r,i){n=n.render;var l=t.ref;return Us(t,i),r=Vd(e,t,n,r,l,i),n=Qd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vn(e,t,i)):(Ve&&n&&Id(t),t.flags|=1,Et(e,t,r,i),t.child)}function Jf(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!nh(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,zx(e,t,l,r,i)):(e=ka(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:nl,n(a,r)&&e.ref===t.ref)return Vn(e,t,i)}return t.flags|=1,e=xr(l,r),e.ref=t.ref,e.return=t,t.child=e}function zx(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(nl(l,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Vn(e,t,i)}return wc(e,t,n,r,i)}function _x(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(Ms,Ht),Ht|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(Ms,Ht),Ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Ue(Ms,Ht),Ht|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Ue(Ms,Ht),Ht|=r;return Et(e,t,i,n),t.child}function $x(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function wc(e,t,n,r,i){var l=_t(n)?Jr:Ct.current;return l=Vs(t,l),Us(t,i),n=Vd(e,t,n,r,l,i),r=Qd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Vn(e,t,i)):(Ve&&r&&Id(t),t.flags|=1,Et(e,t,n,i),t.child)}function Xf(e,t,n,r,i){if(_t(n)){var l=!0;$a(t)}else l=!1;if(Us(t,i),t.stateNode===null)va(e,t),Ix(t,n,r),vc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=an(c):(c=_t(n)?Jr:Ct.current,c=Vs(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Qf(t,a,r,c),rr=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),u=t.memoizedState,o!==r||f!==u||zt.current||rr?(typeof h=="function"&&(yc(t,n,h,r),u=t.memoizedState),(o=rr||Vf(t,n,o,r,f,u,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,hx(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:hn(t.type,o),a.props=c,d=t.pendingProps,f=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=an(u):(u=_t(n)?Jr:Ct.current,u=Vs(t,u));var m=n.getDerivedStateFromProps;(h=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==u)&&Qf(t,a,r,u),rr=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i);var p=t.memoizedState;o!==d||f!==p||zt.current||rr?(typeof m=="function"&&(yc(t,n,m,r),p=t.memoizedState),(c=rr||Vf(t,n,c,r,f,p,u)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return kc(e,t,n,r,l,i)}function kc(e,t,n,r,i,l){$x(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&_f(t,n,!1),Vn(e,t,l);r=t.stateNode,D1.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=qs(t,e.child,null,l),t.child=qs(t,null,o,l)):Et(e,t,o,l),t.memoizedState=r.state,i&&_f(t,n,!0),t.child}function Ox(e){var t=e.stateNode;t.pendingContext?zf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zf(e,t.context,!1),Ud(e,t.containerInfo)}function Zf(e,t,n,r,i){return Qs(),Md(i),t.flags|=256,Et(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0};function Sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fx(e,t,n){var r=t.pendingProps,i=Qe.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ue(Qe,i&1),e===null)return gc(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):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=ko(a,r,0,null),e=Kr(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Sc(n),t.memoizedState=bc,e):Kd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return M1(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=xr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=xr(o,l):(l=Kr(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?Sc(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=bc,r}return l=e.child,e=l.sibling,r=xr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Kd(e,t){return t=ko({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Jl(e,t,n,r){return r!==null&&Md(r),qs(t,e.child,null,n),e=Kd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function M1(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=du(Error(K(422))),Jl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=ko({mode:"visible",children:r.children},i,0,null),l=Kr(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&qs(t,e.child,null,a),t.child.memoizedState=Sc(a),t.memoizedState=bc,l);if(!(t.mode&1))return Jl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(K(419)),r=du(l,r,void 0),Jl(e,t,a,r)}if(o=(a&e.childLanes)!==0,Mt||o){if(r=ht,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Wn(e,i),xn(r,e,i,-1))}return th(),r=du(Error(K(421))),Jl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=G1.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,Vt=fr(i.nextSibling),qt=t,Ve=!0,mn=null,e!==null&&(en[tn++]=$n,en[tn++]=On,en[tn++]=Xr,$n=e.id,On=e.overflow,Xr=t),t=Kd(t,r.children),t.flags|=4096,t)}function ep(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xc(e.return,t,n)}function hu(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function Ux(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Et(e,t,r.children,n),r=Qe.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&&ep(e,n,t);else if(e.tag===19)ep(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ue(Qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),hu(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Wa(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}hu(t,!0,n,null,l);break;case"together":hu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function va(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=xr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function z1(e,t,n){switch(t.tag){case 3:Ox(t),Qs();break;case 5:fx(t);break;case 1:_t(t.type)&&$a(t);break;case 4:Ud(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ue(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ue(Qe,Qe.current&1),t.flags|=128,null):n&t.child.childLanes?Fx(e,t,n):(Ue(Qe,Qe.current&1),e=Vn(e,t,n),e!==null?e.sibling:null);Ue(Qe,Qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ux(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ue(Qe,Qe.current),r)break;return null;case 22:case 23:return t.lanes=0,_x(e,t,n)}return Vn(e,t,n)}var Bx,Nc,Hx,Wx;Bx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Nc=function(){};Hx=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Vr(Ln.current);var l=null;switch(n){case"input":i=qu(e,i),r=qu(e,r),l=[];break;case"select":i=Ge({},i,{value:void 0}),r=Ge({},r,{value:void 0}),l=[];break;case"textarea":i=Yu(e,i),r=Yu(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=za)}Xu(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ki.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&o[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(l||(l=[]),l.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ki.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&Be("scroll",e),l||o===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Wx=function(e,t,n,r){n!==r&&(t.flags|=4)};function ji(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _1(e,t,n){var r=t.pendingProps;switch(Dd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return _t(t.type)&&_a(),St(t),null;case 3:return r=t.stateNode,Gs(),He(zt),He(Ct),Hd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Kl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mn!==null&&(Ic(mn),mn=null))),Nc(e,t),St(t),null;case 5:Bd(t);var i=Vr(al.current);if(n=t.type,e!==null&&t.stateNode!=null)Hx(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return St(t),null}if(e=Vr(Ln.current),Kl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Pn]=t,r[il]=l,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(i=0;i<Ii.length;i++)Be(Ii[i],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":uf(r,l),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Be("invalid",r);break;case"textarea":df(r,l),Be("invalid",r)}Xu(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",""+o]):Ki.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Be("scroll",r)}switch(n){case"input":Fl(r),cf(r,l,!0);break;case"textarea":Fl(r),hf(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=za)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=yg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Pn]=t,e[il]=r,Bx(e,t,!1,!1),t.stateNode=e;e:{switch(a=Zu(n,r),n){case"dialog":Be("cancel",e),Be("close",e),i=r;break;case"iframe":case"object":case"embed":Be("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ii.length;i++)Be(Ii[i],e);i=r;break;case"source":Be("error",e),i=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),i=r;break;case"details":Be("toggle",e),i=r;break;case"input":uf(e,r),i=qu(e,r),Be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ge({},r,{value:void 0}),Be("invalid",e);break;case"textarea":df(e,r),i=Yu(e,r),Be("invalid",e);break;default:i=r}Xu(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="style"?wg(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&vg(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Yi(e,u):typeof u=="number"&&Yi(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ki.hasOwnProperty(l)?u!=null&&l==="onScroll"&&Be("scroll",e):u!=null&&vd(e,l,u,a))}switch(n){case"input":Fl(e),cf(e,r,!1);break;case"textarea":Fl(e),hf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+yr(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?_s(e,!!r.multiple,l,!1):r.defaultValue!=null&&_s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=za)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return St(t),null;case 6:if(e&&t.stateNode!=null)Wx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=Vr(al.current),Vr(Ln.current),Kl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Pn]=t,(l=r.nodeValue!==n)&&(e=qt,e!==null))switch(e.tag){case 3:Gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Pn]=t,t.stateNode=r}return St(t),null;case 13:if(He(Qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ve&&Vt!==null&&t.mode&1&&!(t.flags&128))ox(),Qs(),t.flags|=98560,l=!1;else if(l=Kl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(K(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(K(317));l[Pn]=t}else Qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),l=!1}else mn!==null&&(Ic(mn),mn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Qe.current&1?at===0&&(at=3):th())),t.updateQueue!==null&&(t.flags|=4),St(t),null);case 4:return Gs(),Nc(e,t),e===null&&rl(t.stateNode.containerInfo),St(t),null;case 10:return $d(t.type._context),St(t),null;case 17:return _t(t.type)&&_a(),St(t),null;case 19:if(He(Qe),l=t.memoizedState,l===null)return St(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)ji(l,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Wa(e),a!==null){for(t.flags|=128,ji(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ue(Qe,Qe.current&1|2),t.child}e=e.sibling}l.tail!==null&&tt()>Ys&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304)}else{if(!r)if(e=Wa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Ve)return St(t),null}else 2*tt()-l.renderingStartTime>Ys&&n!==1073741824&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=tt(),t.sibling=null,n=Qe.current,Ue(Qe,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return eh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ht&1073741824&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function $1(e,t){switch(Dd(t),t.tag){case 1:return _t(t.type)&&_a(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gs(),He(zt),He(Ct),Hd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bd(t),null;case 13:if(He(Qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return He(Qe),null;case 4:return Gs(),null;case 10:return $d(t.type._context),null;case 22:case 23:return eh(),null;case 24:return null;default:return null}}var Xl=!1,Nt=!1,O1=typeof WeakSet=="function"?WeakSet:Set,te=null;function Ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Cc(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var tp=!1;function F1(e,t){if(uc=Ia,e=Kg(),Ld(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==l||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===l&&++h===r&&(u=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(cc={focusedElem:e,selectionRange:n},Ia=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,w=p.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:hn(t.type,g),w);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){Xe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return p=tp,tp=!1,p}function Ui(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&Cc(t,n,l)}i=i.next}while(i!==r)}}function jo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ec(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Vx(e){var t=e.alternate;t!==null&&(e.alternate=null,Vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pn],delete t[il],delete t[fc],delete t[k1],delete t[b1])),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 Qx(e){return e.tag===5||e.tag===3||e.tag===4}function np(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qx(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 Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=za));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Pc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Pc(e,t,n),e=e.sibling;e!==null;)Pc(e,t,n),e=e.sibling}var xt=null,fn=!1;function Zn(e,t,n){for(n=n.child;n!==null;)qx(e,t,n),n=n.sibling}function qx(e,t,n){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount(ho,n)}catch{}switch(n.tag){case 5:Nt||Ds(n,t);case 6:var r=xt,i=fn;xt=null,Zn(e,t,n),xt=r,fn=i,xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?iu(e.parentNode,n):e.nodeType===1&&iu(e,n),el(e)):iu(xt,n.stateNode));break;case 4:r=xt,i=fn,xt=n.stateNode.containerInfo,fn=!0,Zn(e,t,n),xt=r,fn=i;break;case 0:case 11:case 14:case 15:if(!Nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&Cc(n,t,a),i=i.next}while(i!==r)}Zn(e,t,n);break;case 1:if(!Nt&&(Ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Xe(n,t,o)}Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:n.mode&1?(Nt=(r=Nt)||n.memoizedState!==null,Zn(e,t,n),Nt=r):Zn(e,t,n);break;default:Zn(e,t,n)}}function rp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new O1),t.forEach(function(r){var i=K1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:xt=o.stateNode,fn=!1;break e;case 3:xt=o.stateNode.containerInfo,fn=!0;break e;case 4:xt=o.stateNode.containerInfo,fn=!0;break e}o=o.return}if(xt===null)throw Error(K(160));qx(l,a,i),xt=null,fn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){Xe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gx(t,e),t=t.sibling}function Gx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),Cn(e),r&4){try{Ui(3,e,e.return),jo(3,e)}catch(g){Xe(e,e.return,g)}try{Ui(5,e,e.return)}catch(g){Xe(e,e.return,g)}}break;case 1:dn(t,e),Cn(e),r&512&&n!==null&&Ds(n,n.return);break;case 5:if(dn(t,e),Cn(e),r&512&&n!==null&&Ds(n,n.return),e.flags&32){var i=e.stateNode;try{Yi(i,"")}catch(g){Xe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&gg(i,l),Zu(o,a);var c=Zu(o,l);for(a=0;a<u.length;a+=2){var h=u[a],d=u[a+1];h==="style"?wg(i,d):h==="dangerouslySetInnerHTML"?vg(i,d):h==="children"?Yi(i,d):vd(i,h,d,c)}switch(o){case"input":Gu(i,l);break;case"textarea":xg(i,l);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?_s(i,!!l.multiple,m,!1):f!==!!l.multiple&&(l.defaultValue!=null?_s(i,!!l.multiple,l.defaultValue,!0):_s(i,!!l.multiple,l.multiple?[]:"",!1))}i[il]=l}catch(g){Xe(e,e.return,g)}}break;case 6:if(dn(t,e),Cn(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(g){Xe(e,e.return,g)}}break;case 3:if(dn(t,e),Cn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{el(t.containerInfo)}catch(g){Xe(e,e.return,g)}break;case 4:dn(t,e),Cn(e);break;case 13:dn(t,e),Cn(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(Xd=tt())),r&4&&rp(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Nt=(c=Nt)||h,dn(t,e),Nt=c):dn(t,e),Cn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(te=e,h=e.child;h!==null;){for(d=te=h;te!==null;){switch(f=te,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ui(4,f,f.return);break;case 1:Ds(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){Xe(r,n,g)}}break;case 5:Ds(f,f.return);break;case 22:if(f.memoizedState!==null){ip(d);continue}}m!==null?(m.return=f,te=m):ip(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=d.stateNode,u=d.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=jg("display",a))}catch(g){Xe(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Xe(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:dn(t,e),Cn(e),r&4&&rp(e);break;case 21:break;default:dn(t,e),Cn(e)}}function Cn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qx(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Yi(i,""),r.flags&=-33);var l=np(e);Pc(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=np(e);Tc(e,o,a);break;default:throw Error(K(161))}}catch(u){Xe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function U1(e,t,n){te=e,Kx(e)}function Kx(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var i=te,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Xl;if(!a){var o=i.alternate,u=o!==null&&o.memoizedState!==null||Nt;o=Xl;var c=Nt;if(Xl=a,(Nt=u)&&!c)for(te=i;te!==null;)a=te,u=a.child,a.tag===22&&a.memoizedState!==null?lp(i):u!==null?(u.return=a,te=u):lp(i);for(;l!==null;)te=l,Kx(l),l=l.sibling;te=i,Xl=o,Nt=c}sp(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,te=l):sp(e)}}function sp(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Nt||jo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Nt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:hn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Bf(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bf(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&el(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Nt||t.flags&512&&Ec(t)}catch(f){Xe(t,t.return,f)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function ip(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function lp(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{jo(4,t)}catch(u){Xe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Xe(t,i,u)}}var l=t.return;try{Ec(t)}catch(u){Xe(t,l,u)}break;case 5:var a=t.return;try{Ec(t)}catch(u){Xe(t,a,u)}}}catch(u){Xe(t,t.return,u)}if(t===e){te=null;break}var o=t.sibling;if(o!==null){o.return=t.return,te=o;break}te=t.return}}var B1=Math.ceil,qa=Qn.ReactCurrentDispatcher,Yd=Qn.ReactCurrentOwner,ln=Qn.ReactCurrentBatchConfig,Te=0,ht=null,it=null,jt=0,Ht=0,Ms=Nr(0),at=0,dl=null,es=0,wo=0,Jd=0,Bi=null,Dt=null,Xd=0,Ys=1/0,zn=null,Ga=!1,Rc=null,mr=null,Zl=!1,ar=null,Ka=0,Hi=0,Ac=null,ja=-1,wa=0;function Tt(){return Te&6?tt():ja!==-1?ja:ja=tt()}function gr(e){return e.mode&1?Te&2&&jt!==0?jt&-jt:N1.transition!==null?(wa===0&&(wa=Ig()),wa):(e=De,e!==0||(e=window.event,e=e===void 0?16:Fg(e.type)),e):1}function xn(e,t,n,r){if(50<Hi)throw Hi=0,Ac=null,Error(K(185));yl(e,n,r),(!(Te&2)||e!==ht)&&(e===ht&&(!(Te&2)&&(wo|=n),at===4&&ir(e,jt)),$t(e,r),n===1&&Te===0&&!(t.mode&1)&&(Ys=tt()+500,xo&&Cr()))}function $t(e,t){var n=e.callbackNode;Nw(e,t);var r=La(e,e===ht?jt:0);if(r===0)n!==null&&mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mf(n),t===1)e.tag===0?S1(ap.bind(null,e)):ix(ap.bind(null,e)),j1(function(){!(Te&6)&&Cr()}),n=null;else{switch(Dg(r)){case 1:n=Sd;break;case 4:n=Ag;break;case 16:n=Aa;break;case 536870912:n=Lg;break;default:n=Aa}n=ry(n,Yx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yx(e,t){if(ja=-1,wa=0,Te&6)throw Error(K(327));var n=e.callbackNode;if(Bs()&&e.callbackNode!==n)return null;var r=La(e,e===ht?jt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ya(e,r);else{t=r;var i=Te;Te|=2;var l=Xx();(ht!==e||jt!==t)&&(zn=null,Ys=tt()+500,Gr(e,t));do try{V1();break}catch(o){Jx(e,o)}while(!0);_d(),qa.current=l,Te=i,it!==null?t=0:(ht=null,jt=0,t=at)}if(t!==0){if(t===2&&(i=sc(e),i!==0&&(r=i,t=Lc(e,i))),t===1)throw n=dl,Gr(e,0),ir(e,r),$t(e,tt()),n;if(t===6)ir(e,r);else{if(i=e.current.alternate,!(r&30)&&!H1(i)&&(t=Ya(e,r),t===2&&(l=sc(e),l!==0&&(r=l,t=Lc(e,l))),t===1))throw n=dl,Gr(e,0),ir(e,r),$t(e,tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Or(e,Dt,zn);break;case 3:if(ir(e,r),(r&130023424)===r&&(t=Xd+500-tt(),10<t)){if(La(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Tt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=hc(Or.bind(null,e,Dt,zn),t);break}Or(e,Dt,zn);break;case 4:if(ir(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-gn(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*B1(r/1960))-r,10<r){e.timeoutHandle=hc(Or.bind(null,e,Dt,zn),r);break}Or(e,Dt,zn);break;case 5:Or(e,Dt,zn);break;default:throw Error(K(329))}}}return $t(e,tt()),e.callbackNode===n?Yx.bind(null,e):null}function Lc(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Gr(e,t).flags|=256),e=Ya(e,t),e!==2&&(t=Dt,Dt=n,t!==null&&Ic(t)),e}function Ic(e){Dt===null?Dt=e:Dt.push.apply(Dt,e)}function H1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!jn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ir(e,t){for(t&=~Jd,t&=~wo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gn(t),r=1<<n;e[n]=-1,t&=~r}}function ap(e){if(Te&6)throw Error(K(327));Bs();var t=La(e,0);if(!(t&1))return $t(e,tt()),null;var n=Ya(e,t);if(e.tag!==0&&n===2){var r=sc(e);r!==0&&(t=r,n=Lc(e,r))}if(n===1)throw n=dl,Gr(e,0),ir(e,t),$t(e,tt()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Or(e,Dt,zn),$t(e,tt()),null}function Zd(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(Ys=tt()+500,xo&&Cr())}}function ts(e){ar!==null&&ar.tag===0&&!(Te&6)&&Bs();var t=Te;Te|=1;var n=ln.transition,r=De;try{if(ln.transition=null,De=1,e)return e()}finally{De=r,ln.transition=n,Te=t,!(Te&6)&&Cr()}}function eh(){Ht=Ms.current,He(Ms)}function Gr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,v1(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Dd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_a();break;case 3:Gs(),He(zt),He(Ct),Hd();break;case 5:Bd(r);break;case 4:Gs();break;case 13:He(Qe);break;case 19:He(Qe);break;case 10:$d(r.type._context);break;case 22:case 23:eh()}n=n.return}if(ht=e,it=e=xr(e.current,null),jt=Ht=t,at=0,dl=null,Jd=wo=es=0,Dt=Bi=null,Wr!==null){for(t=0;t<Wr.length;t++)if(n=Wr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}Wr=null}return e}function Jx(e,t){do{var n=it;try{if(_d(),xa.current=Qa,Va){for(var r=qe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Va=!1}if(Zr=0,ct=lt=qe=null,Fi=!1,ol=0,Yd.current=null,n===null||n.return===null){at=1,dl=t,it=null;break}e:{var l=e,a=n.return,o=n,u=t;if(t=jt,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=Gf(a);if(m!==null){m.flags&=-257,Kf(m,a,o,l,t),m.mode&1&&qf(l,c,t),t=m,u=c;var p=t.updateQueue;if(p===null){var g=new Set;g.add(u),t.updateQueue=g}else p.add(u);break e}else{if(!(t&1)){qf(l,c,t),th();break e}u=Error(K(426))}}else if(Ve&&o.mode&1){var w=Gf(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Kf(w,a,o,l,t),Md(Ks(u,o));break e}}l=u=Ks(u,o),at!==4&&(at=2),Bi===null?Bi=[l]:Bi.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var x=Dx(l,u,t);Uf(l,x);break e;case 1:o=u;var y=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(mr===null||!mr.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=Mx(l,o,t);Uf(l,b);break e}}l=l.return}while(l!==null)}ey(n)}catch(E){t=E,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function Xx(){var e=qa.current;return qa.current=Qa,e===null?Qa:e}function th(){(at===0||at===3||at===2)&&(at=4),ht===null||!(es&268435455)&&!(wo&268435455)||ir(ht,jt)}function Ya(e,t){var n=Te;Te|=2;var r=Xx();(ht!==e||jt!==t)&&(zn=null,Gr(e,t));do try{W1();break}catch(i){Jx(e,i)}while(!0);if(_d(),Te=n,qa.current=r,it!==null)throw Error(K(261));return ht=null,jt=0,at}function W1(){for(;it!==null;)Zx(it)}function V1(){for(;it!==null&&!gw();)Zx(it)}function Zx(e){var t=ny(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?ey(e):it=t,Yd.current=null}function ey(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$1(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,it=null;return}}else if(n=_1(n,t,Ht),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);at===0&&(at=5)}function Or(e,t,n){var r=De,i=ln.transition;try{ln.transition=null,De=1,Q1(e,t,n,r)}finally{ln.transition=i,De=r}return null}function Q1(e,t,n,r){do Bs();while(ar!==null);if(Te&6)throw Error(K(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Cw(e,l),e===ht&&(it=ht=null,jt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zl||(Zl=!0,ry(Aa,function(){return Bs(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=ln.transition,ln.transition=null;var a=De;De=1;var o=Te;Te|=4,Yd.current=null,F1(e,n),Gx(n,e),h1(cc),Ia=!!uc,cc=uc=null,e.current=n,U1(n),xw(),Te=o,De=a,ln.transition=l}else e.current=n;if(Zl&&(Zl=!1,ar=e,Ka=i),l=e.pendingLanes,l===0&&(mr=null),jw(n.stateNode),$t(e,tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ga)throw Ga=!1,e=Rc,Rc=null,e;return Ka&1&&e.tag!==0&&Bs(),l=e.pendingLanes,l&1?e===Ac?Hi++:(Hi=0,Ac=e):Hi=0,Cr(),null}function Bs(){if(ar!==null){var e=Dg(Ka),t=ln.transition,n=De;try{if(ln.transition=null,De=16>e?16:e,ar===null)var r=!1;else{if(e=ar,ar=null,Ka=0,Te&6)throw Error(K(331));var i=Te;for(Te|=4,te=e.current;te!==null;){var l=te,a=l.child;if(te.flags&16){var o=l.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(te=c;te!==null;){var h=te;switch(h.tag){case 0:case 11:case 15:Ui(8,h,l)}var d=h.child;if(d!==null)d.return=h,te=d;else for(;te!==null;){h=te;var f=h.sibling,m=h.return;if(Vx(h),h===c){te=null;break}if(f!==null){f.return=m,te=f;break}te=m}}}var p=l.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}te=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,te=a;else e:for(;te!==null;){if(l=te,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Ui(9,l,l.return)}var x=l.sibling;if(x!==null){x.return=l.return,te=x;break e}te=l.return}}var y=e.current;for(te=y;te!==null;){a=te;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,te=v;else e:for(a=y;te!==null;){if(o=te,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:jo(9,o)}}catch(E){Xe(o,o.return,E)}if(o===a){te=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,te=b;break e}te=o.return}}if(Te=i,Cr(),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot(ho,e)}catch{}r=!0}return r}finally{De=n,ln.transition=t}}return!1}function op(e,t,n){t=Ks(n,t),t=Dx(e,t,1),e=pr(e,t,1),t=Tt(),e!==null&&(yl(e,1,t),$t(e,t))}function Xe(e,t,n){if(e.tag===3)op(e,e,n);else for(;t!==null;){if(t.tag===3){op(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mr===null||!mr.has(r))){e=Ks(n,e),e=Mx(t,e,1),t=pr(t,e,1),e=Tt(),t!==null&&(yl(t,1,e),$t(t,e));break}}t=t.return}}function q1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tt(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(jt&n)===n&&(at===4||at===3&&(jt&130023424)===jt&&500>tt()-Xd?Gr(e,0):Jd|=n),$t(e,t)}function ty(e,t){t===0&&(e.mode&1?(t=Hl,Hl<<=1,!(Hl&130023424)&&(Hl=4194304)):t=1);var n=Tt();e=Wn(e,t),e!==null&&(yl(e,t,n),$t(e,n))}function G1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function K1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),ty(e,n)}var ny;ny=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zt.current)Mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mt=!1,z1(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Ve&&t.flags&1048576&&lx(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;va(e,t),e=t.pendingProps;var i=Vs(t,Ct.current);Us(t,n),i=Vd(null,t,r,e,i,n);var l=Qd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(r)?(l=!0,$a(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Fd(t),i.updater=vo,t.stateNode=i,i._reactInternals=t,vc(t,r,e,n),t=kc(null,t,r,!0,l,n)):(t.tag=0,Ve&&l&&Id(t),Et(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(va(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=J1(r),e=hn(r,e),i){case 0:t=wc(null,t,r,e,n);break e;case 1:t=Xf(null,t,r,e,n);break e;case 11:t=Yf(null,t,r,e,n);break e;case 14:t=Jf(null,t,r,hn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),wc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Xf(e,t,r,i,n);case 3:e:{if(Ox(t),e===null)throw Error(K(387));r=t.pendingProps,l=t.memoizedState,i=l.element,hx(e,t),Ha(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Ks(Error(K(423)),t),t=Zf(e,t,r,n,i);break e}else if(r!==i){i=Ks(Error(K(424)),t),t=Zf(e,t,r,n,i);break e}else for(Vt=fr(t.stateNode.containerInfo.firstChild),qt=t,Ve=!0,mn=null,n=cx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qs(),r===i){t=Vn(e,t,n);break e}Et(e,t,r,n)}t=t.child}return t;case 5:return fx(t),e===null&&gc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,dc(r,i)?a=null:l!==null&&dc(r,l)&&(t.flags|=32),$x(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&gc(t),null;case 13:return Fx(e,t,n);case 4:return Ud(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qs(t,null,r,n):Et(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Yf(e,t,r,i,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,Ue(Ua,r._currentValue),r._currentValue=a,l!==null)if(jn(l.value,a)){if(l.children===i.children&&!zt.current){t=Vn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Fn(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),xc(l.return,n,t),o.lanes|=n;break}u=u.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(K(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),xc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}Et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Us(t,n),i=an(i),r=r(i),t.flags|=1,Et(e,t,r,n),t.child;case 14:return r=t.type,i=hn(r,t.pendingProps),i=hn(r.type,i),Jf(e,t,r,i,n);case 15:return zx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),va(e,t),t.tag=1,_t(r)?(e=!0,$a(t)):e=!1,Us(t,n),Ix(t,r,i),vc(t,r,i,n),kc(null,t,r,!0,e,n);case 19:return Ux(e,t,n);case 22:return _x(e,t,n)}throw Error(K(156,t.tag))};function ry(e,t){return Rg(e,t)}function Y1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,n,r){return new Y1(e,t,n,r)}function nh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function J1(e){if(typeof e=="function")return nh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wd)return 11;if(e===kd)return 14}return 2}function xr(e,t){var n=e.alternate;return n===null?(n=rn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ka(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")nh(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ns:return Kr(n.children,i,l,t);case jd:a=8,i|=8;break;case Hu:return e=rn(12,n,t,i|2),e.elementType=Hu,e.lanes=l,e;case Wu:return e=rn(13,n,t,i),e.elementType=Wu,e.lanes=l,e;case Vu:return e=rn(19,n,t,i),e.elementType=Vu,e.lanes=l,e;case fg:return ko(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dg:a=10;break e;case hg:a=9;break e;case wd:a=11;break e;case kd:a=14;break e;case nr:a=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=rn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Kr(e,t,n,r){return e=rn(7,e,r,t),e.lanes=n,e}function ko(e,t,n,r){return e=rn(22,e,r,t),e.elementType=fg,e.lanes=n,e.stateNode={isHidden:!1},e}function fu(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function pu(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function X1(e,t,n,r,i){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=Go(0),this.expirationTimes=Go(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function rh(e,t,n,r,i,l,a,o,u){return e=new X1(e,t,n,o,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=rn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fd(l),e}function Z1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ss,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sy(e){if(!e)return vr;e=e._reactInternals;e:{if(ls(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(_t(n))return sx(e,n,t)}return t}function iy(e,t,n,r,i,l,a,o,u){return e=rh(n,r,!0,e,i,l,a,o,u),e.context=sy(null),n=e.current,r=Tt(),i=gr(n),l=Fn(r,i),l.callback=t??null,pr(n,l,i),e.current.lanes=i,yl(e,i,r),$t(e,r),e}function bo(e,t,n,r){var i=t.current,l=Tt(),a=gr(i);return n=sy(n),t.context===null?t.context=n:t.pendingContext=n,t=Fn(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pr(i,t,a),e!==null&&(xn(e,i,a,l),ga(e,i,a)),a}function Ja(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 up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sh(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function ek(){return null}var ly=typeof reportError=="function"?reportError:function(e){console.error(e)};function ih(e){this._internalRoot=e}So.prototype.render=ih.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));bo(e,t,null,null)};So.prototype.unmount=ih.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){bo(null,e,null,null)}),t[Hn]=null}};function So(e){this._internalRoot=e}So.prototype.unstable_scheduleHydration=function(e){if(e){var t=_g();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sr.length&&t!==0&&t<sr[n].priority;n++);sr.splice(n,0,e),n===0&&Og(e)}};function lh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function No(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cp(){}function tk(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var c=Ja(a);l.call(c)}}var a=iy(t,r,e,0,null,!1,!1,"",cp);return e._reactRootContainer=a,e[Hn]=a.current,rl(e.nodeType===8?e.parentNode:e),ts(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Ja(u);o.call(c)}}var u=rh(e,0,!1,null,null,!1,!1,"",cp);return e._reactRootContainer=u,e[Hn]=u.current,rl(e.nodeType===8?e.parentNode:e),ts(function(){bo(t,u,n,r)}),u}function Co(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var u=Ja(a);o.call(u)}}bo(t,a,e,i)}else a=tk(n,t,e,i,r);return Ja(a)}Mg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Li(t.pendingLanes);n!==0&&(Nd(t,n|1),$t(t,tt()),!(Te&6)&&(Ys=tt()+500,Cr()))}break;case 13:ts(function(){var r=Wn(e,1);if(r!==null){var i=Tt();xn(r,e,1,i)}}),sh(e,1)}};Cd=function(e){if(e.tag===13){var t=Wn(e,134217728);if(t!==null){var n=Tt();xn(t,e,134217728,n)}sh(e,134217728)}};zg=function(e){if(e.tag===13){var t=gr(e),n=Wn(e,t);if(n!==null){var r=Tt();xn(n,e,t,r)}sh(e,t)}};_g=function(){return De};$g=function(e,t){var n=De;try{return De=e,t()}finally{De=n}};tc=function(e,t,n){switch(t){case"input":if(Gu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=go(r);if(!i)throw Error(K(90));mg(r),Gu(r,i)}}}break;case"textarea":xg(e,n);break;case"select":t=n.value,t!=null&&_s(e,!!n.multiple,t,!1)}};Sg=Zd;Ng=ts;var nk={usingClientEntryPoint:!1,Events:[jl,Ps,go,kg,bg,Zd]},wi={findFiberByHostInstance:Hr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rk={bundleType:wi.bundleType,version:wi.version,rendererPackageName:wi.rendererPackageName,rendererConfig:wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tg(e),e===null?null:e.stateNode},findFiberByHostInstance:wi.findFiberByHostInstance||ek,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 ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ea.isDisabled&&ea.supportsFiber)try{ho=ea.inject(rk),An=ea}catch{}}Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nk;Yt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lh(t))throw Error(K(200));return Z1(e,t,null,n)};Yt.createRoot=function(e,t){if(!lh(e))throw Error(K(299));var n=!1,r="",i=ly;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=rh(e,1,!1,null,null,n,!1,r,i),e[Hn]=t.current,rl(e.nodeType===8?e.parentNode:e),new ih(t)};Yt.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Tg(t),e=e===null?null:e.stateNode,e};Yt.flushSync=function(e){return ts(e)};Yt.hydrate=function(e,t,n){if(!No(t))throw Error(K(200));return Co(null,e,t,!0,n)};Yt.hydrateRoot=function(e,t,n){if(!lh(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=ly;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=iy(t,null,e,1,n??null,i,!1,l,a),e[Hn]=t.current,rl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new So(t)};Yt.render=function(e,t,n){if(!No(t))throw Error(K(200));return Co(null,e,t,!1,n)};Yt.unmountComponentAtNode=function(e){if(!No(e))throw Error(K(40));return e._reactRootContainer?(ts(function(){Co(null,null,e,!1,function(){e._reactRootContainer=null,e[Hn]=null})}),!0):!1};Yt.unstable_batchedUpdates=Zd;Yt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!No(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Co(e,t,n,!1,r)};Yt.version="18.3.1-next-f1338f8080-20240426";function ay(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ay)}catch(e){console.error(e)}}ay(),ag.exports=Yt;var as=ag.exports;const sk=hd(as),ik=Km({__proto__:null,default:sk},[as]);var oy,dp=as;oy=dp.createRoot,dp.hydrateRoot;/**
40
+ `+l.stack}return{value:e,source:t,stack:i,digest:null}}function fu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function kc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var D1=typeof WeakMap=="function"?WeakMap:Map;function Dx(e,t,n){n=Un(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ga||(Ga=!0,Ac=r),kc(e,t)},n}function Mx(e,t,n){n=Un(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){kc(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){kc(e,t),typeof r!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function qf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new D1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=G1.bind(null,e,t,n),t.then(e,e))}function Gf(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 Kf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Un(-1,1),t.tag=2,pr(n,t,1))),n.lanes|=1),e)}var M1=qn.ReactCurrentOwner,Mt=!1;function Et(e,t,n,r){t.child=e===null?cx(t,null,n,r):Gs(t,e.child,n,r)}function Yf(e,t,n,r,i){n=n.render;var l=t.ref;return Bs(t,i),r=Qd(e,t,n,r,l,i),n=qd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Ve&&n&&Dd(t),t.flags|=1,Et(e,t,r,i),t.child)}function Jf(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!rh(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,zx(e,t,l,r,i)):(e=ka(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:nl,n(a,r)&&e.ref===t.ref)return Qn(e,t,i)}return t.flags|=1,e=xr(l,r),e.ref=t.ref,e.return=t,t.child=e}function zx(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(nl(l,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Qn(e,t,i)}return bc(e,t,n,r,i)}function _x(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(zs,Ht),Ht|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(zs,Ht),Ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,Ue(zs,Ht),Ht|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,Ue(zs,Ht),Ht|=r;return Et(e,t,i,n),t.child}function $x(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function bc(e,t,n,r,i){var l=_t(n)?Zr:Ct.current;return l=Qs(t,l),Bs(t,i),n=Qd(e,t,n,r,l,i),r=qd(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Qn(e,t,i)):(Ve&&r&&Dd(t),t.flags|=1,Et(e,t,n,i),t.child)}function Xf(e,t,n,r,i){if(_t(n)){var l=!0;$a(t)}else l=!1;if(Bs(t,i),t.stateNode===null)va(e,t),Ix(t,n,r),wc(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=on(c):(c=_t(n)?Zr:Ct.current,c=Qs(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Qf(t,a,r,c),rr=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),u=t.memoizedState,o!==r||f!==u||zt.current||rr?(typeof h=="function"&&(jc(t,n,h,r),u=t.memoizedState),(o=rr||Vf(t,n,o,r,f,u,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,hx(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:hn(t.type,o),a.props=c,d=t.pendingProps,f=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=on(u):(u=_t(n)?Zr:Ct.current,u=Qs(t,u));var m=n.getDerivedStateFromProps;(h=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==u)&&Qf(t,a,r,u),rr=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i);var p=t.memoizedState;o!==d||f!==p||zt.current||rr?(typeof m=="function"&&(jc(t,n,m,r),p=t.memoizedState),(c=rr||Vf(t,n,c,r,f,p,u)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Sc(e,t,n,r,l,i)}function Sc(e,t,n,r,i,l){$x(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&_f(t,n,!1),Qn(e,t,l);r=t.stateNode,M1.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Gs(t,e.child,null,l),t.child=Gs(t,null,o,l)):Et(e,t,o,l),t.memoizedState=r.state,i&&_f(t,n,!0),t.child}function Ox(e){var t=e.stateNode;t.pendingContext?zf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zf(e,t.context,!1),Bd(e,t.containerInfo)}function Zf(e,t,n,r,i){return qs(),zd(i),t.flags|=256,Et(e,t,n,r),t.child}var Nc={dehydrated:null,treeContext:null,retryLane:0};function Cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fx(e,t,n){var r=t.pendingProps,i=Qe.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ue(Qe,i&1),e===null)return yc(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):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=bo(a,r,0,null),e=Jr(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Cc(n),t.memoizedState=Nc,e):Yd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return z1(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=xr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=xr(o,l):(l=Jr(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?Cc(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=Nc,r}return l=e.child,e=l.sibling,r=xr(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Yd(e,t){return t=bo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Jl(e,t,n,r){return r!==null&&zd(r),Gs(t,e.child,null,n),e=Yd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function z1(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=fu(Error(K(422))),Jl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=bo({mode:"visible",children:r.children},i,0,null),l=Jr(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Gs(t,e.child,null,a),t.child.memoizedState=Cc(a),t.memoizedState=Nc,l);if(!(t.mode&1))return Jl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(K(419)),r=fu(l,r,void 0),Jl(e,t,a,r)}if(o=(a&e.childLanes)!==0,Mt||o){if(r=ht,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,Vn(e,i),xn(r,e,i,-1))}return nh(),r=fu(Error(K(421))),Jl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=K1.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,Vt=fr(i.nextSibling),qt=t,Ve=!0,mn=null,e!==null&&(tn[nn++]=On,tn[nn++]=Fn,tn[nn++]=es,On=e.id,Fn=e.overflow,es=t),t=Yd(t,r.children),t.flags|=4096,t)}function ep(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vc(e.return,t,n)}function pu(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function Ux(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if(Et(e,t,r.children,n),r=Qe.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&&ep(e,n,t);else if(e.tag===19)ep(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ue(Qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pu(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Wa(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pu(t,!0,n,null,l);break;case"together":pu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function va(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ns|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=xr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _1(e,t,n){switch(t.tag){case 3:Ox(t),qs();break;case 5:fx(t);break;case 1:_t(t.type)&&$a(t);break;case 4:Bd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ue(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ue(Qe,Qe.current&1),t.flags|=128,null):n&t.child.childLanes?Fx(e,t,n):(Ue(Qe,Qe.current&1),e=Qn(e,t,n),e!==null?e.sibling:null);Ue(Qe,Qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ux(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ue(Qe,Qe.current),r)break;return null;case 22:case 23:return t.lanes=0,_x(e,t,n)}return Qn(e,t,n)}var Bx,Ec,Hx,Wx;Bx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ec=function(){};Hx=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,qr(An.current);var l=null;switch(n){case"input":i=Ku(e,i),r=Ku(e,r),l=[];break;case"select":i=Ge({},i,{value:void 0}),r=Ge({},r,{value:void 0}),l=[];break;case"textarea":i=Xu(e,i),r=Xu(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=za)}ec(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ki.hasOwnProperty(c)?l||(l=[]):(l=l||[]).push(c,null));for(c in r){var u=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&o[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(l||(l=[]),l.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(l=l||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(l=l||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ki.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&Be("scroll",e),l||o===u||(l=[])):(l=l||[]).push(c,u))}n&&(l=l||[]).push("style",n);var c=l;(t.updateQueue=c)&&(t.flags|=4)}};Wx=function(e,t,n,r){n!==r&&(t.flags|=4)};function ji(e,t){if(!Ve)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function $1(e,t,n){var r=t.pendingProps;switch(Md(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return _t(t.type)&&_a(),St(t),null;case 3:return r=t.stateNode,Ks(),He(zt),He(Ct),Wd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Kl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mn!==null&&(Mc(mn),mn=null))),Ec(e,t),St(t),null;case 5:Hd(t);var i=qr(al.current);if(n=t.type,e!==null&&t.stateNode!=null)Hx(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return St(t),null}if(e=qr(An.current),Kl(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Pn]=t,r[il]=l,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(i=0;i<Ii.length;i++)Be(Ii[i],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":uf(r,l),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Be("invalid",r);break;case"textarea":df(r,l),Be("invalid",r)}ec(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",""+o]):Ki.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Be("scroll",r)}switch(n){case"input":Fl(r),cf(r,l,!0);break;case"textarea":Fl(r),hf(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=za)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=yg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Pn]=t,e[il]=r,Bx(e,t,!1,!1),t.stateNode=e;e:{switch(a=tc(n,r),n){case"dialog":Be("cancel",e),Be("close",e),i=r;break;case"iframe":case"object":case"embed":Be("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ii.length;i++)Be(Ii[i],e);i=r;break;case"source":Be("error",e),i=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),i=r;break;case"details":Be("toggle",e),i=r;break;case"input":uf(e,r),i=Ku(e,r),Be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ge({},r,{value:void 0}),Be("invalid",e);break;case"textarea":df(e,r),i=Xu(e,r),Be("invalid",e);break;default:i=r}ec(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="style"?wg(e,u):l==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&vg(e,u)):l==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Yi(e,u):typeof u=="number"&&Yi(e,""+u):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ki.hasOwnProperty(l)?u!=null&&l==="onScroll"&&Be("scroll",e):u!=null&&jd(e,l,u,a))}switch(n){case"input":Fl(e),cf(e,r,!1);break;case"textarea":Fl(e),hf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+yr(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?$s(e,!!r.multiple,l,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=za)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return St(t),null;case 6:if(e&&t.stateNode!=null)Wx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=qr(al.current),qr(An.current),Kl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Pn]=t,(l=r.nodeValue!==n)&&(e=qt,e!==null))switch(e.tag){case 3:Gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Pn]=t,t.stateNode=r}return St(t),null;case 13:if(He(Qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ve&&Vt!==null&&t.mode&1&&!(t.flags&128))ox(),qs(),t.flags|=98560,l=!1;else if(l=Kl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(K(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(K(317));l[Pn]=t}else qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),l=!1}else mn!==null&&(Mc(mn),mn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Qe.current&1?at===0&&(at=3):nh())),t.updateQueue!==null&&(t.flags|=4),St(t),null);case 4:return Ks(),Ec(e,t),e===null&&rl(t.stateNode.containerInfo),St(t),null;case 10:return Od(t.type._context),St(t),null;case 17:return _t(t.type)&&_a(),St(t),null;case 19:if(He(Qe),l=t.memoizedState,l===null)return St(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)ji(l,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Wa(e),a!==null){for(t.flags|=128,ji(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ue(Qe,Qe.current&1|2),t.child}e=e.sibling}l.tail!==null&&tt()>Js&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304)}else{if(!r)if(e=Wa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Ve)return St(t),null}else 2*tt()-l.renderingStartTime>Js&&n!==1073741824&&(t.flags|=128,r=!0,ji(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=tt(),t.sibling=null,n=Qe.current,Ue(Qe,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return th(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ht&1073741824&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function O1(e,t){switch(Md(t),t.tag){case 1:return _t(t.type)&&_a(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),He(zt),He(Ct),Wd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hd(t),null;case 13:if(He(Qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return He(Qe),null;case 4:return Ks(),null;case 10:return Od(t.type._context),null;case 22:case 23:return th(),null;case 24:return null;default:return null}}var Xl=!1,Nt=!1,F1=typeof WeakSet=="function"?WeakSet:Set,te=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Tc(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var tp=!1;function U1(e,t){if(dc=Ia,e=Kg(),Id(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==l||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===l&&++h===r&&(u=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(hc={focusedElem:e,selectionRange:n},Ia=!1,te=t;te!==null;)if(t=te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,te=e;else for(;te!==null;){t=te;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,w=p.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:hn(t.type,g),w);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){Xe(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,te=e;break}te=t.return}return p=tp,tp=!1,p}function Ui(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&Tc(t,n,l)}i=i.next}while(i!==r)}}function wo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Vx(e){var t=e.alternate;t!==null&&(e.alternate=null,Vx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pn],delete t[il],delete t[mc],delete t[b1],delete t[S1])),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 Qx(e){return e.tag===5||e.tag===3||e.tag===4}function np(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qx(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 Rc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=za));else if(r!==4&&(e=e.child,e!==null))for(Rc(e,t,n),e=e.sibling;e!==null;)Rc(e,t,n),e=e.sibling}function Lc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Lc(e,t,n),e=e.sibling;e!==null;)Lc(e,t,n),e=e.sibling}var xt=null,fn=!1;function Zn(e,t,n){for(n=n.child;n!==null;)qx(e,t,n),n=n.sibling}function qx(e,t,n){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(fo,n)}catch{}switch(n.tag){case 5:Nt||Ms(n,t);case 6:var r=xt,i=fn;xt=null,Zn(e,t,n),xt=r,fn=i,xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(fn?(e=xt,n=n.stateNode,e.nodeType===8?au(e.parentNode,n):e.nodeType===1&&au(e,n),el(e)):au(xt,n.stateNode));break;case 4:r=xt,i=fn,xt=n.stateNode.containerInfo,fn=!0,Zn(e,t,n),xt=r,fn=i;break;case 0:case 11:case 14:case 15:if(!Nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&Tc(n,t,a),i=i.next}while(i!==r)}Zn(e,t,n);break;case 1:if(!Nt&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Xe(n,t,o)}Zn(e,t,n);break;case 21:Zn(e,t,n);break;case 22:n.mode&1?(Nt=(r=Nt)||n.memoizedState!==null,Zn(e,t,n),Nt=r):Zn(e,t,n);break;default:Zn(e,t,n)}}function rp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new F1),t.forEach(function(r){var i=Y1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:xt=o.stateNode,fn=!1;break e;case 3:xt=o.stateNode.containerInfo,fn=!0;break e;case 4:xt=o.stateNode.containerInfo,fn=!0;break e}o=o.return}if(xt===null)throw Error(K(160));qx(l,a,i),xt=null,fn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){Xe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Gx(t,e),t=t.sibling}function Gx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dn(t,e),Cn(e),r&4){try{Ui(3,e,e.return),wo(3,e)}catch(g){Xe(e,e.return,g)}try{Ui(5,e,e.return)}catch(g){Xe(e,e.return,g)}}break;case 1:dn(t,e),Cn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(dn(t,e),Cn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{Yi(i,"")}catch(g){Xe(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&gg(i,l),tc(o,a);var c=tc(o,l);for(a=0;a<u.length;a+=2){var h=u[a],d=u[a+1];h==="style"?wg(i,d):h==="dangerouslySetInnerHTML"?vg(i,d):h==="children"?Yi(i,d):jd(i,h,d,c)}switch(o){case"input":Yu(i,l);break;case"textarea":xg(i,l);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?$s(i,!!l.multiple,m,!1):f!==!!l.multiple&&(l.defaultValue!=null?$s(i,!!l.multiple,l.defaultValue,!0):$s(i,!!l.multiple,l.multiple?[]:"",!1))}i[il]=l}catch(g){Xe(e,e.return,g)}}break;case 6:if(dn(t,e),Cn(e),r&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(g){Xe(e,e.return,g)}}break;case 3:if(dn(t,e),Cn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{el(t.containerInfo)}catch(g){Xe(e,e.return,g)}break;case 4:dn(t,e),Cn(e);break;case 13:dn(t,e),Cn(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(Zd=tt())),r&4&&rp(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Nt=(c=Nt)||h,dn(t,e),Nt=c):dn(t,e),Cn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(te=e,h=e.child;h!==null;){for(d=te=h;te!==null;){switch(f=te,m=f.child,f.tag){case 0:case 11:case 14:case 15:Ui(4,f,f.return);break;case 1:Ms(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){Xe(r,n,g)}}break;case 5:Ms(f,f.return);break;case 22:if(f.memoizedState!==null){ip(d);continue}}m!==null?(m.return=f,te=m):ip(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=d.stateNode,u=d.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=jg("display",a))}catch(g){Xe(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Xe(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:dn(t,e),Cn(e),r&4&&rp(e);break;case 21:break;default:dn(t,e),Cn(e)}}function Cn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qx(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Yi(i,""),r.flags&=-33);var l=np(e);Lc(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=np(e);Rc(e,o,a);break;default:throw Error(K(161))}}catch(u){Xe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function B1(e,t,n){te=e,Kx(e)}function Kx(e,t,n){for(var r=(e.mode&1)!==0;te!==null;){var i=te,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Xl;if(!a){var o=i.alternate,u=o!==null&&o.memoizedState!==null||Nt;o=Xl;var c=Nt;if(Xl=a,(Nt=u)&&!c)for(te=i;te!==null;)a=te,u=a.child,a.tag===22&&a.memoizedState!==null?lp(i):u!==null?(u.return=a,te=u):lp(i);for(;l!==null;)te=l,Kx(l),l=l.sibling;te=i,Xl=o,Nt=c}sp(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,te=l):sp(e)}}function sp(e){for(;te!==null;){var t=te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Nt||wo(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Nt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:hn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&Bf(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Bf(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&el(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Nt||t.flags&512&&Pc(t)}catch(f){Xe(t,t.return,f)}}if(t===e){te=null;break}if(n=t.sibling,n!==null){n.return=t.return,te=n;break}te=t.return}}function ip(e){for(;te!==null;){var t=te;if(t===e){te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,te=n;break}te=t.return}}function lp(e){for(;te!==null;){var t=te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wo(4,t)}catch(u){Xe(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Xe(t,i,u)}}var l=t.return;try{Pc(t)}catch(u){Xe(t,l,u)}break;case 5:var a=t.return;try{Pc(t)}catch(u){Xe(t,a,u)}}}catch(u){Xe(t,t.return,u)}if(t===e){te=null;break}var o=t.sibling;if(o!==null){o.return=t.return,te=o;break}te=t.return}}var H1=Math.ceil,qa=qn.ReactCurrentDispatcher,Jd=qn.ReactCurrentOwner,an=qn.ReactCurrentBatchConfig,Te=0,ht=null,it=null,jt=0,Ht=0,zs=Nr(0),at=0,dl=null,ns=0,ko=0,Xd=0,Bi=null,Dt=null,Zd=0,Js=1/0,_n=null,Ga=!1,Ac=null,mr=null,Zl=!1,ar=null,Ka=0,Hi=0,Ic=null,ja=-1,wa=0;function Tt(){return Te&6?tt():ja!==-1?ja:ja=tt()}function gr(e){return e.mode&1?Te&2&&jt!==0?jt&-jt:C1.transition!==null?(wa===0&&(wa=Ig()),wa):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:Fg(e.type)),e):1}function xn(e,t,n,r){if(50<Hi)throw Hi=0,Ic=null,Error(K(185));yl(e,n,r),(!(Te&2)||e!==ht)&&(e===ht&&(!(Te&2)&&(ko|=n),at===4&&ir(e,jt)),$t(e,r),n===1&&Te===0&&!(t.mode&1)&&(Js=tt()+500,yo&&Cr()))}function $t(e,t){var n=e.callbackNode;Cw(e,t);var r=Aa(e,e===ht?jt:0);if(r===0)n!==null&&mf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mf(n),t===1)e.tag===0?N1(ap.bind(null,e)):ix(ap.bind(null,e)),w1(function(){!(Te&6)&&Cr()}),n=null;else{switch(Dg(r)){case 1:n=Nd;break;case 4:n=Lg;break;case 16:n=La;break;case 536870912:n=Ag;break;default:n=La}n=ry(n,Yx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yx(e,t){if(ja=-1,wa=0,Te&6)throw Error(K(327));var n=e.callbackNode;if(Hs()&&e.callbackNode!==n)return null;var r=Aa(e,e===ht?jt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ya(e,r);else{t=r;var i=Te;Te|=2;var l=Xx();(ht!==e||jt!==t)&&(_n=null,Js=tt()+500,Yr(e,t));do try{Q1();break}catch(o){Jx(e,o)}while(!0);$d(),qa.current=l,Te=i,it!==null?t=0:(ht=null,jt=0,t=at)}if(t!==0){if(t===2&&(i=lc(e),i!==0&&(r=i,t=Dc(e,i))),t===1)throw n=dl,Yr(e,0),ir(e,r),$t(e,tt()),n;if(t===6)ir(e,r);else{if(i=e.current.alternate,!(r&30)&&!W1(i)&&(t=Ya(e,r),t===2&&(l=lc(e),l!==0&&(r=l,t=Dc(e,l))),t===1))throw n=dl,Yr(e,0),ir(e,r),$t(e,tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Ur(e,Dt,_n);break;case 3:if(ir(e,r),(r&130023424)===r&&(t=Zd+500-tt(),10<t)){if(Aa(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Tt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=pc(Ur.bind(null,e,Dt,_n),t);break}Ur(e,Dt,_n);break;case 4:if(ir(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-gn(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*H1(r/1960))-r,10<r){e.timeoutHandle=pc(Ur.bind(null,e,Dt,_n),r);break}Ur(e,Dt,_n);break;case 5:Ur(e,Dt,_n);break;default:throw Error(K(329))}}}return $t(e,tt()),e.callbackNode===n?Yx.bind(null,e):null}function Dc(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Yr(e,t).flags|=256),e=Ya(e,t),e!==2&&(t=Dt,Dt=n,t!==null&&Mc(t)),e}function Mc(e){Dt===null?Dt=e:Dt.push.apply(Dt,e)}function W1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!jn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ir(e,t){for(t&=~Xd,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gn(t),r=1<<n;e[n]=-1,t&=~r}}function ap(e){if(Te&6)throw Error(K(327));Hs();var t=Aa(e,0);if(!(t&1))return $t(e,tt()),null;var n=Ya(e,t);if(e.tag!==0&&n===2){var r=lc(e);r!==0&&(t=r,n=Dc(e,r))}if(n===1)throw n=dl,Yr(e,0),ir(e,t),$t(e,tt()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ur(e,Dt,_n),$t(e,tt()),null}function eh(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(Js=tt()+500,yo&&Cr())}}function rs(e){ar!==null&&ar.tag===0&&!(Te&6)&&Hs();var t=Te;Te|=1;var n=an.transition,r=Ie;try{if(an.transition=null,Ie=1,e)return e()}finally{Ie=r,an.transition=n,Te=t,!(Te&6)&&Cr()}}function th(){Ht=zs.current,He(zs)}function Yr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j1(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Md(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_a();break;case 3:Ks(),He(zt),He(Ct),Wd();break;case 5:Hd(r);break;case 4:Ks();break;case 13:He(Qe);break;case 19:He(Qe);break;case 10:Od(r.type._context);break;case 22:case 23:th()}n=n.return}if(ht=e,it=e=xr(e.current,null),jt=Ht=t,at=0,dl=null,Xd=ko=ns=0,Dt=Bi=null,Qr!==null){for(t=0;t<Qr.length;t++)if(n=Qr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}Qr=null}return e}function Jx(e,t){do{var n=it;try{if($d(),xa.current=Qa,Va){for(var r=qe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Va=!1}if(ts=0,ct=lt=qe=null,Fi=!1,ol=0,Jd.current=null,n===null||n.return===null){at=1,dl=t,it=null;break}e:{var l=e,a=n.return,o=n,u=t;if(t=jt,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var m=Gf(a);if(m!==null){m.flags&=-257,Kf(m,a,o,l,t),m.mode&1&&qf(l,c,t),t=m,u=c;var p=t.updateQueue;if(p===null){var g=new Set;g.add(u),t.updateQueue=g}else p.add(u);break e}else{if(!(t&1)){qf(l,c,t),nh();break e}u=Error(K(426))}}else if(Ve&&o.mode&1){var w=Gf(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Kf(w,a,o,l,t),zd(Ys(u,o));break e}}l=u=Ys(u,o),at!==4&&(at=2),Bi===null?Bi=[l]:Bi.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var x=Dx(l,u,t);Uf(l,x);break e;case 1:o=u;var y=l.type,v=l.stateNode;if(!(l.flags&128)&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(mr===null||!mr.has(v)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=Mx(l,o,t);Uf(l,b);break e}}l=l.return}while(l!==null)}ey(n)}catch(E){t=E,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function Xx(){var e=qa.current;return qa.current=Qa,e===null?Qa:e}function nh(){(at===0||at===3||at===2)&&(at=4),ht===null||!(ns&268435455)&&!(ko&268435455)||ir(ht,jt)}function Ya(e,t){var n=Te;Te|=2;var r=Xx();(ht!==e||jt!==t)&&(_n=null,Yr(e,t));do try{V1();break}catch(i){Jx(e,i)}while(!0);if($d(),Te=n,qa.current=r,it!==null)throw Error(K(261));return ht=null,jt=0,at}function V1(){for(;it!==null;)Zx(it)}function Q1(){for(;it!==null&&!xw();)Zx(it)}function Zx(e){var t=ny(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?ey(e):it=t,Jd.current=null}function ey(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=O1(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,it=null;return}}else if(n=$1(n,t,Ht),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);at===0&&(at=5)}function Ur(e,t,n){var r=Ie,i=an.transition;try{an.transition=null,Ie=1,q1(e,t,n,r)}finally{an.transition=i,Ie=r}return null}function q1(e,t,n,r){do Hs();while(ar!==null);if(Te&6)throw Error(K(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(Ew(e,l),e===ht&&(it=ht=null,jt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Zl||(Zl=!0,ry(La,function(){return Hs(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=an.transition,an.transition=null;var a=Ie;Ie=1;var o=Te;Te|=4,Jd.current=null,U1(e,n),Gx(n,e),f1(hc),Ia=!!dc,hc=dc=null,e.current=n,B1(n),yw(),Te=o,Ie=a,an.transition=l}else e.current=n;if(Zl&&(Zl=!1,ar=e,Ka=i),l=e.pendingLanes,l===0&&(mr=null),ww(n.stateNode),$t(e,tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ga)throw Ga=!1,e=Ac,Ac=null,e;return Ka&1&&e.tag!==0&&Hs(),l=e.pendingLanes,l&1?e===Ic?Hi++:(Hi=0,Ic=e):Hi=0,Cr(),null}function Hs(){if(ar!==null){var e=Dg(Ka),t=an.transition,n=Ie;try{if(an.transition=null,Ie=16>e?16:e,ar===null)var r=!1;else{if(e=ar,ar=null,Ka=0,Te&6)throw Error(K(331));var i=Te;for(Te|=4,te=e.current;te!==null;){var l=te,a=l.child;if(te.flags&16){var o=l.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(te=c;te!==null;){var h=te;switch(h.tag){case 0:case 11:case 15:Ui(8,h,l)}var d=h.child;if(d!==null)d.return=h,te=d;else for(;te!==null;){h=te;var f=h.sibling,m=h.return;if(Vx(h),h===c){te=null;break}if(f!==null){f.return=m,te=f;break}te=m}}}var p=l.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}te=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,te=a;else e:for(;te!==null;){if(l=te,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Ui(9,l,l.return)}var x=l.sibling;if(x!==null){x.return=l.return,te=x;break e}te=l.return}}var y=e.current;for(te=y;te!==null;){a=te;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,te=v;else e:for(a=y;te!==null;){if(o=te,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:wo(9,o)}}catch(E){Xe(o,o.return,E)}if(o===a){te=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,te=b;break e}te=o.return}}if(Te=i,Cr(),Ln&&typeof Ln.onPostCommitFiberRoot=="function")try{Ln.onPostCommitFiberRoot(fo,e)}catch{}r=!0}return r}finally{Ie=n,an.transition=t}}return!1}function op(e,t,n){t=Ys(n,t),t=Dx(e,t,1),e=pr(e,t,1),t=Tt(),e!==null&&(yl(e,1,t),$t(e,t))}function Xe(e,t,n){if(e.tag===3)op(e,e,n);else for(;t!==null;){if(t.tag===3){op(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mr===null||!mr.has(r))){e=Ys(n,e),e=Mx(t,e,1),t=pr(t,e,1),e=Tt(),t!==null&&(yl(t,1,e),$t(t,e));break}}t=t.return}}function G1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tt(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(jt&n)===n&&(at===4||at===3&&(jt&130023424)===jt&&500>tt()-Zd?Yr(e,0):Xd|=n),$t(e,t)}function ty(e,t){t===0&&(e.mode&1?(t=Hl,Hl<<=1,!(Hl&130023424)&&(Hl=4194304)):t=1);var n=Tt();e=Vn(e,t),e!==null&&(yl(e,t,n),$t(e,n))}function K1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function Y1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),ty(e,n)}var ny;ny=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zt.current)Mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mt=!1,_1(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Ve&&t.flags&1048576&&lx(t,Fa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;va(e,t),e=t.pendingProps;var i=Qs(t,Ct.current);Bs(t,n),i=Qd(null,t,r,e,i,n);var l=qd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(r)?(l=!0,$a(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ud(t),i.updater=jo,t.stateNode=i,i._reactInternals=t,wc(t,r,e,n),t=Sc(null,t,r,!0,l,n)):(t.tag=0,Ve&&l&&Dd(t),Et(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(va(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=X1(r),e=hn(r,e),i){case 0:t=bc(null,t,r,e,n);break e;case 1:t=Xf(null,t,r,e,n);break e;case 11:t=Yf(null,t,r,e,n);break e;case 14:t=Jf(null,t,r,hn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),bc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Xf(e,t,r,i,n);case 3:e:{if(Ox(t),e===null)throw Error(K(387));r=t.pendingProps,l=t.memoizedState,i=l.element,hx(e,t),Ha(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=Ys(Error(K(423)),t),t=Zf(e,t,r,n,i);break e}else if(r!==i){i=Ys(Error(K(424)),t),t=Zf(e,t,r,n,i);break e}else for(Vt=fr(t.stateNode.containerInfo.firstChild),qt=t,Ve=!0,mn=null,n=cx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qs(),r===i){t=Qn(e,t,n);break e}Et(e,t,r,n)}t=t.child}return t;case 5:return fx(t),e===null&&yc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,fc(r,i)?a=null:l!==null&&fc(r,l)&&(t.flags|=32),$x(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&yc(t),null;case 13:return Fx(e,t,n);case 4:return Bd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gs(t,null,r,n):Et(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),Yf(e,t,r,i,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,Ue(Ua,r._currentValue),r._currentValue=a,l!==null)if(jn(l.value,a)){if(l.children===i.children&&!zt.current){t=Qn(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Un(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),vc(l.return,n,t),o.lanes|=n;break}u=u.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(K(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),vc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}Et(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Bs(t,n),i=on(i),r=r(i),t.flags|=1,Et(e,t,r,n),t.child;case 14:return r=t.type,i=hn(r,t.pendingProps),i=hn(r.type,i),Jf(e,t,r,i,n);case 15:return zx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:hn(r,i),va(e,t),t.tag=1,_t(r)?(e=!0,$a(t)):e=!1,Bs(t,n),Ix(t,r,i),wc(t,r,i,n),Sc(null,t,r,!0,e,n);case 19:return Ux(e,t,n);case 22:return _x(e,t,n)}throw Error(K(156,t.tag))};function ry(e,t){return Rg(e,t)}function J1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,t,n,r){return new J1(e,t,n,r)}function rh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X1(e){if(typeof e=="function")return rh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kd)return 11;if(e===bd)return 14}return 2}function xr(e,t){var n=e.alternate;return n===null?(n=sn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ka(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")rh(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Cs:return Jr(n.children,i,l,t);case wd:a=8,i|=8;break;case Vu:return e=sn(12,n,t,i|2),e.elementType=Vu,e.lanes=l,e;case Qu:return e=sn(13,n,t,i),e.elementType=Qu,e.lanes=l,e;case qu:return e=sn(19,n,t,i),e.elementType=qu,e.lanes=l,e;case fg:return bo(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dg:a=10;break e;case hg:a=9;break e;case kd:a=11;break e;case bd:a=14;break e;case nr:a=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=sn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Jr(e,t,n,r){return e=sn(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=sn(22,e,r,t),e.elementType=fg,e.lanes=n,e.stateNode={isHidden:!1},e}function mu(e,t,n){return e=sn(6,e,null,t),e.lanes=n,e}function gu(e,t,n){return t=sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Z1(e,t,n,r,i){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=Yo(0),this.expirationTimes=Yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sh(e,t,n,r,i,l,a,o,u){return e=new Z1(e,t,n,o,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=sn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ud(l),e}function ek(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ns,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sy(e){if(!e)return vr;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_t(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if(_t(n))return sx(e,n,t)}return t}function iy(e,t,n,r,i,l,a,o,u){return e=sh(n,r,!0,e,i,l,a,o,u),e.context=sy(null),n=e.current,r=Tt(),i=gr(n),l=Un(r,i),l.callback=t??null,pr(n,l,i),e.current.lanes=i,yl(e,i,r),$t(e,r),e}function So(e,t,n,r){var i=t.current,l=Tt(),a=gr(i);return n=sy(n),t.context===null?t.context=n:t.pendingContext=n,t=Un(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pr(i,t,a),e!==null&&(xn(e,i,a,l),ga(e,i,a)),a}function Ja(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 up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ih(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function tk(){return null}var ly=typeof reportError=="function"?reportError:function(e){console.error(e)};function lh(e){this._internalRoot=e}No.prototype.render=lh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));So(e,t,null,null)};No.prototype.unmount=lh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rs(function(){So(null,e,null,null)}),t[Wn]=null}};function No(e){this._internalRoot=e}No.prototype.unstable_scheduleHydration=function(e){if(e){var t=_g();e={blockedOn:null,target:e,priority:t};for(var n=0;n<sr.length&&t!==0&&t<sr[n].priority;n++);sr.splice(n,0,e),n===0&&Og(e)}};function ah(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Co(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function cp(){}function nk(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var c=Ja(a);l.call(c)}}var a=iy(t,r,e,0,null,!1,!1,"",cp);return e._reactRootContainer=a,e[Wn]=a.current,rl(e.nodeType===8?e.parentNode:e),rs(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Ja(u);o.call(c)}}var u=sh(e,0,!1,null,null,!1,!1,"",cp);return e._reactRootContainer=u,e[Wn]=u.current,rl(e.nodeType===8?e.parentNode:e),rs(function(){So(t,u,n,r)}),u}function Eo(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var u=Ja(a);o.call(u)}}So(t,a,e,i)}else a=nk(n,t,e,i,r);return Ja(a)}Mg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ai(t.pendingLanes);n!==0&&(Cd(t,n|1),$t(t,tt()),!(Te&6)&&(Js=tt()+500,Cr()))}break;case 13:rs(function(){var r=Vn(e,1);if(r!==null){var i=Tt();xn(r,e,1,i)}}),ih(e,1)}};Ed=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=Tt();xn(t,e,134217728,n)}ih(e,134217728)}};zg=function(e){if(e.tag===13){var t=gr(e),n=Vn(e,t);if(n!==null){var r=Tt();xn(n,e,t,r)}ih(e,t)}};_g=function(){return Ie};$g=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}};rc=function(e,t,n){switch(t){case"input":if(Yu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=xo(r);if(!i)throw Error(K(90));mg(r),Yu(r,i)}}}break;case"textarea":xg(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};Sg=eh;Ng=rs;var rk={usingClientEntryPoint:!1,Events:[jl,Rs,xo,kg,bg,eh]},wi={findFiberByHostInstance:Vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},sk={bundleType:wi.bundleType,version:wi.version,rendererPackageName:wi.rendererPackageName,rendererConfig:wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tg(e),e===null?null:e.stateNode},findFiberByHostInstance:wi.findFiberByHostInstance||tk,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 ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ea.isDisabled&&ea.supportsFiber)try{fo=ea.inject(sk),Ln=ea}catch{}}Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rk;Yt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ah(t))throw Error(K(200));return ek(e,t,null,n)};Yt.createRoot=function(e,t){if(!ah(e))throw Error(K(299));var n=!1,r="",i=ly;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=sh(e,1,!1,null,null,n,!1,r,i),e[Wn]=t.current,rl(e.nodeType===8?e.parentNode:e),new lh(t)};Yt.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(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=Tg(t),e=e===null?null:e.stateNode,e};Yt.flushSync=function(e){return rs(e)};Yt.hydrate=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!0,n)};Yt.hydrateRoot=function(e,t,n){if(!ah(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=ly;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=iy(t,null,e,1,n??null,i,!1,l,a),e[Wn]=t.current,rl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new No(t)};Yt.render=function(e,t,n){if(!Co(t))throw Error(K(200));return Eo(null,e,t,!1,n)};Yt.unmountComponentAtNode=function(e){if(!Co(e))throw Error(K(40));return e._reactRootContainer?(rs(function(){Eo(null,null,e,!1,function(){e._reactRootContainer=null,e[Wn]=null})}),!0):!1};Yt.unstable_batchedUpdates=eh;Yt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Co(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return Eo(e,t,n,!1,r)};Yt.version="18.3.1-next-f1338f8080-20240426";function ay(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ay)}catch(e){console.error(e)}}ay(),ag.exports=Yt;var Er=ag.exports;const ik=fd(Er),lk=Km({__proto__:null,default:ik},[Er]);var oy,dp=Er;oy=dp.createRoot,dp.hydrateRoot;/**
41
41
  * @remix-run/router v1.21.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,8 +46,8 @@ Error generating stack: `+l.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}var st;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(st||(st={}));const hp="popstate";function lk(e){e===void 0&&(e={});function t(r,i){let{pathname:l,search:a,hash:o}=r.location;return hl("",{pathname:l,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ns(i)}return ok(t,n,null,e)}function je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Js(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ak(){return Math.random().toString(36).substr(2,8)}function fp(e,t){return{usr:e.state,key:e.key,idx:t}}function hl(e,t,n,r){return n===void 0&&(n=null),We({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Er(t):t,{state:n,key:t&&t.key||r||ak()})}function ns(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Er(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ok(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,a=i.history,o=st.Pop,u=null,c=h();c==null&&(c=0,a.replaceState(We({},a.state,{idx:c}),""));function h(){return(a.state||{idx:null}).idx}function d(){o=st.Pop;let w=h(),x=w==null?null:w-c;c=w,u&&u({action:o,location:g.location,delta:x})}function f(w,x){o=st.Push;let y=hl(g.location,w,x);c=h()+1;let v=fp(y,c),b=g.createHref(y);try{a.pushState(v,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}l&&u&&u({action:o,location:g.location,delta:1})}function m(w,x){o=st.Replace;let y=hl(g.location,w,x);c=h();let v=fp(y,c),b=g.createHref(y);a.replaceState(v,"",b),l&&u&&u({action:o,location:g.location,delta:0})}function p(w){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof w=="string"?w:ns(w);return y=y.replace(/ $/,"%20"),je(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let g={get action(){return o},get location(){return e(i,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(hp,d),u=w,()=>{i.removeEventListener(hp,d),u=null}},createHref(w){return t(i,w)},createURL:p,encodeLocation(w){let x=p(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:m,go(w){return a.go(w)}};return g}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const uk=new Set(["lazy","caseSensitive","path","id","index","children"]);function ck(e){return e.index===!0}function Xa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,l)=>{let a=[...n,String(l)],o=typeof i.id=="string"?i.id:a.join("-");if(je(i.index!==!0||!i.children,"Cannot specify children on an index route"),je(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),ck(i)){let u=We({},i,t(i),{id:o});return r[o]=u,u}else{let u=We({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=Xa(i.children,t,a,r)),u}})}function Ur(e,t,n){return n===void 0&&(n="/"),ba(e,t,n,!1)}function ba(e,t,n,r){let i=typeof t=="string"?Er(t):t,l=wn(i.pathname||"/",n);if(l==null)return null;let a=uy(e);hk(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let c=bk(l);o=wk(a[u],c,r)}return o}function dk(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function uy(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(l,a,o)=>{let u={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};u.relativePath.startsWith("/")&&(je(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Un([r,u.relativePath]),h=n.concat(u);l.children&&l.children.length>0&&(je(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),uy(l.children,t,h,c)),!(l.path==null&&!l.index)&&t.push({path:c,score:vk(c,l.index),routesMeta:h})};return e.forEach((l,a)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,a);else for(let u of cy(l.path))i(l,a,u)}),t}function cy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let a=cy(r.join("/")),o=[];return o.push(...a.map(u=>u===""?l:[l,u].join("/"))),i&&o.push(...a),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function hk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:jk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fk=/^:[\w-]+$/,pk=3,mk=2,gk=1,xk=10,yk=-2,pp=e=>e==="*";function vk(e,t){let n=e.split("/"),r=n.length;return n.some(pp)&&(r+=yk),t&&(r+=mk),n.filter(i=>!pp(i)).reduce((i,l)=>i+(fk.test(l)?pk:l===""?gk:xk),r)}function jk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function wk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},l="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,h=l==="/"?t:t.slice(l.length)||"/",d=Za({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Za({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Un([l,d.pathname]),pathnameBase:Ck(Un([l,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(l=Un([l,d.pathnameBase]))}return a}function Za(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=kk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],a=l.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,h,d)=>{let{paramName:f,isOptional:m}=h;if(f==="*"){let g=o[d]||"";a=l.slice(0,l.length-g.length).replace(/(.)\/+$/,"$1")}const p=o[d];return m&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:l,pathnameBase:a,pattern:e}}function kk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Js(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function bk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Js(!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 wn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Sk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Er(e):e;return{pathname:n?n.startsWith("/")?n:Nk(n,t):t,search:Ek(r),hash:Tk(i)}}function Nk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function mu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function dy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ah(e,t){let n=dy(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function oh(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Er(e):(i=We({},e),je(!i.pathname||!i.pathname.includes("?"),mu("?","pathname","search",i)),je(!i.pathname||!i.pathname.includes("#"),mu("#","pathname","hash",i)),je(!i.search||!i.search.includes("#"),mu("#","search","hash",i)));let l=e===""||i.pathname==="",a=l?"/":i.pathname,o;if(a==null)o=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?t[d]:"/"}let u=Sk(i,o),c=a&&a!=="/"&&a.endsWith("/"),h=(l||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const Un=e=>e.join("/").replace(/\/\/+/g,"/"),Ck=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ek=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class eo{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Eo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const hy=["post","put","patch","delete"],Pk=new Set(hy),Rk=["get",...hy],Ak=new Set(Rk),Lk=new Set([301,302,303,307,308]),Ik=new Set([307,308]),gu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ws={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fy="remix-router-transitions";function zk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let R=e.detectErrorBoundary;i=M=>({hasErrorBoundary:R(M)})}else i=Mk;let l={},a=Xa(e.routes,i,void 0,l),o,u=e.basename||"/",c=e.dataStrategy||Fk,h=e.patchRoutesOnNavigation,d=We({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,p=null,g=null,w=null,x=e.hydrationData!=null,y=Ur(a,e.history.location,u),v=null;if(y==null&&!h){let R=It(404,{pathname:e.history.location.pathname}),{matches:M,route:_}=Np(a);y=M,v={[_.id]:R}}y&&!e.hydrationData&&Dl(y,a,e.history.location.pathname).active&&(y=null);let b;if(y)if(y.some(R=>R.route.lazy))b=!1;else if(!y.some(R=>R.route.loader))b=!0;else if(d.v7_partialHydration){let R=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null;if(M){let _=y.findIndex(V=>M[V.route.id]!==void 0);b=y.slice(0,_+1).every(V=>!Mc(V.route,R,M))}else b=y.every(_=>!Mc(_.route,R,M))}else b=e.hydrationData!=null;else if(b=!1,y=[],d.v7_partialHydration){let R=Dl(null,a,e.history.location.pathname);R.active&&R.matches&&(y=R.matches)}let E,k={historyAction:e.history.action,location:e.history.location,matches:y,initialized:b,navigation:gu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},L=st.Pop,T=!1,D,N=!1,P=new Map,A=null,z=!1,U=!1,I=[],Q=new Set,J=new Map,H=0,X=-1,S=new Map,ae=new Set,O=new Map,C=new Map,F=new Set,Z=new Map,oe=new Map,B;function he(){if(f=e.history.listen(R=>{let{action:M,location:_,delta:V}=R;if(B){B(),B=void 0;return}Js(oe.size===0||V!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ne=ps({currentLocation:k.location,nextLocation:_,historyAction:M});if(ne&&V!=null){let ue=new Promise(xe=>{B=xe});e.history.go(V*-1),Mr(ne,{state:"blocked",location:_,proceed(){Mr(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ue.then(()=>e.history.go(V))},reset(){let xe=new Map(k.blockers);xe.set(ne,ws),W({blockers:xe})}});return}return Zt(M,_)}),n){e0(t,P);let R=()=>t0(t,P);t.addEventListener("pagehide",R),A=()=>t.removeEventListener("pagehide",R)}return k.initialized||Zt(st.Pop,k.location,{initialHydration:!0}),E}function ze(){f&&f(),A&&A(),m.clear(),D&&D.abort(),k.fetchers.forEach((R,M)=>me(M)),k.blockers.forEach((R,M)=>Xn(M))}function Ke(R){return m.add(R),()=>m.delete(R)}function W(R,M){M===void 0&&(M={}),k=We({},k,R);let _=[],V=[];d.v7_fetcherPersist&&k.fetchers.forEach((ne,ue)=>{ne.state==="idle"&&(F.has(ue)?V.push(ue):_.push(ue))}),[...m].forEach(ne=>ne(k,{deletedFetchers:V,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),d.v7_fetcherPersist&&(_.forEach(ne=>k.fetchers.delete(ne)),V.forEach(ne=>me(ne)))}function fe(R,M,_){var V,ne;let{flushSync:ue}=_===void 0?{}:_,xe=k.actionData!=null&&k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&k.navigation.state==="loading"&&((V=R.state)==null?void 0:V._isRedirect)!==!0,se;M.actionData?Object.keys(M.actionData).length>0?se=M.actionData:se=null:xe?se=k.actionData:se=null;let ie=M.loaderData?bp(k.loaderData,M.loaderData,M.matches||[],M.errors):k.loaderData,re=k.blockers;re.size>0&&(re=new Map(re),re.forEach((Ee,gt)=>re.set(gt,ws)));let ce=T===!0||k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&((ne=R.state)==null?void 0:ne._isRedirect)!==!0;o&&(a=o,o=void 0),z||L===st.Pop||(L===st.Push?e.history.push(R,R.state):L===st.Replace&&e.history.replace(R,R.state));let be;if(L===st.Pop){let Ee=P.get(k.location.pathname);Ee&&Ee.has(R.pathname)?be={currentLocation:k.location,nextLocation:R}:P.has(R.pathname)&&(be={currentLocation:R,nextLocation:k.location})}else if(N){let Ee=P.get(k.location.pathname);Ee?Ee.add(R.pathname):(Ee=new Set([R.pathname]),P.set(k.location.pathname,Ee)),be={currentLocation:k.location,nextLocation:R}}W(We({},M,{actionData:se,loaderData:ie,historyAction:L,location:R,initialized:!0,navigation:gu,revalidation:"idle",restoreScrollPosition:ef(R,M.matches||k.matches),preventScrollReset:ce,blockers:re}),{viewTransitionOpts:be,flushSync:ue===!0}),L=st.Pop,T=!1,N=!1,z=!1,U=!1,I=[]}async function Ze(R,M){if(typeof R=="number"){e.history.go(R);return}let _=Dc(k.location,k.matches,u,d.v7_prependBasename,R,d.v7_relativeSplatPath,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:V,submission:ne,error:ue}=mp(d.v7_normalizeFormMethod,!1,_,M),xe=k.location,se=hl(k.location,V,M&&M.state);se=We({},se,e.history.encodeLocation(se));let ie=M&&M.replace!=null?M.replace:void 0,re=st.Push;ie===!0?re=st.Replace:ie===!1||ne!=null&&pn(ne.formMethod)&&ne.formAction===k.location.pathname+k.location.search&&(re=st.Replace);let ce=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,be=(M&&M.flushSync)===!0,Ee=ps({currentLocation:xe,nextLocation:se,historyAction:re});if(Ee){Mr(Ee,{state:"blocked",location:se,proceed(){Mr(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),Ze(R,M)},reset(){let gt=new Map(k.blockers);gt.set(Ee,ws),W({blockers:gt})}});return}return await Zt(re,se,{submission:ne,pendingError:ue,preventScrollReset:ce,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:be})}function Xt(){if(ci(),W({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Zt(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Zt(L||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:N===!0})}}async function Zt(R,M,_){D&&D.abort(),D=null,L=R,z=(_&&_.startUninterruptedRevalidation)===!0,Ej(k.location,k.matches),T=(_&&_.preventScrollReset)===!0,N=(_&&_.enableViewTransition)===!0;let V=o||a,ne=_&&_.overrideNavigation,ue=Ur(V,M,u),xe=(_&&_.flushSync)===!0,se=Dl(ue,V,M.pathname);if(se.active&&se.matches&&(ue=se.matches),!ue){let{error:Fe,notFoundMatches:Le,route:Ye}=mt(M.pathname);fe(M,{matches:Le,loaderData:{},errors:{[Ye.id]:Fe}},{flushSync:xe});return}if(k.initialized&&!U&&Qk(k.location,M)&&!(_&&_.submission&&pn(_.submission.formMethod))){fe(M,{matches:ue},{flushSync:xe});return}D=new AbortController;let ie=vs(e.history,M,D.signal,_&&_.submission),re;if(_&&_.pendingError)re=[Br(ue).route.id,{type:Me.error,error:_.pendingError}];else if(_&&_.submission&&pn(_.submission.formMethod)){let Fe=await ee(ie,M,_.submission,ue,se.active,{replace:_.replace,flushSync:xe});if(Fe.shortCircuited)return;if(Fe.pendingActionResult){let[Le,Ye]=Fe.pendingActionResult;if(Wt(Ye)&&Eo(Ye.error)&&Ye.error.status===404){D=null,fe(M,{matches:Fe.matches,loaderData:{},errors:{[Le]:Ye.error}});return}}ue=Fe.matches||ue,re=Fe.pendingActionResult,ne=xu(M,_.submission),xe=!1,se.active=!1,ie=vs(e.history,ie.url,ie.signal)}let{shortCircuited:ce,matches:be,loaderData:Ee,errors:gt}=await Ne(ie,M,ue,se.active,ne,_&&_.submission,_&&_.fetcherSubmission,_&&_.replace,_&&_.initialHydration===!0,xe,re);ce||(D=null,fe(M,We({matches:be||ue},Sp(re),{loaderData:Ee,errors:gt})))}async function ee(R,M,_,V,ne,ue){ue===void 0&&(ue={}),ci();let xe=Xk(M,_);if(W({navigation:xe},{flushSync:ue.flushSync===!0}),ne){let re=await Ml(V,M.pathname,R.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let ce=Br(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[ce,{type:Me.error,error:re.error}]}}else if(re.matches)V=re.matches;else{let{notFoundMatches:ce,error:be,route:Ee}=mt(M.pathname);return{matches:ce,pendingActionResult:[Ee.id,{type:Me.error,error:be}]}}}let se,ie=Di(V,M);if(!ie.route.action&&!ie.route.lazy)se={type:Me.error,error:It(405,{method:R.method,pathname:M.pathname,routeId:ie.route.id})};else if(se=(await Ir("action",k,R,[ie],V,null))[ie.route.id],R.signal.aborted)return{shortCircuited:!0};if(Qr(se)){let re;return ue&&ue.replace!=null?re=ue.replace:re=jp(se.response.headers.get("Location"),new URL(R.url),u)===k.location.pathname+k.location.search,await Dn(R,se,!0,{submission:_,replace:re}),{shortCircuited:!0}}if(or(se))throw It(400,{type:"defer-action"});if(Wt(se)){let re=Br(V,ie.route.id);return(ue&&ue.replace)!==!0&&(L=st.Push),{matches:V,pendingActionResult:[re.route.id,se]}}return{matches:V,pendingActionResult:[ie.route.id,se]}}async function Ne(R,M,_,V,ne,ue,xe,se,ie,re,ce){let be=ne||xu(M,ue),Ee=ue||xe||Ep(be),gt=!z&&(!d.v7_partialHydration||!ie);if(V){if(gt){let Je=et(ce);W(We({navigation:be},Je!==void 0?{actionData:Je}:{}),{flushSync:re})}let Re=await Ml(_,M.pathname,R.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let Je=Br(Re.partialMatches).route.id;return{matches:Re.partialMatches,loaderData:{},errors:{[Je]:Re.error}}}else if(Re.matches)_=Re.matches;else{let{error:Je,notFoundMatches:gs,route:fi}=mt(M.pathname);return{matches:gs,loaderData:{},errors:{[fi.id]:Je}}}}let Fe=o||a,[Le,Ye]=xp(e.history,k,_,Ee,M,d.v7_partialHydration&&ie===!0,d.v7_skipActionErrorRevalidation,U,I,Q,F,O,ae,Fe,u,ce);if(Sn(Re=>!(_&&_.some(Je=>Je.route.id===Re))||Le&&Le.some(Je=>Je.route.id===Re)),X=++H,Le.length===0&&Ye.length===0){let Re=Ut();return fe(M,We({matches:_,loaderData:{},errors:ce&&Wt(ce[1])?{[ce[0]]:ce[1].error}:null},Sp(ce),Re?{fetchers:new Map(k.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(gt){let Re={};if(!V){Re.navigation=be;let Je=et(ce);Je!==void 0&&(Re.actionData=Je)}Ye.length>0&&(Re.fetchers=Lr(Ye)),W(Re,{flushSync:re})}Ye.forEach(Re=>{Ce(Re.key),Re.controller&&J.set(Re.key,Re.controller)});let ms=()=>Ye.forEach(Re=>Ce(Re.key));D&&D.signal.addEventListener("abort",ms);let{loaderResults:di,fetcherResults:Mn}=await Il(k,_,Le,Ye,R);if(R.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",ms),Ye.forEach(Re=>J.delete(Re.key));let Nn=ta(di);if(Nn)return await Dn(R,Nn.result,!0,{replace:se}),{shortCircuited:!0};if(Nn=ta(Mn),Nn)return ae.add(Nn.key),await Dn(R,Nn.result,!0,{replace:se}),{shortCircuited:!0};let{loaderData:Bo,errors:hi}=kp(k,_,di,ce,Ye,Mn,Z);Z.forEach((Re,Je)=>{Re.subscribe(gs=>{(gs||Re.done)&&Z.delete(Je)})}),d.v7_partialHydration&&ie&&k.errors&&(hi=We({},k.errors,hi));let zr=Ut(),zl=Jn(X),_l=zr||zl||Ye.length>0;return We({matches:_,loaderData:Bo,errors:hi},_l?{fetchers:new Map(k.fetchers)}:{})}function et(R){if(R&&!Wt(R[1]))return{[R[0]]:R[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Lr(R){return R.forEach(M=>{let _=k.fetchers.get(M.key),V=ki(void 0,_?_.data:void 0);k.fetchers.set(M.key,V)}),new Map(k.fetchers)}function Al(R,M,_,V){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ce(R);let ne=(V&&V.flushSync)===!0,ue=o||a,xe=Dc(k.location,k.matches,u,d.v7_prependBasename,_,d.v7_relativeSplatPath,M,V==null?void 0:V.relative),se=Ur(ue,xe,u),ie=Dl(se,ue,xe);if(ie.active&&ie.matches&&(se=ie.matches),!se){G(R,M,It(404,{pathname:xe}),{flushSync:ne});return}let{path:re,submission:ce,error:be}=mp(d.v7_normalizeFormMethod,!0,xe,V);if(be){G(R,M,be,{flushSync:ne});return}let Ee=Di(se,re),gt=(V&&V.preventScrollReset)===!0;if(ce&&pn(ce.formMethod)){Ll(R,M,re,Ee,se,ie.active,ne,gt,ce);return}O.set(R,{routeId:M,path:re}),Uo(R,M,re,Ee,se,ie.active,ne,gt,ce)}async function Ll(R,M,_,V,ne,ue,xe,se,ie){ci(),O.delete(R);function re(nt){if(!nt.route.action&&!nt.route.lazy){let xs=It(405,{method:ie.formMethod,pathname:_,routeId:M});return G(R,M,xs,{flushSync:xe}),!0}return!1}if(!ue&&re(V))return;let ce=k.fetchers.get(R);$(R,Zk(ie,ce),{flushSync:xe});let be=new AbortController,Ee=vs(e.history,_,be.signal,ie);if(ue){let nt=await Ml(ne,_,Ee.signal);if(nt.type==="aborted")return;if(nt.type==="error"){G(R,M,nt.error,{flushSync:xe});return}else if(nt.matches){if(ne=nt.matches,V=Di(ne,_),re(V))return}else{G(R,M,It(404,{pathname:_}),{flushSync:xe});return}}J.set(R,be);let gt=H,Le=(await Ir("action",k,Ee,[V],ne,R))[V.route.id];if(Ee.signal.aborted){J.get(R)===be&&J.delete(R);return}if(d.v7_fetcherPersist&&F.has(R)){if(Qr(Le)||Wt(Le)){$(R,tr(void 0));return}}else{if(Qr(Le))if(J.delete(R),X>gt){$(R,tr(void 0));return}else return ae.add(R),$(R,ki(ie)),Dn(Ee,Le,!1,{fetcherSubmission:ie,preventScrollReset:se});if(Wt(Le)){G(R,M,Le.error);return}}if(or(Le))throw It(400,{type:"defer-action"});let Ye=k.navigation.location||k.location,ms=vs(e.history,Ye,be.signal),di=o||a,Mn=k.navigation.state!=="idle"?Ur(di,k.navigation.location,u):k.matches;je(Mn,"Didn't find any matches after fetcher action");let Nn=++H;S.set(R,Nn);let Bo=ki(ie,Le.data);k.fetchers.set(R,Bo);let[hi,zr]=xp(e.history,k,Mn,ie,Ye,!1,d.v7_skipActionErrorRevalidation,U,I,Q,F,O,ae,di,u,[V.route.id,Le]);zr.filter(nt=>nt.key!==R).forEach(nt=>{let xs=nt.key,tf=k.fetchers.get(xs),Rj=ki(void 0,tf?tf.data:void 0);k.fetchers.set(xs,Rj),Ce(xs),nt.controller&&J.set(xs,nt.controller)}),W({fetchers:new Map(k.fetchers)});let zl=()=>zr.forEach(nt=>Ce(nt.key));be.signal.addEventListener("abort",zl);let{loaderResults:_l,fetcherResults:Re}=await Il(k,Mn,hi,zr,ms);if(be.signal.aborted)return;be.signal.removeEventListener("abort",zl),S.delete(R),J.delete(R),zr.forEach(nt=>J.delete(nt.key));let Je=ta(_l);if(Je)return Dn(ms,Je.result,!1,{preventScrollReset:se});if(Je=ta(Re),Je)return ae.add(Je.key),Dn(ms,Je.result,!1,{preventScrollReset:se});let{loaderData:gs,errors:fi}=kp(k,Mn,_l,void 0,zr,Re,Z);if(k.fetchers.has(R)){let nt=tr(Le.data);k.fetchers.set(R,nt)}Jn(Nn),k.navigation.state==="loading"&&Nn>X?(je(L,"Expected pending action"),D&&D.abort(),fe(k.navigation.location,{matches:Mn,loaderData:gs,errors:fi,fetchers:new Map(k.fetchers)})):(W({errors:fi,loaderData:bp(k.loaderData,gs,Mn,fi),fetchers:new Map(k.fetchers)}),U=!1)}async function Uo(R,M,_,V,ne,ue,xe,se,ie){let re=k.fetchers.get(R);$(R,ki(ie,re?re.data:void 0),{flushSync:xe});let ce=new AbortController,be=vs(e.history,_,ce.signal);if(ue){let Le=await Ml(ne,_,be.signal);if(Le.type==="aborted")return;if(Le.type==="error"){G(R,M,Le.error,{flushSync:xe});return}else if(Le.matches)ne=Le.matches,V=Di(ne,_);else{G(R,M,It(404,{pathname:_}),{flushSync:xe});return}}J.set(R,ce);let Ee=H,Fe=(await Ir("loader",k,be,[V],ne,R))[V.route.id];if(or(Fe)&&(Fe=await ch(Fe,be.signal,!0)||Fe),J.get(R)===ce&&J.delete(R),!be.signal.aborted){if(F.has(R)){$(R,tr(void 0));return}if(Qr(Fe))if(X>Ee){$(R,tr(void 0));return}else{ae.add(R),await Dn(be,Fe,!1,{preventScrollReset:se});return}if(Wt(Fe)){G(R,M,Fe.error);return}je(!or(Fe),"Unhandled fetcher deferred data"),$(R,tr(Fe.data))}}async function Dn(R,M,_,V){let{submission:ne,fetcherSubmission:ue,preventScrollReset:xe,replace:se}=V===void 0?{}:V;M.response.headers.has("X-Remix-Revalidate")&&(U=!0);let ie=M.response.headers.get("Location");je(ie,"Expected a Location header on the redirect Response"),ie=jp(ie,new URL(R.url),u);let re=hl(k.location,ie,{_isRedirect:!0});if(n){let Le=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Le=!0;else if(uh.test(ie)){const Ye=e.history.createURL(ie);Le=Ye.origin!==t.location.origin||wn(Ye.pathname,u)==null}if(Le){se?t.location.replace(ie):t.location.assign(ie);return}}D=null;let ce=se===!0||M.response.headers.has("X-Remix-Replace")?st.Replace:st.Push,{formMethod:be,formAction:Ee,formEncType:gt}=k.navigation;!ne&&!ue&&be&&Ee&&gt&&(ne=Ep(k.navigation));let Fe=ne||ue;if(Ik.has(M.response.status)&&Fe&&pn(Fe.formMethod))await Zt(ce,re,{submission:We({},Fe,{formAction:ie}),preventScrollReset:xe||T,enableViewTransition:_?N:void 0});else{let Le=xu(re,ne);await Zt(ce,re,{overrideNavigation:Le,fetcherSubmission:ue,preventScrollReset:xe||T,enableViewTransition:_?N:void 0})}}async function Ir(R,M,_,V,ne,ue){let xe,se={};try{xe=await Uk(c,R,M,_,V,ne,ue,l,i)}catch(ie){return V.forEach(re=>{se[re.route.id]={type:Me.error,error:ie}}),se}for(let[ie,re]of Object.entries(xe))if(qk(re)){let ce=re.result;se[ie]={type:Me.redirect,response:Wk(ce,_,ie,ne,u,d.v7_relativeSplatPath)}}else se[ie]=await Hk(re);return se}async function Il(R,M,_,V,ne){let ue=R.matches,xe=Ir("loader",R,ne,_,M,null),se=Promise.all(V.map(async ce=>{if(ce.matches&&ce.match&&ce.controller){let Ee=(await Ir("loader",R,vs(e.history,ce.path,ce.controller.signal),[ce.match],ce.matches,ce.key))[ce.match.route.id];return{[ce.key]:Ee}}else return Promise.resolve({[ce.key]:{type:Me.error,error:It(404,{pathname:ce.path})}})})),ie=await xe,re=(await se).reduce((ce,be)=>Object.assign(ce,be),{});return await Promise.all([Yk(M,ie,ne.signal,ue,R.loaderData),Jk(M,re,V)]),{loaderResults:ie,fetcherResults:re}}function ci(){U=!0,I.push(...Sn()),O.forEach((R,M)=>{J.has(M)&&Q.add(M),Ce(M)})}function $(R,M,_){_===void 0&&(_={}),k.fetchers.set(R,M),W({fetchers:new Map(k.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function G(R,M,_,V){V===void 0&&(V={});let ne=Br(k.matches,M);me(R),W({errors:{[ne.route.id]:_},fetchers:new Map(k.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function pe(R){return d.v7_fetcherPersist&&(C.set(R,(C.get(R)||0)+1),F.has(R)&&F.delete(R)),k.fetchers.get(R)||Dk}function me(R){let M=k.fetchers.get(R);J.has(R)&&!(M&&M.state==="loading"&&S.has(R))&&Ce(R),O.delete(R),S.delete(R),ae.delete(R),F.delete(R),Q.delete(R),k.fetchers.delete(R)}function kt(R){if(d.v7_fetcherPersist){let M=(C.get(R)||0)-1;M<=0?(C.delete(R),F.add(R)):C.set(R,M)}else me(R);W({fetchers:new Map(k.fetchers)})}function Ce(R){let M=J.get(R);M&&(M.abort(),J.delete(R))}function pt(R){for(let M of R){let _=pe(M),V=tr(_.data);k.fetchers.set(M,V)}}function Ut(){let R=[],M=!1;for(let _ of ae){let V=k.fetchers.get(_);je(V,"Expected fetcher: "+_),V.state==="loading"&&(ae.delete(_),R.push(_),M=!0)}return pt(R),M}function Jn(R){let M=[];for(let[_,V]of S)if(V<R){let ne=k.fetchers.get(_);je(ne,"Expected fetcher: "+_),ne.state==="loading"&&(Ce(_),S.delete(_),M.push(_))}return pt(M),M.length>0}function Dr(R,M){let _=k.blockers.get(R)||ws;return oe.get(R)!==M&&oe.set(R,M),_}function Xn(R){k.blockers.delete(R),oe.delete(R)}function Mr(R,M){let _=k.blockers.get(R)||ws;je(_.state==="unblocked"&&M.state==="blocked"||_.state==="blocked"&&M.state==="blocked"||_.state==="blocked"&&M.state==="proceeding"||_.state==="blocked"&&M.state==="unblocked"||_.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+_.state+" -> "+M.state);let V=new Map(k.blockers);V.set(R,M),W({blockers:V})}function ps(R){let{currentLocation:M,nextLocation:_,historyAction:V}=R;if(oe.size===0)return;oe.size>1&&Js(!1,"A router only supports one blocker at a time");let ne=Array.from(oe.entries()),[ue,xe]=ne[ne.length-1],se=k.blockers.get(ue);if(!(se&&se.state==="proceeding")&&xe({currentLocation:M,nextLocation:_,historyAction:V}))return ue}function mt(R){let M=It(404,{pathname:R}),_=o||a,{matches:V,route:ne}=Np(_);return Sn(),{notFoundMatches:V,route:ne,error:M}}function Sn(R){let M=[];return Z.forEach((_,V)=>{(!R||R(V))&&(_.cancel(),M.push(V),Z.delete(V))}),M}function cn(R,M,_){if(p=R,w=M,g=_||null,!x&&k.navigation===gu){x=!0;let V=ef(k.location,k.matches);V!=null&&W({restoreScrollPosition:V})}return()=>{p=null,w=null,g=null}}function Zh(R,M){return g&&g(R,M.map(V=>dk(V,k.loaderData)))||R.key}function Ej(R,M){if(p&&w){let _=Zh(R,M);p[_]=w()}}function ef(R,M){if(p){let _=Zh(R,M),V=p[_];if(typeof V=="number")return V}return null}function Dl(R,M,_){if(h)if(R){if(Object.keys(R[0].params).length>0)return{active:!0,matches:ba(M,_,u,!0)}}else return{active:!0,matches:ba(M,_,u,!0)||[]};return{active:!1,matches:null}}async function Ml(R,M,_){if(!h)return{type:"success",matches:R};let V=R;for(;;){let ne=o==null,ue=o||a,xe=l;try{await h({path:M,matches:V,patch:(re,ce)=>{_.aborted||vp(re,ce,ue,xe,i)}})}catch(re){return{type:"error",error:re,partialMatches:V}}finally{ne&&!_.aborted&&(a=[...a])}if(_.aborted)return{type:"aborted"};let se=Ur(ue,M,u);if(se)return{type:"success",matches:se};let ie=ba(ue,M,u,!0);if(!ie||V.length===ie.length&&V.every((re,ce)=>re.route.id===ie[ce].route.id))return{type:"success",matches:null};V=ie}}function Tj(R){l={},o=Xa(R,i,void 0,l)}function Pj(R,M){let _=o==null;vp(R,M,o||a,l,i),_&&(a=[...a],W({}))}return E={get basename(){return u},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:he,subscribe:Ke,enableScrollRestoration:cn,navigate:Ze,fetch:Al,revalidate:Xt,createHref:R=>e.history.createHref(R),encodeLocation:R=>e.history.encodeLocation(R),getFetcher:pe,deleteFetcher:kt,dispose:ze,getBlocker:Dr,deleteBlocker:Xn,patchRoutes:Pj,_internalFetchControllers:J,_internalActiveDeferreds:Z,_internalSetRoutes:Tj},E}function _k(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Dc(e,t,n,r,i,l,a,o){let u,c;if(a){u=[];for(let d of t)if(u.push(d),d.route.id===a){c=d;break}}else u=t,c=t[t.length-1];let h=oh(i||".",ah(u,l),wn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&c){let d=dh(h.search);if(c.route.index&&!d)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let f=new URLSearchParams(h.search),m=f.getAll("index");f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();h.search=p?"?"+p:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Un([n,h.pathname])),ns(h)}function mp(e,t,n,r){if(!r||!_k(r))return{path:n};if(r.formMethod&&!Kk(r.formMethod))return{path:n,error:It(405,{method:r.formMethod})};let i=()=>({path:n,error:It(400,{type:"invalid-body"})}),l=r.formMethod||"get",a=e?l.toUpperCase():l.toLowerCase(),o=gy(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pn(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[g,w]=p;return""+m+g+"="+w+`
50
- `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!pn(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}je(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=zc(r.formData),c=r.formData;else if(r.body instanceof FormData)u=zc(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=wp(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=wp(u)}catch{return i()}let h={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(pn(h.formMethod))return{path:n,submission:h};let d=Er(n);return t&&d.search&&dh(d.search)&&u.append("index",""),d.search="?"+u,{path:ns(d),submission:h}}function gp(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function xp(e,t,n,r,i,l,a,o,u,c,h,d,f,m,p,g){let w=g?Wt(g[1])?g[1].error:g[1].data:void 0,x=e.createURL(t.location),y=e.createURL(i),v=n;l&&t.errors?v=gp(n,Object.keys(t.errors)[0],!0):g&&Wt(g[1])&&(v=gp(n,g[0]));let b=g?g[1].statusCode:void 0,E=a&&b&&b>=400,k=v.filter((T,D)=>{let{route:N}=T;if(N.lazy)return!0;if(N.loader==null)return!1;if(l)return Mc(N,t.loaderData,t.errors);if($k(t.loaderData,t.matches[D],T)||u.some(z=>z===T.route.id))return!0;let P=t.matches[D],A=T;return yp(T,We({currentUrl:x,currentParams:P.params,nextUrl:y,nextParams:A.params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:E?!1:o||x.pathname+x.search===y.pathname+y.search||x.search!==y.search||py(P,A)}))}),L=[];return d.forEach((T,D)=>{if(l||!n.some(U=>U.route.id===T.routeId)||h.has(D))return;let N=Ur(m,T.path,p);if(!N){L.push({key:D,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let P=t.fetchers.get(D),A=Di(N,T.path),z=!1;f.has(D)?z=!1:c.has(D)?(c.delete(D),z=!0):P&&P.state!=="idle"&&P.data===void 0?z=o:z=yp(A,We({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:E?!1:o})),z&&L.push({key:D,routeId:T.routeId,path:T.path,matches:N,match:A,controller:new AbortController})}),[k,L]}function Mc(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function $k(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function py(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function yp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function vp(e,t,n,r,i){var l;let a;if(e){let c=r[e];je(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let o=t.filter(c=>!a.some(h=>my(c,h))),u=Xa(o,i,[e||"_","patch",String(((l=a)==null?void 0:l.length)||"0")],r);a.push(...u)}function my(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(l=>my(n,l))}):!1}async function Ok(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];je(i,"No route found in manifest");let l={};for(let a in r){let u=i[a]!==void 0&&a!=="hasErrorBoundary";Js(!u,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!uk.has(a)&&(l[a]=r[a])}Object.assign(i,l),Object.assign(i,We({},t(i),{lazy:void 0}))}async function Fk(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,l,a)=>Object.assign(i,{[n[a].route.id]:l}),{})}async function Uk(e,t,n,r,i,l,a,o,u,c){let h=l.map(m=>m.route.lazy?Ok(m.route,u,o):void 0),d=l.map((m,p)=>{let g=h[p],w=i.some(y=>y.route.id===m.route.id);return We({},m,{shouldLoad:w,resolve:async y=>(y&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(w=!0),w?Bk(t,r,m,g,y,c):Promise.resolve({type:Me.data,result:void 0}))})}),f=await e({matches:d,request:r,params:l[0].params,fetcherKey:a,context:c});try{await Promise.all(h)}catch{}return f}async function Bk(e,t,n,r,i,l){let a,o,u=c=>{let h,d=new Promise((p,g)=>h=g);o=()=>h(),t.signal.addEventListener("abort",o);let f=p=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:l},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(g=>f(g)):f())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,d])};try{let c=n.route[e];if(r)if(c){let h,[d]=await Promise.all([u(c).catch(f=>{h=f}),r]);if(h!==void 0)throw h;a=d}else if(await r,c=n.route[e],c)a=await u(c);else if(e==="action"){let h=new URL(t.url),d=h.pathname+h.search;throw It(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:Me.data,result:void 0};else if(c)a=await u(c);else{let h=new URL(t.url),d=h.pathname+h.search;throw It(404,{pathname:d})}je(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Me.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function Hk(e){let{result:t,type:n}=e;if(xy(t)){let c;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(h){return{type:Me.error,error:h}}return n===Me.error?{type:Me.error,error:new eo(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:Me.data,data:c,statusCode:t.status,headers:t.headers}}if(n===Me.error){if(Cp(t)){var r;if(t.data instanceof Error){var i;return{type:Me.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new eo(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Me.error,error:t,statusCode:Eo(t)?t.status:void 0}}if(Gk(t)){var l,a;return{type:Me.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(Cp(t)){var o,u;return{type:Me.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Me.data,data:t}}function Wk(e,t,n,r,i,l){let a=e.headers.get("Location");if(je(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!uh.test(a)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=Dc(new URL(t.url),o,i,!0,a,l),e.headers.set("Location",a)}return e}function jp(e,t,n){if(uh.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=wn(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}return e}function vs(e,t,n,r){let i=e.createURL(gy(t)).toString(),l={signal:n};if(r&&pn(r.formMethod)){let{formMethod:a,formEncType:o}=r;l.method=a.toUpperCase(),o==="application/json"?(l.headers=new Headers({"Content-Type":o}),l.body=JSON.stringify(r.json)):o==="text/plain"?l.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?l.body=zc(r.formData):l.body=r.formData}return new Request(i,l)}function zc(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function wp(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Vk(e,t,n,r,i){let l={},a=null,o,u=!1,c={},h=n&&Wt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,m=t[f];if(je(!Qr(m),"Cannot handle redirect results in processLoaderData"),Wt(m)){let p=m.error;h!==void 0&&(p=h,h=void 0),a=a||{};{let g=Br(e,f);a[g.route.id]==null&&(a[g.route.id]=p)}l[f]=void 0,u||(u=!0,o=Eo(m.error)?m.error.status:500),m.headers&&(c[f]=m.headers)}else or(m)?(r.set(f,m.deferredData),l[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers)):(l[f]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers))}),h!==void 0&&n&&(a={[n[0]]:h},l[n[0]]=void 0),{loaderData:l,errors:a,statusCode:o||200,loaderHeaders:c}}function kp(e,t,n,r,i,l,a){let{loaderData:o,errors:u}=Vk(t,n,r,a);return i.forEach(c=>{let{key:h,match:d,controller:f}=c,m=l[h];if(je(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Wt(m)){let p=Br(e.matches,d==null?void 0:d.route.id);u&&u[p.route.id]||(u=We({},u,{[p.route.id]:m.error})),e.fetchers.delete(h)}else if(Qr(m))je(!1,"Unhandled fetcher revalidation redirect");else if(or(m))je(!1,"Unhandled fetcher deferred data");else{let p=tr(m.data);e.fetchers.set(h,p)}}),{loaderData:o,errors:u}}function bp(e,t,n,r){let i=We({},t);for(let l of n){let a=l.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&l.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Sp(e){return e?Wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Br(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Np(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function It(e,t){let{pathname:n,routeId:r,method:i,type:l,message:a}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new eo(e||500,o,new Error(u),!0)}function ta(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Qr(i))return{key:r,result:i}}}function gy(e){let t=typeof e=="string"?Er(e):e;return ns(We({},t,{hash:""}))}function Qk(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function qk(e){return xy(e.result)&&Lk.has(e.result.status)}function or(e){return e.type===Me.deferred}function Wt(e){return e.type===Me.error}function Qr(e){return(e&&e.type)===Me.redirect}function Cp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Gk(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function xy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Kk(e){return Ak.has(e.toLowerCase())}function pn(e){return Pk.has(e.toLowerCase())}async function Yk(e,t,n,r,i){let l=Object.entries(t);for(let a=0;a<l.length;a++){let[o,u]=l[a],c=e.find(f=>(f==null?void 0:f.route.id)===o);if(!c)continue;let h=r.find(f=>f.route.id===c.route.id),d=h!=null&&!py(h,c)&&(i&&i[c.route.id])!==void 0;or(u)&&d&&await ch(u,n,!1).then(f=>{f&&(t[o]=f)})}}async function Jk(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:l,controller:a}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===l)&&or(o)&&(je(a,"Expected an AbortController for revalidating fetcher deferred result"),await ch(o,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function ch(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function dh(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Di(e,t){let n=typeof t=="string"?Er(t).search:t.search;if(e[e.length-1].route.index&&dh(n||""))return e[e.length-1];let r=dy(e);return r[r.length-1]}function Ep(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:l,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function xu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xk(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ki(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Zk(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function tr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function e0(e,t){try{let n=e.sessionStorage.getItem(fy);if(n){let r=JSON.parse(n);for(let[i,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function t0(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(fy,JSON.stringify(n))}catch(r){Js(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
49
+ */function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},We.apply(this,arguments)}var st;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(st||(st={}));const hp="popstate";function ak(e){e===void 0&&(e={});function t(r,i){let{pathname:l,search:a,hash:o}=r.location;return hl("",{pathname:l,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ss(i)}return uk(t,n,null,e)}function je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ok(){return Math.random().toString(36).substr(2,8)}function fp(e,t){return{usr:e.state,key:e.key,idx:t}}function hl(e,t,n,r){return n===void 0&&(n=null),We({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tr(t):t,{state:n,key:t&&t.key||r||ok()})}function ss(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Tr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function uk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:l=!1}=r,a=i.history,o=st.Pop,u=null,c=h();c==null&&(c=0,a.replaceState(We({},a.state,{idx:c}),""));function h(){return(a.state||{idx:null}).idx}function d(){o=st.Pop;let w=h(),x=w==null?null:w-c;c=w,u&&u({action:o,location:g.location,delta:x})}function f(w,x){o=st.Push;let y=hl(g.location,w,x);c=h()+1;let v=fp(y,c),b=g.createHref(y);try{a.pushState(v,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}l&&u&&u({action:o,location:g.location,delta:1})}function m(w,x){o=st.Replace;let y=hl(g.location,w,x);c=h();let v=fp(y,c),b=g.createHref(y);a.replaceState(v,"",b),l&&u&&u({action:o,location:g.location,delta:0})}function p(w){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof w=="string"?w:ss(w);return y=y.replace(/ $/,"%20"),je(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let g={get action(){return o},get location(){return e(i,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(hp,d),u=w,()=>{i.removeEventListener(hp,d),u=null}},createHref(w){return t(i,w)},createURL:p,encodeLocation(w){let x=p(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:m,go(w){return a.go(w)}};return g}var De;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(De||(De={}));const ck=new Set(["lazy","caseSensitive","path","id","index","children"]);function dk(e){return e.index===!0}function Xa(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,l)=>{let a=[...n,String(l)],o=typeof i.id=="string"?i.id:a.join("-");if(je(i.index!==!0||!i.children,"Cannot specify children on an index route"),je(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),dk(i)){let u=We({},i,t(i),{id:o});return r[o]=u,u}else{let u=We({},i,t(i),{id:o,children:void 0});return r[o]=u,i.children&&(u.children=Xa(i.children,t,a,r)),u}})}function Hr(e,t,n){return n===void 0&&(n="/"),ba(e,t,n,!1)}function ba(e,t,n,r){let i=typeof t=="string"?Tr(t):t,l=wn(i.pathname||"/",n);if(l==null)return null;let a=uy(e);fk(a);let o=null;for(let u=0;o==null&&u<a.length;++u){let c=Sk(l);o=kk(a[u],c,r)}return o}function hk(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function uy(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(l,a,o)=>{let u={relativePath:o===void 0?l.path||"":o,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};u.relativePath.startsWith("/")&&(je(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Bn([r,u.relativePath]),h=n.concat(u);l.children&&l.children.length>0&&(je(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),uy(l.children,t,h,c)),!(l.path==null&&!l.index)&&t.push({path:c,score:jk(c,l.index),routesMeta:h})};return e.forEach((l,a)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,a);else for(let u of cy(l.path))i(l,a,u)}),t}function cy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return i?[l,""]:[l];let a=cy(r.join("/")),o=[];return o.push(...a.map(u=>u===""?l:[l,u].join("/"))),i&&o.push(...a),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function fk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:wk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const pk=/^:[\w-]+$/,mk=3,gk=2,xk=1,yk=10,vk=-2,pp=e=>e==="*";function jk(e,t){let n=e.split("/"),r=n.length;return n.some(pp)&&(r+=vk),t&&(r+=gk),n.filter(i=>!pp(i)).reduce((i,l)=>i+(pk.test(l)?mk:l===""?xk:yk),r)}function wk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function kk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},l="/",a=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,h=l==="/"?t:t.slice(l.length)||"/",d=Za({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Za({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:Bn([l,d.pathname]),pathnameBase:Ek(Bn([l,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(l=Bn([l,d.pathnameBase]))}return a}function Za(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=bk(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],a=l.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((c,h,d)=>{let{paramName:f,isOptional:m}=h;if(f==="*"){let g=o[d]||"";a=l.slice(0,l.length-g.length).replace(/(.)\/+$/,"$1")}const p=o[d];return m&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:l,pathnameBase:a,pattern:e}}function bk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Xs(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Sk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xs(!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 wn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Nk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Tr(e):e;return{pathname:n?n.startsWith("/")?n:Ck(n,t):t,search:Tk(r),hash:Pk(i)}}function Ck(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function dy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oh(e,t){let n=dy(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function uh(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Tr(e):(i=We({},e),je(!i.pathname||!i.pathname.includes("?"),xu("?","pathname","search",i)),je(!i.pathname||!i.pathname.includes("#"),xu("#","pathname","hash",i)),je(!i.search||!i.search.includes("#"),xu("#","search","hash",i)));let l=e===""||i.pathname==="",a=l?"/":i.pathname,o;if(a==null)o=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}o=d>=0?t[d]:"/"}let u=Nk(i,o),c=a&&a!=="/"&&a.endsWith("/"),h=(l||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const Bn=e=>e.join("/").replace(/\/\/+/g,"/"),Ek=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Tk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Pk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class eo{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function To(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const hy=["post","put","patch","delete"],Rk=new Set(hy),Lk=["get",...hy],Ak=new Set(Lk),Ik=new Set([301,302,303,307,308]),Dk=new Set([307,308]),yu={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Mk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ks={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ch=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fy="remix-router-transitions";function _k(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;je(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;i=M=>({hasErrorBoundary:P(M)})}else i=zk;let l={},a=Xa(e.routes,i,void 0,l),o,u=e.basename||"/",c=e.dataStrategy||Uk,h=e.patchRoutesOnNavigation,d=We({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,p=null,g=null,w=null,x=e.hydrationData!=null,y=Hr(a,e.history.location,u),v=null;if(y==null&&!h){let P=It(404,{pathname:e.history.location.pathname}),{matches:M,route:_}=Np(a);y=M,v={[_.id]:P}}y&&!e.hydrationData&&Dl(y,a,e.history.location.pathname).active&&(y=null);let b;if(y)if(y.some(P=>P.route.lazy))b=!1;else if(!y.some(P=>P.route.loader))b=!0;else if(d.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null;if(M){let _=y.findIndex(V=>M[V.route.id]!==void 0);b=y.slice(0,_+1).every(V=>!_c(V.route,P,M))}else b=y.every(_=>!_c(_.route,P,M))}else b=e.hydrationData!=null;else if(b=!1,y=[],d.v7_partialHydration){let P=Dl(null,a,e.history.location.pathname);P.active&&P.matches&&(y=P.matches)}let E,k={historyAction:e.history.action,location:e.history.location,matches:y,initialized:b,navigation:yu,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},R=st.Pop,T=!1,D,C=!1,L=new Map,A=null,z=!1,U=!1,I=[],Q=new Set,J=new Map,H=0,X=-1,S=new Map,ae=new Set,O=new Map,N=new Map,F=new Set,Z=new Map,oe=new Map,B;function he(){if(f=e.history.listen(P=>{let{action:M,location:_,delta:V}=P;if(B){B(),B=void 0;return}Xs(oe.size===0||V!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ne=ms({currentLocation:k.location,nextLocation:_,historyAction:M});if(ne&&V!=null){let ue=new Promise(xe=>{B=xe});e.history.go(V*-1),_r(ne,{state:"blocked",location:_,proceed(){_r(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),ue.then(()=>e.history.go(V))},reset(){let xe=new Map(k.blockers);xe.set(ne,ks),W({blockers:xe})}});return}return en(M,_)}),n){t0(t,L);let P=()=>n0(t,L);t.addEventListener("pagehide",P),A=()=>t.removeEventListener("pagehide",P)}return k.initialized||en(st.Pop,k.location,{initialHydration:!0}),E}function ze(){f&&f(),A&&A(),m.clear(),D&&D.abort(),k.fetchers.forEach((P,M)=>me(M)),k.blockers.forEach((P,M)=>Xn(M))}function Ke(P){return m.add(P),()=>m.delete(P)}function W(P,M){M===void 0&&(M={}),k=We({},k,P);let _=[],V=[];d.v7_fetcherPersist&&k.fetchers.forEach((ne,ue)=>{ne.state==="idle"&&(F.has(ue)?V.push(ue):_.push(ue))}),[...m].forEach(ne=>ne(k,{deletedFetchers:V,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),d.v7_fetcherPersist&&(_.forEach(ne=>k.fetchers.delete(ne)),V.forEach(ne=>me(ne)))}function fe(P,M,_){var V,ne;let{flushSync:ue}=_===void 0?{}:_,xe=k.actionData!=null&&k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&k.navigation.state==="loading"&&((V=P.state)==null?void 0:V._isRedirect)!==!0,se;M.actionData?Object.keys(M.actionData).length>0?se=M.actionData:se=null:xe?se=k.actionData:se=null;let ie=M.loaderData?bp(k.loaderData,M.loaderData,M.matches||[],M.errors):k.loaderData,re=k.blockers;re.size>0&&(re=new Map(re),re.forEach((Ee,gt)=>re.set(gt,ks)));let ce=T===!0||k.navigation.formMethod!=null&&pn(k.navigation.formMethod)&&((ne=P.state)==null?void 0:ne._isRedirect)!==!0;o&&(a=o,o=void 0),z||R===st.Pop||(R===st.Push?e.history.push(P,P.state):R===st.Replace&&e.history.replace(P,P.state));let be;if(R===st.Pop){let Ee=L.get(k.location.pathname);Ee&&Ee.has(P.pathname)?be={currentLocation:k.location,nextLocation:P}:L.has(P.pathname)&&(be={currentLocation:P,nextLocation:k.location})}else if(C){let Ee=L.get(k.location.pathname);Ee?Ee.add(P.pathname):(Ee=new Set([P.pathname]),L.set(k.location.pathname,Ee)),be={currentLocation:k.location,nextLocation:P}}W(We({},M,{actionData:se,loaderData:ie,historyAction:R,location:P,initialized:!0,navigation:yu,revalidation:"idle",restoreScrollPosition:ef(P,M.matches||k.matches),preventScrollReset:ce,blockers:re}),{viewTransitionOpts:be,flushSync:ue===!0}),R=st.Pop,T=!1,C=!1,z=!1,U=!1,I=[]}async function Ze(P,M){if(typeof P=="number"){e.history.go(P);return}let _=zc(k.location,k.matches,u,d.v7_prependBasename,P,d.v7_relativeSplatPath,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:V,submission:ne,error:ue}=mp(d.v7_normalizeFormMethod,!1,_,M),xe=k.location,se=hl(k.location,V,M&&M.state);se=We({},se,e.history.encodeLocation(se));let ie=M&&M.replace!=null?M.replace:void 0,re=st.Push;ie===!0?re=st.Replace:ie===!1||ne!=null&&pn(ne.formMethod)&&ne.formAction===k.location.pathname+k.location.search&&(re=st.Replace);let ce=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,be=(M&&M.flushSync)===!0,Ee=ms({currentLocation:xe,nextLocation:se,historyAction:re});if(Ee){_r(Ee,{state:"blocked",location:se,proceed(){_r(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),Ze(P,M)},reset(){let gt=new Map(k.blockers);gt.set(Ee,ks),W({blockers:gt})}});return}return await en(re,se,{submission:ne,pendingError:ue,preventScrollReset:ce,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:be})}function Zt(){if(ci(),W({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){en(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}en(R||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:C===!0})}}async function en(P,M,_){D&&D.abort(),D=null,R=P,z=(_&&_.startUninterruptedRevalidation)===!0,Tj(k.location,k.matches),T=(_&&_.preventScrollReset)===!0,C=(_&&_.enableViewTransition)===!0;let V=o||a,ne=_&&_.overrideNavigation,ue=Hr(V,M,u),xe=(_&&_.flushSync)===!0,se=Dl(ue,V,M.pathname);if(se.active&&se.matches&&(ue=se.matches),!ue){let{error:Fe,notFoundMatches:Ae,route:Ye}=mt(M.pathname);fe(M,{matches:Ae,loaderData:{},errors:{[Ye.id]:Fe}},{flushSync:xe});return}if(k.initialized&&!U&&qk(k.location,M)&&!(_&&_.submission&&pn(_.submission.formMethod))){fe(M,{matches:ue},{flushSync:xe});return}D=new AbortController;let ie=js(e.history,M,D.signal,_&&_.submission),re;if(_&&_.pendingError)re=[Wr(ue).route.id,{type:De.error,error:_.pendingError}];else if(_&&_.submission&&pn(_.submission.formMethod)){let Fe=await ee(ie,M,_.submission,ue,se.active,{replace:_.replace,flushSync:xe});if(Fe.shortCircuited)return;if(Fe.pendingActionResult){let[Ae,Ye]=Fe.pendingActionResult;if(Wt(Ye)&&To(Ye.error)&&Ye.error.status===404){D=null,fe(M,{matches:Fe.matches,loaderData:{},errors:{[Ae]:Ye.error}});return}}ue=Fe.matches||ue,re=Fe.pendingActionResult,ne=vu(M,_.submission),xe=!1,se.active=!1,ie=js(e.history,ie.url,ie.signal)}let{shortCircuited:ce,matches:be,loaderData:Ee,errors:gt}=await Ne(ie,M,ue,se.active,ne,_&&_.submission,_&&_.fetcherSubmission,_&&_.replace,_&&_.initialHydration===!0,xe,re);ce||(D=null,fe(M,We({matches:be||ue},Sp(re),{loaderData:Ee,errors:gt})))}async function ee(P,M,_,V,ne,ue){ue===void 0&&(ue={}),ci();let xe=Zk(M,_);if(W({navigation:xe},{flushSync:ue.flushSync===!0}),ne){let re=await Ml(V,M.pathname,P.signal);if(re.type==="aborted")return{shortCircuited:!0};if(re.type==="error"){let ce=Wr(re.partialMatches).route.id;return{matches:re.partialMatches,pendingActionResult:[ce,{type:De.error,error:re.error}]}}else if(re.matches)V=re.matches;else{let{notFoundMatches:ce,error:be,route:Ee}=mt(M.pathname);return{matches:ce,pendingActionResult:[Ee.id,{type:De.error,error:be}]}}}let se,ie=Di(V,M);if(!ie.route.action&&!ie.route.lazy)se={type:De.error,error:It(405,{method:P.method,pathname:M.pathname,routeId:ie.route.id})};else if(se=(await Mr("action",k,P,[ie],V,null))[ie.route.id],P.signal.aborted)return{shortCircuited:!0};if(Gr(se)){let re;return ue&&ue.replace!=null?re=ue.replace:re=jp(se.response.headers.get("Location"),new URL(P.url),u)===k.location.pathname+k.location.search,await Mn(P,se,!0,{submission:_,replace:re}),{shortCircuited:!0}}if(or(se))throw It(400,{type:"defer-action"});if(Wt(se)){let re=Wr(V,ie.route.id);return(ue&&ue.replace)!==!0&&(R=st.Push),{matches:V,pendingActionResult:[re.route.id,se]}}return{matches:V,pendingActionResult:[ie.route.id,se]}}async function Ne(P,M,_,V,ne,ue,xe,se,ie,re,ce){let be=ne||vu(M,ue),Ee=ue||xe||Ep(be),gt=!z&&(!d.v7_partialHydration||!ie);if(V){if(gt){let Je=et(ce);W(We({navigation:be},Je!==void 0?{actionData:Je}:{}),{flushSync:re})}let Re=await Ml(_,M.pathname,P.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let Je=Wr(Re.partialMatches).route.id;return{matches:Re.partialMatches,loaderData:{},errors:{[Je]:Re.error}}}else if(Re.matches)_=Re.matches;else{let{error:Je,notFoundMatches:xs,route:fi}=mt(M.pathname);return{matches:xs,loaderData:{},errors:{[fi.id]:Je}}}}let Fe=o||a,[Ae,Ye]=xp(e.history,k,_,Ee,M,d.v7_partialHydration&&ie===!0,d.v7_skipActionErrorRevalidation,U,I,Q,F,O,ae,Fe,u,ce);if(Sn(Re=>!(_&&_.some(Je=>Je.route.id===Re))||Ae&&Ae.some(Je=>Je.route.id===Re)),X=++H,Ae.length===0&&Ye.length===0){let Re=Ut();return fe(M,We({matches:_,loaderData:{},errors:ce&&Wt(ce[1])?{[ce[0]]:ce[1].error}:null},Sp(ce),Re?{fetchers:new Map(k.fetchers)}:{}),{flushSync:re}),{shortCircuited:!0}}if(gt){let Re={};if(!V){Re.navigation=be;let Je=et(ce);Je!==void 0&&(Re.actionData=Je)}Ye.length>0&&(Re.fetchers=Dr(Ye)),W(Re,{flushSync:re})}Ye.forEach(Re=>{Ce(Re.key),Re.controller&&J.set(Re.key,Re.controller)});let gs=()=>Ye.forEach(Re=>Ce(Re.key));D&&D.signal.addEventListener("abort",gs);let{loaderResults:di,fetcherResults:zn}=await Il(k,_,Ae,Ye,P);if(P.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",gs),Ye.forEach(Re=>J.delete(Re.key));let Nn=ta(di);if(Nn)return await Mn(P,Nn.result,!0,{replace:se}),{shortCircuited:!0};if(Nn=ta(zn),Nn)return ae.add(Nn.key),await Mn(P,Nn.result,!0,{replace:se}),{shortCircuited:!0};let{loaderData:Wo,errors:hi}=kp(k,_,di,ce,Ye,zn,Z);Z.forEach((Re,Je)=>{Re.subscribe(xs=>{(xs||Re.done)&&Z.delete(Je)})}),d.v7_partialHydration&&ie&&k.errors&&(hi=We({},k.errors,hi));let $r=Ut(),zl=Jn(X),_l=$r||zl||Ye.length>0;return We({matches:_,loaderData:Wo,errors:hi},_l?{fetchers:new Map(k.fetchers)}:{})}function et(P){if(P&&!Wt(P[1]))return{[P[0]]:P[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function Dr(P){return P.forEach(M=>{let _=k.fetchers.get(M.key),V=ki(void 0,_?_.data:void 0);k.fetchers.set(M.key,V)}),new Map(k.fetchers)}function Ll(P,M,_,V){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Ce(P);let ne=(V&&V.flushSync)===!0,ue=o||a,xe=zc(k.location,k.matches,u,d.v7_prependBasename,_,d.v7_relativeSplatPath,M,V==null?void 0:V.relative),se=Hr(ue,xe,u),ie=Dl(se,ue,xe);if(ie.active&&ie.matches&&(se=ie.matches),!se){G(P,M,It(404,{pathname:xe}),{flushSync:ne});return}let{path:re,submission:ce,error:be}=mp(d.v7_normalizeFormMethod,!0,xe,V);if(be){G(P,M,be,{flushSync:ne});return}let Ee=Di(se,re),gt=(V&&V.preventScrollReset)===!0;if(ce&&pn(ce.formMethod)){Al(P,M,re,Ee,se,ie.active,ne,gt,ce);return}O.set(P,{routeId:M,path:re}),Ho(P,M,re,Ee,se,ie.active,ne,gt,ce)}async function Al(P,M,_,V,ne,ue,xe,se,ie){ci(),O.delete(P);function re(nt){if(!nt.route.action&&!nt.route.lazy){let ys=It(405,{method:ie.formMethod,pathname:_,routeId:M});return G(P,M,ys,{flushSync:xe}),!0}return!1}if(!ue&&re(V))return;let ce=k.fetchers.get(P);$(P,e0(ie,ce),{flushSync:xe});let be=new AbortController,Ee=js(e.history,_,be.signal,ie);if(ue){let nt=await Ml(ne,_,Ee.signal);if(nt.type==="aborted")return;if(nt.type==="error"){G(P,M,nt.error,{flushSync:xe});return}else if(nt.matches){if(ne=nt.matches,V=Di(ne,_),re(V))return}else{G(P,M,It(404,{pathname:_}),{flushSync:xe});return}}J.set(P,be);let gt=H,Ae=(await Mr("action",k,Ee,[V],ne,P))[V.route.id];if(Ee.signal.aborted){J.get(P)===be&&J.delete(P);return}if(d.v7_fetcherPersist&&F.has(P)){if(Gr(Ae)||Wt(Ae)){$(P,tr(void 0));return}}else{if(Gr(Ae))if(J.delete(P),X>gt){$(P,tr(void 0));return}else return ae.add(P),$(P,ki(ie)),Mn(Ee,Ae,!1,{fetcherSubmission:ie,preventScrollReset:se});if(Wt(Ae)){G(P,M,Ae.error);return}}if(or(Ae))throw It(400,{type:"defer-action"});let Ye=k.navigation.location||k.location,gs=js(e.history,Ye,be.signal),di=o||a,zn=k.navigation.state!=="idle"?Hr(di,k.navigation.location,u):k.matches;je(zn,"Didn't find any matches after fetcher action");let Nn=++H;S.set(P,Nn);let Wo=ki(ie,Ae.data);k.fetchers.set(P,Wo);let[hi,$r]=xp(e.history,k,zn,ie,Ye,!1,d.v7_skipActionErrorRevalidation,U,I,Q,F,O,ae,di,u,[V.route.id,Ae]);$r.filter(nt=>nt.key!==P).forEach(nt=>{let ys=nt.key,tf=k.fetchers.get(ys),Lj=ki(void 0,tf?tf.data:void 0);k.fetchers.set(ys,Lj),Ce(ys),nt.controller&&J.set(ys,nt.controller)}),W({fetchers:new Map(k.fetchers)});let zl=()=>$r.forEach(nt=>Ce(nt.key));be.signal.addEventListener("abort",zl);let{loaderResults:_l,fetcherResults:Re}=await Il(k,zn,hi,$r,gs);if(be.signal.aborted)return;be.signal.removeEventListener("abort",zl),S.delete(P),J.delete(P),$r.forEach(nt=>J.delete(nt.key));let Je=ta(_l);if(Je)return Mn(gs,Je.result,!1,{preventScrollReset:se});if(Je=ta(Re),Je)return ae.add(Je.key),Mn(gs,Je.result,!1,{preventScrollReset:se});let{loaderData:xs,errors:fi}=kp(k,zn,_l,void 0,$r,Re,Z);if(k.fetchers.has(P)){let nt=tr(Ae.data);k.fetchers.set(P,nt)}Jn(Nn),k.navigation.state==="loading"&&Nn>X?(je(R,"Expected pending action"),D&&D.abort(),fe(k.navigation.location,{matches:zn,loaderData:xs,errors:fi,fetchers:new Map(k.fetchers)})):(W({errors:fi,loaderData:bp(k.loaderData,xs,zn,fi),fetchers:new Map(k.fetchers)}),U=!1)}async function Ho(P,M,_,V,ne,ue,xe,se,ie){let re=k.fetchers.get(P);$(P,ki(ie,re?re.data:void 0),{flushSync:xe});let ce=new AbortController,be=js(e.history,_,ce.signal);if(ue){let Ae=await Ml(ne,_,be.signal);if(Ae.type==="aborted")return;if(Ae.type==="error"){G(P,M,Ae.error,{flushSync:xe});return}else if(Ae.matches)ne=Ae.matches,V=Di(ne,_);else{G(P,M,It(404,{pathname:_}),{flushSync:xe});return}}J.set(P,ce);let Ee=H,Fe=(await Mr("loader",k,be,[V],ne,P))[V.route.id];if(or(Fe)&&(Fe=await dh(Fe,be.signal,!0)||Fe),J.get(P)===ce&&J.delete(P),!be.signal.aborted){if(F.has(P)){$(P,tr(void 0));return}if(Gr(Fe))if(X>Ee){$(P,tr(void 0));return}else{ae.add(P),await Mn(be,Fe,!1,{preventScrollReset:se});return}if(Wt(Fe)){G(P,M,Fe.error);return}je(!or(Fe),"Unhandled fetcher deferred data"),$(P,tr(Fe.data))}}async function Mn(P,M,_,V){let{submission:ne,fetcherSubmission:ue,preventScrollReset:xe,replace:se}=V===void 0?{}:V;M.response.headers.has("X-Remix-Revalidate")&&(U=!0);let ie=M.response.headers.get("Location");je(ie,"Expected a Location header on the redirect Response"),ie=jp(ie,new URL(P.url),u);let re=hl(k.location,ie,{_isRedirect:!0});if(n){let Ae=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Ae=!0;else if(ch.test(ie)){const Ye=e.history.createURL(ie);Ae=Ye.origin!==t.location.origin||wn(Ye.pathname,u)==null}if(Ae){se?t.location.replace(ie):t.location.assign(ie);return}}D=null;let ce=se===!0||M.response.headers.has("X-Remix-Replace")?st.Replace:st.Push,{formMethod:be,formAction:Ee,formEncType:gt}=k.navigation;!ne&&!ue&&be&&Ee&&gt&&(ne=Ep(k.navigation));let Fe=ne||ue;if(Dk.has(M.response.status)&&Fe&&pn(Fe.formMethod))await en(ce,re,{submission:We({},Fe,{formAction:ie}),preventScrollReset:xe||T,enableViewTransition:_?C:void 0});else{let Ae=vu(re,ne);await en(ce,re,{overrideNavigation:Ae,fetcherSubmission:ue,preventScrollReset:xe||T,enableViewTransition:_?C:void 0})}}async function Mr(P,M,_,V,ne,ue){let xe,se={};try{xe=await Bk(c,P,M,_,V,ne,ue,l,i)}catch(ie){return V.forEach(re=>{se[re.route.id]={type:De.error,error:ie}}),se}for(let[ie,re]of Object.entries(xe))if(Gk(re)){let ce=re.result;se[ie]={type:De.redirect,response:Vk(ce,_,ie,ne,u,d.v7_relativeSplatPath)}}else se[ie]=await Wk(re);return se}async function Il(P,M,_,V,ne){let ue=P.matches,xe=Mr("loader",P,ne,_,M,null),se=Promise.all(V.map(async ce=>{if(ce.matches&&ce.match&&ce.controller){let Ee=(await Mr("loader",P,js(e.history,ce.path,ce.controller.signal),[ce.match],ce.matches,ce.key))[ce.match.route.id];return{[ce.key]:Ee}}else return Promise.resolve({[ce.key]:{type:De.error,error:It(404,{pathname:ce.path})}})})),ie=await xe,re=(await se).reduce((ce,be)=>Object.assign(ce,be),{});return await Promise.all([Jk(M,ie,ne.signal,ue,P.loaderData),Xk(M,re,V)]),{loaderResults:ie,fetcherResults:re}}function ci(){U=!0,I.push(...Sn()),O.forEach((P,M)=>{J.has(M)&&Q.add(M),Ce(M)})}function $(P,M,_){_===void 0&&(_={}),k.fetchers.set(P,M),W({fetchers:new Map(k.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function G(P,M,_,V){V===void 0&&(V={});let ne=Wr(k.matches,M);me(P),W({errors:{[ne.route.id]:_},fetchers:new Map(k.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function pe(P){return d.v7_fetcherPersist&&(N.set(P,(N.get(P)||0)+1),F.has(P)&&F.delete(P)),k.fetchers.get(P)||Mk}function me(P){let M=k.fetchers.get(P);J.has(P)&&!(M&&M.state==="loading"&&S.has(P))&&Ce(P),O.delete(P),S.delete(P),ae.delete(P),F.delete(P),Q.delete(P),k.fetchers.delete(P)}function kt(P){if(d.v7_fetcherPersist){let M=(N.get(P)||0)-1;M<=0?(N.delete(P),F.add(P)):N.set(P,M)}else me(P);W({fetchers:new Map(k.fetchers)})}function Ce(P){let M=J.get(P);M&&(M.abort(),J.delete(P))}function pt(P){for(let M of P){let _=pe(M),V=tr(_.data);k.fetchers.set(M,V)}}function Ut(){let P=[],M=!1;for(let _ of ae){let V=k.fetchers.get(_);je(V,"Expected fetcher: "+_),V.state==="loading"&&(ae.delete(_),P.push(_),M=!0)}return pt(P),M}function Jn(P){let M=[];for(let[_,V]of S)if(V<P){let ne=k.fetchers.get(_);je(ne,"Expected fetcher: "+_),ne.state==="loading"&&(Ce(_),S.delete(_),M.push(_))}return pt(M),M.length>0}function zr(P,M){let _=k.blockers.get(P)||ks;return oe.get(P)!==M&&oe.set(P,M),_}function Xn(P){k.blockers.delete(P),oe.delete(P)}function _r(P,M){let _=k.blockers.get(P)||ks;je(_.state==="unblocked"&&M.state==="blocked"||_.state==="blocked"&&M.state==="blocked"||_.state==="blocked"&&M.state==="proceeding"||_.state==="blocked"&&M.state==="unblocked"||_.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+_.state+" -> "+M.state);let V=new Map(k.blockers);V.set(P,M),W({blockers:V})}function ms(P){let{currentLocation:M,nextLocation:_,historyAction:V}=P;if(oe.size===0)return;oe.size>1&&Xs(!1,"A router only supports one blocker at a time");let ne=Array.from(oe.entries()),[ue,xe]=ne[ne.length-1],se=k.blockers.get(ue);if(!(se&&se.state==="proceeding")&&xe({currentLocation:M,nextLocation:_,historyAction:V}))return ue}function mt(P){let M=It(404,{pathname:P}),_=o||a,{matches:V,route:ne}=Np(_);return Sn(),{notFoundMatches:V,route:ne,error:M}}function Sn(P){let M=[];return Z.forEach((_,V)=>{(!P||P(V))&&(_.cancel(),M.push(V),Z.delete(V))}),M}function cn(P,M,_){if(p=P,w=M,g=_||null,!x&&k.navigation===yu){x=!0;let V=ef(k.location,k.matches);V!=null&&W({restoreScrollPosition:V})}return()=>{p=null,w=null,g=null}}function Zh(P,M){return g&&g(P,M.map(V=>hk(V,k.loaderData)))||P.key}function Tj(P,M){if(p&&w){let _=Zh(P,M);p[_]=w()}}function ef(P,M){if(p){let _=Zh(P,M),V=p[_];if(typeof V=="number")return V}return null}function Dl(P,M,_){if(h)if(P){if(Object.keys(P[0].params).length>0)return{active:!0,matches:ba(M,_,u,!0)}}else return{active:!0,matches:ba(M,_,u,!0)||[]};return{active:!1,matches:null}}async function Ml(P,M,_){if(!h)return{type:"success",matches:P};let V=P;for(;;){let ne=o==null,ue=o||a,xe=l;try{await h({path:M,matches:V,patch:(re,ce)=>{_.aborted||vp(re,ce,ue,xe,i)}})}catch(re){return{type:"error",error:re,partialMatches:V}}finally{ne&&!_.aborted&&(a=[...a])}if(_.aborted)return{type:"aborted"};let se=Hr(ue,M,u);if(se)return{type:"success",matches:se};let ie=ba(ue,M,u,!0);if(!ie||V.length===ie.length&&V.every((re,ce)=>re.route.id===ie[ce].route.id))return{type:"success",matches:null};V=ie}}function Pj(P){l={},o=Xa(P,i,void 0,l)}function Rj(P,M){let _=o==null;vp(P,M,o||a,l,i),_&&(a=[...a],W({}))}return E={get basename(){return u},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:he,subscribe:Ke,enableScrollRestoration:cn,navigate:Ze,fetch:Ll,revalidate:Zt,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:pe,deleteFetcher:kt,dispose:ze,getBlocker:zr,deleteBlocker:Xn,patchRoutes:Rj,_internalFetchControllers:J,_internalActiveDeferreds:Z,_internalSetRoutes:Pj},E}function $k(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function zc(e,t,n,r,i,l,a,o){let u,c;if(a){u=[];for(let d of t)if(u.push(d),d.route.id===a){c=d;break}}else u=t,c=t[t.length-1];let h=uh(i||".",oh(u,l),wn(e.pathname,n)||e.pathname,o==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&c){let d=hh(h.search);if(c.route.index&&!d)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let f=new URLSearchParams(h.search),m=f.getAll("index");f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let p=f.toString();h.search=p?"?"+p:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Bn([n,h.pathname])),ss(h)}function mp(e,t,n,r){if(!r||!$k(r))return{path:n};if(r.formMethod&&!Yk(r.formMethod))return{path:n,error:It(405,{method:r.formMethod})};let i=()=>({path:n,error:It(400,{type:"invalid-body"})}),l=r.formMethod||"get",a=e?l.toUpperCase():l.toLowerCase(),o=gy(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pn(a))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[g,w]=p;return""+m+g+"="+w+`
50
+ `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!pn(a))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}je(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=$c(r.formData),c=r.formData;else if(r.body instanceof FormData)u=$c(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=wp(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=wp(u)}catch{return i()}let h={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(pn(h.formMethod))return{path:n,submission:h};let d=Tr(n);return t&&d.search&&hh(d.search)&&u.append("index",""),d.search="?"+u,{path:ss(d),submission:h}}function gp(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function xp(e,t,n,r,i,l,a,o,u,c,h,d,f,m,p,g){let w=g?Wt(g[1])?g[1].error:g[1].data:void 0,x=e.createURL(t.location),y=e.createURL(i),v=n;l&&t.errors?v=gp(n,Object.keys(t.errors)[0],!0):g&&Wt(g[1])&&(v=gp(n,g[0]));let b=g?g[1].statusCode:void 0,E=a&&b&&b>=400,k=v.filter((T,D)=>{let{route:C}=T;if(C.lazy)return!0;if(C.loader==null)return!1;if(l)return _c(C,t.loaderData,t.errors);if(Ok(t.loaderData,t.matches[D],T)||u.some(z=>z===T.route.id))return!0;let L=t.matches[D],A=T;return yp(T,We({currentUrl:x,currentParams:L.params,nextUrl:y,nextParams:A.params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:E?!1:o||x.pathname+x.search===y.pathname+y.search||x.search!==y.search||py(L,A)}))}),R=[];return d.forEach((T,D)=>{if(l||!n.some(U=>U.route.id===T.routeId)||h.has(D))return;let C=Hr(m,T.path,p);if(!C){R.push({key:D,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let L=t.fetchers.get(D),A=Di(C,T.path),z=!1;f.has(D)?z=!1:c.has(D)?(c.delete(D),z=!0):L&&L.state!=="idle"&&L.data===void 0?z=o:z=yp(A,We({currentUrl:x,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:b,defaultShouldRevalidate:E?!1:o})),z&&R.push({key:D,routeId:T.routeId,path:T.path,matches:C,match:A,controller:new AbortController})}),[k,R]}function _c(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function Ok(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function py(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function yp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function vp(e,t,n,r,i){var l;let a;if(e){let c=r[e];je(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let o=t.filter(c=>!a.some(h=>my(c,h))),u=Xa(o,i,[e||"_","patch",String(((l=a)==null?void 0:l.length)||"0")],r);a.push(...u)}function my(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(l=>my(n,l))}):!1}async function Fk(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];je(i,"No route found in manifest");let l={};for(let a in r){let u=i[a]!==void 0&&a!=="hasErrorBoundary";Xs(!u,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!ck.has(a)&&(l[a]=r[a])}Object.assign(i,l),Object.assign(i,We({},t(i),{lazy:void 0}))}async function Uk(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,l,a)=>Object.assign(i,{[n[a].route.id]:l}),{})}async function Bk(e,t,n,r,i,l,a,o,u,c){let h=l.map(m=>m.route.lazy?Fk(m.route,u,o):void 0),d=l.map((m,p)=>{let g=h[p],w=i.some(y=>y.route.id===m.route.id);return We({},m,{shouldLoad:w,resolve:async y=>(y&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(w=!0),w?Hk(t,r,m,g,y,c):Promise.resolve({type:De.data,result:void 0}))})}),f=await e({matches:d,request:r,params:l[0].params,fetcherKey:a,context:c});try{await Promise.all(h)}catch{}return f}async function Hk(e,t,n,r,i,l){let a,o,u=c=>{let h,d=new Promise((p,g)=>h=g);o=()=>h(),t.signal.addEventListener("abort",o);let f=p=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:l},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(i?i(g=>f(g)):f())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,d])};try{let c=n.route[e];if(r)if(c){let h,[d]=await Promise.all([u(c).catch(f=>{h=f}),r]);if(h!==void 0)throw h;a=d}else if(await r,c=n.route[e],c)a=await u(c);else if(e==="action"){let h=new URL(t.url),d=h.pathname+h.search;throw It(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:De.data,result:void 0};else if(c)a=await u(c);else{let h=new URL(t.url),d=h.pathname+h.search;throw It(404,{pathname:d})}je(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:De.error,result:c}}finally{o&&t.signal.removeEventListener("abort",o)}return a}async function Wk(e){let{result:t,type:n}=e;if(xy(t)){let c;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(h){return{type:De.error,error:h}}return n===De.error?{type:De.error,error:new eo(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:De.data,data:c,statusCode:t.status,headers:t.headers}}if(n===De.error){if(Cp(t)){var r;if(t.data instanceof Error){var i;return{type:De.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new eo(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:De.error,error:t,statusCode:To(t)?t.status:void 0}}if(Kk(t)){var l,a;return{type:De.deferred,deferredData:t,statusCode:(l=t.init)==null?void 0:l.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(Cp(t)){var o,u;return{type:De.data,data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:De.data,data:t}}function Vk(e,t,n,r,i,l){let a=e.headers.get("Location");if(je(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!ch.test(a)){let o=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=zc(new URL(t.url),o,i,!0,a,l),e.headers.set("Location",a)}return e}function jp(e,t,n){if(ch.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=wn(i.pathname,n)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}return e}function js(e,t,n,r){let i=e.createURL(gy(t)).toString(),l={signal:n};if(r&&pn(r.formMethod)){let{formMethod:a,formEncType:o}=r;l.method=a.toUpperCase(),o==="application/json"?(l.headers=new Headers({"Content-Type":o}),l.body=JSON.stringify(r.json)):o==="text/plain"?l.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?l.body=$c(r.formData):l.body=r.formData}return new Request(i,l)}function $c(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function wp(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Qk(e,t,n,r,i){let l={},a=null,o,u=!1,c={},h=n&&Wt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let f=d.route.id,m=t[f];if(je(!Gr(m),"Cannot handle redirect results in processLoaderData"),Wt(m)){let p=m.error;h!==void 0&&(p=h,h=void 0),a=a||{};{let g=Wr(e,f);a[g.route.id]==null&&(a[g.route.id]=p)}l[f]=void 0,u||(u=!0,o=To(m.error)?m.error.status:500),m.headers&&(c[f]=m.headers)}else or(m)?(r.set(f,m.deferredData),l[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers)):(l[f]=m.data,m.statusCode&&m.statusCode!==200&&!u&&(o=m.statusCode),m.headers&&(c[f]=m.headers))}),h!==void 0&&n&&(a={[n[0]]:h},l[n[0]]=void 0),{loaderData:l,errors:a,statusCode:o||200,loaderHeaders:c}}function kp(e,t,n,r,i,l,a){let{loaderData:o,errors:u}=Qk(t,n,r,a);return i.forEach(c=>{let{key:h,match:d,controller:f}=c,m=l[h];if(je(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Wt(m)){let p=Wr(e.matches,d==null?void 0:d.route.id);u&&u[p.route.id]||(u=We({},u,{[p.route.id]:m.error})),e.fetchers.delete(h)}else if(Gr(m))je(!1,"Unhandled fetcher revalidation redirect");else if(or(m))je(!1,"Unhandled fetcher deferred data");else{let p=tr(m.data);e.fetchers.set(h,p)}}),{loaderData:o,errors:u}}function bp(e,t,n,r){let i=We({},t);for(let l of n){let a=l.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&l.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function Sp(e){return e?Wt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Wr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Np(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function It(e,t){let{pathname:n,routeId:r,method:i,type:l,message:a}=t===void 0?{}:t,o="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?u="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":l==="defer-action"?u="defer() is not supported in actions":l==="invalid-body"&&(u="Unable to encode submission body")):e===403?(o="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",u='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?u="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(u='Invalid request method "'+i.toUpperCase()+'"')),new eo(e||500,o,new Error(u),!0)}function ta(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Gr(i))return{key:r,result:i}}}function gy(e){let t=typeof e=="string"?Tr(e):e;return ss(We({},t,{hash:""}))}function qk(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Gk(e){return xy(e.result)&&Ik.has(e.result.status)}function or(e){return e.type===De.deferred}function Wt(e){return e.type===De.error}function Gr(e){return(e&&e.type)===De.redirect}function Cp(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Kk(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function xy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Yk(e){return Ak.has(e.toLowerCase())}function pn(e){return Rk.has(e.toLowerCase())}async function Jk(e,t,n,r,i){let l=Object.entries(t);for(let a=0;a<l.length;a++){let[o,u]=l[a],c=e.find(f=>(f==null?void 0:f.route.id)===o);if(!c)continue;let h=r.find(f=>f.route.id===c.route.id),d=h!=null&&!py(h,c)&&(i&&i[c.route.id])!==void 0;or(u)&&d&&await dh(u,n,!1).then(f=>{f&&(t[o]=f)})}}async function Xk(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:l,controller:a}=n[r],o=t[i];e.find(c=>(c==null?void 0:c.route.id)===l)&&or(o)&&(je(a,"Expected an AbortController for revalidating fetcher deferred result"),await dh(o,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function dh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:De.data,data:e.deferredData.unwrappedData}}catch(i){return{type:De.error,error:i}}return{type:De.data,data:e.deferredData.data}}}function hh(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Di(e,t){let n=typeof t=="string"?Tr(t).search:t.search;if(e[e.length-1].route.index&&hh(n||""))return e[e.length-1];let r=dy(e);return r[r.length-1]}function Ep(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:l,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function vu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Zk(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ki(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function e0(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function tr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function t0(e,t){try{let n=e.sessionStorage.getItem(fy);if(n){let r=JSON.parse(n);for(let[i,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(i,new Set(l||[]))}}catch{}}function n0(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(fy,JSON.stringify(n))}catch(r){Xs(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
51
51
  * React Router v6.28.0
52
52
  *
53
53
  * Copyright (c) Remix Software Inc.
@@ -56,7 +56,7 @@ Error generating stack: `+l.message+`
56
56
  * LICENSE.md file in the root directory of this source tree.
57
57
  *
58
58
  * @license MIT
59
- */function Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xs.apply(this,arguments)}const kl=j.createContext(null),hh=j.createContext(null),Tr=j.createContext(null),fh=j.createContext(null),qn=j.createContext({outlet:null,matches:[],isDataRoute:!1}),yy=j.createContext(null);function n0(e,t){let{relative:n}=t===void 0?{}:t;bl()||je(!1);let{basename:r,navigator:i}=j.useContext(Tr),{hash:l,pathname:a,search:o}=To(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Un([r,a])),i.createHref({pathname:u,search:o,hash:l})}function bl(){return j.useContext(fh)!=null}function Gn(){return bl()||je(!1),j.useContext(fh).location}function vy(e){j.useContext(Tr).static||j.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=j.useContext(qn);return e?m0():r0()}function r0(){bl()||je(!1);let e=j.useContext(kl),{basename:t,future:n,navigator:r}=j.useContext(Tr),{matches:i}=j.useContext(qn),{pathname:l}=Gn(),a=JSON.stringify(ah(i,n.v7_relativeSplatPath)),o=j.useRef(!1);return vy(()=>{o.current=!0}),j.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let d=oh(c,JSON.parse(a),l,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Un([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,a,l,e])}const s0=j.createContext(null);function i0(e){let t=j.useContext(qn).outlet;return t&&j.createElement(s0.Provider,{value:e},t)}function ii(){let{matches:e}=j.useContext(qn),t=e[e.length-1];return t?t.params:{}}function To(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=j.useContext(Tr),{matches:i}=j.useContext(qn),{pathname:l}=Gn(),a=JSON.stringify(ah(i,r.v7_relativeSplatPath));return j.useMemo(()=>oh(e,JSON.parse(a),l,n==="path"),[e,a,l,n])}function l0(e,t,n,r){bl()||je(!1);let{navigator:i}=j.useContext(Tr),{matches:l}=j.useContext(qn),a=l[l.length-1],o=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Gn(),h;h=c;let d=h.pathname||"/",f=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=Ur(e,{pathname:f});return d0(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Un([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Un([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),l,n,r)}function a0(){let e=f0(),t=Eo(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:i},n):null,null)}const o0=j.createElement(a0,null);class u0 extends j.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?j.createElement(qn.Provider,{value:this.props.routeContext},j.createElement(yy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function c0(e){let{routeContext:t,match:n,children:r}=e,i=j.useContext(kl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(qn.Provider,{value:t},r)}function d0(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let h=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||je(!1),a=a.slice(0,Math.min(a.length,h+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<a.length;h++){let d=a[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:f,errors:m}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||p){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((h,d,f)=>{let m,p=!1,g=null,w=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,g=d.route.errorElement||o0,u&&(c<0&&f===0?(g0("route-fallback"),p=!0,w=null):c===f&&(p=!0,w=d.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,f+1)),y=()=>{let v;return m?v=g:p?v=w:d.route.Component?v=j.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=h,j.createElement(c0,{match:d,routeContext:{outlet:h,matches:x,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?j.createElement(u0,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var jy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jy||{}),wy=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}(wy||{});function ky(e){let t=j.useContext(kl);return t||je(!1),t}function by(e){let t=j.useContext(hh);return t||je(!1),t}function h0(e){let t=j.useContext(qn);return t||je(!1),t}function Sy(e){let t=h0(),n=t.matches[t.matches.length-1];return n.route.id||je(!1),n.route.id}function f0(){var e;let t=j.useContext(yy),n=by(),r=Sy();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let p0=0;function ph(e){let{router:t,basename:n}=ky(jy.UseBlocker),r=by(wy.UseBlocker),[i,l]=j.useState(""),a=j.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:u,nextLocation:c,historyAction:h}=o;return e({currentLocation:Xs({},u,{pathname:wn(u.pathname,n)||u.pathname}),nextLocation:Xs({},c,{pathname:wn(c.pathname,n)||c.pathname}),historyAction:h})},[n,e]);return j.useEffect(()=>{let o=String(++p0);return l(o),()=>t.deleteBlocker(o)},[t]),j.useEffect(()=>{i!==""&&t.getBlocker(i,a)},[t,i,a]),i&&r.blockers.has(i)?r.blockers.get(i):ws}function m0(){let{router:e}=ky(),t=Sy(),n=j.useRef(!1);return vy(()=>{n.current=!0}),j.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Xs({fromRouteId:t},l)))},[e,t])}const Tp={};function g0(e,t,n){Tp[e]||(Tp[e]=!0)}const Pp={};function x0(e,t){Pp[t]||(Pp[t]=!0,console.warn(t))}const js=(e,t,n)=>x0(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function y0(e,t){e!=null&&e.v7_startTransition||js("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&js("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||js("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||js("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||js("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||js("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function v0(e){return i0(e.context)}function j0(e){let{basename:t="/",children:n=null,location:r,navigationType:i=st.Pop,navigator:l,static:a=!1,future:o}=e;bl()&&je(!1);let u=t.replace(/^\/*/,"/"),c=j.useMemo(()=>({basename:u,navigator:l,static:a,future:Xs({v7_relativeSplatPath:!1},o)}),[u,o,l,a]);typeof r=="string"&&(r=Er(r));let{pathname:h="/",search:d="",hash:f="",state:m=null,key:p="default"}=r,g=j.useMemo(()=>{let w=wn(h,u);return w==null?null:{location:{pathname:w,search:d,hash:f,state:m,key:p},navigationType:i}},[u,h,d,f,m,p,i]);return g==null?null:j.createElement(Tr.Provider,{value:c},j.createElement(fh.Provider,{children:n,value:g}))}new Promise(()=>{});function w0(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:j.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
59
+ */function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(this,arguments)}const kl=j.createContext(null),fh=j.createContext(null),Pr=j.createContext(null),ph=j.createContext(null),Gn=j.createContext({outlet:null,matches:[],isDataRoute:!1}),yy=j.createContext(null);function r0(e,t){let{relative:n}=t===void 0?{}:t;bl()||je(!1);let{basename:r,navigator:i}=j.useContext(Pr),{hash:l,pathname:a,search:o}=Po(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:Bn([r,a])),i.createHref({pathname:u,search:o,hash:l})}function bl(){return j.useContext(ph)!=null}function Kn(){return bl()||je(!1),j.useContext(ph).location}function vy(e){j.useContext(Pr).static||j.useLayoutEffect(e)}function ut(){let{isDataRoute:e}=j.useContext(Gn);return e?g0():s0()}function s0(){bl()||je(!1);let e=j.useContext(kl),{basename:t,future:n,navigator:r}=j.useContext(Pr),{matches:i}=j.useContext(Gn),{pathname:l}=Kn(),a=JSON.stringify(oh(i,n.v7_relativeSplatPath)),o=j.useRef(!1);return vy(()=>{o.current=!0}),j.useCallback(function(c,h){if(h===void 0&&(h={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let d=uh(c,JSON.parse(a),l,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Bn([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,a,l,e])}const i0=j.createContext(null);function l0(e){let t=j.useContext(Gn).outlet;return t&&j.createElement(i0.Provider,{value:e},t)}function li(){let{matches:e}=j.useContext(Gn),t=e[e.length-1];return t?t.params:{}}function Po(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=j.useContext(Pr),{matches:i}=j.useContext(Gn),{pathname:l}=Kn(),a=JSON.stringify(oh(i,r.v7_relativeSplatPath));return j.useMemo(()=>uh(e,JSON.parse(a),l,n==="path"),[e,a,l,n])}function a0(e,t,n,r){bl()||je(!1);let{navigator:i}=j.useContext(Pr),{matches:l}=j.useContext(Gn),a=l[l.length-1],o=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Kn(),h;h=c;let d=h.pathname||"/",f=d;if(u!=="/"){let g=u.replace(/^\//,"").split("/");f="/"+d.replace(/^\//,"").split("/").slice(g.length).join("/")}let m=Hr(e,{pathname:f});return h0(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:Bn([u,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Bn([u,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),l,n,r)}function o0(){let e=p0(),t=To(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:i},n):null,null)}const u0=j.createElement(o0,null);class c0 extends j.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?j.createElement(Gn.Provider,{value:this.props.routeContext},j.createElement(yy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function d0(e){let{routeContext:t,match:n,children:r}=e,i=j.useContext(kl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(Gn.Provider,{value:t},r)}function h0(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=r)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let h=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);h>=0||je(!1),a=a.slice(0,Math.min(a.length,h+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<a.length;h++){let d=a[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:f,errors:m}=n,p=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||p){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((h,d,f)=>{let m,p=!1,g=null,w=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,g=d.route.errorElement||u0,u&&(c<0&&f===0?(x0("route-fallback"),p=!0,w=null):c===f&&(p=!0,w=d.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,f+1)),y=()=>{let v;return m?v=g:p?v=w:d.route.Component?v=j.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=h,j.createElement(d0,{match:d,routeContext:{outlet:h,matches:x,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?j.createElement(c0,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:y(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var jy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jy||{}),wy=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}(wy||{});function ky(e){let t=j.useContext(kl);return t||je(!1),t}function by(e){let t=j.useContext(fh);return t||je(!1),t}function f0(e){let t=j.useContext(Gn);return t||je(!1),t}function Sy(e){let t=f0(),n=t.matches[t.matches.length-1];return n.route.id||je(!1),n.route.id}function p0(){var e;let t=j.useContext(yy),n=by(),r=Sy();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let m0=0;function mh(e){let{router:t,basename:n}=ky(jy.UseBlocker),r=by(wy.UseBlocker),[i,l]=j.useState(""),a=j.useCallback(o=>{if(typeof e!="function")return!!e;if(n==="/")return e(o);let{currentLocation:u,nextLocation:c,historyAction:h}=o;return e({currentLocation:Zs({},u,{pathname:wn(u.pathname,n)||u.pathname}),nextLocation:Zs({},c,{pathname:wn(c.pathname,n)||c.pathname}),historyAction:h})},[n,e]);return j.useEffect(()=>{let o=String(++m0);return l(o),()=>t.deleteBlocker(o)},[t]),j.useEffect(()=>{i!==""&&t.getBlocker(i,a)},[t,i,a]),i&&r.blockers.has(i)?r.blockers.get(i):ks}function g0(){let{router:e}=ky(),t=Sy(),n=j.useRef(!1);return vy(()=>{n.current=!0}),j.useCallback(function(i,l){l===void 0&&(l={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Zs({fromRouteId:t},l)))},[e,t])}const Tp={};function x0(e,t,n){Tp[e]||(Tp[e]=!0)}const Pp={};function y0(e,t){Pp[t]||(Pp[t]=!0,console.warn(t))}const ws=(e,t,n)=>y0(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function v0(e,t){e!=null&&e.v7_startTransition||ws("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&ws("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||ws("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||ws("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||ws("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||ws("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function j0(e){return l0(e.context)}function w0(e){let{basename:t="/",children:n=null,location:r,navigationType:i=st.Pop,navigator:l,static:a=!1,future:o}=e;bl()&&je(!1);let u=t.replace(/^\/*/,"/"),c=j.useMemo(()=>({basename:u,navigator:l,static:a,future:Zs({v7_relativeSplatPath:!1},o)}),[u,o,l,a]);typeof r=="string"&&(r=Tr(r));let{pathname:h="/",search:d="",hash:f="",state:m=null,key:p="default"}=r,g=j.useMemo(()=>{let w=wn(h,u);return w==null?null:{location:{pathname:w,search:d,hash:f,state:m,key:p},navigationType:i}},[u,h,d,f,m,p,i]);return g==null?null:j.createElement(Pr.Provider,{value:c},j.createElement(ph.Provider,{children:n,value:g}))}new Promise(()=>{});function k0(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:j.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
60
60
  * React Router DOM v6.28.0
61
61
  *
62
62
  * Copyright (c) Remix Software Inc.
@@ -65,7 +65,7 @@ Error generating stack: `+l.message+`
65
65
  * LICENSE.md file in the root directory of this source tree.
66
66
  *
67
67
  * @license MIT
68
- */function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(this,arguments)}function Ny(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l<r.length;l++)i=r[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function k0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function b0(e,t){return e.button===0&&(!t||t==="_self")&&!k0(e)}function _c(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function S0(e,t){let n=_c(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}const N0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],C0=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],E0="6";try{window.__reactRouterVersion=E0}catch{}function T0(e,t){return zk({basename:t==null?void 0:t.basename,future:Zs({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:lk({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||P0(),routes:e,mapRouteProperties:w0,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function P0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Zs({},t,{errors:R0(t.errors)})),t}function R0(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new eo(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let a=new l(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let l=new Error(i.message);l.stack="",n[r]=l}}else n[r]=i;return n}const Cy=j.createContext({isTransitioning:!1}),A0=j.createContext(new Map),L0="startTransition",Rp=qj[L0],I0="flushSync",Ap=ik[I0];function D0(e){Rp?Rp(e):e()}function bi(e){Ap?Ap(e):e()}class M0{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function z0(e){let{fallbackElement:t,router:n,future:r}=e,[i,l]=j.useState(n.state),[a,o]=j.useState(),[u,c]=j.useState({isTransitioning:!1}),[h,d]=j.useState(),[f,m]=j.useState(),[p,g]=j.useState(),w=j.useRef(new Map),{v7_startTransition:x}=r||{},y=j.useCallback(T=>{x?D0(T):T()},[x]),v=j.useCallback((T,D)=>{let{deletedFetchers:N,flushSync:P,viewTransitionOpts:A}=D;N.forEach(U=>w.current.delete(U)),T.fetchers.forEach((U,I)=>{U.data!==void 0&&w.current.set(I,U.data)});let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!A||z){P?bi(()=>l(T)):y(()=>l(T));return}if(P){bi(()=>{f&&(h&&h.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let U=n.window.document.startViewTransition(()=>{bi(()=>l(T))});U.finished.finally(()=>{bi(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})})}),bi(()=>m(U));return}f?(h&&h.resolve(),f.skipTransition(),g({state:T,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(o(T),c({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[n.window,f,h,w,y]);j.useLayoutEffect(()=>n.subscribe(v),[n,v]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&d(new M0)},[u]),j.useEffect(()=>{if(h&&a&&n.window){let T=a,D=h.promise,N=n.window.document.startViewTransition(async()=>{y(()=>l(T)),await D});N.finished.finally(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})}),m(N)}},[y,a,h,n.window]),j.useEffect(()=>{h&&a&&i.location.key===a.location.key&&h.resolve()},[h,f,i.location,a]),j.useEffect(()=>{!u.isTransitioning&&p&&(o(p.state),c({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[u.isTransitioning,p]),j.useEffect(()=>{},[]);let b=j.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,D,N)=>n.navigate(T,{state:D,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,D,N)=>n.navigate(T,{replace:!0,state:D,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),E=n.basename||"/",k=j.useMemo(()=>({router:n,navigator:b,static:!1,basename:E}),[n,b,E]),L=j.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return j.useEffect(()=>y0(r,n.future),[r,n.future]),j.createElement(j.Fragment,null,j.createElement(kl.Provider,{value:k},j.createElement(hh.Provider,{value:i},j.createElement(A0.Provider,{value:w.current},j.createElement(Cy.Provider,{value:u},j.createElement(j0,{basename:E,location:i.location,navigationType:i.historyAction,navigator:b,future:L},i.initialized||n.future.v7_partialHydration?j.createElement(_0,{routes:n.routes,future:n.future,state:i}):t))))),null)}const _0=j.memo($0);function $0(e){let{routes:t,future:n,state:r}=e;return l0(t,void 0,r,n)}const O0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",F0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=j.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:a,state:o,target:u,to:c,preventScrollReset:h,viewTransition:d}=t,f=Ny(t,N0),{basename:m}=j.useContext(Tr),p,g=!1;if(typeof c=="string"&&F0.test(c)&&(p=c,O0))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=wn(b.pathname,m);b.origin===v.origin&&E!=null?c=E+b.search+b.hash:g=!0}catch{}let w=n0(c,{relative:i}),x=H0(c,{replace:a,state:o,target:u,preventScrollReset:h,relative:i,viewTransition:d});function y(v){r&&r(v),v.defaultPrevented||x(v)}return j.createElement("a",Zs({},f,{href:p||w,onClick:g||l?r:y,ref:n,target:u}))}),U0=j.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:l="",end:a=!1,style:o,to:u,viewTransition:c,children:h}=t,d=Ny(t,C0),f=To(u,{relative:d.relative}),m=Gn(),p=j.useContext(hh),{navigator:g,basename:w}=j.useContext(Tr),x=p!=null&&W0(f)&&c===!0,y=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,v=m.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(v=v.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&w&&(b=wn(b,w)||b);const E=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let k=v===y||!a&&v.startsWith(y)&&v.charAt(E)==="/",L=b!=null&&(b===y||!a&&b.startsWith(y)&&b.charAt(y.length)==="/"),T={isActive:k,isPending:L,isTransitioning:x},D=k?r:void 0,N;typeof l=="function"?N=l(T):N=[l,k?"active":null,L?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let P=typeof o=="function"?o(T):o;return j.createElement(ye,Zs({},d,{"aria-current":D,className:N,ref:n,style:P,to:u,viewTransition:c}),typeof h=="function"?h(T):h)});var $c;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($c||($c={}));var Lp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Lp||(Lp={}));function B0(e){let t=j.useContext(kl);return t||je(!1),t}function H0(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:a,viewTransition:o}=t===void 0?{}:t,u=ut(),c=Gn(),h=To(e,{relative:a});return j.useCallback(d=>{if(b0(d,n)){d.preventDefault();let f=r!==void 0?r:ns(c)===ns(h);u(e,{replace:f,state:i,preventScrollReset:l,relative:a,viewTransition:o})}},[c,u,h,r,i,n,e,l,a,o])}function mh(e){let t=j.useRef(_c(e)),n=j.useRef(!1),r=Gn(),i=j.useMemo(()=>S0(r.search,n.current?null:t.current),[r.search]),l=ut(),a=j.useCallback((o,u)=>{const c=_c(typeof o=="function"?o(i):o);n.current=!0,l("?"+c,u)},[l,i]);return[i,a]}function W0(e,t){t===void 0&&(t={});let n=j.useContext(Cy);n==null&&je(!1);let{basename:r}=B0($c.useViewTransitionState),i=To(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Za(i.pathname,a)!=null||Za(i.pathname,l)!=null}class Oc extends Error{constructor(t,n){super(n),this.status=t}}const Fc="qa-studio:server-down";async function V0(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}async function le(e,t,n){let r;try{r=await fetch(t,{method:e,headers:n===void 0?void 0:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw window.dispatchEvent(new Event(Fc)),new Oc(0,"Agent Studio server is not reachable. Is it running?")}if(r.status===204)return;const i=await r.json().catch(()=>({}));if(!r.ok)throw new Oc(r.status,Array.isArray(i.message)?i.message.join(", "):i.message??r.statusText);return i}const _e=encodeURIComponent,yu=e=>Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,n])=>`${_e(t)}=${_e(String(n))}`).join("&"),q={dashboard:()=>le("GET","/api/dashboard"),specs:()=>le("GET","/api/specs"),spec:e=>le("GET",`/api/specs/${_e(e)}`),createSpec:(e,t)=>le("POST","/api/specs",{file:e,content:t}),saveSpec:(e,t,n)=>le("PUT",`/api/specs/${_e(e)}`,{content:t,baseMtime:n}),deleteSpec:e=>le("DELETE",`/api/specs/${_e(e)}`),mapping:()=>le("GET","/api/mapping"),mappingPage:e=>le("GET",`/api/mapping/page?${yu(e)}`),jobs:()=>le("GET","/api/jobs"),jobsPage:e=>le("GET",`/api/jobs?${yu(e)}`),job:e=>le("GET",`/api/jobs/${e}`),agentRun:(e,t)=>le("GET",`/api/jobs/${e}/agents/${t}`),createJob:e=>le("POST","/api/jobs",e),cancelJob:e=>le("POST",`/api/jobs/${e}/cancel`),approveJob:e=>le("POST",`/api/jobs/${e}/approve`),rerunFailedJob:e=>le("POST",`/api/jobs/${e}/rerun-failed`),rejectJob:(e,t)=>le("POST",`/api/jobs/${e}/reject`,{reason:t}),answerJob:(e,t)=>le("POST",`/api/jobs/${e}/answer`,{answers:t}),jobRequirement:e=>le("GET",`/api/jobs/${e}/requirement`),settings:()=>le("GET","/api/settings"),saveSettings:e=>le("PUT","/api/settings",e),usage:e=>le("GET",`/api/usage?days=${e}`),searchTestCases:e=>le("POST","/api/test-cases/search",e),testRuns:e=>le("GET",`/api/test-runs?${yu(e)}`),claudeMd:()=>le("GET","/api/project/claude-md"),uploadClaudeMd:e=>le("POST","/api/project/claude-md",{content:e}),resetPlan:e=>le("GET",`/api/project/reset/plan${e?`?terms=${_e(e)}`:""}`),resetProject:e=>le("POST","/api/project/reset",e),claudeStatus:()=>le("GET","/api/claude/status"),claudeTest:()=>le("POST","/api/claude/test"),agentPrompts:()=>le("GET","/api/agents/prompts"),saveAgentPrompt:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}`,{instructions:t}),resetAgentPrompt:e=>le("DELETE",`/api/agents/prompts/${_e(e)}`),saveAgentModel:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}/model`,{model:t}),resetAgentModel:e=>le("DELETE",`/api/agents/prompts/${_e(e)}/model`),skills:()=>le("GET","/api/agents/skills"),customAgents:()=>le("GET","/api/agents/custom"),customAgent:e=>le("GET",`/api/agents/custom/${_e(e)}`),createCustomAgent:e=>le("POST","/api/agents/custom",e),saveCustomAgent:(e,t,n)=>le("PUT",`/api/agents/custom/${_e(e)}`,{...t,baseUpdatedAt:n}),deleteCustomAgent:e=>le("DELETE",`/api/agents/custom/${_e(e)}`),previewCustomAgent:(e,t)=>le("POST",e?`/api/agents/custom/${_e(e)}/preview`:"/api/agents/custom/preview",t),claudeMdSections:()=>le("GET","/api/project/claude-md/sections"),saveAgentSkills:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}/skills`,{skills:t}),pipelines:()=>le("GET","/api/pipelines"),pipeline:e=>le("GET",`/api/pipelines/${_e(e)}`),createPipeline:e=>le("POST","/api/pipelines",e),savePipeline:(e,t,n)=>le("PUT",`/api/pipelines/${_e(e)}`,{...t,baseUpdatedAt:n}),deletePipeline:e=>le("DELETE",`/api/pipelines/${_e(e)}`),chatCommands:(e=!1)=>le("GET",`/api/chat/commands${e?"?refresh=1":""}`),chats:()=>le("GET","/api/chat/sessions"),chat:e=>le("GET",`/api/chat/sessions/${_e(e)}`),createChat:e=>le("POST","/api/chat/sessions",e),updateChat:(e,t)=>le("PATCH",`/api/chat/sessions/${_e(e)}`,t),deleteChat:e=>le("DELETE",`/api/chat/sessions/${_e(e)}`),uploadChatFile:(e,t)=>le("POST",`/api/chat/sessions/${_e(e)}/attachments`,t),sendChat:(e,t,n)=>le("POST",`/api/chat/sessions/${_e(e)}/messages`,{text:t,attachmentIds:n}),answerChatPermission:(e,t,n)=>le("POST",`/api/chat/sessions/${_e(e)}/permissions/${_e(t)}`,{decision:n}),stopChat:e=>le("POST",`/api/chat/sessions/${_e(e)}/stop`),previewAgentPrompt:(e,t)=>le("POST",`/api/agents/prompts/${_e(e)}/preview`,t)};function Q0(e,t,n){const r=new EventSource(`/api/jobs/${e}/stream`);for(const i of["job","agent","log"])r.addEventListener(i,l=>t(JSON.parse(l.data)));return r.onerror=()=>{r.close(),n()},()=>r.close()}function q0(e,t){const n=new EventSource(`/api/chat/sessions/${encodeURIComponent(e)}/stream`);for(const r of["session","message"])n.addEventListener(r,i=>t(JSON.parse(i.data)));return()=>n.close()}const gh=e=>`/api/jobs/${e}/report/`,Uc=["passed","failed","cancelled","interrupted"],G0=`# Spec title
68
+ */function ei(){return ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ei.apply(this,arguments)}function Ny(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,l;for(l=0;l<r.length;l++)i=r[l],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function b0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S0(e,t){return e.button===0&&(!t||t==="_self")&&!b0(e)}function Oc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function N0(e,t){let n=Oc(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}const C0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],E0=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],T0="6";try{window.__reactRouterVersion=T0}catch{}function P0(e,t){return _k({basename:t==null?void 0:t.basename,future:ei({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:ak({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||R0(),routes:e,mapRouteProperties:k0,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function R0(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ei({},t,{errors:L0(t.errors)})),t}function L0(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new eo(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let l=window[i.__subType];if(typeof l=="function")try{let a=new l(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let l=new Error(i.message);l.stack="",n[r]=l}}else n[r]=i;return n}const Cy=j.createContext({isTransitioning:!1}),A0=j.createContext(new Map),I0="startTransition",Rp=Gj[I0],D0="flushSync",Lp=lk[D0];function M0(e){Rp?Rp(e):e()}function bi(e){Lp?Lp(e):e()}class z0{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function _0(e){let{fallbackElement:t,router:n,future:r}=e,[i,l]=j.useState(n.state),[a,o]=j.useState(),[u,c]=j.useState({isTransitioning:!1}),[h,d]=j.useState(),[f,m]=j.useState(),[p,g]=j.useState(),w=j.useRef(new Map),{v7_startTransition:x}=r||{},y=j.useCallback(T=>{x?M0(T):T()},[x]),v=j.useCallback((T,D)=>{let{deletedFetchers:C,flushSync:L,viewTransitionOpts:A}=D;C.forEach(U=>w.current.delete(U)),T.fetchers.forEach((U,I)=>{U.data!==void 0&&w.current.set(I,U.data)});let z=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!A||z){L?bi(()=>l(T)):y(()=>l(T));return}if(L){bi(()=>{f&&(h&&h.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let U=n.window.document.startViewTransition(()=>{bi(()=>l(T))});U.finished.finally(()=>{bi(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})})}),bi(()=>m(U));return}f?(h&&h.resolve(),f.skipTransition(),g({state:T,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(o(T),c({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[n.window,f,h,w,y]);j.useLayoutEffect(()=>n.subscribe(v),[n,v]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&d(new z0)},[u]),j.useEffect(()=>{if(h&&a&&n.window){let T=a,D=h.promise,C=n.window.document.startViewTransition(async()=>{y(()=>l(T)),await D});C.finished.finally(()=>{d(void 0),m(void 0),o(void 0),c({isTransitioning:!1})}),m(C)}},[y,a,h,n.window]),j.useEffect(()=>{h&&a&&i.location.key===a.location.key&&h.resolve()},[h,f,i.location,a]),j.useEffect(()=>{!u.isTransitioning&&p&&(o(p.state),c({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[u.isTransitioning,p]),j.useEffect(()=>{},[]);let b=j.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,D,C)=>n.navigate(T,{state:D,preventScrollReset:C==null?void 0:C.preventScrollReset}),replace:(T,D,C)=>n.navigate(T,{replace:!0,state:D,preventScrollReset:C==null?void 0:C.preventScrollReset})}),[n]),E=n.basename||"/",k=j.useMemo(()=>({router:n,navigator:b,static:!1,basename:E}),[n,b,E]),R=j.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return j.useEffect(()=>v0(r,n.future),[r,n.future]),j.createElement(j.Fragment,null,j.createElement(kl.Provider,{value:k},j.createElement(fh.Provider,{value:i},j.createElement(A0.Provider,{value:w.current},j.createElement(Cy.Provider,{value:u},j.createElement(w0,{basename:E,location:i.location,navigationType:i.historyAction,navigator:b,future:R},i.initialized||n.future.v7_partialHydration?j.createElement($0,{routes:n.routes,future:n.future,state:i}):t))))),null)}const $0=j.memo(O0);function O0(e){let{routes:t,future:n,state:r}=e;return a0(t,void 0,r,n)}const F0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",U0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ye=j.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:l,replace:a,state:o,target:u,to:c,preventScrollReset:h,viewTransition:d}=t,f=Ny(t,C0),{basename:m}=j.useContext(Pr),p,g=!1;if(typeof c=="string"&&U0.test(c)&&(p=c,F0))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=wn(b.pathname,m);b.origin===v.origin&&E!=null?c=E+b.search+b.hash:g=!0}catch{}let w=r0(c,{relative:i}),x=W0(c,{replace:a,state:o,target:u,preventScrollReset:h,relative:i,viewTransition:d});function y(v){r&&r(v),v.defaultPrevented||x(v)}return j.createElement("a",ei({},f,{href:p||w,onClick:g||l?r:y,ref:n,target:u}))}),B0=j.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:l="",end:a=!1,style:o,to:u,viewTransition:c,children:h}=t,d=Ny(t,E0),f=Po(u,{relative:d.relative}),m=Kn(),p=j.useContext(fh),{navigator:g,basename:w}=j.useContext(Pr),x=p!=null&&V0(f)&&c===!0,y=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,v=m.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;i||(v=v.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&w&&(b=wn(b,w)||b);const E=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let k=v===y||!a&&v.startsWith(y)&&v.charAt(E)==="/",R=b!=null&&(b===y||!a&&b.startsWith(y)&&b.charAt(y.length)==="/"),T={isActive:k,isPending:R,isTransitioning:x},D=k?r:void 0,C;typeof l=="function"?C=l(T):C=[l,k?"active":null,R?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let L=typeof o=="function"?o(T):o;return j.createElement(ye,ei({},d,{"aria-current":D,className:C,ref:n,style:L,to:u,viewTransition:c}),typeof h=="function"?h(T):h)});var Fc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fc||(Fc={}));var Ap;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ap||(Ap={}));function H0(e){let t=j.useContext(kl);return t||je(!1),t}function W0(e,t){let{target:n,replace:r,state:i,preventScrollReset:l,relative:a,viewTransition:o}=t===void 0?{}:t,u=ut(),c=Kn(),h=Po(e,{relative:a});return j.useCallback(d=>{if(S0(d,n)){d.preventDefault();let f=r!==void 0?r:ss(c)===ss(h);u(e,{replace:f,state:i,preventScrollReset:l,relative:a,viewTransition:o})}},[c,u,h,r,i,n,e,l,a,o])}function gh(e){let t=j.useRef(Oc(e)),n=j.useRef(!1),r=Kn(),i=j.useMemo(()=>N0(r.search,n.current?null:t.current),[r.search]),l=ut(),a=j.useCallback((o,u)=>{const c=Oc(typeof o=="function"?o(i):o);n.current=!0,l("?"+c,u)},[l,i]);return[i,a]}function V0(e,t){t===void 0&&(t={});let n=j.useContext(Cy);n==null&&je(!1);let{basename:r}=H0(Fc.useViewTransitionState),i=Po(e,{relative:t.relative});if(!n.isTransitioning)return!1;let l=wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Za(i.pathname,a)!=null||Za(i.pathname,l)!=null}class to extends Error{constructor(t,n){super(n),this.status=t}}const Uc="qa-studio:server-down";async function Q0(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}async function le(e,t,n){let r;try{r=await fetch(t,{method:e,headers:n===void 0?void 0:{"Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)})}catch{throw window.dispatchEvent(new Event(Uc)),new to(0,"Agent Studio server is not reachable. Is it running?")}if(r.status===204)return;const i=await r.json().catch(()=>({}));if(!r.ok)throw new to(r.status,Array.isArray(i.message)?i.message.join(", "):i.message??r.statusText);return i}const _e=encodeURIComponent,ju=e=>Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,n])=>`${_e(t)}=${_e(String(n))}`).join("&"),q={dashboard:()=>le("GET","/api/dashboard"),specs:()=>le("GET","/api/specs"),spec:e=>le("GET",`/api/specs/${_e(e)}`),createSpec:(e,t)=>le("POST","/api/specs",{file:e,content:t}),saveSpec:(e,t,n)=>le("PUT",`/api/specs/${_e(e)}`,{content:t,baseMtime:n}),deleteSpec:e=>le("DELETE",`/api/specs/${_e(e)}`),mapping:()=>le("GET","/api/mapping"),mappingPage:e=>le("GET",`/api/mapping/page?${ju(e)}`),jobs:()=>le("GET","/api/jobs"),jobsPage:e=>le("GET",`/api/jobs?${ju(e)}`),job:e=>le("GET",`/api/jobs/${e}`),agentRun:(e,t)=>le("GET",`/api/jobs/${e}/agents/${t}`),createJob:e=>le("POST","/api/jobs",e),cancelJob:e=>le("POST",`/api/jobs/${e}/cancel`),approveJob:e=>le("POST",`/api/jobs/${e}/approve`),rerunFailedJob:e=>le("POST",`/api/jobs/${e}/rerun-failed`),rejectJob:(e,t)=>le("POST",`/api/jobs/${e}/reject`,{reason:t}),answerJob:(e,t)=>le("POST",`/api/jobs/${e}/answer`,{answers:t}),jobRequirement:e=>le("GET",`/api/jobs/${e}/requirement`),settings:()=>le("GET","/api/settings"),saveSettings:e=>le("PUT","/api/settings",e),usage:e=>le("GET",`/api/usage?days=${e}`),searchTestCases:e=>le("POST","/api/test-cases/search",e),testRuns:e=>le("GET",`/api/test-runs?${ju(e)}`),claudeMd:()=>le("GET","/api/project/claude-md"),uploadClaudeMd:e=>le("POST","/api/project/claude-md",{content:e}),resetPlan:e=>le("GET",`/api/project/reset/plan${e?`?terms=${_e(e)}`:""}`),resetProject:e=>le("POST","/api/project/reset",e),claudeStatus:()=>le("GET","/api/claude/status"),claudeTest:()=>le("POST","/api/claude/test"),agentPrompts:()=>le("GET","/api/agents/prompts"),saveAgentPrompt:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}`,{instructions:t}),resetAgentPrompt:e=>le("DELETE",`/api/agents/prompts/${_e(e)}`),saveAgentModel:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}/model`,{model:t}),resetAgentModel:e=>le("DELETE",`/api/agents/prompts/${_e(e)}/model`),skills:()=>le("GET","/api/agents/skills"),customAgents:()=>le("GET","/api/agents/custom"),customAgent:e=>le("GET",`/api/agents/custom/${_e(e)}`),createCustomAgent:e=>le("POST","/api/agents/custom",e),saveCustomAgent:(e,t,n)=>le("PUT",`/api/agents/custom/${_e(e)}`,{...t,baseUpdatedAt:n}),deleteCustomAgent:e=>le("DELETE",`/api/agents/custom/${_e(e)}`),previewCustomAgent:(e,t)=>le("POST",e?`/api/agents/custom/${_e(e)}/preview`:"/api/agents/custom/preview",t),exportProject:async()=>{const e=await fetch("/api/project/export");if(!e.ok)throw new to(e.status,(await e.json().catch(()=>({}))).message??e.statusText);return e.blob()},importProject:e=>le("POST","/api/project/import",{zip:e}),claudeMdSections:()=>le("GET","/api/project/claude-md/sections"),saveAgentSkills:(e,t)=>le("PUT",`/api/agents/prompts/${_e(e)}/skills`,{skills:t}),pipelines:()=>le("GET","/api/pipelines"),pipeline:e=>le("GET",`/api/pipelines/${_e(e)}`),createPipeline:e=>le("POST","/api/pipelines",e),savePipeline:(e,t,n)=>le("PUT",`/api/pipelines/${_e(e)}`,{...t,baseUpdatedAt:n}),deletePipeline:e=>le("DELETE",`/api/pipelines/${_e(e)}`),chatCommands:(e=!1)=>le("GET",`/api/chat/commands${e?"?refresh=1":""}`),chats:()=>le("GET","/api/chat/sessions"),chat:e=>le("GET",`/api/chat/sessions/${_e(e)}`),createChat:e=>le("POST","/api/chat/sessions",e),updateChat:(e,t)=>le("PATCH",`/api/chat/sessions/${_e(e)}`,t),deleteChat:e=>le("DELETE",`/api/chat/sessions/${_e(e)}`),uploadChatFile:(e,t)=>le("POST",`/api/chat/sessions/${_e(e)}/attachments`,t),sendChat:(e,t,n)=>le("POST",`/api/chat/sessions/${_e(e)}/messages`,{text:t,attachmentIds:n}),answerChatPermission:(e,t,n)=>le("POST",`/api/chat/sessions/${_e(e)}/permissions/${_e(t)}`,{decision:n}),stopChat:e=>le("POST",`/api/chat/sessions/${_e(e)}/stop`),previewAgentPrompt:(e,t)=>le("POST",`/api/agents/prompts/${_e(e)}/preview`,t)};function q0(e,t,n){const r=new EventSource(`/api/jobs/${e}/stream`);for(const i of["job","agent","log"])r.addEventListener(i,l=>t(JSON.parse(l.data)));return r.onerror=()=>{r.close(),n()},()=>r.close()}function G0(e,t){const n=new EventSource(`/api/chat/sessions/${encodeURIComponent(e)}/stream`);for(const r of["session","message"])n.addEventListener(r,i=>t(JSON.parse(i.data)));return()=>n.close()}const xh=e=>`/api/jobs/${e}/report/`,Bc=["passed","failed","cancelled","interrupted"],K0=`# Spec title
69
69
  Tags: smoke
70
70
  Preconditions: describe the initial state
71
71
 
@@ -73,9 +73,9 @@ Preconditions: describe the initial state
73
73
  1. Step 1
74
74
  2. Step 2
75
75
  3. Expected result
76
- `;function Ie(e,t=[]){const[n,r]=j.useState(null),[i,l]=j.useState(null),[a,o]=j.useState(0);j.useEffect(()=>{let c=!0;return e().then(h=>c&&(r(h),l(null))).catch(h=>c&&l(h.message)),()=>{c=!1}},[...t,a]);const u=j.useCallback(()=>o(c=>c+1),[]);return{data:n,error:i,reload:u}}const Ey=j.createContext({specs:[],mapping:[],refresh:()=>{}}),un=()=>j.useContext(Ey);function K0(){const[e,t]=j.useState([]),[n,r]=j.useState([]),i=j.useCallback(()=>{Promise.all([q.specs(),q.mapping()]).then(([l,a])=>{t(l),r(a)}).catch(()=>{})},[]);return j.useEffect(()=>{i();const l=setInterval(i,15e3);return()=>clearInterval(l)},[i]),{specs:e,mapping:n,refresh:i}}function Y0(e){const[t,n]=j.useState(null),[r,i]=j.useState([]),[l,a]=j.useState([]),[o,u]=j.useState(null),[c,h]=j.useState({}),[d,f]=j.useState(null),[m,p]=j.useState(null),g=j.useRef(!1),[w,x]=j.useState(0),y=j.useCallback(()=>x(b=>b+1),[]),v=j.useCallback(async()=>{const b=await q.job(e);return p(b.pending??null),n(b.job),i(b.agentRuns),a(b.testResults),u(b.pipeline??null),b},[e]);return j.useEffect(()=>{let b=!0,E=null,k=null;g.current=!1;const L=()=>{h({}),E=Q0(e,T=>{b&&(T.type==="job"?(n(T.job),T.job.status==="waiting"?v():p(null),Uc.includes(T.job.status)&&!g.current&&(g.current=!0,v())):T.type==="agent"?i(D=>{const N=D.findIndex(A=>A.id===T.run.id);if(N<0)return[...D,T.run].sort((A,z)=>A.seq-z.seq);const P=D.slice();return P[N]=T.run,P}):h(D=>({...D,[T.runId]:(D[T.runId]??"")+T.chunk})))},()=>{b&&!g.current&&(k=setTimeout(L,2e3))})};return v().then(()=>b&&L()).catch(T=>b&&f(T.message)),()=>{b=!1,E==null||E(),k&&clearTimeout(k)}},[e,v,w]),{job:t,runs:r,results:l,pipeline:o,pending:m,logs:c,error:d,refetch:v,reconnect:y}}function J0(){const[e,t]=j.useState(()=>{try{return localStorage.getItem("qa-studio.theme")??"light"}catch{return"light"}});return j.useEffect(()=>{document.documentElement.dataset.theme=e;try{localStorage.setItem("qa-studio.theme",e)}catch{}},[e]),[e,()=>t(n=>n==="dark"?"light":"dark")]}function X0(e,t){const[n,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function we({size:e=18,children:t,...n}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:t})}const Z0=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"2"})]}),jr=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),s.jsx("path",{d:"M14 3v5h5M9 13h6M9 17h4"})]}),xh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"}),s.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"})]}),ft=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z"})}),eb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z",fill:"currentColor",stroke:"none"})}),tb=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M10 3.5l1.6 4.4a2 2 0 0 0 1.2 1.2L17.2 10.7l-4.4 1.6a2 2 0 0 0-1.2 1.2L10 17.9l-1.6-4.4a2 2 0 0 0-1.2-1.2L2.8 10.7l4.4-1.6a2 2 0 0 0 1.2-1.2z"}),s.jsx("path",{d:"M18.5 14.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"})]}),Po=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"11",cy:"11",r:"7"}),s.jsx("path",{d:"m20 20-3.5-3.5"})]}),Qt=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 5v14M5 12h14"})}),ei=({open:e,...t})=>s.jsx(we,{...t,style:{transform:e?"rotate(90deg)":void 0,transition:"transform .15s"},children:s.jsx("path",{d:"m9 6 6 6-6 6"})}),yh=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m5 12 5 5 9-10"})}),wr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),nb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})}),Ty=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),vh=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m4 20 12-12M14 4l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM19 11l.6 1.4L21 13l-1.4.6L19 15l-.6-1.4L17 13l1.4-.6z"})}),jh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]}),Py=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M19.5 12.5 12 20l-7.5-7.5a4.5 4.5 0 0 1 6.4-6.4l1.1 1.1 1.1-1.1a4.5 4.5 0 0 1 6.4 6.4z"}),s.jsx("path",{d:"M12 10v5M9.5 12.5h5"})]}),rb=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),s.jsx("path",{d:"m7 9 3 3-3 3M13 15h4"})]}),Ry=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z"})}),Ay=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),Pr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M20 11a8 8 0 0 0-14.5-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14.5 4.5L20 16M20 20v-4h-4"})}),Ly=e=>s.jsx(we,{...e,children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Rr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3"})}),li=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M5 3h11l3 3v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}),s.jsx("path",{d:"M7 3v6h8V3M7 21v-7h10v7"})]}),Iy=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"7",cy:"7",r:"3"}),s.jsx("circle",{cx:"17",cy:"17",r:"3"}),s.jsx("path",{d:"M10 7h4a3 3 0 0 1 3 3v4M7 10v4a3 3 0 0 0 3 3h4"})]}),sb=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"}),s.jsx("circle",{cx:"15",cy:"6",r:"2"}),s.jsx("circle",{cx:"9",cy:"12",r:"2"}),s.jsx("circle",{cx:"17",cy:"18",r:"2"})]}),ib=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M19 12H5M11 18l-6-6 6-6"})}),wh=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 16V4M7 9l5-5 5 5M4 16v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})}),kh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z"}),s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5"})]}),lb=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M9 6h11M9 12h11M9 18h11"}),s.jsx("path",{d:"M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"})]}),bh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M14 4h6v6M20 4l-9 9"}),s.jsx("path",{d:"M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})]}),fl=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 20h9"}),s.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]}),rs=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M17 2l4 4-4 4"}),s.jsx("path",{d:"M3 11v-1a4 4 0 0 1 4-4h14"}),s.jsx("path",{d:"M7 22l-4-4 4-4"}),s.jsx("path",{d:"M21 13v1a4 4 0 0 1-4 4H3"})]}),Dy=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 14l4-4"}),s.jsx("path",{d:"M3.3 19a9 9 0 1 1 17.4 0"})]}),ab=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 5h16l-6 8v5l-4 2v-7z"})}),ob=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),s.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]}),My=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m21 11.5-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9"})}),ub=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Sh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4.1A8 8 0 1 1 20 12z"}),s.jsx("path",{d:"M8.5 12h.01M12 12h.01M15.5 12h.01"})]}),cb=/^[A-Z][A-Z0-9]*(-[A-Z0-9]+)+$/;function db(e){return typeof e=="string"&&cb.test(e)}function hb(e){const t={title:"",tags:[],preconditions:"",tcs:[],warnings:[]},n=new Set;return e.split(/\r?\n/).forEach((r,i)=>{const l=r.trim(),a=i+1;let o;const u=t.tcs[t.tcs.length-1];if(!t.title&&(o=l.match(/^#\s+(.+)$/)))t.title=o[1].trim();else if(o=l.match(/^tags\s*:\s*(.*)$/i)){const c=o[1].split(",").map(h=>h.trim()).filter(Boolean);u?u.tags=c:t.tags=c}else if(u&&(o=l.match(/^technique\s*:\s*(.*)$/i)))u.technique=o[1].trim()||null;else if(o=l.match(/^preconditions\s*:\s*(.*)$/i))t.preconditions=o[1].trim();else if(o=l.match(/^##\s+(.*)$/)){const c=o[1].match(/^(\S+?)\s*:\s*(.+)$/);c&&db(c[1])?(n.has(c[1])&&t.warnings.push(`Line ${a}: duplicate TC-ID ${c[1]} in spec`),n.add(c[1]),t.tcs.push({id:c[1],title:c[2].trim(),line:a,tags:[],technique:null})):t.warnings.push(`Line ${a}: heading "${l}" does not match "## <TC-ID>: <name>"`)}}),t}const Ip=e=>e===null||e===""?[]:e.replace(/\r\n/g,`
76
+ `;function Me(e,t=[]){const[n,r]=j.useState(null),[i,l]=j.useState(null),[a,o]=j.useState(0);j.useEffect(()=>{let c=!0;return e().then(h=>c&&(r(h),l(null))).catch(h=>c&&l(h.message)),()=>{c=!1}},[...t,a]);const u=j.useCallback(()=>o(c=>c+1),[]);return{data:n,error:i,reload:u}}const Ey=j.createContext({specs:[],mapping:[],refresh:()=>{}}),Xt=()=>j.useContext(Ey);function Y0(){const[e,t]=j.useState([]),[n,r]=j.useState([]),i=j.useCallback(()=>{Promise.all([q.specs(),q.mapping()]).then(([l,a])=>{t(l),r(a)}).catch(()=>{})},[]);return j.useEffect(()=>{i();const l=setInterval(i,15e3);return()=>clearInterval(l)},[i]),{specs:e,mapping:n,refresh:i}}function J0(e){const[t,n]=j.useState(null),[r,i]=j.useState([]),[l,a]=j.useState([]),[o,u]=j.useState(null),[c,h]=j.useState({}),[d,f]=j.useState(null),[m,p]=j.useState(null),g=j.useRef(!1),[w,x]=j.useState(0),y=j.useCallback(()=>x(b=>b+1),[]),v=j.useCallback(async()=>{const b=await q.job(e);return p(b.pending??null),n(b.job),i(b.agentRuns),a(b.testResults),u(b.pipeline??null),b},[e]);return j.useEffect(()=>{let b=!0,E=null,k=null;g.current=!1;const R=()=>{h({}),E=q0(e,T=>{b&&(T.type==="job"?(n(T.job),T.job.status==="waiting"?v():p(null),Bc.includes(T.job.status)&&!g.current&&(g.current=!0,v())):T.type==="agent"?i(D=>{const C=D.findIndex(A=>A.id===T.run.id);if(C<0)return[...D,T.run].sort((A,z)=>A.seq-z.seq);const L=D.slice();return L[C]=T.run,L}):h(D=>({...D,[T.runId]:(D[T.runId]??"")+T.chunk})))},()=>{b&&!g.current&&(k=setTimeout(R,2e3))})};return v().then(()=>b&&R()).catch(T=>b&&f(T.message)),()=>{b=!1,E==null||E(),k&&clearTimeout(k)}},[e,v,w]),{job:t,runs:r,results:l,pipeline:o,pending:m,logs:c,error:d,refetch:v,reconnect:y}}function X0(){const[e,t]=j.useState(()=>{try{return localStorage.getItem("qa-studio.theme")??"light"}catch{return"light"}});return j.useEffect(()=>{document.documentElement.dataset.theme=e;try{localStorage.setItem("qa-studio.theme",e)}catch{}},[e]),[e,()=>t(n=>n==="dark"?"light":"dark")]}function Z0(e,t){const[n,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function we({size:e=18,children:t,...n}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:t})}const eb=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"2"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"2"})]}),jr=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),s.jsx("path",{d:"M14 3v5h5M9 13h6M9 17h4"})]}),yh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"}),s.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"})]}),ft=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z"})}),tb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M7 4.5v15a1 1 0 0 0 1.5.86l12-7.5a1 1 0 0 0 0-1.72l-12-7.5A1 1 0 0 0 7 4.5z",fill:"currentColor",stroke:"none"})}),nb=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M10 3.5l1.6 4.4a2 2 0 0 0 1.2 1.2L17.2 10.7l-4.4 1.6a2 2 0 0 0-1.2 1.2L10 17.9l-1.6-4.4a2 2 0 0 0-1.2-1.2L2.8 10.7l4.4-1.6a2 2 0 0 0 1.2-1.2z"}),s.jsx("path",{d:"M18.5 14.5l.7 1.8 1.8.7-1.8.7-.7 1.8-.7-1.8-1.8-.7 1.8-.7z"})]}),Ro=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"11",cy:"11",r:"7"}),s.jsx("path",{d:"m20 20-3.5-3.5"})]}),Qt=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 5v14M5 12h14"})}),ti=({open:e,...t})=>s.jsx(we,{...t,style:{transform:e?"rotate(90deg)":void 0,transition:"transform .15s"},children:s.jsx("path",{d:"m9 6 6 6-6 6"})}),vh=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m5 12 5 5 9-10"})}),wr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),rb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16"})}),Ty=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),jh=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m4 20 12-12M14 4l1 2 2 1-2 1-1 2-1-2-2-1 2-1zM19 11l.6 1.4L21 13l-1.4.6L19 15l-.6-1.4L17 13l1.4-.6z"})}),wh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 3 5 6v6c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]}),Py=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M19.5 12.5 12 20l-7.5-7.5a4.5 4.5 0 0 1 6.4-6.4l1.1 1.1 1.1-1.1a4.5 4.5 0 0 1 6.4 6.4z"}),s.jsx("path",{d:"M12 10v5M9.5 12.5h5"})]}),sb=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),s.jsx("path",{d:"m7 9 3 3-3 3M13 15h4"})]}),Ry=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z"})}),Ly=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),Rr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M20 11a8 8 0 0 0-14.5-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14.5 4.5L20 16M20 20v-4h-4"})}),Ay=e=>s.jsx(we,{...e,children:s.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Lr=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3"})}),us=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M5 3h11l3 3v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}),s.jsx("path",{d:"M7 3v6h8V3M7 21v-7h10v7"})]}),Iy=e=>s.jsxs(we,{...e,children:[s.jsx("circle",{cx:"7",cy:"7",r:"3"}),s.jsx("circle",{cx:"17",cy:"17",r:"3"}),s.jsx("path",{d:"M10 7h4a3 3 0 0 1 3 3v4M7 10v4a3 3 0 0 0 3 3h4"})]}),ib=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M4 6h9M17 6h3M4 12h3M11 12h9M4 18h11M19 18h1"}),s.jsx("circle",{cx:"15",cy:"6",r:"2"}),s.jsx("circle",{cx:"9",cy:"12",r:"2"}),s.jsx("circle",{cx:"17",cy:"18",r:"2"})]}),lb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M19 12H5M11 18l-6-6 6-6"})}),Lo=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 16V4M7 9l5-5 5 5M4 16v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})}),kh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z"}),s.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5"})]}),ab=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M9 6h11M9 12h11M9 18h11"}),s.jsx("path",{d:"M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"})]}),bh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M14 4h6v6M20 4l-9 9"}),s.jsx("path",{d:"M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})]}),fl=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 20h9"}),s.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]}),is=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M17 2l4 4-4 4"}),s.jsx("path",{d:"M3 11v-1a4 4 0 0 1 4-4h14"}),s.jsx("path",{d:"M7 22l-4-4 4-4"}),s.jsx("path",{d:"M21 13v1a4 4 0 0 1-4 4H3"})]}),Dy=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M12 14l4-4"}),s.jsx("path",{d:"M3.3 19a9 9 0 1 1 17.4 0"})]}),ob=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M4 5h16l-6 8v5l-4 2v-7z"})}),ub=e=>s.jsxs(we,{...e,children:[s.jsx("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),s.jsx("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]}),My=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"m21 11.5-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.6-8.6a3.7 3.7 0 0 1 5.2 5.2l-8.6 8.6a1.8 1.8 0 0 1-2.6-2.6l7.9-7.9"})}),cb=e=>s.jsx(we,{...e,children:s.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Sh=e=>s.jsxs(we,{...e,children:[s.jsx("path",{d:"M20 12a8 8 0 0 1-11.6 7.1L4 20l1-4.1A8 8 0 1 1 20 12z"}),s.jsx("path",{d:"M8.5 12h.01M12 12h.01M15.5 12h.01"})]}),db=/^[A-Z][A-Z0-9]*(-[A-Z0-9]+)+$/;function hb(e){return typeof e=="string"&&db.test(e)}function fb(e){const t={title:"",tags:[],preconditions:"",tcs:[],warnings:[]},n=new Set;return e.split(/\r?\n/).forEach((r,i)=>{const l=r.trim(),a=i+1;let o;const u=t.tcs[t.tcs.length-1];if(!t.title&&(o=l.match(/^#\s+(.+)$/)))t.title=o[1].trim();else if(o=l.match(/^tags\s*:\s*(.*)$/i)){const c=o[1].split(",").map(h=>h.trim()).filter(Boolean);u?u.tags=c:t.tags=c}else if(u&&(o=l.match(/^technique\s*:\s*(.*)$/i)))u.technique=o[1].trim()||null;else if(o=l.match(/^preconditions\s*:\s*(.*)$/i))t.preconditions=o[1].trim();else if(o=l.match(/^##\s+(.*)$/)){const c=o[1].match(/^(\S+?)\s*:\s*(.+)$/);c&&hb(c[1])?(n.has(c[1])&&t.warnings.push(`Line ${a}: duplicate TC-ID ${c[1]} in spec`),n.add(c[1]),t.tcs.push({id:c[1],title:c[2].trim(),line:a,tags:[],technique:null})):t.warnings.push(`Line ${a}: heading "${l}" does not match "## <TC-ID>: <name>"`)}}),t}const Ip=e=>e===null||e===""?[]:e.replace(/\r\n/g,`
77
77
  `).split(`
78
- `);function fb(e,t){const n=Ip(e),r=Ip(t),i=Array.from({length:n.length+1},()=>new Array(r.length+1).fill(0));for(let u=n.length-1;u>=0;u--)for(let c=r.length-1;c>=0;c--)i[u][c]=n[u]===r[c]?i[u+1][c+1]+1:Math.max(i[u+1][c],i[u][c+1]);const l=[];let a=0,o=0;for(;a<n.length&&o<r.length;)n[a]===r[o]?(l.push({type:"same",text:n[a]}),a++,o++):i[a+1][o]>=i[a][o+1]?l.push({type:"del",text:n[a++]}):l.push({type:"add",text:r[o++]});for(;a<n.length;)l.push({type:"del",text:n[a++]});for(;o<r.length;)l.push({type:"add",text:r[o++]});return l}const Se={explorer:{label:"QA Explorer",llm:!0,description:"Verifies each test case in a real browser"},generator:{label:"QA Script Generator",llm:!0,description:"Generates the Playwright script from the exploration results"},validator:{label:"QA Validator",llm:!1,description:"Runs the script with repeat-each=3, retries=0"},healer:{label:"QA Script Healer",llm:!0,description:"Fixes script errors (never assertions) and flags app bugs"},runner:{label:"QA Test Runner",llm:!1,description:"Runs Playwright tests"},specwriter:{label:"QA Test Case Writer",llm:!0,description:"Turns a BA requirement into a spec file with test cases"},contextwriter:{label:"Context Writer",llm:!0,description:"Rewrites the project context in CLAUDE.md and removes the old project's"},custom:{label:"Custom agent",llm:!0,description:"An agent created on the Agents page"}},Ro={explore:["explorer"],generate:["explorer","generator","validator"],heal:["healer","validator"],spec:["specwriter"],testrun:["runner"],context:["contextwriter"]},Nh=["validator","healer"],Dp=500,pb=5,mb=120,gb=2e3,vu=5e4,zy=20,xb=[10,20,50,100],yb={maxHealRounds:2},Mp=10,Ch=[{id:"opus",label:"Opus — most capable, highest cost"},{id:"sonnet",label:"Sonnet — balanced"},{id:"haiku",label:"Haiku — fastest, cheapest"}],vb=["specFile","testFile","jobDir"],jb={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},_y=["git push","git reset --hard","rm -rf","curl","wget","cat .env","type .env"],$y=["qa-studio",".git",".claude","node_modules"],wb=2e3;Ch.map(e=>e.id);const Eh=e=>`custom:${e}`,Sl=e=>e.startsWith("custom:")?e.slice(7):null,kb=["first","last"],os=e=>typeof e=="string"?{kind:"agent",agent:e}:e,Bc=80,Hc=500,Sa=20,Na=10,pl=10,bb=3,to=3,zp=100,Sb=Object.keys(Se).filter(e=>e!=="custom"),Ao=e=>e.flatMap(t=>t.kind==="agent"?[t.agent]:Ao(t.steps.map(os))),Oy=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(t=>Oy(os(t))));function Fy(e){if(e.kind==="agent")return 1;const t=e.steps.map(a=>Fy(os(a))),n=e.maxIterations,r=t.reduce((a,o)=>a+o,0);if(e.endsWhen==="last")return n*r;const[i=0,...l]=t;return n*i+Math.max(0,n-1)*l.reduce((a,o)=>a+o,0)}const Nb=new Set(["explorer","generator","validator","healer","runner","specwriter"]),Cb=e=>Ao(e).find(t=>Nb.has(t))??null;function Eb(e,t){const n=[];if(!e||typeof e!="object")return{ok:!1,errors:["Body must be an object"]};const r=e,i=typeof r.name=="string"?r.name.trim():"";i?i.length>Bc&&n.push(`Name is longer than ${Bc} characters`):n.push("Name is required");const l=r.description===void 0||r.description===null?"":r.description;typeof l!="string"?n.push("Description must be text"):l.length>Hc&&n.push(`Description is longer than ${Hc} characters`);let a;if(r.workDir!==void 0&&r.workDir!==null)if(typeof r.workDir!="string")n.push("Working directory must be text");else{const h=r.workDir.trim();h&&(/^([A-Za-z]:[\\/]|\/)/.test(h)?a=/^([A-Za-z]:[\\/]|\/)$/.test(h)?h:h.replace(/[\\/]+$/,""):n.push("Working directory must be an absolute path (e.g. D:\\my-app)"))}const o=h=>typeof h!="string"?`unknown agent ${JSON.stringify(h)}`:Sl(h)!==null||Sb.includes(h)?null:`unknown agent ${JSON.stringify(h)}`,u=(h,d,f)=>{if(f>to)return n.push(`${d}: loops can be nested at most ${to} levels deep`),null;const m=h.maxIterations;let p=!0;if((typeof m!="number"||!Number.isInteger(m)||m<1||m>pl)&&(n.push(`${d}: maximum loop count must be a whole number from 1 to ${pl}`),p=!1),h.endsWhen!==void 0&&!kb.includes(h.endsWhen)&&(n.push(`${d}: ends when must be "first" or "last"`),p=!1),!Array.isArray(h.steps)||h.steps.length===0)return n.push(`${d}: drop at least one agent into the loop`),null;h.steps.length>Na&&(n.push(`${d}: a loop has at most ${Na} entries`),p=!1);const g=[],w=new Set;return h.steps.slice(0,Na).forEach((x,y)=>{if(typeof x=="string"){const b=o(x);b?w.add(b):g.push(x);return}const v=x;if(v&&typeof v=="object"&&v.kind==="loop"){const b=u(v,`${d} › loop ${y+1}`,f+1);b?g.push(b):p=!1;return}if(v&&typeof v=="object"&&v.kind==="agent"){const b=o(v.agent);b?w.add(b):g.push(v.agent);return}w.add(`unknown agent ${JSON.stringify(x)}`)}),w.forEach(x=>n.push(`${d}: ${x}`)),!p||w.size?null:{kind:"loop",steps:g,maxIterations:m,...h.endsWhen==="last"?{endsWhen:"last"}:{}}},c=[];return Array.isArray(r.steps)?(r.steps.length===0&&n.push("Add at least one agent to the pipeline"),r.steps.length>Sa&&n.push(`A pipeline has at most ${Sa} blocks`),r.steps.slice(0,Sa).forEach((h,d)=>{const f=`Block ${d+1}`,m=h;if(!m||typeof m!="object")return void n.push(`${f}: must be an object`);if(m.kind==="agent"){const p=o(m.agent);if(p)return void n.push(`${f}: ${p}`);c.push({kind:"agent",agent:m.agent})}else if(m.kind==="loop"){const p=u(m,f,1);if(!p)return;const g=Fy(p);if(Oy(p)>1&&g>zp)return void n.push(`${f}: these nested loops could take up to ${g} agent runs (at most ${zp}); lower the maximum iterations`);c.push(p)}else n.push(`${f}: kind must be "agent" or "loop"`)})):n.push("steps must be a list"),c.findIndex(h=>Ao([h]).includes("specwriter")),n.length?{ok:!1,errors:n}:{ok:!0,value:{name:i,description:l.trim(),steps:c,...a?{workDir:a}:{}}}}function Tb(e){const t=Math.max(1,Math.min(pl,e+1));return[{id:"explore",name:"Explore",description:"Verify each test case in a real browser.",steps:[{kind:"agent",agent:"explorer"}]},{id:"generate",name:"Generate",description:"Explore the spec, generate the script, then validate and heal until it passes.",steps:[{kind:"agent",agent:"explorer"},{kind:"agent",agent:"generator"},{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"heal",name:"Heal",description:"Fix a failing script, then validate it.",steps:[{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"spec",name:"Write spec",description:"Turn a BA requirement into a spec file.",steps:[{kind:"agent",agent:"specwriter"}]},{id:"testrun",name:"Test run",description:"Run all tests, one spec, one test case or a picked selection.",steps:[{kind:"agent",agent:"runner"}]},{id:"context",name:"Project context",description:"Rewrite the project context in CLAUDE.md.",steps:[{kind:"agent",agent:"contextwriter"}]}]}const _p=[{id:"default",label:"Default"},{id:"fable",label:"Fable"},{id:"opus",label:"Opus"},{id:"sonnet",label:"Sonnet"},{id:"haiku",label:"Haiku"}],qr=["default","low","medium","high","xhigh","max"],no=[{id:"manual",label:"Ask every time",description:"Like the terminal: Claude asks before editing files or running commands"},{id:"acceptEdits",label:"Accept edits",description:"File edits run without asking; commands and other actions ask you first"},{id:"plan",label:"Plan (read-only)",description:"Claude can read and search but not edit files or run commands"},{id:"auto",label:"Auto",description:"Claude Code decides which actions are safe to run"},{id:"bypassPermissions",label:"Bypass permissions",description:"Every tool runs without asking (use with care)"}];function na(e,t){const n=t.toLowerCase();if(!n)return e;const r=i=>{const l=i.name.toLowerCase();return l.startsWith(n)||l.slice(l.indexOf(":")+1).startsWith(n)?0:l.includes(n)?1:i.description.toLowerCase().includes(n)?2:3};return e.map((i,l)=>({i,idx:l,r:r(i)})).filter(i=>i.r<3).sort((i,l)=>i.r-l.r||i.idx-l.idx).map(i=>i.i)}const Uy={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},ju={...Uy,mode:"full",typecheck:!0,deniedCommands:[..._y],protectedPaths:[...$y]},Pb=`# Planner Agent — Instructions
78
+ `);function pb(e,t){const n=Ip(e),r=Ip(t),i=Array.from({length:n.length+1},()=>new Array(r.length+1).fill(0));for(let u=n.length-1;u>=0;u--)for(let c=r.length-1;c>=0;c--)i[u][c]=n[u]===r[c]?i[u+1][c+1]+1:Math.max(i[u+1][c],i[u][c+1]);const l=[];let a=0,o=0;for(;a<n.length&&o<r.length;)n[a]===r[o]?(l.push({type:"same",text:n[a]}),a++,o++):i[a+1][o]>=i[a][o+1]?l.push({type:"del",text:n[a++]}):l.push({type:"add",text:r[o++]});for(;a<n.length;)l.push({type:"del",text:n[a++]});for(;o<r.length;)l.push({type:"add",text:r[o++]});return l}const Se={explorer:{label:"QA Explorer",llm:!0,description:"Verifies each test case in a real browser"},generator:{label:"QA Script Generator",llm:!0,description:"Generates the Playwright script from the exploration results"},validator:{label:"QA Validator",llm:!1,description:"Runs the script with repeat-each=3, retries=0"},healer:{label:"QA Script Healer",llm:!0,description:"Fixes script errors (never assertions) and flags app bugs"},runner:{label:"QA Test Runner",llm:!1,description:"Runs Playwright tests"},specwriter:{label:"QA Test Case Writer",llm:!0,description:"Turns a BA requirement into a spec file with test cases"},contextwriter:{label:"Context Writer",llm:!0,description:"Rewrites the project context in CLAUDE.md and removes the old project's"},custom:{label:"Custom agent",llm:!0,description:"An agent created on the Agents page"}},Ao={explore:["explorer"],generate:["explorer","generator","validator"],heal:["healer","validator"],spec:["specwriter"],testrun:["runner"],context:["contextwriter"]},Nh=["validator","healer"],Dp=500,mb=5,gb=120,xb=2e3,wu=5e4,zy=20,yb=[10,20,50,100],vb={maxHealRounds:2},Mp=10,Ch=[{id:"opus",label:"Opus — most capable, highest cost"},{id:"sonnet",label:"Sonnet — balanced"},{id:"haiku",label:"Haiku — fastest, cheapest"}],jb=["specFile","testFile","jobDir"],wb={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},_y=["git push","git reset --hard","rm -rf","curl","wget","cat .env","type .env"],$y=["qa-studio",".git",".claude","node_modules"],kb=2e3;Ch.map(e=>e.id);const Eh=e=>`custom:${e}`,Sl=e=>e.startsWith("custom:")?e.slice(7):null,bb=["first","last"],cs=e=>typeof e=="string"?{kind:"agent",agent:e}:e,Hc=80,Wc=500,Sa=20,Na=10,pl=10,Sb=3,no=3,zp=100,Nb=Object.keys(Se).filter(e=>e!=="custom"),Io=e=>e.flatMap(t=>t.kind==="agent"?[t.agent]:Io(t.steps.map(cs))),Oy=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(t=>Oy(cs(t))));function Fy(e){if(e.kind==="agent")return 1;const t=e.steps.map(a=>Fy(cs(a))),n=e.maxIterations,r=t.reduce((a,o)=>a+o,0);if(e.endsWhen==="last")return n*r;const[i=0,...l]=t;return n*i+Math.max(0,n-1)*l.reduce((a,o)=>a+o,0)}const Cb=new Set(["explorer","generator","validator","healer","runner","specwriter"]),Eb=e=>Io(e).find(t=>Cb.has(t))??null;function Tb(e,t){const n=[];if(!e||typeof e!="object")return{ok:!1,errors:["Body must be an object"]};const r=e,i=typeof r.name=="string"?r.name.trim():"";i?i.length>Hc&&n.push(`Name is longer than ${Hc} characters`):n.push("Name is required");const l=r.description===void 0||r.description===null?"":r.description;typeof l!="string"?n.push("Description must be text"):l.length>Wc&&n.push(`Description is longer than ${Wc} characters`);let a;if(r.workDir!==void 0&&r.workDir!==null)if(typeof r.workDir!="string")n.push("Working directory must be text");else{const h=r.workDir.trim();h&&(/^([A-Za-z]:[\\/]|\/)/.test(h)?a=/^([A-Za-z]:[\\/]|\/)$/.test(h)?h:h.replace(/[\\/]+$/,""):n.push("Working directory must be an absolute path (e.g. D:\\my-app)"))}const o=h=>typeof h!="string"?`unknown agent ${JSON.stringify(h)}`:Sl(h)!==null||Nb.includes(h)?null:`unknown agent ${JSON.stringify(h)}`,u=(h,d,f)=>{if(f>no)return n.push(`${d}: loops can be nested at most ${no} levels deep`),null;const m=h.maxIterations;let p=!0;if((typeof m!="number"||!Number.isInteger(m)||m<1||m>pl)&&(n.push(`${d}: maximum loop count must be a whole number from 1 to ${pl}`),p=!1),h.endsWhen!==void 0&&!bb.includes(h.endsWhen)&&(n.push(`${d}: ends when must be "first" or "last"`),p=!1),!Array.isArray(h.steps)||h.steps.length===0)return n.push(`${d}: drop at least one agent into the loop`),null;h.steps.length>Na&&(n.push(`${d}: a loop has at most ${Na} entries`),p=!1);const g=[],w=new Set;return h.steps.slice(0,Na).forEach((x,y)=>{if(typeof x=="string"){const b=o(x);b?w.add(b):g.push(x);return}const v=x;if(v&&typeof v=="object"&&v.kind==="loop"){const b=u(v,`${d} › loop ${y+1}`,f+1);b?g.push(b):p=!1;return}if(v&&typeof v=="object"&&v.kind==="agent"){const b=o(v.agent);b?w.add(b):g.push(v.agent);return}w.add(`unknown agent ${JSON.stringify(x)}`)}),w.forEach(x=>n.push(`${d}: ${x}`)),!p||w.size?null:{kind:"loop",steps:g,maxIterations:m,...h.endsWhen==="last"?{endsWhen:"last"}:{}}},c=[];return Array.isArray(r.steps)?(r.steps.length===0&&n.push("Add at least one agent to the pipeline"),r.steps.length>Sa&&n.push(`A pipeline has at most ${Sa} blocks`),r.steps.slice(0,Sa).forEach((h,d)=>{const f=`Block ${d+1}`,m=h;if(!m||typeof m!="object")return void n.push(`${f}: must be an object`);if(m.kind==="agent"){const p=o(m.agent);if(p)return void n.push(`${f}: ${p}`);c.push({kind:"agent",agent:m.agent})}else if(m.kind==="loop"){const p=u(m,f,1);if(!p)return;const g=Fy(p);if(Oy(p)>1&&g>zp)return void n.push(`${f}: these nested loops could take up to ${g} agent runs (at most ${zp}); lower the maximum iterations`);c.push(p)}else n.push(`${f}: kind must be "agent" or "loop"`)})):n.push("steps must be a list"),c.findIndex(h=>Io([h]).includes("specwriter")),n.length?{ok:!1,errors:n}:{ok:!0,value:{name:i,description:l.trim(),steps:c,...a?{workDir:a}:{}}}}function Pb(e){const t=Math.max(1,Math.min(pl,e+1));return[{id:"explore",name:"Explore",description:"Verify each test case in a real browser.",steps:[{kind:"agent",agent:"explorer"}]},{id:"generate",name:"Generate",description:"Explore the spec, generate the script, then validate and heal until it passes.",steps:[{kind:"agent",agent:"explorer"},{kind:"agent",agent:"generator"},{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"heal",name:"Heal",description:"Fix a failing script, then validate it.",steps:[{kind:"loop",steps:["validator","healer"],maxIterations:t}]},{id:"spec",name:"Write spec",description:"Turn a BA requirement into a spec file.",steps:[{kind:"agent",agent:"specwriter"}]},{id:"testrun",name:"Test run",description:"Run all tests, one spec, one test case or a picked selection.",steps:[{kind:"agent",agent:"runner"}]},{id:"context",name:"Project context",description:"Rewrite the project context in CLAUDE.md.",steps:[{kind:"agent",agent:"contextwriter"}]}]}const _p=[{id:"default",label:"Default"},{id:"fable",label:"Fable"},{id:"opus",label:"Opus"},{id:"sonnet",label:"Sonnet"},{id:"haiku",label:"Haiku"}],Kr=["default","low","medium","high","xhigh","max"],ro=[{id:"manual",label:"Ask every time",description:"Like the terminal: Claude asks before editing files or running commands"},{id:"acceptEdits",label:"Accept edits",description:"File edits run without asking; commands and other actions ask you first"},{id:"plan",label:"Plan (read-only)",description:"Claude can read and search but not edit files or run commands"},{id:"auto",label:"Auto",description:"Claude Code decides which actions are safe to run"},{id:"bypassPermissions",label:"Bypass permissions",description:"Every tool runs without asking (use with care)"}];function na(e,t){const n=t.toLowerCase();if(!n)return e;const r=i=>{const l=i.name.toLowerCase();return l.startsWith(n)||l.slice(l.indexOf(":")+1).startsWith(n)?0:l.includes(n)?1:i.description.toLowerCase().includes(n)?2:3};return e.map((i,l)=>({i,idx:l,r:r(i)})).filter(i=>i.r<3).sort((i,l)=>i.r-l.r||i.idx-l.idx).map(i=>i.i)}const Uy={mode:"scoped",browser:!1,editTests:!1,editSpecs:!1,typecheck:!1,deniedCommands:[],protectedPaths:[]},ku={...Uy,mode:"full",typecheck:!0,deniedCommands:[..._y],protectedPaths:[...$y]},Rb=`# Planner Agent — Instructions
79
79
 
80
80
  ## 1. Persona
81
81
 
@@ -136,7 +136,7 @@ Ask the questions that matter, get the human's answers, and turn the request int
136
136
  - Do not write or change code.
137
137
  - Keep the solution minimal: no features, refactors or dependencies the request does not need.
138
138
  - \`status\` is \`passed\` when you wrote questions or a final solution. Use \`failed\` only when the request cannot be planned (for example, it contradicts the codebase), and say why in \`failure\`.
139
- `,Rb=`# Coding Agent — Instructions
139
+ `,Lb=`# Coding Agent — Instructions
140
140
 
141
141
  ## 1. Persona
142
142
 
@@ -270,7 +270,7 @@ Own the unit tests for the change. Review the existing tests, update or add test
270
270
  - Are all tests deterministic and independent?
271
271
  - Is every branch of the changed code exercised?
272
272
  - Is there at least one edge case and one error case per unit?
273
- `,Lb=`# Code Review Agent
273
+ `,Ib=`# Code Review Agent
274
274
 
275
275
  ## Persona
276
276
 
@@ -357,63 +357,63 @@ Any CRITICAL or REQUIRED finding, or any failed check → \`"status": "failed"\`
357
357
  - Is the verdict consistent with the Rule?
358
358
  - Did I check every checklist category?
359
359
  - Is every Must-fix item specific enough for the Coding agent to act on without asking?
360
- `,Wc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:Pb,model:"sonnet",permissions:Uy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:Rb,model:"opus",permissions:ju,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Ab,model:"sonnet",permissions:ju,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Lb,model:"sonnet",permissions:ju,review:"auto"}}];function Ib(e){const t=Wc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function dt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function kn({status:e}){return s.jsx(dt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ti({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Pe({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function bn({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const By={explorer:Ty,generator:vh,validator:jh,healer:Py,runner:rb,specwriter:fl,contextwriter:kh,custom:fl};function Ot({agent:e,size:t=36}){const n=By[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Se[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function Db({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=By[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Se[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Pt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function us(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const kr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function Mb(e){var t;return e.label??((t=Se[e.agent])==null?void 0:t.label)??e.agent}function sn(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Gt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function zb({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=un(),i=Ie(()=>q.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(Qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void q.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(jr,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(jr,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",kr[g.type]," · ",g.target," ",s.jsx(kn,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Hy=j.createContext(async()=>!1),Kn=()=>j.useContext(Hy);function _b({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Hy.Provider,{value:o,children:[e,l&&as.createPortal(s.jsx($b,{opts:l,onClose:a},l.id),document.body)]})}function $b({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null);return j.useEffect(()=>{var l;(l=(e.danger?n:r).current)==null||l.focus();const i=a=>{var o;if(a.key==="Escape"&&(a.stopPropagation(),t(!1)),a.key==="Tab"){const u=[n.current,r.current].filter(Boolean),c=u.indexOf(document.activeElement);a.preventDefault(),(o=u[(c+(a.shiftKey?-1:1)+u.length)%u.length])==null||o.focus()}};return window.addEventListener("keydown",i,!0),()=>window.removeEventListener("keydown",i,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:i=>i.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Rr,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:n,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:r,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Th(e,t){const n=Kn(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Si=()=>{},Wy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),cs=()=>j.useContext(Wy);function Ob({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Wy.Provider,{value:a,children:[e,as.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(Fb,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function Fb({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(yh,{size:14}):e.kind==="error"?s.jsx(wr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(wr,{size:13})})]})}const Vy=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),ds=()=>j.useContext(Vy);function Ub(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const Bb=.6;function Hb(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(Bb,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function Wb({collapsed:e,mobileOpen:t,onCloseMobile:n}){var x;const r=j.useRef(null),i=j.useRef(null);Hb(r,i);const{specs:l,mapping:a}=un(),{openPalette:o}=ds(),u=Gn(),c=Ie(()=>q.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(y=>y.status==="queued"||y.status==="running"||y.status==="waiting");j.useEffect(()=>{if(!d)return;const y=setInterval(h,5e3);return()=>clearInterval(y)},[d,h]);const f=(c.data??[]).filter(y=>y.status==="running"||y.status==="queued").length,m=(c.data??[]).filter(y=>y.status==="waiting").length;j.useEffect(()=>(document.title=m?"● Agent Studio":"Agent Studio",()=>{document.title="Agent Studio"}),[m]);const p=a.filter(y=>y.status!=="orphan"&&y.testFile).length,g=a.filter(y=>y.status!=="orphan").length,w=(y,v,b,E,k,L)=>s.jsxs(U0,{to:y,end:k,className:({isActive:T})=>`side-link ${T&&!(L&&u.pathname.startsWith(L))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),E!==void 0&&s.jsx("span",{className:"count",children:E})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(jh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(wr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Po,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(Z0,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Sh,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(jr,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(fl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(xh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(lb,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((x=c.data)==null?void 0:x.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx(Iy,{size:17}),"Agents"),w("/usage",s.jsx(Dy,{size:17}),"Claude usage"),w("/project",s.jsx(kh,{size:17}),"Project context"),w("/settings",s.jsx(sb,{size:17}),"Settings")]})]})})}function Vb({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=ds();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(nb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Po,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(Ay,{size:17}):s.jsx(Ry,{size:17})})]})}const Qb=/^[a-z0-9][a-z0-9_-]*$/;function qb({initial:e,onClose:t}){const n=ut(),{refresh:r}=un(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!Qb.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await q.createSpec(`${h}.md`,(e==null?void 0:e.content)??G0),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Pe,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function Gb(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Fc,r),()=>window.removeEventListener(Fc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{V0().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function Kb(){var k;const e=K0(),[t,n]=J0(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(Ub),[c,h]=j.useState(!1),{pathname:d}=Gn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,x]=j.useState(null),y=j.useCallback(()=>{q.claudeStatus().then(x).catch(()=>{})},[]),{refresh:v}=e,b=Gb(j.useCallback(()=>{v(),y()},[v,y]));j.useEffect(()=>{y();const L=setInterval(y,5*6e4);return()=>clearInterval(L)},[y]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const L=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(D=>!D)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[]);const E=j.useMemo(()=>({openNewSpec:L=>a(L??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:y}),[t,n,f,p,y]);return s.jsx(Ey.Provider,{value:e,children:s.jsx(Vy.Provider,{value:E,children:s.jsx(Ob,{children:s.jsxs(_b,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(Wb,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(L=>!L),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ei,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(Vb,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(v0,{})})]})]}),r&&s.jsx(zb,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(qb,{initial:l,onClose:()=>a(null)})]})})})})}function ot({items:e}){const{crumbSlot:t}=ds();return t?as.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function Yb({children:e}){const{extraSlot:t}=ds();return t?as.createPortal(e,t):null}function Jb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Xb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,eS={};function $p(e,t){return(eS.jsx?Zb:Xb).test(e)}const tS=/[ \t\n\f\r]/g;function nS(e){return typeof e=="object"?e.type==="text"?Op(e.value):!1:Op(e)}function Op(e){return e.replace(tS,"")===""}class Nl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Nl.prototype.normal={};Nl.prototype.property={};Nl.prototype.space=void 0;function Qy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Nl(n,r,t)}function Vc(e){return e.toLowerCase()}class Ft{constructor(t,n){this.attribute=n,this.property=t}}Ft.prototype.attribute="";Ft.prototype.booleanish=!1;Ft.prototype.boolean=!1;Ft.prototype.commaOrSpaceSeparated=!1;Ft.prototype.commaSeparated=!1;Ft.prototype.defined=!1;Ft.prototype.mustUseProperty=!1;Ft.prototype.number=!1;Ft.prototype.overloadedBoolean=!1;Ft.prototype.property="";Ft.prototype.spaceSeparated=!1;Ft.prototype.space=void 0;let rS=0;const ge=hs(),rt=hs(),Qc=hs(),Y=hs(),$e=hs(),Yr=hs(),Bt=hs();function hs(){return 2**++rS}const qc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:rt,commaOrSpaceSeparated:Bt,commaSeparated:Yr,number:Y,overloadedBoolean:Qc,spaceSeparated:$e},Symbol.toStringTag,{value:"Module"})),wu=Object.keys(qc);class Ph extends Ft{constructor(t,n,r,i){let l=-1;if(super(t,n),Fp(this,"space",i),typeof r=="number")for(;++l<wu.length;){const a=wu[l];Fp(this,wu[l],(r&qc[a])===qc[a])}}}Ph.prototype.defined=!0;function Fp(e,t,n){n&&(e[t]=n)}function ai(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Ph(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Vc(r)]=r,n[Vc(l.attribute)]=r}return new Nl(t,n,e.space)}const qy=ai({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:$e,ariaCurrent:null,ariaDescribedBy:$e,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:$e,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:$e,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$e,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:$e,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:$e,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gy(e,t){return t in e?e[t]:t}function Ky(e,t){return Gy(e,t.toLowerCase())}const sS=ai({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yr,acceptCharset:$e,accessKey:$e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alpha:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:$e,autoFocus:ge,autoPlay:ge,blocking:$e,capture:null,charSet:null,checked:ge,cite:null,className:$e,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:ge,controlsList:$e,coords:Y|Yr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:Qc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:$e,height:Y,hidden:Qc,high:Y,href:null,hrefLang:null,htmlFor:$e,httpEquiv:$e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:$e,itemRef:$e,itemScope:ge,itemType:$e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ge,optimum:Y,pattern:null,ping:$e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:$e,required:ge,reversed:ge,rows:Y,rowSpan:Y,sandbox:$e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootCustomElementRegistry:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shadowRootSerializable:ge,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$e,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ge,disablePictureInPicture:ge,disableRemotePlayback:ge,exportParts:Yr,part:$e,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:Ky}),iS=ai({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Bt,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:$e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Yr,g2:Yr,glyphName:Yr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bt,rev:Bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bt,requiredFeatures:Bt,requiredFonts:Bt,requiredFormats:Bt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bt,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gy}),Yy=ai({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Jy=ai({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ky}),Xy=ai({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},aS=/[A-Z]/g,Up=/-[a-z]/g,oS=/^data[-\w.:]+$/i;function uS(e,t){const n=Vc(t);let r=t,i=Ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Up,dS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Up.test(l)){let a=l.replace(aS,cS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ph}return new i(r,t)}function cS(e){return"-"+e.toLowerCase()}function dS(e){return e.charAt(1).toUpperCase()}const hS=Qy([qy,sS,Yy,Jy,Xy],"html"),Rh=Qy([qy,iS,Yy,Jy,Xy],"svg");function fS(e){return e.join(" ").trim()}var Bp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,pS=/\n/g,mS=/^\s*/,gS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xS=/^:\s*/,yS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,vS=/^[;\s]*/,jS=`
361
- `,Hp="/",Wp="*",Ni="",wS="comment",kS="declaration";function bS(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(pS);g&&(n+=g.length);var w=p.lastIndexOf(jS);r=~w?p.length-w:r+p.length}function l(){var p={line:n,column:r};return function(g){return g.position=new a(p),c(),g}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(mS)}function h(p){for(var g;g=d();)p.push(g);return p}function d(){var p=l();if(!(Hp!=e.charAt(0)||Wp!=e.charAt(1))){for(var g=2;Ni!=e.charAt(g)&&(Wp!=e.charAt(g)||Hp!=e.charAt(g+1));)++g;if(g+=2,Ni===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:wS,comment:w})}}function f(){var p=l(),g=u(gS);if(g){if(d(),!u(xS))return o("property missing ':'");var w=u(yS),x=p({type:kS,property:g[0].replace(Bp,Ni).trim(),value:w?w[0].replace(Bp,Ni).trim():Ni});return u(vS),x}}function m(){var p=[];h(p);for(var g;g=f();)p.push(g),h(p);return p}return c(),m()}function SS(e,t){let n=null;if(!e||typeof e!="string")return n;const r=bS(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n??{},n[a]=o)}),n}const Zy=ev("end"),Ah=ev("start");function ev(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function NS(e){const t=Ah(e),n=Zy(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vp(e.position):"start"in e||"end"in e?Vp(e):"line"in e||"column"in e?Gc(e):""}function Gc(e){return Qp(e&&e.line)+":"+Qp(e&&e.column)}function Vp(e){return Gc(e&&e.start)+"-"+Gc(e&&e.end)}function Qp(e){return e&&typeof e=="number"?e:1}class Lo extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Lo.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const Lh={}.hasOwnProperty,CS=new Map,ES=/[A-Z]/g,TS=/-([a-z])/g,PS=new Set(["table","tbody","thead","tfoot","tr"]),RS=new Set(["td","th"]),tv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=OS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$S(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Rh:hS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=nv(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function nv(e,t,n){if(t.type==="element")return LS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return IS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MS(e,t,n);if(t.type==="mdxjsEsm")return DS(e,t);if(t.type==="root")return zS(e,t,n);if(t.type==="text")return _S(e,t)}function LS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rh,e.schema=i),e.ancestors.push(t);const l=sv(e,t.tagName,!1),a=FS(e,t);let o=Dh(e,t);return PS.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!nS(u):!0})),rv(e,a,l,t),Ih(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function IS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ml(e,t.position)}function DS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ml(e,t.position)}function MS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Rh,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:sv(e,t.name,!0),a=US(e,t),o=Dh(e,t);return rv(e,a,l,t),Ih(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function zS(e,t,n){const r={};return Ih(r,Dh(e,t)),e.create(t,e.Fragment,r,n)}function _S(e,t){return t.value}function rv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ih(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $S(e,t,n){return r;function r(i,l,a,o){const c=Array.isArray(a.children)?n:t;return o?c(l,a,o):c(l,a)}}function OS(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),u=Ah(r);return t(i,l,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function FS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Lh.call(t.properties,i)){const l=BS(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&RS.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function US(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ml(e,t.position);else{const{name:i}=r;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else ml(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Dh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:CS;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const c=i.get(u)||0;a=u+"-"+c,i.set(u,c+1)}}const o=nv(e,l,a);o!==void 0&&n.push(o)}return n}function BS(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=uS(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Jb(n):fS(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:WS(n):HS(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?lS[r.property]||r.property:r.attribute,n]}function HS(e,t){const n={};try{SS(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(TS,qS))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Lo("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=tv+"#cannot-parse-style-attribute",l}return n}function sv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=$p(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=$p(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Lh.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ml(e)}function ml(e,t){const n=new Lo("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=tv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function WS(e){const t={};let n;for(n in e)Lh.call(e,n)&&(t[VS(n)]=e[n]);return t}function VS(e){if(e.slice(0,2)==="--")return e;let t=e.replace(ES,QS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function QS(e){return"-"+e.toLowerCase()}function qS(e,t){return t.toUpperCase()}const ku={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},GS={};function Io(e,t){const n=GS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return iv(e,r,i)}function iv(e,t,n){if(KS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qp(e.children,t,n)}return Array.isArray(e)?qp(e,t,n):""}function qp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=iv(e[i],t,n);return r.join("")}function KS(e){return!!(e&&typeof e=="object")}const Gp=document.createElement("i");function Mh(e){const t="&"+e+";";Gp.innerHTML=t;const n=Gp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function nn(e,t){return e.length>0?(yn(e,e.length,0,t),e):t}const Kp={}.hasOwnProperty;function lv(e){const t={};let n=-1;for(;++n<e.length;)YS(t,e[n]);return t}function YS(e,t){let n;for(n in t){const i=(Kp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Kp.call(i,a)||(i[a]=[]);const o=l[a];JS(i[a],Array.isArray(o)?o:o?[o]:[])}}}function JS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yn(e,0,0,r)}function av(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yt=Ar(/[A-Za-z]/),vt=Ar(/[\dA-Za-z]/),XS=Ar(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return e!==null&&(e<32||e===127)}const Kc=Ar(/\d/),ZS=Ar(/[\dA-Fa-f]/),ov=Ar(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<-2}function Oe(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const Cl=Ar(new RegExp("\\p{P}|\\p{S}","u")),ss=Ar(/\s/);function Ar(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&vt(e.charCodeAt(n+1))&&vt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ae(e,t,n,r){const i=r?r-1:1/0;let l=0;return a;function a(u){return ve(u)?(e.enter(n),o(u)):t(u)}function o(u){return ve(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}function uv(e,t,n,r,i,l){let a=0;return o;function o(h){return ve(h)?(e.enter(r),u(h)):c(h)}function u(h){return ve(h)&&a<l?(e.consume(h),a++,u):(e.exit(r),c(h))}function c(h){return a>=i?t(h):n(h)}}const eN={tokenize:tN};function tN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ae(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return de(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}let so=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Yp(this,t,n,r,!1)}addBefore(t,n,r){Yp(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function Yp(e,t,n,r,i){if(n===0&&r.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const nN={tokenize:rN},Jp={tokenize:sN};function rN(e){const t=this,n=[];let r=0,i,l,a;return o;function o(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const b=t.events.length;let E=b,k;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){k=t.events[E][1].end;break}x(r);let L=b;for(;L<t.events.length;)t.events[L][1].end={...k},L++;const T=new so;return T.add(E+1,0,t.events.slice(b)),T.add(b,L-b,[]),T.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Jp,h,d)(v)}function h(v){return i&&y(),x(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(v)}function f(v){return t.containerState={},e.attempt(Jp,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function p(v){if(v===null){i&&y(),x(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),x(0),e.consume(v);return}return de(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,b){const E=t.sliceStream(v);if(b&&E.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const L=t.events.length;let T=L,D,N;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){N=t.events[T][1].end;break}D=!0}for(x(r),k=L;k<t.events.length;)t.events[k][1].end={...N},k++;const P=new so;P.add(T+1,0,t.events.slice(L)),P.add(L,k-L,[]),P.consume(t.events)}}function x(v){let b=n.length;for(;b-- >v;){const E=n[b];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function y(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function sN(e,t,n){return Ae(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function br(e){if(e===null||Oe(e)||ss(e))return 1;if(Cl(e))return 2}function Do(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Yc={name:"attention",resolveAll:iN,tokenize:lN};function iN(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},o={...e[n][1].start};Xp(a,-l),Xp(o,l);const u={type:l>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},h={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},d={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=nn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=nn(r,[["enter",d,t],["enter",u,t],["exit",u,t],["enter",h,t]]),r=nn(r,Do(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=nn(r,[["exit",h,t],["enter",c,t],["exit",c,t],["exit",d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=nn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),yn(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function lN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=br(r);let l;return a;function a(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const c=e.exit("attentionSequence"),h=br(u),d=!h||h===2&&i||n.includes(u)&&u!==42&&u!==95,f=!i||i===2&&h||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?d:d&&(i||!f)),c._close=!!(l===42?f:f&&(h||!d)),t(u)}}function Xp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const aN={name:"autolink",tokenize:oN};function oN(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return yt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||vt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||vt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ro(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),h):XS(m)?(e.consume(m),c):n(m)}function h(m){return vt(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,h):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||vt(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const El={partial:!0,tokenize:uN};function uN(e,t,n){return r;function r(l){return ve(l)?Ae(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||de(l)?t(l):n(l)}}const cv={continuation:{tokenize:dN},exit:hN,name:"blockQuote",tokenize:cN};function cN(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return ve(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function dN(e,t,n){const r=this;return i;function i(a){return ve(a)?Ae(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(cv,t,n)(a)}}function hN(e){e.exit("blockQuote")}const dv={name:"characterEscape",tokenize:fN};function fN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return ov(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const hv={name:"characterReference",tokenize:pN};function pN(e,t,n){const r=this;let i=0,l,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,a=vt,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=ZS,h):(e.enter("characterReferenceValue"),l=7,a=Kc,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===vt&&!Mh(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<l?(e.consume(d),h):n(d)}}const Jc={partial:!0,tokenize:mN};function mN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Zp={concrete:!0,name:"codeFenced",tokenize:gN};function gN(e,t,n){const r=this,i={partial:!0,tokenize:E};let l=0,a=0,o;return u;function u(k){return c(k)}function c(k){const L=r.events[r.events.length-1];return l=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===o?(a++,e.consume(k),h):a<3?n(k):(e.exit("codeFencedFenceSequence"),ve(k)?Ae(e,d,"whitespace")(k):d(k))}function d(k){return k===null||de(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Jc,g,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):ve(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ae(e,m,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),f)}function m(k){return k===null||de(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===o?n(k):(e.consume(k),p)}function g(k){return e.attempt(i,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return l>0&&ve(k)?Ae(e,y,"linePrefix",l+1)(k):y(k)}function y(k){return k===null||de(k)?e.check(Jc,g,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||de(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function E(k,L,T){let D=0;return N;function N(I){return k.enter("lineEnding"),k.consume(I),k.exit("lineEnding"),P}function P(I){return k.enter("codeFencedFence"),ve(I)?Ae(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===o?(k.enter("codeFencedFenceSequence"),z(I)):T(I)}function z(I){return I===o?(D++,k.consume(I),z):D>=a?(k.exit("codeFencedFenceSequence"),ve(I)?Ae(k,U,"whitespace")(I):U(I)):T(I)}function U(I){return I===null||de(I)?(k.exit("codeFencedFence"),L(I)):T(I)}}}const bu={name:"codeIndented",tokenize:yN},xN={partial:!0,tokenize:vN};function yN(e,t,n){return r;function r(o){return e.enter("codeIndented"),uv(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?a(o):de(o)?e.attempt(xN,i,a)(o):(e.enter("codeFlowValue"),l(o))}function l(o){return o===null||de(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),l)}function a(o){return e.exit("codeIndented"),t(o)}}function vN(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):de(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):uv(e,t,l,"linePrefix",4,4)(a)}function l(a){return de(a)?i(a):n(a)}}const jN={name:"codeText",previous:kN,resolve:wN,tokenize:bN};function wN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bN(e,t,n){let r=0,i,l;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(l=e.enter("codeTextSequence"),i=0,h(d)):de(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||de(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",c(d))}}class SN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function fv(e){const t={};let n=-1,r,i,l,a,o,u,c;const h=new SN(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,NN(h,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=h.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return yn(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function NN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],c={};let h,d,f=-1,m=n,p=0,g=0;const w=[g];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(g=f+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),f=w.length;f--;){const x=o.slice(w[f],w[f+1]),y=l.pop();u.push([y,y+x.length-1]),e.splice(y,2,x)}for(u.reverse(),f=-1;++f<u.length;)c[p+u[f][0]]=p+u[f][1],p+=u[f][1]-u[f][0]-1;return c}const CN={resolve:TN,tokenize:PN},EN={partial:!0,tokenize:RN};function TN(e){return fv(e),e}function PN(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):de(o)?e.check(EN,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function RN(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ae(e,l,"linePrefix")}function l(a){if(a===null||de(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function pv(e,t,n,r,i,l,a,o,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),f):x===null||x===32||x===41||ro(x)?n(x):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(x))}function f(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(o),f(x)):x===null||x===60||de(x)?n(x):(e.consume(x),x===92?p:m)}function p(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function g(x){return!h&&(x===null||x===41||Oe(x))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(x)):h<c&&x===40?(e.consume(x),h++,g):x===41?(e.consume(x),h--,g):x===null||x===32||x===40||ro(x)?n(x):(e.consume(x),x===92?w:g)}function w(x){return x===40||x===41||x===92?(e.consume(x),g):g(x)}}function mv(e,t,n,r,i,l){const a=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),h}function h(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):de(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||de(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),u||(u=!ve(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function gv(e,t,n,r,i,l){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,u):n(f)}function u(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(l),c(f))}function c(f){return f===a?(e.exit(l),u(a)):f===null?n(f):de(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ae(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||de(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Vi(e,t){let n;return r;function r(i){return de(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?Ae(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const AN={name:"definition",tokenize:IN},LN={partial:!0,tokenize:DN};function IN(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return mv.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Oe(m)?Vi(e,c)(m):c(m)}function c(m){return pv(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(LN,d,d)(m)}function d(m){return ve(m)?Ae(e,f,"whitespace")(m):f(m)}function f(m){return m===null||de(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function DN(e,t,n){return r;function r(o){return Oe(o)?Vi(e,i)(o):n(o)}function i(o){return gv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return ve(o)?Ae(e,a,"whitespace")(o):a(o)}function a(o){return o===null||de(o)?t(o):n(o)}}const MN={name:"hardBreakEscape",tokenize:zN};function zN(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return de(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const _N={name:"headingAtx",resolve:$N,tokenize:ON};function $N(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};yn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function ON(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Oe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||de(h)?(e.exit("atxHeading"),t(h)):ve(h)?Ae(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Oe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const xv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xc=["pre","script","style","textarea"],FN={concrete:!0,name:"htmlFlow",resolveTo:BN,tokenize:HN},UN={partial:!0,tokenize:WN};function BN(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function HN(e,t,n){const r=this;let i,l,a,o,u;return c;function c(C){return h(C)}function h(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),l=!0,g):C===63?(e.consume(C),i=3,r.interrupt?t:S):yt(C)?(e.consume(C),a=String.fromCharCode(C),w):n(C)}function f(C){return C===45?(e.consume(C),i=2,m):C===91?(e.consume(C),i=5,o=0,p):yt(C)?(e.consume(C),i=4,r.interrupt?t:S):n(C)}function m(C){return C===45?(e.consume(C),r.interrupt?t:S):n(C)}function p(C){const F="CDATA[";return C===F.charCodeAt(o++)?(e.consume(C),o===F.length?r.interrupt?t:A:p):n(C)}function g(C){return yt(C)?(e.consume(C),a=String.fromCharCode(C),w):n(C)}function w(C){if(C===null||C===47||C===62||Oe(C)){const F=C===47,Z=a.toLowerCase();return!F&&!l&&Xc.includes(Z)?(i=1,r.interrupt?t(C):A(C)):xv.includes(a.toLowerCase())?(i=6,F?(e.consume(C),x):r.interrupt?t(C):A(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):l?y(C):v(C))}return C===45||vt(C)?(e.consume(C),a+=String.fromCharCode(C),w):n(C)}function x(C){return C===62?(e.consume(C),r.interrupt?t:A):n(C)}function y(C){return ve(C)?(e.consume(C),y):N(C)}function v(C){return C===47?(e.consume(C),N):C===58||C===95||yt(C)?(e.consume(C),b):ve(C)?(e.consume(C),v):N(C)}function b(C){return C===45||C===46||C===58||C===95||vt(C)?(e.consume(C),b):E(C)}function E(C){return C===61?(e.consume(C),k):ve(C)?(e.consume(C),E):v(C)}function k(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),u=C,L):ve(C)?(e.consume(C),k):T(C)}function L(C){return C===u?(e.consume(C),u=null,D):C===null||de(C)?n(C):(e.consume(C),L)}function T(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||Oe(C)?E(C):(e.consume(C),T)}function D(C){return C===47||C===62||ve(C)?v(C):n(C)}function N(C){return C===62?(e.consume(C),P):n(C)}function P(C){return C===null||de(C)?A(C):ve(C)?(e.consume(C),P):n(C)}function A(C){return C===45&&i===2?(e.consume(C),Q):C===60&&i===1?(e.consume(C),J):C===62&&i===4?(e.consume(C),ae):C===63&&i===3?(e.consume(C),S):C===93&&i===5?(e.consume(C),X):de(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(UN,O,z)(C)):C===null||de(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.check(Jc,U,O)(C)}function U(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),I}function I(C){return C===null||de(C)?z(C):(e.enter("htmlFlowData"),A(C))}function Q(C){return C===45?(e.consume(C),S):A(C)}function J(C){return C===47?(e.consume(C),a="",H):A(C)}function H(C){if(C===62){const F=a.toLowerCase();return Xc.includes(F)?(e.consume(C),ae):A(C)}return yt(C)&&a.length<8?(e.consume(C),a+=String.fromCharCode(C),H):A(C)}function X(C){return C===93?(e.consume(C),S):A(C)}function S(C){return C===62?(e.consume(C),ae):C===45&&i===2?(e.consume(C),S):A(C)}function ae(C){return C===null||de(C)?(e.exit("htmlFlowData"),O(C)):(e.consume(C),ae)}function O(C){return e.exit("htmlFlow"),t(C)}}function WN(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(El,t,n)}}const VN={name:"htmlText",tokenize:QN};function QN(e,t,n){const r=this;let i,l,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),E):S===63?(e.consume(S),v):yt(S)?(e.consume(S),T):n(S)}function c(S){return S===45?(e.consume(S),h):S===91?(e.consume(S),l=0,p):yt(S)?(e.consume(S),y):n(S)}function h(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),f):de(S)?(a=d,J(S)):(e.consume(S),d)}function f(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?Q(S):S===45?f(S):d(S)}function p(S){const ae="CDATA[";return S===ae.charCodeAt(l++)?(e.consume(S),l===ae.length?g:p):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),w):de(S)?(a=g,J(S)):(e.consume(S),g)}function w(S){return S===93?(e.consume(S),x):g(S)}function x(S){return S===62?Q(S):S===93?(e.consume(S),x):g(S)}function y(S){return S===null||S===62?Q(S):de(S)?(a=y,J(S)):(e.consume(S),y)}function v(S){return S===null?n(S):S===63?(e.consume(S),b):de(S)?(a=v,J(S)):(e.consume(S),v)}function b(S){return S===62?Q(S):v(S)}function E(S){return yt(S)?(e.consume(S),k):n(S)}function k(S){return S===45||vt(S)?(e.consume(S),k):L(S)}function L(S){return de(S)?(a=L,J(S)):ve(S)?(e.consume(S),L):Q(S)}function T(S){return S===45||vt(S)?(e.consume(S),T):S===47||S===62||Oe(S)?D(S):n(S)}function D(S){return S===47?(e.consume(S),Q):S===58||S===95||yt(S)?(e.consume(S),N):de(S)?(a=D,J(S)):ve(S)?(e.consume(S),D):Q(S)}function N(S){return S===45||S===46||S===58||S===95||vt(S)?(e.consume(S),N):P(S)}function P(S){return S===61?(e.consume(S),A):de(S)?(a=P,J(S)):ve(S)?(e.consume(S),P):D(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,z):de(S)?(a=A,J(S)):ve(S)?(e.consume(S),A):(e.consume(S),U)}function z(S){return S===i?(e.consume(S),i=void 0,I):S===null?n(S):de(S)?(a=z,J(S)):(e.consume(S),z)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Oe(S)?D(S):(e.consume(S),U)}function I(S){return S===47||S===62||Oe(S)?D(S):n(S)}function Q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function J(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),H}function H(S){return ve(S)?Ae(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):X(S)}function X(S){return e.enter("htmlTextData"),a(S)}}const zh={name:"labelEnd",resolveAll:YN,resolveTo:JN,tokenize:XN},qN={tokenize:ZN},GN={tokenize:eC},KN={tokenize:tC};function YN(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&yn(e,0,e.length,n),e}function JN(e,t){let n=e.length,r=0,i,l,a;for(;n--;){const h=e[n][1];if(i){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[n][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(i=n,h.type!=="labelLink")){r=2;break}}else h.type==="labelEnd"&&(l=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",o,t],["enter",u,t]],a=nn(a,e.slice(i+1,i+r+3)),a=nn(a,[["enter",c,t]]),a=nn(a,Do(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),a=nn(a,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),a=nn(a,e.slice(l+1)),a=nn(a,[["exit",o,t]]),yn(e,i,e.length,a),e}function XN(e,t,n){const r=this,i=r._labelStarts;let l,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return o;function o(f){return l?l._inactive?d(f):(a=r.parser.defined.includes(vn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(qN,h,a?h:d)(f):f===91?e.attempt(GN,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(KN,h,d)(f)}function h(f){return i.pop(),t(f)}function d(f){return l._balanced=!0,n(f)}}function ZN(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Oe(d)?Vi(e,l)(d):l(d)}function l(d){return d===41?h(d):pv(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Oe(d)?Vi(e,u)(d):h(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?gv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Oe(d)?Vi(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function eC(e,t,n){const r=this;return i;function i(o){return mv.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function tC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const nC={name:"labelStartImage",resolveAll:zh.resolveAll,tokenize:rC};function rC(e,t,n){const r=this;let i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const sC={name:"labelStartLink",resolveAll:zh.resolveAll,tokenize:iC};function iC(e,t,n){const r=this;let i;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Su={name:"lineEnding",tokenize:lC};function lC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ae(e,t,"linePrefix")}}const Ca={name:"thematicBreak",tokenize:aC};function aC(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||de(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ve(c)?Ae(e,o,"whitespace")(c):o(c))}}const Lt={continuation:{tokenize:dC},exit:fC,name:"list",tokenize:cC},oC={partial:!0,tokenize:pC},uC={partial:!0,tokenize:hC};function cC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Kc(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ca,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Kc(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(El,r.interrupt?n:h,e.attempt(oC,f,d))}function h(m){return r.containerState.initialBlankLine=!0,l++,f(m)}function d(m){return ve(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function dC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(El,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ae(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!ve(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uC,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ae(e,e.attempt(Lt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function hC(e,t,n){const r=this;return Ae(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function fC(e){e.exit(this.containerState.type)}function pC(e,t,n){const r=this;return Ae(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!ve(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const em={name:"setextUnderline",resolveTo:mC,tokenize:gC};function mC(e,t){const n=new so;let r=e.length,i,l,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",a?(n.add(l,0,[["enter",o,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function gC(e,t,n){const r=this;let i;return l;function l(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),ve(c)?Ae(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||de(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const xC={tokenize:yC};function yC(e){const t=this,n=e.attempt(El,r,e.attempt(this.parser.constructs.flowInitial,i,Ae(e,e.attempt(this.parser.constructs.flow,i,e.attempt(CN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vC={resolveAll:vv()},jC=yv("string"),wC=yv("text");function yv(e){return{resolveAll:vv(e==="text"?kC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(h){return c(h)?l(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function vv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function kC(e,t){const n=new so;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let a=l.length,o=-1,u=0,c;for(;a--;){const h=l[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)c=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const h={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):n.add(r,0,[["enter",h,t],["exit",h,t]])}r++}return n.consume(e),e}const bC={42:Lt,43:Lt,45:Lt,48:Lt,49:Lt,50:Lt,51:Lt,52:Lt,53:Lt,54:Lt,55:Lt,56:Lt,57:Lt,62:cv},SC={91:AN},NC={[-2]:bu,[-1]:bu,32:bu},CC={35:_N,42:Ca,45:[em,Ca],60:FN,61:em,95:Ca,96:Zp,126:Zp},EC={38:hv,92:dv},TC={[-5]:Su,[-4]:Su,[-3]:Su,33:nC,38:hv,42:Yc,60:[aN,VN],91:sC,92:[MN,dv],93:zh,95:Yc,96:jN},PC={null:[Yc,vC]},RC={null:[42,95]},AC={null:[]},LC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RC,contentInitial:SC,disable:AC,document:bC,flow:CC,flowInitial:NC,insideSpan:PC,string:EC,text:TC},Symbol.toStringTag,{value:"Module"}));function IC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const u={attempt:L(E),check:L(k),consume:y,enter:v,exit:b,interrupt:L(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&l.push(t),c;function d(P){return a=nn(a,P),w(),a[a.length-1]!==null?[]:(T(t,0),c.events=Do(l,c.events,c),c.events)}function f(P,A){return MC(m(P),A)}function m(P){return DC(a,P)}function p(){const{_bufferIndex:P,_index:A,line:z,column:U,offset:I}=r;return{_bufferIndex:P,_index:A,line:z,column:U,offset:I}}function g(P){i[P.line]=P.column,N()}function w(){for(;r._index<a.length;){const P=a[r._index];if(typeof P=="string"){const A=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<P.length;)x(P.charCodeAt(r._bufferIndex))}else x(P)}}function x(P){h=h(P)}function y(P){de(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,N()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=P}function v(P,A){const z=A||{};return z.type=P,z.start=p(),c.events.push(["enter",z,c]),o.push(z),z}function b(P){const A=o.pop();return A.end=p(),c.events.push(["exit",A,c]),A}function E(P,A){T(P,A.from)}function k(P,A){A.restore()}function L(P,A){return z;function z(U,I,Q){let J,H,X,S;return Array.isArray(U)?O(U):"tokenize"in U?O([U]):ae(U);function ae(oe){return B;function B(he){const ze=he!==null&&oe[he],Ke=he!==null&&oe.null,W=[...Array.isArray(ze)?ze:ze?[ze]:[],...Array.isArray(Ke)?Ke:Ke?[Ke]:[]];return O(W)(he)}}function O(oe){return J=oe,H=0,oe.length===0?Q:C(oe[H])}function C(oe){return B;function B(he){return S=D(),X=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?Z():oe.tokenize.call(A?Object.assign(Object.create(c),A):c,u,F,Z)(he)}}function F(oe){return P(X,S),I}function Z(oe){return S.restore(),++H<J.length?C(J[H]):Q}}}function T(P,A){P.resolveAll&&!l.includes(P)&&l.push(P),P.resolve&&yn(c.events,A,c.events.length-A,P.resolve(c.events.slice(A),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function D(){const P=p(),A=c.previous,z=c.currentConstruct,U=c.events.length,I=Array.from(o);return{from:U,restore:Q};function Q(){r=P,c.previous=A,c.currentConstruct=z,c.events.length=U,o=I,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function DC(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function MC(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
360
+ `,Vc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:Rb,model:"sonnet",permissions:Uy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:Lb,model:"opus",permissions:ku,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Ab,model:"sonnet",permissions:ku,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Ib,model:"sonnet",permissions:ku,review:"auto"}}];function Db(e){const t=Vc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function dt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function kn({status:e}){return s.jsx(dt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ni({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Pe({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function bn({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const By={explorer:Ty,generator:jh,validator:wh,healer:Py,runner:sb,specwriter:fl,contextwriter:kh,custom:fl};function Ot({agent:e,size:t=36}){const n=By[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Se[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function Mb({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=By[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Se[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Pt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function ds(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const kr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function zb(e){var t;return e.label??((t=Se[e.agent])==null?void 0:t.label)??e.agent}function ln(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Gt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function _b({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=Xt(),i=Me(()=>q.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(Qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void q.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(jr,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(jr,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",kr[g.type]," · ",g.target," ",s.jsx(kn,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Hy=j.createContext(async()=>!1),In=()=>j.useContext(Hy);function $b({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Hy.Provider,{value:o,children:[e,l&&Er.createPortal(s.jsx(Ob,{opts:l,onClose:a},l.id),document.body)]})}function Ob({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null);return j.useEffect(()=>{var l;(l=(e.danger?n:r).current)==null||l.focus();const i=a=>{var o;if(a.key==="Escape"&&(a.stopPropagation(),t(!1)),a.key==="Tab"){const u=[n.current,r.current].filter(Boolean),c=u.indexOf(document.activeElement);a.preventDefault(),(o=u[(c+(a.shiftKey?-1:1)+u.length)%u.length])==null||o.focus()}};return window.addEventListener("keydown",i,!0),()=>window.removeEventListener("keydown",i,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:i=>i.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Lr,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:n,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:r,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Th(e,t){const n=In(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Wy=j.createContext(e=>e),Fb=()=>j.useContext(Wy);function Ub({children:e}){const[t,n]=j.useState(0),r=j.useCallback(i=>(n(l=>l+1),i.finally(()=>n(l=>l-1))),[]);return s.jsxs(Wy.Provider,{value:r,children:[e,t>0&&Er.createPortal(s.jsx("div",{className:"loading-bar",role:"progressbar","aria-label":"Loading"}),document.body)]})}const Si=()=>{},Vy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),Ar=()=>j.useContext(Vy);function Bb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Vy.Provider,{value:a,children:[e,Er.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(Hb,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function Hb({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(vh,{size:14}):e.kind==="error"?s.jsx(wr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(wr,{size:13})})]})}const Qy=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),hs=()=>j.useContext(Qy);function Wb(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const Vb=.6;function Qb(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(Vb,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function qb({collapsed:e,mobileOpen:t,onCloseMobile:n}){var x;const r=j.useRef(null),i=j.useRef(null);Qb(r,i);const{specs:l,mapping:a}=Xt(),{openPalette:o}=hs(),u=Kn(),c=Me(()=>q.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(y=>y.status==="queued"||y.status==="running"||y.status==="waiting");j.useEffect(()=>{if(!d)return;const y=setInterval(h,5e3);return()=>clearInterval(y)},[d,h]);const f=(c.data??[]).filter(y=>y.status==="running"||y.status==="queued").length,m=(c.data??[]).filter(y=>y.status==="waiting").length;j.useEffect(()=>(document.title=m?"● Agent Studio":"Agent Studio",()=>{document.title="Agent Studio"}),[m]);const p=a.filter(y=>y.status!=="orphan"&&y.testFile).length,g=a.filter(y=>y.status!=="orphan").length,w=(y,v,b,E,k,R)=>s.jsxs(B0,{to:y,end:k,className:({isActive:T})=>`side-link ${T&&!(R&&u.pathname.startsWith(R))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),E!==void 0&&s.jsx("span",{className:"count",children:E})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(wh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(wr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Ro,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(eb,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Sh,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(jr,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(fl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(yh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(ab,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((x=c.data)==null?void 0:x.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx(Iy,{size:17}),"Agents"),w("/usage",s.jsx(Dy,{size:17}),"Claude usage"),w("/project",s.jsx(kh,{size:17}),"Project"),w("/settings",s.jsx(ib,{size:17}),"Settings")]})]})})}function Gb({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=hs();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(rb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Ro,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(Ly,{size:17}):s.jsx(Ry,{size:17})})]})}const Kb=/^[a-z0-9][a-z0-9_-]*$/;function Yb({initial:e,onClose:t}){const n=ut(),{refresh:r}=Xt(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!Kb.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await q.createSpec(`${h}.md`,(e==null?void 0:e.content)??K0),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Pe,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function Jb(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Uc,r),()=>window.removeEventListener(Uc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{Q0().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function Xb(){var k;const e=Y0(),[t,n]=X0(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(Wb),[c,h]=j.useState(!1),{pathname:d}=Kn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,x]=j.useState(null),y=j.useCallback(()=>{q.claudeStatus().then(x).catch(()=>{})},[]),{refresh:v}=e,b=Jb(j.useCallback(()=>{v(),y()},[v,y]));j.useEffect(()=>{y();const R=setInterval(y,5*6e4);return()=>clearInterval(R)},[y]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const R=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(D=>!D)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[]);const E=j.useMemo(()=>({openNewSpec:R=>a(R??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:y}),[t,n,f,p,y]);return s.jsx(Ey.Provider,{value:e,children:s.jsx(Qy.Provider,{value:E,children:s.jsx(Bb,{children:s.jsx(Ub,{children:s.jsxs($b,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(qb,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(R=>!R),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ti,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(Gb,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(j0,{})})]})]}),r&&s.jsx(_b,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(Yb,{initial:l,onClose:()=>a(null)})]})})})})})}function ot({items:e}){const{crumbSlot:t}=hs();return t?Er.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function Zb({children:e}){const{extraSlot:t}=hs();return t?Er.createPortal(e,t):null}function eS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const tS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rS={};function $p(e,t){return(rS.jsx?nS:tS).test(e)}const sS=/[ \t\n\f\r]/g;function iS(e){return typeof e=="object"?e.type==="text"?Op(e.value):!1:Op(e)}function Op(e){return e.replace(sS,"")===""}class Nl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Nl.prototype.normal={};Nl.prototype.property={};Nl.prototype.space=void 0;function qy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Nl(n,r,t)}function Qc(e){return e.toLowerCase()}class Ft{constructor(t,n){this.attribute=n,this.property=t}}Ft.prototype.attribute="";Ft.prototype.booleanish=!1;Ft.prototype.boolean=!1;Ft.prototype.commaOrSpaceSeparated=!1;Ft.prototype.commaSeparated=!1;Ft.prototype.defined=!1;Ft.prototype.mustUseProperty=!1;Ft.prototype.number=!1;Ft.prototype.overloadedBoolean=!1;Ft.prototype.property="";Ft.prototype.spaceSeparated=!1;Ft.prototype.space=void 0;let lS=0;const ge=fs(),rt=fs(),qc=fs(),Y=fs(),$e=fs(),Xr=fs(),Bt=fs();function fs(){return 2**++lS}const Gc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:rt,commaOrSpaceSeparated:Bt,commaSeparated:Xr,number:Y,overloadedBoolean:qc,spaceSeparated:$e},Symbol.toStringTag,{value:"Module"})),bu=Object.keys(Gc);class Ph extends Ft{constructor(t,n,r,i){let l=-1;if(super(t,n),Fp(this,"space",i),typeof r=="number")for(;++l<bu.length;){const a=bu[l];Fp(this,bu[l],(r&Gc[a])===Gc[a])}}}Ph.prototype.defined=!0;function Fp(e,t,n){n&&(e[t]=n)}function ai(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Ph(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Qc(r)]=r,n[Qc(l.attribute)]=r}return new Nl(t,n,e.space)}const Gy=ai({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:$e,ariaCurrent:null,ariaDescribedBy:$e,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:$e,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:$e,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$e,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:$e,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:$e,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ky(e,t){return t in e?e[t]:t}function Yy(e,t){return Ky(e,t.toLowerCase())}const aS=ai({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xr,acceptCharset:$e,accessKey:$e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alpha:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:$e,autoFocus:ge,autoPlay:ge,blocking:$e,capture:null,charSet:null,checked:ge,cite:null,className:$e,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:ge,controlsList:$e,coords:Y|Xr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:qc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:$e,height:Y,hidden:qc,high:Y,href:null,hrefLang:null,htmlFor:$e,httpEquiv:$e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:$e,itemRef:$e,itemScope:ge,itemType:$e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ge,optimum:Y,pattern:null,ping:$e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:$e,required:ge,reversed:ge,rows:Y,rowSpan:Y,sandbox:$e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootCustomElementRegistry:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shadowRootSerializable:ge,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$e,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ge,disablePictureInPicture:ge,disableRemotePlayback:ge,exportParts:Xr,part:$e,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:Yy}),oS=ai({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Bt,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:$e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xr,g2:Xr,glyphName:Xr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Bt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bt,rev:Bt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bt,requiredFeatures:Bt,requiredFonts:Bt,requiredFormats:Bt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Bt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bt,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ky}),Jy=ai({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Xy=ai({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Yy}),Zy=ai({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},cS=/[A-Z]/g,Up=/-[a-z]/g,dS=/^data[-\w.:]+$/i;function hS(e,t){const n=Qc(t);let r=t,i=Ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Up,pS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Up.test(l)){let a=l.replace(cS,fS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ph}return new i(r,t)}function fS(e){return"-"+e.toLowerCase()}function pS(e){return e.charAt(1).toUpperCase()}const mS=qy([Gy,aS,Jy,Xy,Zy],"html"),Rh=qy([Gy,oS,Jy,Xy,Zy],"svg");function gS(e){return e.join(" ").trim()}var Bp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,xS=/\n/g,yS=/^\s*/,vS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,jS=/^:\s*/,wS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,kS=/^[;\s]*/,bS=`
361
+ `,Hp="/",Wp="*",Ni="",SS="comment",NS="declaration";function CS(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(xS);g&&(n+=g.length);var w=p.lastIndexOf(bS);r=~w?p.length-w:r+p.length}function l(){var p={line:n,column:r};return function(g){return g.position=new a(p),c(),g}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(yS)}function h(p){for(var g;g=d();)p.push(g);return p}function d(){var p=l();if(!(Hp!=e.charAt(0)||Wp!=e.charAt(1))){for(var g=2;Ni!=e.charAt(g)&&(Wp!=e.charAt(g)||Hp!=e.charAt(g+1));)++g;if(g+=2,Ni===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:SS,comment:w})}}function f(){var p=l(),g=u(vS);if(g){if(d(),!u(jS))return o("property missing ':'");var w=u(wS),x=p({type:NS,property:g[0].replace(Bp,Ni).trim(),value:w?w[0].replace(Bp,Ni).trim():Ni});return u(kS),x}}function m(){var p=[];h(p);for(var g;g=f();)p.push(g),h(p);return p}return c(),m()}function ES(e,t){let n=null;if(!e||typeof e!="string")return n;const r=CS(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n??{},n[a]=o)}),n}const ev=tv("end"),Lh=tv("start");function tv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function TS(e){const t=Lh(e),n=ev(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vp(e.position):"start"in e||"end"in e?Vp(e):"line"in e||"column"in e?Kc(e):""}function Kc(e){return Qp(e&&e.line)+":"+Qp(e&&e.column)}function Vp(e){return Kc(e&&e.start)+"-"+Kc(e&&e.end)}function Qp(e){return e&&typeof e=="number"?e:1}class Do extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Do.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const Ah={}.hasOwnProperty,PS=new Map,RS=/[A-Z]/g,LS=/-([a-z])/g,AS=new Set(["table","tbody","thead","tfoot","tr"]),IS=new Set(["td","th"]),nv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function DS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=BS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=US(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Rh:mS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=rv(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function rv(e,t,n){if(t.type==="element")return MS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $S(e,t,n);if(t.type==="mdxjsEsm")return _S(e,t);if(t.type==="root")return OS(e,t,n);if(t.type==="text")return FS(e,t)}function MS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Rh,e.schema=i),e.ancestors.push(t);const l=iv(e,t.tagName,!1),a=HS(e,t);let o=Dh(e,t);return AS.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!iS(u):!0})),sv(e,a,l,t),Ih(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function zS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ml(e,t.position)}function _S(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ml(e,t.position)}function $S(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Rh,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:iv(e,t.name,!0),a=WS(e,t),o=Dh(e,t);return sv(e,a,l,t),Ih(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function OS(e,t,n){const r={};return Ih(r,Dh(e,t)),e.create(t,e.Fragment,r,n)}function FS(e,t){return t.value}function sv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ih(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function US(e,t,n){return r;function r(i,l,a,o){const c=Array.isArray(a.children)?n:t;return o?c(l,a,o):c(l,a)}}function BS(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),u=Lh(r);return t(i,l,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function HS(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ah.call(t.properties,i)){const l=VS(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&IS.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function WS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ml(e,t.position);else{const{name:i}=r;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else ml(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Dh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:PS;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const c=i.get(u)||0;a=u+"-"+c,i.set(u,c+1)}}const o=rv(e,l,a);o!==void 0&&n.push(o)}return n}function VS(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=hS(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?eS(n):gS(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:qS(n):QS(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?uS[r.property]||r.property:r.attribute,n]}function QS(e,t){const n={};try{ES(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(LS,YS))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Do("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=nv+"#cannot-parse-style-attribute",l}return n}function iv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=$p(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=$p(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Ah.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ml(e)}function ml(e,t){const n=new Do("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=nv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function qS(e){const t={};let n;for(n in e)Ah.call(e,n)&&(t[GS(n)]=e[n]);return t}function GS(e){if(e.slice(0,2)==="--")return e;let t=e.replace(RS,KS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function KS(e){return"-"+e.toLowerCase()}function YS(e,t){return t.toUpperCase()}const Su={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},JS={};function Mo(e,t){const n=JS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return lv(e,r,i)}function lv(e,t,n){if(XS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qp(e.children,t,n)}return Array.isArray(e)?qp(e,t,n):""}function qp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=lv(e[i],t,n);return r.join("")}function XS(e){return!!(e&&typeof e=="object")}const Gp=document.createElement("i");function Mh(e){const t="&"+e+";";Gp.innerHTML=t;const n=Gp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function rn(e,t){return e.length>0?(yn(e,e.length,0,t),e):t}const Kp={}.hasOwnProperty;function av(e){const t={};let n=-1;for(;++n<e.length;)ZS(t,e[n]);return t}function ZS(e,t){let n;for(n in t){const i=(Kp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Kp.call(i,a)||(i[a]=[]);const o=l[a];eN(i[a],Array.isArray(o)?o:o?[o]:[])}}}function eN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yn(e,0,0,r)}function ov(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yt=Ir(/[A-Za-z]/),vt=Ir(/[\dA-Za-z]/),tN=Ir(/[#-'*+\--9=?A-Z^-~]/);function so(e){return e!==null&&(e<32||e===127)}const Yc=Ir(/\d/),nN=Ir(/[\dA-Fa-f]/),uv=Ir(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<-2}function Oe(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const Cl=Ir(new RegExp("\\p{P}|\\p{S}","u")),ls=Ir(/\s/);function Ir(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&vt(e.charCodeAt(n+1))&&vt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Le(e,t,n,r){const i=r?r-1:1/0;let l=0;return a;function a(u){return ve(u)?(e.enter(n),o(u)):t(u)}function o(u){return ve(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}function cv(e,t,n,r,i,l){let a=0;return o;function o(h){return ve(h)?(e.enter(r),u(h)):c(h)}function u(h){return ve(h)&&a<l?(e.consume(h),a++,u):(e.exit(r),c(h))}function c(h){return a>=i?t(h):n(h)}}const rN={tokenize:sN};function sN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Le(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return de(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}let io=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Yp(this,t,n,r,!1)}addBefore(t,n,r){Yp(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function Yp(e,t,n,r,i){if(n===0&&r.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const iN={tokenize:lN},Jp={tokenize:aN};function lN(e){const t=this,n=[];let r=0,i,l,a;return o;function o(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const b=t.events.length;let E=b,k;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){k=t.events[E][1].end;break}x(r);let R=b;for(;R<t.events.length;)t.events[R][1].end={...k},R++;const T=new io;return T.add(E+1,0,t.events.slice(b)),T.add(b,R-b,[]),T.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Jp,h,d)(v)}function h(v){return i&&y(),x(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(v)}function f(v){return t.containerState={},e.attempt(Jp,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function p(v){if(v===null){i&&y(),x(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),x(0),e.consume(v);return}return de(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,b){const E=t.sliceStream(v);if(b&&E.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(E),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const R=t.events.length;let T=R,D,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){C=t.events[T][1].end;break}D=!0}for(x(r),k=R;k<t.events.length;)t.events[k][1].end={...C},k++;const L=new io;L.add(T+1,0,t.events.slice(R)),L.add(R,k-R,[]),L.consume(t.events)}}function x(v){let b=n.length;for(;b-- >v;){const E=n[b];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function y(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function aN(e,t,n){return Le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function br(e){if(e===null||Oe(e)||ls(e))return 1;if(Cl(e))return 2}function zo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Jc={name:"attention",resolveAll:oN,tokenize:uN};function oN(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},o={...e[n][1].start};Xp(a,-l),Xp(o,l);const u={type:l>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},h={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},d={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=rn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=rn(r,[["enter",d,t],["enter",u,t],["exit",u,t],["enter",h,t]]),r=rn(r,zo(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=rn(r,[["exit",h,t],["enter",c,t],["exit",c,t],["exit",d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=rn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),yn(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=br(r);let l;return a;function a(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const c=e.exit("attentionSequence"),h=br(u),d=!h||h===2&&i||n.includes(u)&&u!==42&&u!==95,f=!i||i===2&&h||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?d:d&&(i||!f)),c._close=!!(l===42?f:f&&(h||!d)),t(u)}}function Xp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const cN={name:"autolink",tokenize:dN};function dN(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return yt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||vt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||vt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||so(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),h):tN(m)?(e.consume(m),c):n(m)}function h(m){return vt(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,h):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||vt(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const El={partial:!0,tokenize:hN};function hN(e,t,n){return r;function r(l){return ve(l)?Le(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||de(l)?t(l):n(l)}}const dv={continuation:{tokenize:pN},exit:mN,name:"blockQuote",tokenize:fN};function fN(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return ve(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function pN(e,t,n){const r=this;return i;function i(a){return ve(a)?Le(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(dv,t,n)(a)}}function mN(e){e.exit("blockQuote")}const hv={name:"characterEscape",tokenize:gN};function gN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return uv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const fv={name:"characterReference",tokenize:xN};function xN(e,t,n){const r=this;let i=0,l,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,a=vt,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=nN,h):(e.enter("characterReferenceValue"),l=7,a=Yc,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===vt&&!Mh(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<l?(e.consume(d),h):n(d)}}const Xc={partial:!0,tokenize:yN};function yN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Zp={concrete:!0,name:"codeFenced",tokenize:vN};function vN(e,t,n){const r=this,i={partial:!0,tokenize:E};let l=0,a=0,o;return u;function u(k){return c(k)}function c(k){const R=r.events[r.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===o?(a++,e.consume(k),h):a<3?n(k):(e.exit("codeFencedFenceSequence"),ve(k)?Le(e,d,"whitespace")(k):d(k))}function d(k){return k===null||de(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(Xc,g,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):ve(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Le(e,m,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),f)}function m(k){return k===null||de(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||de(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===o?n(k):(e.consume(k),p)}function g(k){return e.attempt(i,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return l>0&&ve(k)?Le(e,y,"linePrefix",l+1)(k):y(k)}function y(k){return k===null||de(k)?e.check(Xc,g,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||de(k)?(e.exit("codeFlowValue"),y(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function E(k,R,T){let D=0;return C;function C(I){return k.enter("lineEnding"),k.consume(I),k.exit("lineEnding"),L}function L(I){return k.enter("codeFencedFence"),ve(I)?Le(k,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):A(I)}function A(I){return I===o?(k.enter("codeFencedFenceSequence"),z(I)):T(I)}function z(I){return I===o?(D++,k.consume(I),z):D>=a?(k.exit("codeFencedFenceSequence"),ve(I)?Le(k,U,"whitespace")(I):U(I)):T(I)}function U(I){return I===null||de(I)?(k.exit("codeFencedFence"),R(I)):T(I)}}}const Nu={name:"codeIndented",tokenize:wN},jN={partial:!0,tokenize:kN};function wN(e,t,n){return r;function r(o){return e.enter("codeIndented"),cv(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?a(o):de(o)?e.attempt(jN,i,a)(o):(e.enter("codeFlowValue"),l(o))}function l(o){return o===null||de(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),l)}function a(o){return e.exit("codeIndented"),t(o)}}function kN(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):de(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):cv(e,t,l,"linePrefix",4,4)(a)}function l(a){return de(a)?i(a):n(a)}}const bN={name:"codeText",previous:NN,resolve:SN,tokenize:CN};function SN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function NN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CN(e,t,n){let r=0,i,l;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(l=e.enter("codeTextSequence"),i=0,h(d)):de(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||de(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",c(d))}}class EN{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function pv(e){const t={};let n=-1,r,i,l,a,o,u,c;const h=new EN(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,TN(h,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=h.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return yn(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function TN(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],c={};let h,d,f=-1,m=n,p=0,g=0;const w=[g];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(g=f+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),f=w.length;f--;){const x=o.slice(w[f],w[f+1]),y=l.pop();u.push([y,y+x.length-1]),e.splice(y,2,x)}for(u.reverse(),f=-1;++f<u.length;)c[p+u[f][0]]=p+u[f][1],p+=u[f][1]-u[f][0]-1;return c}const PN={resolve:LN,tokenize:AN},RN={partial:!0,tokenize:IN};function LN(e){return pv(e),e}function AN(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):de(o)?e.check(RN,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function IN(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Le(e,l,"linePrefix")}function l(a){if(a===null||de(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function mv(e,t,n,r,i,l,a,o,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),f):x===null||x===32||x===41||so(x)?n(x):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(x))}function f(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(o),f(x)):x===null||x===60||de(x)?n(x):(e.consume(x),x===92?p:m)}function p(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function g(x){return!h&&(x===null||x===41||Oe(x))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(x)):h<c&&x===40?(e.consume(x),h++,g):x===41?(e.consume(x),h--,g):x===null||x===32||x===40||so(x)?n(x):(e.consume(x),x===92?w:g)}function w(x){return x===40||x===41||x===92?(e.consume(x),g):g(x)}}function gv(e,t,n,r,i,l){const a=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),h}function h(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):de(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||de(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),u||(u=!ve(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function xv(e,t,n,r,i,l){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,u):n(f)}function u(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(l),c(f))}function c(f){return f===a?(e.exit(l),u(a)):f===null?n(f):de(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||de(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Vi(e,t){let n;return r;function r(i){return de(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?Le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const DN={name:"definition",tokenize:zN},MN={partial:!0,tokenize:_N};function zN(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return gv.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Oe(m)?Vi(e,c)(m):c(m)}function c(m){return mv(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(MN,d,d)(m)}function d(m){return ve(m)?Le(e,f,"whitespace")(m):f(m)}function f(m){return m===null||de(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function _N(e,t,n){return r;function r(o){return Oe(o)?Vi(e,i)(o):n(o)}function i(o){return xv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return ve(o)?Le(e,a,"whitespace")(o):a(o)}function a(o){return o===null||de(o)?t(o):n(o)}}const $N={name:"hardBreakEscape",tokenize:ON};function ON(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return de(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const FN={name:"headingAtx",resolve:UN,tokenize:BN};function UN(e,t){let n=e.length-2,r=3;if(e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};yn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function BN(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Oe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||de(h)?(e.exit("atxHeading"),t(h)):ve(h)?Le(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Oe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const yv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Zc=["pre","script","style","textarea"],HN={concrete:!0,name:"htmlFlow",resolveTo:VN,tokenize:QN},WN={partial:!0,tokenize:qN};function VN(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function QN(e,t,n){const r=this;let i,l,a,o,u;return c;function c(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),l=!0,g):N===63?(e.consume(N),i=3,r.interrupt?t:S):yt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function f(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,o=0,p):yt(N)?(e.consume(N),i=4,r.interrupt?t:S):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:S):n(N)}function p(N){const F="CDATA[";return N===F.charCodeAt(o++)?(e.consume(N),o===F.length?r.interrupt?t:A:p):n(N)}function g(N){return yt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Oe(N)){const F=N===47,Z=a.toLowerCase();return!F&&!l&&Zc.includes(Z)?(i=1,r.interrupt?t(N):A(N)):yv.includes(a.toLowerCase())?(i=6,F?(e.consume(N),x):r.interrupt?t(N):A(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):l?y(N):v(N))}return N===45||vt(N)?(e.consume(N),a+=String.fromCharCode(N),w):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:A):n(N)}function y(N){return ve(N)?(e.consume(N),y):C(N)}function v(N){return N===47?(e.consume(N),C):N===58||N===95||yt(N)?(e.consume(N),b):ve(N)?(e.consume(N),v):C(N)}function b(N){return N===45||N===46||N===58||N===95||vt(N)?(e.consume(N),b):E(N)}function E(N){return N===61?(e.consume(N),k):ve(N)?(e.consume(N),E):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,R):ve(N)?(e.consume(N),k):T(N)}function R(N){return N===u?(e.consume(N),u=null,D):N===null||de(N)?n(N):(e.consume(N),R)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Oe(N)?E(N):(e.consume(N),T)}function D(N){return N===47||N===62||ve(N)?v(N):n(N)}function C(N){return N===62?(e.consume(N),L):n(N)}function L(N){return N===null||de(N)?A(N):ve(N)?(e.consume(N),L):n(N)}function A(N){return N===45&&i===2?(e.consume(N),Q):N===60&&i===1?(e.consume(N),J):N===62&&i===4?(e.consume(N),ae):N===63&&i===3?(e.consume(N),S):N===93&&i===5?(e.consume(N),X):de(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(WN,O,z)(N)):N===null||de(N)?(e.exit("htmlFlowData"),z(N)):(e.consume(N),A)}function z(N){return e.check(Xc,U,O)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),I}function I(N){return N===null||de(N)?z(N):(e.enter("htmlFlowData"),A(N))}function Q(N){return N===45?(e.consume(N),S):A(N)}function J(N){return N===47?(e.consume(N),a="",H):A(N)}function H(N){if(N===62){const F=a.toLowerCase();return Zc.includes(F)?(e.consume(N),ae):A(N)}return yt(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),H):A(N)}function X(N){return N===93?(e.consume(N),S):A(N)}function S(N){return N===62?(e.consume(N),ae):N===45&&i===2?(e.consume(N),S):A(N)}function ae(N){return N===null||de(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),ae)}function O(N){return e.exit("htmlFlow"),t(N)}}function qN(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(El,t,n)}}const GN={name:"htmlText",tokenize:KN};function KN(e,t,n){const r=this;let i,l,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),E):S===63?(e.consume(S),v):yt(S)?(e.consume(S),T):n(S)}function c(S){return S===45?(e.consume(S),h):S===91?(e.consume(S),l=0,p):yt(S)?(e.consume(S),y):n(S)}function h(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),f):de(S)?(a=d,J(S)):(e.consume(S),d)}function f(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?Q(S):S===45?f(S):d(S)}function p(S){const ae="CDATA[";return S===ae.charCodeAt(l++)?(e.consume(S),l===ae.length?g:p):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),w):de(S)?(a=g,J(S)):(e.consume(S),g)}function w(S){return S===93?(e.consume(S),x):g(S)}function x(S){return S===62?Q(S):S===93?(e.consume(S),x):g(S)}function y(S){return S===null||S===62?Q(S):de(S)?(a=y,J(S)):(e.consume(S),y)}function v(S){return S===null?n(S):S===63?(e.consume(S),b):de(S)?(a=v,J(S)):(e.consume(S),v)}function b(S){return S===62?Q(S):v(S)}function E(S){return yt(S)?(e.consume(S),k):n(S)}function k(S){return S===45||vt(S)?(e.consume(S),k):R(S)}function R(S){return de(S)?(a=R,J(S)):ve(S)?(e.consume(S),R):Q(S)}function T(S){return S===45||vt(S)?(e.consume(S),T):S===47||S===62||Oe(S)?D(S):n(S)}function D(S){return S===47?(e.consume(S),Q):S===58||S===95||yt(S)?(e.consume(S),C):de(S)?(a=D,J(S)):ve(S)?(e.consume(S),D):Q(S)}function C(S){return S===45||S===46||S===58||S===95||vt(S)?(e.consume(S),C):L(S)}function L(S){return S===61?(e.consume(S),A):de(S)?(a=L,J(S)):ve(S)?(e.consume(S),L):D(S)}function A(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,z):de(S)?(a=A,J(S)):ve(S)?(e.consume(S),A):(e.consume(S),U)}function z(S){return S===i?(e.consume(S),i=void 0,I):S===null?n(S):de(S)?(a=z,J(S)):(e.consume(S),z)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Oe(S)?D(S):(e.consume(S),U)}function I(S){return S===47||S===62||Oe(S)?D(S):n(S)}function Q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function J(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),H}function H(S){return ve(S)?Le(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):X(S)}function X(S){return e.enter("htmlTextData"),a(S)}}const zh={name:"labelEnd",resolveAll:ZN,resolveTo:eC,tokenize:tC},YN={tokenize:nC},JN={tokenize:rC},XN={tokenize:sC};function ZN(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&yn(e,0,e.length,n),e}function eC(e,t){let n=e.length,r=0,i,l,a;for(;n--;){const h=e[n][1];if(i){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[n][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(i=n,h.type!=="labelLink")){r=2;break}}else h.type==="labelEnd"&&(l=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",o,t],["enter",u,t]],a=rn(a,e.slice(i+1,i+r+3)),a=rn(a,[["enter",c,t]]),a=rn(a,zo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),a=rn(a,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),a=rn(a,e.slice(l+1)),a=rn(a,[["exit",o,t]]),yn(e,i,e.length,a),e}function tC(e,t,n){const r=this,i=r._labelStarts;let l,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return o;function o(f){return l?l._inactive?d(f):(a=r.parser.defined.includes(vn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(YN,h,a?h:d)(f):f===91?e.attempt(JN,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(XN,h,d)(f)}function h(f){return i.pop(),t(f)}function d(f){return l._balanced=!0,n(f)}}function nC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Oe(d)?Vi(e,l)(d):l(d)}function l(d){return d===41?h(d):mv(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Oe(d)?Vi(e,u)(d):h(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?xv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Oe(d)?Vi(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function rC(e,t,n){const r=this;return i;function i(o){return gv.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function sC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const iC={name:"labelStartImage",resolveAll:zh.resolveAll,tokenize:lC};function lC(e,t,n){const r=this;let i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const aC={name:"labelStartLink",resolveAll:zh.resolveAll,tokenize:oC};function oC(e,t,n){const r=this;let i;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Cu={name:"lineEnding",tokenize:uC};function uC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Le(e,t,"linePrefix")}}const Ca={name:"thematicBreak",tokenize:cC};function cC(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||de(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),ve(c)?Le(e,o,"whitespace")(c):o(c))}}const At={continuation:{tokenize:pC},exit:gC,name:"list",tokenize:fC},dC={partial:!0,tokenize:xC},hC={partial:!0,tokenize:mC};function fC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Yc(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ca,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Yc(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(El,r.interrupt?n:h,e.attempt(dC,f,d))}function h(m){return r.containerState.initialBlankLine=!0,l++,f(m)}function d(m){return ve(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function pC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(El,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Le(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!ve(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hC,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Le(e,e.attempt(At,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function mC(e,t,n){const r=this;return Le(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function gC(e){e.exit(this.containerState.type)}function xC(e,t,n){const r=this;return Le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!ve(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const em={name:"setextUnderline",resolveTo:yC,tokenize:vC};function yC(e,t){const n=new io;let r=e.length,i,l,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",a?(n.add(l,0,[["enter",o,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function vC(e,t,n){const r=this;let i;return l;function l(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),ve(c)?Le(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||de(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const jC={tokenize:wC};function wC(e){const t=this,n=e.attempt(El,r,e.attempt(this.parser.constructs.flowInitial,i,Le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(PN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const kC={resolveAll:jv()},bC=vv("string"),SC=vv("text");function vv(e){return{resolveAll:jv(e==="text"?NC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(h){return c(h)?l(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function jv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function NC(e,t){const n=new io;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let a=l.length,o=-1,u=0,c;for(;a--;){const h=l[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)c=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const h={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):n.add(r,0,[["enter",h,t],["exit",h,t]])}r++}return n.consume(e),e}const CC={42:At,43:At,45:At,48:At,49:At,50:At,51:At,52:At,53:At,54:At,55:At,56:At,57:At,62:dv},EC={91:DN},TC={[-2]:Nu,[-1]:Nu,32:Nu},PC={35:FN,42:Ca,45:[em,Ca],60:HN,61:em,95:Ca,96:Zp,126:Zp},RC={38:fv,92:hv},LC={[-5]:Cu,[-4]:Cu,[-3]:Cu,33:iC,38:fv,42:Jc,60:[cN,GN],91:aC,92:[$N,hv],93:zh,95:Jc,96:bN},AC={null:[Jc,kC]},IC={null:[42,95]},DC={null:[]},MC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IC,contentInitial:EC,disable:DC,document:CC,flow:PC,flowInitial:TC,insideSpan:AC,string:RC,text:LC},Symbol.toStringTag,{value:"Module"}));function zC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const u={attempt:R(E),check:R(k),consume:y,enter:v,exit:b,interrupt:R(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&l.push(t),c;function d(L){return a=rn(a,L),w(),a[a.length-1]!==null?[]:(T(t,0),c.events=zo(l,c.events,c),c.events)}function f(L,A){return $C(m(L),A)}function m(L){return _C(a,L)}function p(){const{_bufferIndex:L,_index:A,line:z,column:U,offset:I}=r;return{_bufferIndex:L,_index:A,line:z,column:U,offset:I}}function g(L){i[L.line]=L.column,C()}function w(){for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string"){const A=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex))}else x(L)}}function x(L){h=h(L)}function y(L){de(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,C()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function v(L,A){const z=A||{};return z.type=L,z.start=p(),c.events.push(["enter",z,c]),o.push(z),z}function b(L){const A=o.pop();return A.end=p(),c.events.push(["exit",A,c]),A}function E(L,A){T(L,A.from)}function k(L,A){A.restore()}function R(L,A){return z;function z(U,I,Q){let J,H,X,S;return Array.isArray(U)?O(U):"tokenize"in U?O([U]):ae(U);function ae(oe){return B;function B(he){const ze=he!==null&&oe[he],Ke=he!==null&&oe.null,W=[...Array.isArray(ze)?ze:ze?[ze]:[],...Array.isArray(Ke)?Ke:Ke?[Ke]:[]];return O(W)(he)}}function O(oe){return J=oe,H=0,oe.length===0?Q:N(oe[H])}function N(oe){return B;function B(he){return S=D(),X=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?Z():oe.tokenize.call(A?Object.assign(Object.create(c),A):c,u,F,Z)(he)}}function F(oe){return L(X,S),I}function Z(oe){return S.restore(),++H<J.length?N(J[H]):Q}}}function T(L,A){L.resolveAll&&!l.includes(L)&&l.push(L),L.resolve&&yn(c.events,A,c.events.length-A,L.resolve(c.events.slice(A),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function D(){const L=p(),A=c.previous,z=c.currentConstruct,U=c.events.length,I=Array.from(o);return{from:U,restore:Q};function Q(){r=L,c.previous=A,c.currentConstruct=z,c.events.length=U,o=I,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _C(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function $C(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
362
362
  `;break}case-3:{a=`\r
363
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function zC(e){const r={constructs:lv([LC,...(e||{}).extensions||[]]),content:i(eN),defined:[],document:i(nN),flow:i(xC),lazy:{},string:i(jC),text:i(wC)};return r;function i(l){return a;function a(o){return IC(r,l,o)}}}function _C(e){for(;!fv(e););return e}const tm=/[\0\t\n\r]/g;function $C(){let e=1,t="",n=!0,r;return i;function i(l,a,o){l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l));const u=[];let c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){tm.lastIndex=c;const h=tm.exec(l),d=h&&h.index!==void 0?h.index:l.length,f=l.charCodeAt(d);if(!h){t=l.slice(c);break}if(f===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),f){case 0:{u.push(65533),e++;break}case 9:{const m=Math.ceil(e/4)*4;for(u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const OC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function FC(e){return e.replace(OC,UC)}function UC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return av(n.slice(l?2:1),l?16:10)}return Mh(n)||e}const jv={}.hasOwnProperty;function BC(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),HC(n)(_C(zC(n).document().write($C()(e,t,!0))))}function HC(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Al),autolinkProtocol:N,autolinkEmail:N,atxHeading:a(ee),blockQuote:a(W),characterEscape:N,characterReference:N,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(Ze,o),codeTextData:N,data:N,codeFlowValue:N,definition:a(Xt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Zt),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(et,o),htmlFlowData:N,htmlText:a(et,o),htmlTextData:N,image:a(Lr),label:o,link:a(Al),listItem:a(Uo),listItemValue:m,listOrdered:a(Ll,f),listUnordered:a(Ll),paragraph:a(Dn),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ee),strong:a(Ir),thematicBreak:a(ci)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Ke,autolinkProtocol:ze,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:B,characterReference:he,codeFenced:c(x),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:c(y),codeText:c(Q),codeTextData:P,data:P,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(z),hardBreakTrailing:c(z),htmlFlow:c(U),htmlFlowData:P,htmlText:c(I),htmlTextData:P,image:c(H),label:S,labelText:X,lineEnding:A,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:ae,resourceTitleString:O,resource:C,setextHeading:c(D),setextHeadingLineSequence:T,setextHeadingText:L,strong:c(),thematicBreak:c()}};wv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let G={type:"root",children:[],position:void 0};const pe={stack:[G],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:d,data:n},me=[],kt=[];let Ce=-1;for(;++Ce<$.length;)if(kt.push($[Ce]),$[Ce][1].type==="listOrdered"||$[Ce][1].type==="listUnordered")if($[Ce][0]==="enter")me.push(kt.length-1);else{const pt=me.pop();l(kt,pt)}for($=kt,Ce=-1;++Ce<$.length;){const pt=t[$[Ce][0]];$[Ce][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1]),jv.call(pt,$[Ce][1].type)&&pt[$[Ce][1].type].call({...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1]),$[Ce][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1])}if(pe.tokenStack.length>0){const pt=pe.tokenStack[pe.tokenStack.length-1];(pt[1]||nm).call(pe,void 0,pt[0])}for(G.position={start:er($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:er($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)G=t.transforms[Ce](G)||G;return G}function i($,G,pe){let me=-1;for(;++me<$.length;)$[me].call(G,pe)}function l($,G){const pe=$.length-1;let me=G-1,kt=-1,Ce=!1,pt,Ut,Jn,Dr;const Xn=[];for(;++me<=pe;){const mt=$[me];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?kt++:kt--,Dr=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(pt&&!Dr&&!kt&&!Jn&&(Jn=me),Dr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dr=void 0}if(!kt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||kt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(pt){let Sn=me;for(Ut=void 0;Sn--;){const cn=$[Sn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;Ut&&($[Ut][1].type="lineEndingBlank",Ce=!0),cn[1].type="lineEnding",Ut=Sn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}Jn&&(!Ut||Jn<Ut)&&(pt._spread=!0),pt.end=Object.assign({},Ut?$[Ut][1].start:mt[1].end),Xn.push({at:Ut||me,event:["exit",pt,mt[2]]})}if(mt[1].type==="listItemPrefix"){const Sn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};pt=Sn,Xn.push({at:me,event:["enter",Sn,mt[2]]}),Jn=void 0,Dr=!0}}}const Mr=$.splice(G);let ps=0;for(me=-1;++me<Mr.length;){for(;ps<Xn.length&&Xn[ps].at===G+me;)$.push(Xn[ps++].event);$.push(Mr[me])}$[G][1]._spread=Ce}function a($,G){return pe;function pe(me){u.call(this,$(me),me),G&&G.call(this,me)}}function o(){this.stack.push({type:"fragment",children:[]})}function u($,G,pe){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([G,pe||void 0]),$.position={start:er(G.start),end:void 0}}function c($){return G;function G(pe){$&&$.call(this,pe),h.call(this,pe)}}function h($,G){const pe=this.stack.pop(),me=this.tokenStack.pop();if(!me)throw new Error("Cannot close `"+$.type+"` ("+Wi({start:$.start,end:$.end})+"): it’s not open");me[0].type!==$.type&&(G?G.call(this,$,me[0]):(me[1]||nm).call(this,$,me[0])),pe.position.end=er($.end)}function d(){return Io(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m($){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function p(){const $=this.resume(),G=this.stack[this.stack.length-1];G.lang=$}function g(){const $=this.resume(),G=this.stack[this.stack.length-1];G.meta=$}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/(\r?\n|\r)$/g,"")}function v($){const G=this.resume(),pe=this.stack[this.stack.length-1];pe.label=G,pe.identifier=vn(this.sliceSerialize($)).toLowerCase()}function b(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function E(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function k($){const G=this.stack[this.stack.length-1];if(!G.depth){const pe=this.sliceSerialize($).length;G.depth=pe}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function T($){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function N($){const pe=this.stack[this.stack.length-1].children;let me=pe[pe.length-1];(!me||me.type!=="text")&&(me=Il(),me.position={start:er($.start),end:void 0},pe.push(me)),this.stack.push(me)}function P($){const G=this.stack.pop();G.value+=this.sliceSerialize($),G.position.end=er($.end)}function A($){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=G.children[G.children.length-1];pe.position.end=er($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(N.call(this,$),P.call(this,$))}function z(){this.data.atHardBreak=!0}function U(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function I(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function Q(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function J(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function H(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function X($){const G=this.sliceSerialize($),pe=this.stack[this.stack.length-2];pe.label=FC(G),pe.identifier=vn(G).toLowerCase()}function S(){const $=this.stack[this.stack.length-1],G=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const me=$.children;pe.children=me}else pe.alt=G}function ae(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function O(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function C(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Z($){const G=this.resume(),pe=this.stack[this.stack.length-1];pe.label=G,pe.identifier=vn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function oe($){this.data.characterReferenceType=$.type}function B($){const G=this.sliceSerialize($),pe=this.data.characterReferenceType;let me;pe?(me=av(G,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=Mh(G);const kt=this.stack[this.stack.length-1];kt.value+=me}function he($){const G=this.stack.pop();G.position.end=er($.end)}function ze($){P.call(this,$);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize($)}function Ke($){P.call(this,$);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize($)}function W(){return{type:"blockquote",children:[],position:void 0}}function fe(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ze(){return{type:"inlineCode",value:"",position:void 0}}function Xt(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Zt(){return{type:"emphasis",children:[],position:void 0}}function ee(){return{type:"heading",depth:0,children:[],position:void 0}}function Ne(){return{type:"break",position:void 0}}function et(){return{type:"html",value:"",position:void 0}}function Lr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Al(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Ll($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[],position:void 0}}function Uo($){return{type:"listItem",spread:$._spread,checked:null,children:[],position:void 0}}function Dn(){return{type:"paragraph",children:[],position:void 0}}function Ir(){return{type:"strong",children:[],position:void 0}}function Il(){return{type:"text",value:"",position:void 0}}function ci(){return{type:"thematicBreak",position:void 0}}}function er(e){return{line:e.line,column:e.column,offset:e.offset}}function wv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?wv(e,r):WC(e,r)}}function WC(e,t){let n;for(n in t)if(jv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function VC(e){const t=this;t.parser=n;function n(r){return BC(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function QC(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
364
- `}]}function GC(e,t){const n=t.value?t.value+`
365
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function KC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JC(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=oi(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function XC(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZC(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function eE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kv(e,t);const i={src:oi(r.url||"")};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function tE(e,t){const n={src:oi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function nE(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function rE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kv(e,t);const i={href:oi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function sE(e,t){const n={href:oi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iE(e,t,n){const r=e.all(t),i=n?lE(n):bv(t),l={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
363
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function OC(e){const r={constructs:av([MC,...(e||{}).extensions||[]]),content:i(rN),defined:[],document:i(iN),flow:i(jC),lazy:{},string:i(bC),text:i(SC)};return r;function i(l){return a;function a(o){return zC(r,l,o)}}}function FC(e){for(;!pv(e););return e}const tm=/[\0\t\n\r]/g;function UC(){let e=1,t="",n=!0,r;return i;function i(l,a,o){l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l));const u=[];let c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){tm.lastIndex=c;const h=tm.exec(l),d=h&&h.index!==void 0?h.index:l.length,f=l.charCodeAt(d);if(!h){t=l.slice(c);break}if(f===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),f){case 0:{u.push(65533),e++;break}case 9:{const m=Math.ceil(e/4)*4;for(u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const BC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HC(e){return e.replace(BC,WC)}function WC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return ov(n.slice(l?2:1),l?16:10)}return Mh(n)||e}const wv={}.hasOwnProperty;function VC(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),QC(n)(FC(OC(n).document().write(UC()(e,t,!0))))}function QC(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ll),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(ee),blockQuote:a(W),characterEscape:C,characterReference:C,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(Ze,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(Zt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(en),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(et,o),htmlFlowData:C,htmlText:a(et,o),htmlTextData:C,image:a(Dr),label:o,link:a(Ll),listItem:a(Ho),listItemValue:m,listOrdered:a(Al,f),listUnordered:a(Al),paragraph:a(Mn),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ee),strong:a(Mr),thematicBreak:a(ci)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Ke,autolinkProtocol:ze,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:B,characterReference:he,codeFenced:c(x),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:L,codeIndented:c(y),codeText:c(Q),codeTextData:L,data:L,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(z),hardBreakTrailing:c(z),htmlFlow:c(U),htmlFlowData:L,htmlText:c(I),htmlTextData:L,image:c(H),label:S,labelText:X,lineEnding:A,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:ae,resourceTitleString:O,resource:N,setextHeading:c(D),setextHeadingLineSequence:T,setextHeadingText:R,strong:c(),thematicBreak:c()}};kv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let G={type:"root",children:[],position:void 0};const pe={stack:[G],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:d,data:n},me=[],kt=[];let Ce=-1;for(;++Ce<$.length;)if(kt.push($[Ce]),$[Ce][1].type==="listOrdered"||$[Ce][1].type==="listUnordered")if($[Ce][0]==="enter")me.push(kt.length-1);else{const pt=me.pop();l(kt,pt)}for($=kt,Ce=-1;++Ce<$.length;){const pt=t[$[Ce][0]];$[Ce][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1]),wv.call(pt,$[Ce][1].type)&&pt[$[Ce][1].type].call({...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1]),$[Ce][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...pe,sliceSerialize:$[Ce][2].sliceSerialize},$[Ce][1])}if(pe.tokenStack.length>0){const pt=pe.tokenStack[pe.tokenStack.length-1];(pt[1]||nm).call(pe,void 0,pt[0])}for(G.position={start:er($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:er($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)G=t.transforms[Ce](G)||G;return G}function i($,G,pe){let me=-1;for(;++me<$.length;)$[me].call(G,pe)}function l($,G){const pe=$.length-1;let me=G-1,kt=-1,Ce=!1,pt,Ut,Jn,zr;const Xn=[];for(;++me<=pe;){const mt=$[me];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?kt++:kt--,zr=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(pt&&!zr&&!kt&&!Jn&&(Jn=me),zr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zr=void 0}if(!kt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||kt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(pt){let Sn=me;for(Ut=void 0;Sn--;){const cn=$[Sn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;Ut&&($[Ut][1].type="lineEndingBlank",Ce=!0),cn[1].type="lineEnding",Ut=Sn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}Jn&&(!Ut||Jn<Ut)&&(pt._spread=!0),pt.end=Object.assign({},Ut?$[Ut][1].start:mt[1].end),Xn.push({at:Ut||me,event:["exit",pt,mt[2]]})}if(mt[1].type==="listItemPrefix"){const Sn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};pt=Sn,Xn.push({at:me,event:["enter",Sn,mt[2]]}),Jn=void 0,zr=!0}}}const _r=$.splice(G);let ms=0;for(me=-1;++me<_r.length;){for(;ms<Xn.length&&Xn[ms].at===G+me;)$.push(Xn[ms++].event);$.push(_r[me])}$[G][1]._spread=Ce}function a($,G){return pe;function pe(me){u.call(this,$(me),me),G&&G.call(this,me)}}function o(){this.stack.push({type:"fragment",children:[]})}function u($,G,pe){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([G,pe||void 0]),$.position={start:er(G.start),end:void 0}}function c($){return G;function G(pe){$&&$.call(this,pe),h.call(this,pe)}}function h($,G){const pe=this.stack.pop(),me=this.tokenStack.pop();if(!me)throw new Error("Cannot close `"+$.type+"` ("+Wi({start:$.start,end:$.end})+"): it’s not open");me[0].type!==$.type&&(G?G.call(this,$,me[0]):(me[1]||nm).call(this,$,me[0])),pe.position.end=er($.end)}function d(){return Mo(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m($){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function p(){const $=this.resume(),G=this.stack[this.stack.length-1];G.lang=$}function g(){const $=this.resume(),G=this.stack[this.stack.length-1];G.meta=$}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$.replace(/(\r?\n|\r)$/g,"")}function v($){const G=this.resume(),pe=this.stack[this.stack.length-1];pe.label=G,pe.identifier=vn(this.sliceSerialize($)).toLowerCase()}function b(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function E(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function k($){const G=this.stack[this.stack.length-1];if(!G.depth){const pe=this.sliceSerialize($).length;G.depth=pe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function T($){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function C($){const pe=this.stack[this.stack.length-1].children;let me=pe[pe.length-1];(!me||me.type!=="text")&&(me=Il(),me.position={start:er($.start),end:void 0},pe.push(me)),this.stack.push(me)}function L($){const G=this.stack.pop();G.value+=this.sliceSerialize($),G.position.end=er($.end)}function A($){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=G.children[G.children.length-1];pe.position.end=er($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(C.call(this,$),L.call(this,$))}function z(){this.data.atHardBreak=!0}function U(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function I(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function Q(){const $=this.resume(),G=this.stack[this.stack.length-1];G.value=$}function J(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function H(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=G,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function X($){const G=this.sliceSerialize($),pe=this.stack[this.stack.length-2];pe.label=HC(G),pe.identifier=vn(G).toLowerCase()}function S(){const $=this.stack[this.stack.length-1],G=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const me=$.children;pe.children=me}else pe.alt=G}function ae(){const $=this.resume(),G=this.stack[this.stack.length-1];G.url=$}function O(){const $=this.resume(),G=this.stack[this.stack.length-1];G.title=$}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Z($){const G=this.resume(),pe=this.stack[this.stack.length-1];pe.label=G,pe.identifier=vn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function oe($){this.data.characterReferenceType=$.type}function B($){const G=this.sliceSerialize($),pe=this.data.characterReferenceType;let me;pe?(me=ov(G,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=Mh(G);const kt=this.stack[this.stack.length-1];kt.value+=me}function he($){const G=this.stack.pop();G.position.end=er($.end)}function ze($){L.call(this,$);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize($)}function Ke($){L.call(this,$);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize($)}function W(){return{type:"blockquote",children:[],position:void 0}}function fe(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function Ze(){return{type:"inlineCode",value:"",position:void 0}}function Zt(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function en(){return{type:"emphasis",children:[],position:void 0}}function ee(){return{type:"heading",depth:0,children:[],position:void 0}}function Ne(){return{type:"break",position:void 0}}function et(){return{type:"html",value:"",position:void 0}}function Dr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Ll(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Al($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[],position:void 0}}function Ho($){return{type:"listItem",spread:$._spread,checked:null,children:[],position:void 0}}function Mn(){return{type:"paragraph",children:[],position:void 0}}function Mr(){return{type:"strong",children:[],position:void 0}}function Il(){return{type:"text",value:"",position:void 0}}function ci(){return{type:"thematicBreak",position:void 0}}}function er(e){return{line:e.line,column:e.column,offset:e.offset}}function kv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?kv(e,r):qC(e,r)}}function qC(e,t){let n;for(n in t)if(wv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function GC(e){const t=this;t.parser=n;function n(r){return VC(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KC(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function YC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
364
+ `}]}function JC(e,t){const n=t.value?t.value+`
365
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function XC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eE(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=oi(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function tE(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nE(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function rE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bv(e,t);const i={src:oi(r.url||"")};t.alt!==null&&t.alt!==void 0&&(i.alt=t.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function sE(e,t){const n={src:oi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function iE(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function lE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return bv(e,t);const i={href:oi(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function aE(e,t){const n={href:oi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oE(e,t,n){const r=e.all(t),i=n?uE(n):Sv(t),l={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
366
366
  `}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
367
- `});const c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)}function lE(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const{children:n}=e;let r=-1;for(;!t&&++r<n.length;)t=bv(n[r])}return t}function bv(e){const{spread:t}=e;return t??e.children.length>1}function aE(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function oE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function cE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ah(t.children[1]),u=Zy(t.children[t.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function hE(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const d=t.children[u],f={},m=a?a[u]:void 0;m&&(f.align=m);let p={type:"element",tagName:l,properties:f,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function fE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rm=9,sm=32;function pE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(im(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(im(t.slice(i),i>0,!1)),l.join("")}function im(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===rm||l===sm;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===rm||l===sm;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function mE(e,t){const n={type:"text",value:pE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function gE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xE={blockquote:QC,break:qC,code:GC,delete:KC,emphasis:YC,footnoteReference:JC,heading:XC,html:ZC,imageReference:eE,image:tE,inlineCode:nE,linkReference:rE,link:sE,listItem:iE,list:aE,paragraph:oE,root:uE,strong:cE,table:dE,tableCell:fE,tableRow:hE,text:mE,thematicBreak:gE,toml:ra,yaml:ra,definition:ra,footnoteDefinition:ra};function ra(){}const Sv=-1,Mo=0,Qi=1,io=2,_h=3,$h=4,Oh=5,Fh=6,Nv=7,Cv=8,{defineProperty:yE}=Object,Ev=typeof self=="object"?self:globalThis,lm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ev[e](t)},vE=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case Mo:case Sv:return n(a,i);case Qi:{const o=n([],i);for(const u of a)o.push(r(u));return o}case io:{const o=n({},i);for(const[u,c]of a){const h=r(u),d=r(c);h==="__proto__"?yE(o,h,{value:d,configurable:!0,enumerable:!0,writable:!0}):o[h]=d}return o}case _h:return n(new Date(a),i);case $h:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Oh:{const o=n(new Map,i);for(const[u,c]of a)o.set(r(u),r(c));return o}case Fh:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Nv:{const{name:o,message:u}=a;return n(typeof Ev[o]=="function"?lm(o,u):new Error(u),i)}case Cv:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(lm(l,a),i)};return r},am=e=>vE(new Map,e)(0),Fr="",{toString:jE}={},{keys:wE,is:kE}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[Mo,t];const n=jE.call(e).slice(8,-1);switch(n){case"Array":return[Qi,Fr];case"Object":return[io,Fr];case"Date":return[_h,Fr];case"RegExp":return[$h,Fr];case"Map":return[Oh,Fr];case"Set":return[Fh,Fr];case"DataView":return[Qi,n]}return n.includes("Array")?[Qi,n]:e instanceof Error?[Nv,e.name||"Error"]:[io,n]},sa=([e,t])=>e===Mo&&(t==="function"||t==="symbol"),bE=(e,t,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},l=a=>{if(n.has(a))return n.get(a);let[o,u]=Ei(a);switch(o){case Mo:{let h=a;switch(u){case"bigint":o=Cv,h=a.toString();break;case"number":if(!a&&kE(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([Sv],a)}return i([o,h],a)}case Qi:{if(u){let f=a;return u==="DataView"?f=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(a)),i([u,[...f]],a)}const h=[],d=i([o,h],a);for(const f of a)h.push(l(f));return d}case io:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const h=[],d=i([o,h],a);for(const f of wE(a))(e||!sa(Ei(a[f])))&&h.push([l(f),l(a[f])]);return d}case _h:return i([o,isNaN(a.getTime())?Fr:a.toISOString()],a);case $h:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case Oh:{const h=[],d=i([o,h],a);for(const[f,m]of a)(e||!(sa(Ei(f))||sa(Ei(m))))&&h.push([l(f),l(m)]);return d}case Fh:{const h=[],d=i([o,h],a);for(const f of a)(e||!sa(Ei(f)))&&h.push(l(f));return d}}const{message:c}=a;return i([o,{name:u,message:c}],a)};return l},om=(e,{json:t,lossy:n}={})=>{const r=[];return bE(!(t||n),!!t,new Map,r)(e),r},lo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?am(om(e,t)):structuredClone(e):(e,t)=>am(om(e,t));function SE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function NE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function CE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||SE,r=e.options.footnoteBackLabel||NE,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],u=[];let c=-1;for(;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);h&&(o[c]=e.all(h))}for(c=-1;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);if(!h)continue;const d=o[c],f=String(h.identifier).toUpperCase(),m=oi(f.toLowerCase());let p=0;const g=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++p<=w;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(h,y),u.push(y)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...lo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
367
+ `});const c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)}function uE(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const{children:n}=e;let r=-1;for(;!t&&++r<n.length;)t=Sv(n[r])}return t}function Sv(e){const{spread:t}=e;return t??e.children.length>1}function cE(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function dE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pE(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Lh(t.children[1]),u=ev(t.children[t.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function mE(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let u=-1;const c=[];for(;++u<o;){const d=t.children[u],f={},m=a?a[u]:void 0;m&&(f.align=m);let p={type:"element",tagName:l,properties:f,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function gE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const rm=9,sm=32;function xE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(im(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(im(t.slice(i),i>0,!1)),l.join("")}function im(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===rm||l===sm;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===rm||l===sm;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function yE(e,t){const n={type:"text",value:xE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const jE={blockquote:KC,break:YC,code:JC,delete:XC,emphasis:ZC,footnoteReference:eE,heading:tE,html:nE,imageReference:rE,image:sE,inlineCode:iE,linkReference:lE,link:aE,listItem:oE,list:cE,paragraph:dE,root:hE,strong:fE,table:pE,tableCell:gE,tableRow:mE,text:yE,thematicBreak:vE,toml:ra,yaml:ra,definition:ra,footnoteDefinition:ra};function ra(){}const Nv=-1,_o=0,Qi=1,lo=2,_h=3,$h=4,Oh=5,Fh=6,Cv=7,Ev=8,{defineProperty:wE}=Object,Tv=typeof self=="object"?self:globalThis,lm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Tv[e](t)},kE=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case _o:case Nv:return n(a,i);case Qi:{const o=n([],i);for(const u of a)o.push(r(u));return o}case lo:{const o=n({},i);for(const[u,c]of a){const h=r(u),d=r(c);h==="__proto__"?wE(o,h,{value:d,configurable:!0,enumerable:!0,writable:!0}):o[h]=d}return o}case _h:return n(new Date(a),i);case $h:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Oh:{const o=n(new Map,i);for(const[u,c]of a)o.set(r(u),r(c));return o}case Fh:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case Cv:{const{name:o,message:u}=a;return n(typeof Tv[o]=="function"?lm(o,u):new Error(u),i)}case Ev:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}case"-0":return-0}return n(lm(l,a),i)};return r},am=e=>kE(new Map,e)(0),Br="",{toString:bE}={},{keys:SE,is:NE}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[_o,t];const n=bE.call(e).slice(8,-1);switch(n){case"Array":return[Qi,Br];case"Object":return[lo,Br];case"Date":return[_h,Br];case"RegExp":return[$h,Br];case"Map":return[Oh,Br];case"Set":return[Fh,Br];case"DataView":return[Qi,n]}return n.includes("Array")?[Qi,n]:e instanceof Error?[Cv,e.name||"Error"]:[lo,n]},sa=([e,t])=>e===_o&&(t==="function"||t==="symbol"),CE=(e,t,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},l=a=>{if(n.has(a))return n.get(a);let[o,u]=Ei(a);switch(o){case _o:{let h=a;switch(u){case"bigint":o=Ev,h=a.toString();break;case"number":if(!a&&NE(a,-0))return r.push(["-0"])-1;break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([Nv],a)}return i([o,h],a)}case Qi:{if(u){let f=a;return u==="DataView"?f=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(f=new Uint8Array(a)),i([u,[...f]],a)}const h=[],d=i([o,h],a);for(const f of a)h.push(l(f));return d}case lo:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const h=[],d=i([o,h],a);for(const f of SE(a))(e||!sa(Ei(a[f])))&&h.push([l(f),l(a[f])]);return d}case _h:return i([o,isNaN(a.getTime())?Br:a.toISOString()],a);case $h:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case Oh:{const h=[],d=i([o,h],a);for(const[f,m]of a)(e||!(sa(Ei(f))||sa(Ei(m))))&&h.push([l(f),l(m)]);return d}case Fh:{const h=[],d=i([o,h],a);for(const f of a)(e||!sa(Ei(f)))&&h.push(l(f));return d}}const{message:c}=a;return i([o,{name:u,message:c}],a)};return l},om=(e,{json:t,lossy:n}={})=>{const r=[];return CE(!(t||n),!!t,new Map,r)(e),r},ao=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?am(om(e,t)):structuredClone(e):(e,t)=>am(om(e,t));function EE(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function TE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function PE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||EE,r=e.options.footnoteBackLabel||TE,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],u=[];let c=-1;for(;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);h&&(o[c]=e.all(h))}for(c=-1;++c<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[c]);if(!h)continue;const d=o[c],f=String(h.identifier).toUpperCase(),m=oi(f.toLowerCase());let p=0;const g=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++p<=w;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(h,y),u.push(y)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ao(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
368
368
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
369
- `}]}}const zo=function(e){if(e==null)return RE;if(typeof e=="function")return _o(e);if(typeof e=="object")return Array.isArray(e)?EE(e):TE(e);if(typeof e=="string")return PE(e);throw new Error("Expected function, string, or object as test")};function EE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zo(e[n]);return _o(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function TE(e){const t=e;return _o(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function PE(e){return _o(t);function t(n){return n&&n.type===e}}function _o(e){return t;function t(n,r,i){return!!(AE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function RE(){return!0}function AE(e){return e!==null&&typeof e=="object"&&"type"in e}const Tv=[],LE=!0,qi=!1,Zc="skip";function ed(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,l,a,o,u;if(typeof n=="function"||n&&typeof n=="object"?(l=t,a=n,r&&(i=!1)):(a=t,n&&(i=!1)),typeof a=="function")o=a;else if(a&&typeof a=="object"){if(!(a.enter===null||a.enter===void 0))if(typeof a.enter=="function")o=a.enter;else throw new Error("Unexpected value `"+a.enter+"` for `visitors.enter`, expected optional visitor");if(typeof a.exit=="function")u=a.exit;else throw new Error("Unexpected value `"+a.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+a+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=zo(l),h=i?1:-1;d(e,void 0,[])();function d(f,m,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(x?"<"+x+">":""))+")"})}return w;function w(){const x=!l||c(f,m,p[p.length-1]||void 0);let y=Tv;if(o&&x&&(y=um(o(f,p,m)),y[0]===qi))return y;if("children"in f&&f.children){const v=f;if(v.children&&y[0]!==Zc){let b=(i?-1:v.children.length)+h;const E=[...p,v];for(;b>-1&&b<v.children.length;){const k=v.children[b],L=d(k,b,E)();if(L[0]===qi)return L;b=typeof L[1]=="number"?L[1]:b+h}}}if(u&&x){const v=um(u(f,p,m));if(v[0]===Zc)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===qi||typeof v[1]=="number")return v}return y}}}function um(e){return Array.isArray(e)?e:typeof e=="number"?[LE,e]:e==null?Tv:[e]}function $o(e,t,n,r){let i,l,a;l=t,a=n,typeof l=="function"?ed(e,i,td(l),a):ed(e,i,IE(l),a)}function IE(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?td(e.enter):e.enter,exit:typeof e.exit=="function"?td(e.exit):e.exit}}function td(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const nd={}.hasOwnProperty,DE={};function ME(e,t){const n=t||DE,r=new Map,i=new Map,l=new Map,a={...xE,...n.handlers},o={all:c,applyData:_E,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:u,options:n,patch:zE,wrap:OE};return $o(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=String(h.identifier).toUpperCase();h.type==="definition"?r.has(d)||r.set(d,h):i.has(d)||i.set(d,h)}}),o;function u(h,d){const{type:f}=h,m=o.handlers[f];if(nd.call(o.handlers,f)&&m)return m(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:g,...w}=h;return{...lo(w),children:o.all(h)}}return lo(h)}return(o.options.unknownHandler||$E)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let m=-1;for(;++m<f.length;){const p=o.one(f[m],h);if(p){if(m&&f[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=cm(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=cm(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function zE(e,t){e.position&&(t.position=NS(e))}function _E(e,t){let n=t;if(e&&e.data){const{hChildren:r,hName:i,hProperties:l}=e.data;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,lo(l)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function $E(e,t){const n=t.data||{},r="value"in t&&!(nd.call(n,"hProperties")||nd.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function OE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
369
+ `}]}}const $o=function(e){if(e==null)return IE;if(typeof e=="function")return Oo(e);if(typeof e=="object")return Array.isArray(e)?RE(e):LE(e);if(typeof e=="string")return AE(e);throw new Error("Expected function, string, or object as test")};function RE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$o(e[n]);return Oo(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function LE(e){const t=e;return Oo(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function AE(e){return Oo(t);function t(n){return n&&n.type===e}}function Oo(e){return t;function t(n,r,i){return!!(DE(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function IE(){return!0}function DE(e){return e!==null&&typeof e=="object"&&"type"in e}const Pv=[],ME=!0,qi=!1,ed="skip";function td(e,t,n,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,l,a,o,u;if(typeof n=="function"||n&&typeof n=="object"?(l=t,a=n,r&&(i=!1)):(a=t,n&&(i=!1)),typeof a=="function")o=a;else if(a&&typeof a=="object"){if(!(a.enter===null||a.enter===void 0))if(typeof a.enter=="function")o=a.enter;else throw new Error("Unexpected value `"+a.enter+"` for `visitors.enter`, expected optional visitor");if(typeof a.exit=="function")u=a.exit;else throw new Error("Unexpected value `"+a.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+a+"` for `enter` or `visitors`, expected visitor or object with visitors");const c=$o(l),h=i?1:-1;d(e,void 0,[])();function d(f,m,p){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(f.type+(x?"<"+x+">":""))+")"})}return w;function w(){const x=!l||c(f,m,p[p.length-1]||void 0);let y=Pv;if(o&&x&&(y=um(o(f,p,m)),y[0]===qi))return y;if("children"in f&&f.children){const v=f;if(v.children&&y[0]!==ed){let b=(i?-1:v.children.length)+h;const E=[...p,v];for(;b>-1&&b<v.children.length;){const k=v.children[b],R=d(k,b,E)();if(R[0]===qi)return R;b=typeof R[1]=="number"?R[1]:b+h}}}if(u&&x){const v=um(u(f,p,m));if(v[0]===ed)throw new Error("Unexpected value `"+v[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(v[0]===qi||typeof v[1]=="number")return v}return y}}}function um(e){return Array.isArray(e)?e:typeof e=="number"?[ME,e]:e==null?Pv:[e]}function Fo(e,t,n,r){let i,l,a;l=t,a=n,typeof l=="function"?td(e,i,nd(l),a):td(e,i,zE(l),a)}function zE(e){return!e||typeof e!="object"?e:{enter:typeof e.enter=="function"?nd(e.enter):e.enter,exit:typeof e.exit=="function"?nd(e.exit):e.exit}}function nd(e){return t;function t(n,r,i){return e(n,i,r[r.length-1])}}const rd={}.hasOwnProperty,_E={};function $E(e,t){const n=t||_E,r=new Map,i=new Map,l=new Map,a={...jE,...n.handlers},o={all:c,applyData:FE,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:u,options:n,patch:OE,wrap:BE};return Fo(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=String(h.identifier).toUpperCase();h.type==="definition"?r.has(d)||r.set(d,h):i.has(d)||i.set(d,h)}}),o;function u(h,d){const{type:f}=h,m=o.handlers[f];if(rd.call(o.handlers,f)&&m)return m(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:g,...w}=h;return{...ao(w),children:o.all(h)}}return ao(h)}return(o.options.unknownHandler||UE)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let m=-1;for(;++m<f.length;){const p=o.one(f[m],h);if(p){if(m&&f[m-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=cm(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=cm(g.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function OE(e,t){e.position&&(t.position=TS(e))}function FE(e,t){let n=t;if(e&&e.data){const{hChildren:r,hName:i,hProperties:l}=e.data;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const a="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,ao(l)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function UE(e,t){const n=t.data||{},r="value"in t&&!(rd.call(n,"hProperties")||rd.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function BE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
370
370
  `});++r<e.length;)r&&n.push({type:"text",value:`
371
371
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
372
- `}),n}function cm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dm(e,t){const n=ME(e,t),r=n.one(e,void 0),i=CE(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
373
- `},i),l}function FE(e,t){return e&&"run"in e?async function(n,r){const i=dm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dm(n,{file:r,...e||t})}}function hm(e){if(e)throw e}var Ea=Object.prototype.hasOwnProperty,Pv=Object.prototype.toString,fm=Object.defineProperty,pm=Object.getOwnPropertyDescriptor,mm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Pv.call(t)==="[object Array]"},gm=function(t){if(!t||Pv.call(t)!=="[object Object]")return!1;var n=Ea.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ea.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ea.call(t,i)},xm=function(t,n){fm&&n.name==="__proto__"?fm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ym=function(t,n){if(n==="__proto__")if(Ea.call(t,n)){if(pm)return pm(t,n).value}else return;return t[n]},UE=function e(){var t,n,r,i,l,a,o=arguments[0],u=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=ym(o,n),i=ym(t,n),o!==i&&(h&&i&&(gm(i)||(l=mm(i)))?(l?(l=!1,a=r&&mm(r)?r:[]):a=r&&gm(r)?r:{},xm(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&xm(o,{name:n,newValue:i}));return o};const Nu=hd(UE);function rd(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function BE(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...c){const h=e[++l];let d=-1;if(u){a(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?HE(h,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function HE(e,t){let n;return r;function r(...a){const o=e.length>a.length;let u;o&&a.push(i);try{u=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const Tn={basename:WE,dirname:VE,extname:QE,join:qE,sep:"/"};function WE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Tl(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function VE(e){if(Tl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function QE(e){Tl(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qE(...e){let t=-1,n;for(;++t<e.length;)Tl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":GE(n)}function GE(e){Tl(e);const t=e.codePointAt(0)===47;let n=KE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KE(e,t){let n="",r=0,i=-1,l=0,a=-1,o,u;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function Tl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const YE={cwd:JE};function JE(){return"/"}function sd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function XE(e){if(typeof e=="string")e=new URL(e);else if(!sd(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ZE(e)}function ZE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Cu=["history","path","basename","stem","extname","dirname"];class Rv{constructor(t){let n;t?sd(t)?n={path:t}:typeof t=="string"||eT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":YE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Cu.length;){const l=Cu[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Cu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Tn.basename(this.path):void 0}set basename(t){Tu(t,"basename"),Eu(t,"basename"),this.path=Tn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tn.dirname(this.path):void 0}set dirname(t){vm(this.basename,"dirname"),this.path=Tn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tn.extname(this.path):void 0}set extname(t){if(Eu(t,"extname"),vm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Tn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sd(t)&&(t=XE(t)),Tu(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tn.basename(this.path,this.extname):void 0}set stem(t){Tu(t,"stem"),Eu(t,"stem"),this.path=Tn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Lo(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Eu(e,t){if(e&&e.includes(Tn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tn.sep+"`")}function Tu(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tT=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},nT={}.hasOwnProperty;class Uh extends tT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=BE()}copy(){const t=new Uh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Nu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Au("data",this.frozen),this.namespace[t]=n,this):nT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Au("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ia(t),r=this.parser||this.Parser;return Pu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Pu("process",this.parser||this.Parser),Ru("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=ia(t),u=r.parse(o);r.run(u,o,function(h,d,f){if(h||!d||!f)return c(h);const m=d,p=r.stringify(m,f);iT(p)?f.value=p:f.result=p,c(h,f)});function c(h,d){h||!d?a(h):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Pu("processSync",this.parser||this.Parser),Ru("processSync",this.compiler||this.Compiler),this.process(t,i),wm("processSync","process",n),r;function i(l,a){n=!0,hm(l),r=a}}run(t,n,r){jm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const u=ia(n);i.run(t,u,c);function c(h,d,f){const m=d||t;h?o(h):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),wm("runSync","run",r),i;function l(a,o){hm(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=ia(n),i=this.compiler||this.Compiler;return Ru("stringify",i),jm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Au("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=Nu(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];l(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[m,...p]=h;const g=r[f][1];rd(g)&&rd(m)&&(m=Nu(!0,g,m)),r[f]=[c,m,...p]}}}}const rT=new Uh().freeze();function Pu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ru(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Au(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jm(e){if(!rd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ia(e){return sT(e)?e:new Rv(e)}function sT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iT(e){return typeof e=="string"||lT(e)}function lT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",km=[],bm={allowDangerousHtml:!0},oT=/^(https?|ircs?|mailto|xmpp)$/i,uT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ui(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,l=e.components,a=e.disallowedElements,o=e.rehypePlugins||km,u=e.remarkPlugins||km,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bm}:bm,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||cT,m=rT().use(VC).use(u).use(FE,c).use(o),p=new Rv;typeof r=="string"&&(p.value=r);for(const y of uT)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+aT+y.id,void 0);const g=m.parse(p);let w=m.runSync(g,p);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),$o(w,x),AS(w,{Fragment:s.Fragment,components:l,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function x(y,v,b){if(y.type==="raw"&&b&&typeof v=="number")return h?b.children.splice(v,1):b.children[v]={type:"text",value:y.value},v;if(y.type==="element"){let E;for(E in ku)if(Object.hasOwn(ku,E)&&Object.hasOwn(y.properties,E)){const k=y.properties[E],L=ku[E];(L===null||L.includes(y.tagName))&&(y.properties[E]=f(String(k||""),E,y))}}if(y.type==="element"){let E=t?!t.includes(y.tagName):a?a.includes(y.tagName):!1;if(!E&&n&&typeof v=="number"&&(E=!n(y,v,b)),E&&b&&typeof v=="number")return d&&y.children?b.children.splice(v,1,...y.children):b.children.splice(v,1),v}}}function cT(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||oT.test(e.slice(0,t))?e:""}function dT(e,t){if(t<=7)return Array.from({length:t},(l,a)=>a+1);const n=[1],r=Math.max(2,e-1),i=Math.min(t-1,e+1);r>2&&n.push("…");for(let l=r;l<=i;l++)n.push(l);return i<t-1&&n.push("…"),n.push(t),n}function fs({page:e,pageSize:t,total:n,onPage:r,onPageSize:i,label:l="rows"}){const a=Math.max(1,Math.ceil(n/t)),o=n?(e-1)*t+1:0,u=Math.min(e*t,n);return s.jsxs("div",{className:"pagination",children:[s.jsx("span",{className:"muted small",children:n?`Showing ${o}–${u} of ${n} ${l}`:`0 ${l}`}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"row small muted",style:{gap:6},children:["Rows per page",s.jsx("select",{className:"select sm",value:t,onChange:c=>i(Number(c.target.value)),"aria-label":"Rows per page",children:xb.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("nav",{className:"pager","aria-label":"Pagination",children:[s.jsx("button",{className:"pg-btn",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"Previous page",children:s.jsx("span",{style:{display:"inline-flex",transform:"rotate(180deg)"},children:s.jsx(ei,{size:14})})}),dT(e,a).map((c,h)=>c==="…"?s.jsx("span",{className:"pg-gap",children:"…"},`e${h}`):s.jsx("button",{className:`pg-btn ${c===e?"active":""}`,onClick:()=>r(c),"aria-current":c===e?"page":void 0,children:c},c)),s.jsx("button",{className:"pg-btn",onClick:()=>r(e+1),disabled:e>=a,"aria-label":"Next page",children:s.jsx(ei,{size:14})})]})]})}function Pl(e=[],t=zy){const[n,r]=j.useState(1),[i,l]=j.useState(t);return j.useEffect(()=>r(1),e),{page:n,setPage:r,pageSize:i,setPageSize:o=>{l(o),r(1)}}}function Bh(e,t=[],n=zy){const r=Pl(t,n),i=Math.max(1,Math.ceil(e.length/r.pageSize)),l=Math.min(r.page,i);return{pageItems:j.useMemo(()=>e.slice((l-1)*r.pageSize,l*r.pageSize),[e,l,r.pageSize]),props:{page:l,pageSize:r.pageSize,total:e.length,onPage:r.setPage,onPageSize:r.setPageSize}}}const Rl=(e,t)=>{var r;const n=Sl(e);return n?((r=t.find(i=>i.id===n))==null?void 0:r.name)??`${e} (deleted)`:Se[e].label},Hh=e=>Sl(e)?"custom":e,hT={pending:"not started",running:"running",passed:"passed",out:"out of iterations",stopped:"stopped"};function fT({nodes:e,agents:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const a=u=>{if(u.kind==="agent")return s.jsx(pT,{node:u,label:Rl(u.ref,t),selected:n,onSelect:r,waitingRunId:i??null,finished:l},u.key);const c=u.passes.reduce((d,f)=>d+f,0),h=u.passes.length>1?`${u.passes.join(" + ")} iterations (one number per pass of the outer loop)`:`${c} iteration${c===1?"":"s"}`;return s.jsxs("div",{className:`ptl-loop ${u.state}`,children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(rs,{size:13}),s.jsxs("b",{children:["Loop ×",u.step.maxIterations]}),s.jsxs("span",{className:"muted",children:["· until ",u.step.endsWhen==="last"?"last":"first"," passes"]}),s.jsx("span",{className:`ptl-state ${u.state}`,children:hT[u.state]})]}),s.jsx("div",{className:"ptl-row",children:u.children.map((d,f)=>o(d,f))}),s.jsx("div",{className:`ptl-return ${c?"":"idle"}`,title:`Ran ${h}; at most ${u.step.maxIterations} per pass`,children:s.jsxs("span",{children:["↺ ×",c]})})]},u.key)},o=(u,c)=>s.jsxs(j.Fragment,{children:[c>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),a(u)]},u.key);return s.jsx("div",{className:"ptl",role:"tablist","aria-label":"Agents",children:e.map((u,c)=>o(u,c))})}function pT({node:e,label:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const{runs:a}=e;if(!a.length)return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:l?"Skipped":"Not run yet",children:[s.jsx(Ot,{agent:Hh(e.ref),size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${l?"skipped":"pending"}`})]});const o=a[a.length-1],u=a.some(h=>h.id===n),c=a.some(h=>h.id===i);return s.jsxs("div",{className:`ptl-node ${o.status} ${u?"selected":""} ${c?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":u,className:"ptl-main",onClick:()=>r((a.find(h=>h.id===n)??o).id),title:`${t} · ${a.length} run${a.length>1?"s":""}`,children:[s.jsx(Ot,{agent:o.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),a.length>1&&s.jsxs("span",{className:"ptl-count",children:["×",a.length]})]}),s.jsx("span",{className:"ptl-runs",children:a.map((h,d)=>s.jsx("button",{type:"button",className:`ptl-dot ${h.id===i?"waiting":h.status} ${h.id===n?"on":""}`,onClick:()=>r(h.id),title:mT(h,t,d+1),"aria-label":`${t} run ${d+1}: ${h.status}`},h.id))}),a.length===1&&s.jsx("span",{className:"ptl-time",children:us(o.startedAt,o.finishedAt)})]})}function mT(e,t,n){const r=e.usage;return[`${t} #${n}: ${e.status}`,us(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Gt(e.costUsd):null,r?`${sn(r.inputTokens+r.cacheReadTokens+r.cacheWriteTokens)} in / ${sn(r.outputTokens)} out`:null].filter(Boolean).join(" · ")}class Sm extends Error{}const gT=e=>e.ref??e.agent;function xT(e){return e.status==="passed"?!0:e.agent==="explorer"&&e.status==="failed"&&e.output!==null&&e.output!==void 0}function ks(e,t){return e.kind==="agent"?{kind:"ghost",key:t,ref:e.agent}:{kind:"loop",key:t,step:e,state:"pending",iterations:[e.steps.map((n,r)=>ks(os(n),`${t}.${r}`))]}}function yT(e,t){let n=0;const r=(a,o)=>{const u=t[n];if(!u)return{node:{kind:"ghost",key:o,ref:a},flow:"open"};if(gT(u)!==a)throw new Sm;n++;const c=u.status!=="running"&&u.status!=="pending";return{node:{kind:"run",key:o,run:u},flow:c?xT(u)?"ok":"fail":"open"}},i=(a,o)=>a.kind==="agent"?r(a.agent,o):l(a,o),l=(a,o)=>{const u=a.steps.map(os),c=a.endsWhen==="last",h=[],d=f=>({kind:"loop",key:o,step:a,iterations:h,state:f});if(n>=t.length)return{node:ks(a,o),flow:"open"};for(let f=0;f<a.maxIterations;f++){const m=[];h.push(m);const p=`${o}i${f}`,g=x=>u.slice(x).forEach((y,v)=>m.push(ks(y,`${p}.${x+v}`)));if(c){for(let x=0;x<u.length;x++){const y=i(u[x],`${p}.${x}`);if(m.push(y.node),y.flow==="open")return g(x+1),{node:d("running"),flow:"open"};if(y.flow==="stop")return{node:d("stopped"),flow:"stop"};const v=x===u.length-1;if(v&&y.flow==="ok")return{node:d("passed"),flow:"ok"};if(!v&&y.flow==="fail")return{node:d("stopped"),flow:"stop"}}if(f<a.maxIterations-1&&n>=t.length)return h.push(u.map((x,y)=>ks(x,`${o}i${f+1}.${y}`))),{node:d("running"),flow:"open"};continue}const w=i(u[0],`${p}.0`);if(m.push(w.node),w.flow==="open")return{node:d("running"),flow:"open"};if(w.flow==="stop")return{node:d("stopped"),flow:"stop"};if(w.flow==="ok")return{node:d("passed"),flow:"ok"};if(f===a.maxIterations-1)break;for(let x=1;x<u.length;x++){const y=i(u[x],`${p}.${x}`);if(m.push(y.node),y.flow==="open")return g(x+1),{node:d("running"),flow:"open"};if(y.flow!=="ok")return{node:d("stopped"),flow:"stop"}}if(n>=t.length)return h.push([ks(u[0],`${o}i${f+1}.0`)]),{node:d("running"),flow:"open"}}return{node:d("out"),flow:"fail"}};try{const a=[];let o=!1;return e.forEach((u,c)=>{if(o){a.push(ks(u,`b${c}`));return}const h=i(u,`b${c}`);a.push(h.node),h.flow!=="ok"&&(o=!0)}),n===t.length?a:null}catch(a){if(a instanceof Sm)return null;throw a}}const Av=e=>e.some(t=>t.kind==="run"||t.kind==="loop"&&t.iterations.some(Av));function Lv(e){const t=e[0];if(t.kind!=="loop"){const a=t.kind==="run"?t.run.ref??t.run.agent:t.ref;return{kind:"agent",key:t.key,ref:a,runs:e.flatMap(o=>o.kind==="run"?[o.run]:[])}}const n=e.filter(a=>a.kind==="loop"),r=t.step.steps.length,i=[];for(let a=0;a<r;a++){const o=n.flatMap(u=>u.iterations.flatMap(c=>c[a]?[c[a]]:[]));o.length&&i.push(Lv(o))}const l=n[n.length-1];return{kind:"loop",key:t.key,step:t.step,state:l.state,passes:n.map(a=>a.iterations.filter(Av).length),children:i}}function vT(e){return e.map(t=>Lv([t]))}const jT=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"];function wT(e,t){const n=Ro[e].filter(i=>!Gi(e)||!Nh.includes(i));let r=0;for(const i of t)i.agent===n[r]&&r++;return n.slice(r)}function kT(e,t){const n=o=>o.ref??o.agent,r=(o,u)=>({kind:"agent",key:u,agent:Hh(o),name:Rl(o,e.agents),description:o.startsWith("custom:")?"Custom agent":Se[o].description}),i=(o,u)=>o.kind==="agent"?r(o.agent,u):{kind:"loop",key:u,maxIterations:o.maxIterations,items:o.steps.map((c,h)=>i(os(c),`${u}-${h}`))},l=[];let a=0;return e.pipeline.steps.forEach((o,u)=>{if(o.kind==="agent"){a<t.length?a++:l.push(i(o,`s${u}`));return}if(a<t.length){const c=new Set(Ao([o]));for(;a<t.length&&c.has(n(t[a]));)a++;return}l.push(i(o,`s${u}`))}),l}const Gi=e=>e==="generate"||e==="heal";function bT(e,t){if(!Gi(e.type))return{linear:t,loop:[]};const n=t.findIndex(r=>Nh.includes(r.agent));return n<0?{linear:t,loop:[]}:{linear:t.slice(0,n),loop:t.slice(n)}}function ST(e,t,n,r){if(r)return null;const i=t[t.length-1];if(!i)return e.type==="heal"?"healer":"validator";if(i.status==="running"||i.status==="pending")return null;const l=t.filter(a=>a.agent==="healer").length;return i.agent==="validator"?i.status==="failed"&&l<n?"healer":null:i.status==="passed"?"validator":null}function Nm(e,t){const n=t.filter(i=>i.agent===e.agent&&i.label===e.label),r=Mb(e);return n.length>1?`${r} #${n.indexOf(e)+1}`:r}function NT(){var oe;const e=Number(ii().id),t=ut(),[n]=mh(),r=n.get("result")?Number(n.get("result")):null,{refresh:i}=un(),{job:l,runs:a,results:o,pipeline:u,pending:c,logs:h,error:d,refetch:f,reconnect:m}=Y0(e),p=(l==null?void 0:l.status)==="waiting"?c:null,[g,w]=j.useState(null),x=j.useRef(!1),y=j.useRef(!1),[v,b]=j.useState(null);if(j.useEffect(()=>{if(x.current||a.length===0)return;const B=a.find(he=>he.status==="running");w((B??a[a.length-1]).id)},[a]),j.useEffect(()=>{if(y.current||!r||o.length===0)return;const B=o.find(he=>he.id===r);B!=null&&B.agentRunId&&(x.current=!0,y.current=!0,w(B.agentRunId))},[r,o]),j.useEffect(()=>{p&&(x.current=!0,w(p.runId))},[p==null?void 0:p.runId]),j.useEffect(()=>{l&&Uc.includes(l.status)&&i()},[l==null?void 0:l.status]),!Number.isInteger(e)||e<=0)return s.jsx(Pe,{error:"Invalid job id"});const E=a.find(B=>B.id===g)??null,k=l&&l.type in Ro?wT(l.type,a):[],L=l?Uc.includes(l.status):!1,T=(l==null?void 0:l.type)==="pipeline"&&u?yT(u.pipeline.steps,a):null,D=(l==null?void 0:l.type)==="pipeline"&&u&&!T?kT(u,a):[],N=(l==null?void 0:l.args.maxHealRounds)??yb.maxHealRounds,{linear:P,loop:A}=l?bT(l,a):{linear:a,loop:[]},z=l&&Gi(l.type)?ST(l,A,N,L):null,U=A.filter(B=>B.agent==="healer").length,I=B=>{x.current=!0,w(B)},Q=B=>s.jsx(PT,{run:B,label:Nm(B,a),selected:g===B.id,waiting:(p==null?void 0:p.runId)===B.id,onSelect:()=>I(B.id)},B.id),J=(B,he,ze,Ke,W)=>s.jsx(RT,{agent:B,finished:L,note:ze,name:Ke,description:W},he),H=B=>B.kind==="agent"?J(B.agent,B.key,void 0,B.name,B.description):s.jsxs("div",{className:"loop-group idle","aria-label":`Loop ×${B.maxIterations}`,children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(rs,{size:14}),s.jsxs("span",{children:["Loop ×",B.maxIterations]})]}),s.jsx("div",{className:"loop-body",children:B.items.map((he,ze)=>s.jsxs(j.Fragment,{children:[ze>0&&s.jsx("span",{className:"connector"}),H(he)]},he.key))})]},B.key),X=a.some(B=>{var he;return B.agent==="runner"&&((he=B.output)==null?void 0:he.htmlReport)}),S=async B=>{if(!l)return;const he=o.filter(W=>(W.status==="failed"||W.status==="flaky")&&W.specFile&&W.tcId).map(W=>({spec:W.specFile,tcId:W.tcId})),ze=`${l.args.name??`Test run #${l.id}`} (${B?"failed re-run":"re-run"})`;if(!l.args.selection&&!B){try{const W=await q.createJob({type:"testrun",name:ze,...l.target!=="all"?{spec:l.target}:{},...l.args.tcId?{tcId:l.args.tcId}:{},repeatEach:l.args.repeatEach??1,...l.args.retries!==void 0?{retries:l.args.retries}:{},htmlReport:l.args.htmlReport});t(`/runs/${W.id}`)}catch(W){b(W.message)}return}let Ke=l.args.selection??he;if(B){const W=new Set(he.map(fe=>`${fe.spec}#${fe.tcId}`));Ke=Ke.filter(fe=>W.has(`${fe.spec}#${fe.tcId}`))}Ke=[...new Map(Ke.map(W=>[`${W.spec}#${W.tcId}`,W])).values()],t("/test-runs/new",{state:{name:ze,selection:Ke,retries:l.args.retries}})},ae=o.some(B=>B.status==="failed"||B.status==="flaky"),O=async()=>{b(null);try{await q.rerunFailedJob(e),m()}catch(B){b(B.message)}},C=async()=>{try{const B=await q.createJob({type:"generate",spec:l.target});t(`/runs/${B.id}`)}catch(B){b(B.message)}},F=l&&(l.type==="testrun"||l.type==="heal"||l.type==="generate")&&L?[...new Set(o.filter(B=>B.status==="failed"&&B.specFile).map(B=>B.specFile))]:[],Z=async B=>{try{const he=await q.createJob({type:"heal",spec:B,sourceJobId:e});t(`/runs/${he.id}`)}catch(he){b(he.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs",to:"/runs"},{label:`Job #${e}`}]}),s.jsx(Pe,{error:d??v}),l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"row between",style:{marginBottom:6},children:[s.jsxs("div",{className:"row",children:[s.jsxs("h1",{className:"page-title",children:[kr[l.type]," ·"," ",l.type==="testrun"?l.args.name:l.type==="context"?s.jsx(ye,{to:"/project",children:"CLAUDE.md"}):l.type==="custom"||l.type==="pipeline"?[l.type==="pipeline"?l.args.pipelineName:l.args.customAgentName,l.target.endsWith(".md")?l.target:null].filter(Boolean).join(" · ")||l.target:l.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${l.target}`,children:l.target}):l.target]}),s.jsx(kn,{status:l.status})]}),s.jsxs("div",{className:"row",children:[X&&s.jsxs("a",{className:"btn ghost",href:gh(e),target:"_blank",rel:"noreferrer",title:"Playwright HTML report (new tab)",children:[s.jsx(bh,{size:14})," HTML report"]}),l.type==="testrun"&&L&&s.jsxs(s.Fragment,{children:[ae&&s.jsxs("button",{className:"btn ghost",onClick:()=>void S(!0),title:"New test run with only the failed test cases",children:[s.jsx(ft,{size:14})," Re-run failed"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S(!1),title:"New test run with the same test cases",children:[s.jsx(ft,{size:14})," Re-run"]})]}),(l.type==="pipeline"||l.type==="generate"||l.type==="heal")&&(l.status==="failed"||l.status==="cancelled"||l.status==="interrupted")&&s.jsxs("button",{className:"btn ghost",onClick:()=>void O(),title:"Run this job again from the step that stopped it: the earlier steps are not run again, their outputs are reused",children:[s.jsx(ft,{size:14})," Re-run failed"]}),l.type==="context"&&l.status==="passed"&&s.jsxs(ye,{className:"btn ghost",to:"/project",children:[s.jsx(jr,{size:15})," View CLAUDE.md"]}),l.type==="spec"&&l.status==="passed"&&s.jsxs(s.Fragment,{children:[s.jsxs(ye,{className:"btn ghost",to:`/specs/${l.target}`,children:[s.jsx(jr,{size:15})," Open spec"]}),s.jsxs("button",{className:"btn",onClick:()=>void C(),title:"QA Explorer → QA Script Generator → QA Validator ⇄ QA Script Healer on the new spec",children:[s.jsx(vh,{size:15})," Generate tests"]})]}),F.map(B=>s.jsxs("button",{className:"btn",onClick:()=>void Z(B),title:"QA Script Healer fixes the scripts of failing tests, then QA Validator re-runs them",children:[s.jsx(Py,{size:15})," Heal ",B]},B)),!L&&s.jsxs("button",{className:"btn danger",onClick:()=>void q.cancelJob(e).catch(B=>b(B.message)),children:[s.jsx(Ly,{size:14})," Cancel"]})]})]}),s.jsxs("div",{className:"muted small",style:{marginBottom:14},children:["Started ",Pt(l.startedAt??l.createdAt)," · ",us(l.startedAt,l.finishedAt),l.args.tcId&&` · ${l.args.tcId}`,l.args.repeatEach&&` · repeat ${l.args.repeatEach}×`,l.args.retries!==void 0&&` · retries ${l.args.retries}`,l.args.selection&&` · ${l.args.selection.length} test case${l.args.selection.length===1?"":"s"}`,l.type==="testrun"&&(l.args.htmlReport?" · line + HTML report":" · line report"),Gi(l.type)&&` · max ${N} heal round${N===1?"":"s"}`,l.args.sourceJobId&&s.jsxs(s.Fragment,{children:[" ","· from ",s.jsxs(ye,{to:`/runs/${l.args.sourceJobId}`,children:["job #",l.args.sourceJobId]})]}),l.summary&&s.jsxs(s.Fragment,{children:[" · ",l.summary]})]}),l.warning&&s.jsxs("div",{className:"warn-box",children:["⚠ ",l.warning]}),T&&u?s.jsx(fT,{nodes:vT(T),agents:u.agents,selected:g,onSelect:I,waitingRunId:(p==null?void 0:p.runId)??null,finished:L}):s.jsxs("div",{className:"timeline",role:"tablist","aria-label":"Agents",children:[P.map((B,he)=>s.jsxs(j.Fragment,{children:[he>0&&s.jsx("span",{className:`connector ${P[he-1].status==="passed"?"done":""}`}),Q(B)]},B.id)),k.map((B,he)=>s.jsxs(j.Fragment,{children:[(P.length>0||he>0)&&s.jsx("span",{className:"connector"}),J(B,`g-${B}-${he}`)]},`ghost-${B}-${he}`)),D.map((B,he)=>s.jsxs(j.Fragment,{children:[(P.length>0||he>0)&&s.jsx("span",{className:"connector"}),H(B)]},B.key)),Gi(l.type)&&s.jsxs(s.Fragment,{children:[(P.length>0||k.length>0)&&s.jsx("span",{className:`connector ${((oe=P[P.length-1])==null?void 0:oe.status)==="passed"?"done":""}`}),s.jsxs("div",{className:`loop-group ${A.length?"":"idle"}`,"aria-label":"Validator and Healer loop",children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(rs,{size:14}),s.jsx("span",{children:"Validate ⇄ Heal loop"}),s.jsxs("span",{className:"loop-count",title:"Healer rounds used / maximum (Settings)",children:["heal round ",U,"/",N]})]}),s.jsxs("div",{className:"loop-body",children:[A.map((B,he)=>s.jsxs(j.Fragment,{children:[he>0&&s.jsx("span",{className:`connector ${A[he-1].status==="passed"?"done":""} ${B.agent==="validator"?"back":"fail"}`,title:B.agent==="validator"?"QA Script Healer done → back to QA Validator":"QA Validator failed → QA Script Healer"}),Q(B)]},B.id)),z&&s.jsxs(s.Fragment,{children:[A.length>0&&s.jsx("span",{className:`connector ${z==="validator"?"back":"fail"}`}),J(z,"loop-ghost",z==="healer"&&A.length?"Runs if the QA Validator fails":void 0)]}),!A.length&&!z&&J(l.type==="heal"?"healer":"validator","loop-skip")]}),s.jsx("div",{className:"loop-return",title:`QA Validator fails → QA Script Healer fixes → back to QA Validator. Stops when tests pass, the QA Script Healer reports an app bug or gives up, or after ${N} heal round${N===1?"":"s"}.`,children:s.jsxs("span",{children:["↺ back to QA Validator · max ",N]})})]})]})]}),p&&s.jsx(TT,{jobId:e,label:p.label,questions:p.questions??[],onDone:()=>void f()},`review-${p.runId}`),E?s.jsx(AT,{jobId:e,job:l,run:E,label:Nm(E,a),log:h[E.id]??"",results:o.filter(B=>B.agentRunId===E.id),highlightResultId:r,reviewing:(p==null?void 0:p.runId)===E.id},E.id):s.jsx("div",{className:"card pad muted",children:"Waiting for the first agent to start…"})]})]})}const zs=-1,CT=e=>Object.fromEntries(e.map(t=>[t.id,Math.max(t.options.findIndex(n=>n.recommended),t.options.length?0:zs)]));function ET({questions:e,choice:t,other:n,onChoice:r,onOther:i}){return s.jsx("ol",{className:"question-list",children:e.map(l=>s.jsx("li",{className:"question",children:s.jsxs("fieldset",{children:[s.jsx("legend",{children:l.question}),l.options.map((a,o)=>s.jsxs("label",{className:`question-option ${t[l.id]===o?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===o,onChange:()=>r(l.id,o)}),s.jsxs("span",{children:[s.jsx("b",{children:a.label}),a.recommended&&s.jsx("span",{className:"chip ok small",children:"Recommended"}),a.description&&s.jsx("span",{className:"muted small question-desc",children:a.description})]})]},o)),s.jsxs("label",{className:`question-option ${t[l.id]===zs?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===zs,onChange:()=>r(l.id,zs)}),s.jsxs("span",{className:"question-other",children:[s.jsx("b",{children:"Other"}),s.jsx("input",{className:"input",maxLength:wb,placeholder:"Type your answer",value:n[l.id]??"",onFocus:()=>r(l.id,zs),onChange:a=>i(l.id,a.target.value),"aria-label":`Other answer to: ${l.question}`})]})]})]})},l.id))})}function TT({jobId:e,label:t,questions:n,onDone:r}){const i=Kn(),[l,a]=j.useState(()=>CT(n)),[o,u]=j.useState({}),c=n.length>0,h=n.map(v=>{var b;return{id:v.id,answer:l[v.id]===zs?(o[v.id]??"").trim():((b=v.options[l[v.id]])==null?void 0:b.label)??""}}),d=h.filter(v=>!v.answer).length,[f,m]=j.useState(""),[p,g]=j.useState(!1),[w,x]=j.useState(null),y=async v=>{g(!0);try{await v(),r()}catch(b){x(b.message)}finally{g(!1)}};return s.jsxs("div",{className:"review-panel",role:"region","aria-label":"Review",children:[s.jsx("b",{children:c?`${t} has ${n.length} question${n.length>1?"s":""} for you.`:`${t} is waiting for your review.`}),s.jsx("span",{className:"muted small",children:c?`Pick an option or type your own answer. Sending runs ${t} again with your answers. Reject ends the pipeline.`:"Approve to continue the pipeline with this result. Reject ends the pipeline."}),c&&s.jsx(ET,{questions:n,choice:l,other:o,onChoice:(v,b)=>a(E=>({...E,[v]:b})),onOther:(v,b)=>u(E=>({...E,[v]:b}))}),s.jsx("textarea",{className:"input",rows:2,maxLength:gb,placeholder:"Reason (optional, saved with a rejection)",value:f,onChange:v=>m(v.target.value),"aria-label":"Reject reason"}),s.jsx(Pe,{error:w}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn danger",disabled:p,onClick:async()=>{await i({title:`Reject the output of ${t}?`,message:"The pipeline ends here and the job is marked failed.",confirmLabel:"Reject",danger:!0})&&await y(()=>q.rejectJob(e,f.trim()||void 0))},children:"Reject"}),c?s.jsx("button",{className:"btn",disabled:p||d>0,title:d?'Type an answer for every "Other"':void 0,onClick:()=>void y(()=>q.answerJob(e,h)),children:"Send answers"}):s.jsx("button",{className:"btn",disabled:p,onClick:()=>void y(()=>q.approveJob(e)),children:"Approve"})]})]})}function PT({run:e,label:t,selected:n,waiting:r,onSelect:i}){const l=e.usage;return s.jsxs("button",{role:"tab","aria-selected":n,className:`agent-card ${n?"selected":""} ${e.status} ${r?"waiting":""}`,onClick:i,children:[s.jsxs("span",{className:"agent-head",children:[s.jsx(Ot,{agent:e.agent}),s.jsxs("span",{children:[s.jsx("span",{className:"agent-name",children:t}),s.jsx("br",{}),s.jsx(kn,{status:e.status})]})]}),s.jsxs("span",{className:"agent-meta",children:[s.jsx("span",{children:us(e.startedAt,e.finishedAt)}),e.turns!==null&&s.jsxs("span",{children:[e.turns," turns"]}),e.costUsd!==null&&s.jsx("span",{children:Gt(e.costUsd)}),l&&s.jsxs("span",{title:`input ${l.inputTokens} · output ${l.outputTokens} · cache read ${l.cacheReadTokens} · cache write ${l.cacheWriteTokens}`,children:[sn(l.inputTokens+l.cacheReadTokens+l.cacheWriteTokens)," in / ",sn(l.outputTokens)," out"]})]})]})}function RT({agent:e,finished:t,note:n,name:r,description:i}){return s.jsxs("div",{className:"agent-card ghost","aria-disabled":"true",children:[s.jsxs("span",{className:"agent-head",children:[s.jsx(Ot,{agent:e}),s.jsxs("span",{children:[s.jsx("span",{className:"agent-name",children:r??Se[e].label}),s.jsx("br",{}),s.jsx(dt,{status:t?"skipped":"pending"})]})]}),s.jsx("span",{className:"agent-meta",children:n??i??Se[e].description})]})}function AT({jobId:e,job:t,run:n,label:r,log:i,results:l,highlightResultId:a,reviewing:o}){const u=!!a&&l.some(x=>x.id===a),[c,h]=j.useState(u||o?"output":"log");j.useEffect(()=>{o&&h("output")},[o]);const[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=!["running","pending"].includes(n.status);j.useEffect(()=>{g&&q.agentRun(e,n.id).then(f).catch(()=>{})},[e,n.id,g]),j.useEffect(()=>{const x=m.current;x&&p.current&&(x.scrollTop=x.scrollHeight)},[i,c]),_T(m,c==="log");const w=i||(d==null?void 0:d.log)||"";return s.jsxs("div",{className:"card panel",children:[s.jsxs("div",{className:"panel-head",children:[s.jsx(Ot,{agent:n.agent,size:30}),s.jsxs("div",{className:"grow",children:[s.jsxs("div",{style:{fontWeight:600},children:[r," ",s.jsx(kn,{status:n.status})]}),s.jsx("div",{className:"muted small",children:Se[n.agent].description})]}),s.jsx(bn,{value:c,onChange:h,items:[{id:"log",label:"Log"},{id:"output",label:"Output"},{id:"perm",label:"Permissions"}]})]}),s.jsxs("div",{className:"panel-body",children:[c==="log"&&n.usage&&s.jsxs("div",{className:"muted small",style:{marginBottom:8},children:[n.usage.model??"model unknown"," · input ",sn(n.usage.inputTokens)," · output ",sn(n.usage.outputTokens)," · cache read"," ",sn(n.usage.cacheReadTokens)," · cache write ",sn(n.usage.cacheWriteTokens),n.costUsd!==null&&s.jsxs(s.Fragment,{children:[" · est. ",Gt(n.costUsd)]})]}),c==="log"&&s.jsx("pre",{className:"log",ref:m,onScroll:x=>{const y=x.currentTarget;p.current=y.scrollHeight-y.scrollTop-y.clientHeight<40},children:w?s.jsx(LT,{text:w}):n.status==="running"?"Waiting for output…":"(empty)"}),c==="output"&&s.jsx(DT,{jobId:t.id,run:n,full:d,results:l,highlightResultId:a}),c==="perm"&&s.jsx("div",{children:n.allowedTools?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": any action outside the allow list is denied."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:n.allowedTools.map(x=>s.jsx("code",{children:x},x))}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:jT.map(x=>s.jsx("code",{className:"deny",children:x},x))})]}):s.jsx("p",{className:"muted",children:"Non-LLM agent: runs Playwright Test directly (no shell) and cannot write any file other than the report."})})]})]})}function LT({text:e}){const t=j.useMemo(()=>e.split(`
372
+ `}),n}function cm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dm(e,t){const n=$E(e,t),r=n.one(e,void 0),i=PE(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
373
+ `},i),l}function HE(e,t){return e&&"run"in e?async function(n,r){const i=dm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dm(n,{file:r,...e||t})}}function hm(e){if(e)throw e}var Ea=Object.prototype.hasOwnProperty,Rv=Object.prototype.toString,fm=Object.defineProperty,pm=Object.getOwnPropertyDescriptor,mm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Rv.call(t)==="[object Array]"},gm=function(t){if(!t||Rv.call(t)!=="[object Object]")return!1;var n=Ea.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ea.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ea.call(t,i)},xm=function(t,n){fm&&n.name==="__proto__"?fm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ym=function(t,n){if(n==="__proto__")if(Ea.call(t,n)){if(pm)return pm(t,n).value}else return;return t[n]},WE=function e(){var t,n,r,i,l,a,o=arguments[0],u=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},u=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=ym(o,n),i=ym(t,n),o!==i&&(h&&i&&(gm(i)||(l=mm(i)))?(l?(l=!1,a=r&&mm(r)?r:[]):a=r&&gm(r)?r:{},xm(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&xm(o,{name:n,newValue:i}));return o};const Eu=fd(WE);function sd(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function VE(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...c){const h=e[++l];let d=-1;if(u){a(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?QE(h,o)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function QE(e,t){let n;return r;function r(...a){const o=e.length>a.length;let u;o&&a.push(i);try{u=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const Tn={basename:qE,dirname:GE,extname:KE,join:YE,sep:"/"};function qE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Tl(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function GE(e){if(Tl(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function KE(e){Tl(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function YE(...e){let t=-1,n;for(;++t<e.length;)Tl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JE(n)}function JE(e){Tl(e);const t=e.codePointAt(0)===47;let n=XE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XE(e,t){let n="",r=0,i=-1,l=0,a=-1,o,u;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function Tl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZE={cwd:eT};function eT(){return"/"}function id(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tT(e){if(typeof e=="string")e=new URL(e);else if(!id(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return nT(e)}function nT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Tu=["history","path","basename","stem","extname","dirname"];class Lv{constructor(t){let n;t?id(t)?n={path:t}:typeof t=="string"||rT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":ZE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Tu.length;){const l=Tu[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)Tu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Tn.basename(this.path):void 0}set basename(t){Ru(t,"basename"),Pu(t,"basename"),this.path=Tn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tn.dirname(this.path):void 0}set dirname(t){vm(this.basename,"dirname"),this.path=Tn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tn.extname(this.path):void 0}set extname(t){if(Pu(t,"extname"),vm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Tn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){id(t)&&(t=tT(t)),Ru(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tn.basename(this.path,this.extname):void 0}set stem(t){Ru(t,"stem"),Pu(t,"stem"),this.path=Tn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Do(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Pu(e,t){if(e&&e.includes(Tn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tn.sep+"`")}function Ru(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sT=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},iT={}.hasOwnProperty;class Uh extends sT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=VE()}copy(){const t=new Uh;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Eu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Iu("data",this.frozen),this.namespace[t]=n,this):iT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Iu("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ia(t),r=this.parser||this.Parser;return Lu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Lu("process",this.parser||this.Parser),Au("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=ia(t),u=r.parse(o);r.run(u,o,function(h,d,f){if(h||!d||!f)return c(h);const m=d,p=r.stringify(m,f);oT(p)?f.value=p:f.result=p,c(h,f)});function c(h,d){h||!d?a(h):l?l(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Lu("processSync",this.parser||this.Parser),Au("processSync",this.compiler||this.Compiler),this.process(t,i),wm("processSync","process",n),r;function i(l,a){n=!0,hm(l),r=a}}run(t,n,r){jm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const u=ia(n);i.run(t,u,c);function c(h,d,f){const m=d||t;h?o(h):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),wm("runSync","run",r),i;function l(a,o){hm(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=ia(n),i=this.compiler||this.Compiler;return Au("stringify",i),jm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Iu("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(c.plugins),c.settings&&(i.settings=Eu(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];l(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[m,...p]=h;const g=r[f][1];sd(g)&&sd(m)&&(m=Eu(!0,g,m)),r[f]=[c,m,...p]}}}}const lT=new Uh().freeze();function Lu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Au(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Iu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jm(e){if(!sd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ia(e){return aT(e)?e:new Lv(e)}function aT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oT(e){return typeof e=="string"||uT(e)}function uT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",km=[],bm={allowDangerousHtml:!0},dT=/^(https?|ircs?|mailto|xmpp)$/i,hT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ui(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,l=e.components,a=e.disallowedElements,o=e.rehypePlugins||km,u=e.remarkPlugins||km,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bm}:bm,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||fT,m=lT().use(GC).use(u).use(HE,c).use(o),p=new Lv;typeof r=="string"&&(p.value=r);for(const y of hT)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+cT+y.id,void 0);const g=m.parse(p);let w=m.runSync(g,p);return i&&(w={type:"element",tagName:"div",properties:{className:i},children:w.type==="root"?w.children:[w]}),Fo(w,x),DS(w,{Fragment:s.Fragment,components:l,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function x(y,v,b){if(y.type==="raw"&&b&&typeof v=="number")return h?b.children.splice(v,1):b.children[v]={type:"text",value:y.value},v;if(y.type==="element"){let E;for(E in Su)if(Object.hasOwn(Su,E)&&Object.hasOwn(y.properties,E)){const k=y.properties[E],R=Su[E];(R===null||R.includes(y.tagName))&&(y.properties[E]=f(String(k||""),E,y))}}if(y.type==="element"){let E=t?!t.includes(y.tagName):a?a.includes(y.tagName):!1;if(!E&&n&&typeof v=="number"&&(E=!n(y,v,b)),E&&b&&typeof v=="number")return d&&y.children?b.children.splice(v,1,...y.children):b.children.splice(v,1),v}}}function fT(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||dT.test(e.slice(0,t))?e:""}function pT(e,t){if(t<=7)return Array.from({length:t},(l,a)=>a+1);const n=[1],r=Math.max(2,e-1),i=Math.min(t-1,e+1);r>2&&n.push("…");for(let l=r;l<=i;l++)n.push(l);return i<t-1&&n.push("…"),n.push(t),n}function ps({page:e,pageSize:t,total:n,onPage:r,onPageSize:i,label:l="rows"}){const a=Math.max(1,Math.ceil(n/t)),o=n?(e-1)*t+1:0,u=Math.min(e*t,n);return s.jsxs("div",{className:"pagination",children:[s.jsx("span",{className:"muted small",children:n?`Showing ${o}–${u} of ${n} ${l}`:`0 ${l}`}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"row small muted",style:{gap:6},children:["Rows per page",s.jsx("select",{className:"select sm",value:t,onChange:c=>i(Number(c.target.value)),"aria-label":"Rows per page",children:yb.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsxs("nav",{className:"pager","aria-label":"Pagination",children:[s.jsx("button",{className:"pg-btn",onClick:()=>r(e-1),disabled:e<=1,"aria-label":"Previous page",children:s.jsx("span",{style:{display:"inline-flex",transform:"rotate(180deg)"},children:s.jsx(ti,{size:14})})}),pT(e,a).map((c,h)=>c==="…"?s.jsx("span",{className:"pg-gap",children:"…"},`e${h}`):s.jsx("button",{className:`pg-btn ${c===e?"active":""}`,onClick:()=>r(c),"aria-current":c===e?"page":void 0,children:c},c)),s.jsx("button",{className:"pg-btn",onClick:()=>r(e+1),disabled:e>=a,"aria-label":"Next page",children:s.jsx(ti,{size:14})})]})]})}function Pl(e=[],t=zy){const[n,r]=j.useState(1),[i,l]=j.useState(t);return j.useEffect(()=>r(1),e),{page:n,setPage:r,pageSize:i,setPageSize:o=>{l(o),r(1)}}}function Bh(e,t=[],n=zy){const r=Pl(t,n),i=Math.max(1,Math.ceil(e.length/r.pageSize)),l=Math.min(r.page,i);return{pageItems:j.useMemo(()=>e.slice((l-1)*r.pageSize,l*r.pageSize),[e,l,r.pageSize]),props:{page:l,pageSize:r.pageSize,total:e.length,onPage:r.setPage,onPageSize:r.setPageSize}}}const Rl=(e,t)=>{var r;const n=Sl(e);return n?((r=t.find(i=>i.id===n))==null?void 0:r.name)??`${e} (deleted)`:Se[e].label},Hh=e=>Sl(e)?"custom":e,mT={pending:"not started",running:"running",passed:"passed",out:"out of iterations",stopped:"stopped"};function gT({nodes:e,agents:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const a=u=>{if(u.kind==="agent")return s.jsx(xT,{node:u,label:Rl(u.ref,t),selected:n,onSelect:r,waitingRunId:i??null,finished:l},u.key);const c=u.passes.reduce((d,f)=>d+f,0),h=u.passes.length>1?`${u.passes.join(" + ")} iterations (one number per pass of the outer loop)`:`${c} iteration${c===1?"":"s"}`;return s.jsxs("div",{className:`ptl-loop ${u.state}`,children:[s.jsxs("div",{className:"ptl-loop-head",children:[s.jsx(is,{size:13}),s.jsxs("b",{children:["Loop ×",u.step.maxIterations]}),s.jsxs("span",{className:"muted",children:["· until ",u.step.endsWhen==="last"?"last":"first"," passes"]}),s.jsx("span",{className:`ptl-state ${u.state}`,children:mT[u.state]})]}),s.jsx("div",{className:"ptl-row",children:u.children.map((d,f)=>o(d,f))}),s.jsx("div",{className:`ptl-return ${c?"":"idle"}`,title:`Ran ${h}; at most ${u.step.maxIterations} per pass`,children:s.jsxs("span",{children:["↺ ×",c]})})]},u.key)},o=(u,c)=>s.jsxs(j.Fragment,{children:[c>0&&s.jsx("span",{className:"ptl-arrow","aria-hidden":"true",children:"→"}),a(u)]},u.key);return s.jsx("div",{className:"ptl",role:"tablist","aria-label":"Agents",children:e.map((u,c)=>o(u,c))})}function xT({node:e,label:t,selected:n,onSelect:r,waitingRunId:i,finished:l}){const{runs:a}=e;if(!a.length)return s.jsxs("div",{className:"ptl-node ghost","aria-disabled":"true",title:l?"Skipped":"Not run yet",children:[s.jsx(Ot,{agent:Hh(e.ref),size:22}),s.jsx("span",{className:"ptl-name",children:t}),s.jsx("span",{className:`ptl-dot ${l?"skipped":"pending"}`})]});const o=a[a.length-1],u=a.some(h=>h.id===n),c=a.some(h=>h.id===i);return s.jsxs("div",{className:`ptl-node ${o.status} ${u?"selected":""} ${c?"waiting":""}`,children:[s.jsxs("button",{role:"tab","aria-selected":u,className:"ptl-main",onClick:()=>r((a.find(h=>h.id===n)??o).id),title:`${t} · ${a.length} run${a.length>1?"s":""}`,children:[s.jsx(Ot,{agent:o.agent,size:22}),s.jsx("span",{className:"ptl-name",children:t}),a.length>1&&s.jsxs("span",{className:"ptl-count",children:["×",a.length]})]}),s.jsx("span",{className:"ptl-runs",children:a.map((h,d)=>s.jsx("button",{type:"button",className:`ptl-dot ${h.id===i?"waiting":h.status} ${h.id===n?"on":""}`,onClick:()=>r(h.id),title:yT(h,t,d+1),"aria-label":`${t} run ${d+1}: ${h.status}`},h.id))}),a.length===1&&s.jsx("span",{className:"ptl-time",children:ds(o.startedAt,o.finishedAt)})]})}function yT(e,t,n){const r=e.usage;return[`${t} #${n}: ${e.status}`,ds(e.startedAt,e.finishedAt),e.turns!==null?`${e.turns} turns`:null,e.costUsd!==null?Gt(e.costUsd):null,r?`${ln(r.inputTokens+r.cacheReadTokens+r.cacheWriteTokens)} in / ${ln(r.outputTokens)} out`:null].filter(Boolean).join(" · ")}class Sm extends Error{}const vT=e=>e.ref??e.agent;function jT(e){return e.status==="passed"?!0:e.agent==="explorer"&&e.status==="failed"&&e.output!==null&&e.output!==void 0}function bs(e,t){return e.kind==="agent"?{kind:"ghost",key:t,ref:e.agent}:{kind:"loop",key:t,step:e,state:"pending",iterations:[e.steps.map((n,r)=>bs(cs(n),`${t}.${r}`))]}}function wT(e,t){let n=0;const r=(a,o)=>{const u=t[n];if(!u)return{node:{kind:"ghost",key:o,ref:a},flow:"open"};if(vT(u)!==a)throw new Sm;n++;const c=u.status!=="running"&&u.status!=="pending";return{node:{kind:"run",key:o,run:u},flow:c?jT(u)?"ok":"fail":"open"}},i=(a,o)=>a.kind==="agent"?r(a.agent,o):l(a,o),l=(a,o)=>{const u=a.steps.map(cs),c=a.endsWhen==="last",h=[],d=f=>({kind:"loop",key:o,step:a,iterations:h,state:f});if(n>=t.length)return{node:bs(a,o),flow:"open"};for(let f=0;f<a.maxIterations;f++){const m=[];h.push(m);const p=`${o}i${f}`,g=x=>u.slice(x).forEach((y,v)=>m.push(bs(y,`${p}.${x+v}`)));if(c){for(let x=0;x<u.length;x++){const y=i(u[x],`${p}.${x}`);if(m.push(y.node),y.flow==="open")return g(x+1),{node:d("running"),flow:"open"};if(y.flow==="stop")return{node:d("stopped"),flow:"stop"};const v=x===u.length-1;if(v&&y.flow==="ok")return{node:d("passed"),flow:"ok"};if(!v&&y.flow==="fail")return{node:d("stopped"),flow:"stop"}}if(f<a.maxIterations-1&&n>=t.length)return h.push(u.map((x,y)=>bs(x,`${o}i${f+1}.${y}`))),{node:d("running"),flow:"open"};continue}const w=i(u[0],`${p}.0`);if(m.push(w.node),w.flow==="open")return{node:d("running"),flow:"open"};if(w.flow==="stop")return{node:d("stopped"),flow:"stop"};if(w.flow==="ok")return{node:d("passed"),flow:"ok"};if(f===a.maxIterations-1)break;for(let x=1;x<u.length;x++){const y=i(u[x],`${p}.${x}`);if(m.push(y.node),y.flow==="open")return g(x+1),{node:d("running"),flow:"open"};if(y.flow!=="ok")return{node:d("stopped"),flow:"stop"}}if(n>=t.length)return h.push([bs(u[0],`${o}i${f+1}.0`)]),{node:d("running"),flow:"open"}}return{node:d("out"),flow:"fail"}};try{const a=[];let o=!1;return e.forEach((u,c)=>{if(o){a.push(bs(u,`b${c}`));return}const h=i(u,`b${c}`);a.push(h.node),h.flow!=="ok"&&(o=!0)}),n===t.length?a:null}catch(a){if(a instanceof Sm)return null;throw a}}const Av=e=>e.some(t=>t.kind==="run"||t.kind==="loop"&&t.iterations.some(Av));function Iv(e){const t=e[0];if(t.kind!=="loop"){const a=t.kind==="run"?t.run.ref??t.run.agent:t.ref;return{kind:"agent",key:t.key,ref:a,runs:e.flatMap(o=>o.kind==="run"?[o.run]:[])}}const n=e.filter(a=>a.kind==="loop"),r=t.step.steps.length,i=[];for(let a=0;a<r;a++){const o=n.flatMap(u=>u.iterations.flatMap(c=>c[a]?[c[a]]:[]));o.length&&i.push(Iv(o))}const l=n[n.length-1];return{kind:"loop",key:t.key,step:t.step,state:l.state,passes:n.map(a=>a.iterations.filter(Av).length),children:i}}function kT(e){return e.map(t=>Iv([t]))}const bT=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"];function ST(e,t){const n=Ao[e].filter(i=>!Gi(e)||!Nh.includes(i));let r=0;for(const i of t)i.agent===n[r]&&r++;return n.slice(r)}function NT(e,t){const n=o=>o.ref??o.agent,r=(o,u)=>({kind:"agent",key:u,agent:Hh(o),name:Rl(o,e.agents),description:o.startsWith("custom:")?"Custom agent":Se[o].description}),i=(o,u)=>o.kind==="agent"?r(o.agent,u):{kind:"loop",key:u,maxIterations:o.maxIterations,items:o.steps.map((c,h)=>i(cs(c),`${u}-${h}`))},l=[];let a=0;return e.pipeline.steps.forEach((o,u)=>{if(o.kind==="agent"){a<t.length?a++:l.push(i(o,`s${u}`));return}if(a<t.length){const c=new Set(Io([o]));for(;a<t.length&&c.has(n(t[a]));)a++;return}l.push(i(o,`s${u}`))}),l}const Gi=e=>e==="generate"||e==="heal";function CT(e,t){if(!Gi(e.type))return{linear:t,loop:[]};const n=t.findIndex(r=>Nh.includes(r.agent));return n<0?{linear:t,loop:[]}:{linear:t.slice(0,n),loop:t.slice(n)}}function ET(e,t,n,r){if(r)return null;const i=t[t.length-1];if(!i)return e.type==="heal"?"healer":"validator";if(i.status==="running"||i.status==="pending")return null;const l=t.filter(a=>a.agent==="healer").length;return i.agent==="validator"?i.status==="failed"&&l<n?"healer":null:i.status==="passed"?"validator":null}function Nm(e,t){const n=t.filter(i=>i.agent===e.agent&&i.label===e.label),r=zb(e);return n.length>1?`${r} #${n.indexOf(e)+1}`:r}function TT(){var oe;const e=Number(li().id),t=ut(),[n]=gh(),r=n.get("result")?Number(n.get("result")):null,{refresh:i}=Xt(),{job:l,runs:a,results:o,pipeline:u,pending:c,logs:h,error:d,refetch:f,reconnect:m}=J0(e),p=(l==null?void 0:l.status)==="waiting"?c:null,[g,w]=j.useState(null),x=j.useRef(!1),y=j.useRef(!1),[v,b]=j.useState(null);if(j.useEffect(()=>{if(x.current||a.length===0)return;const B=a.find(he=>he.status==="running");w((B??a[a.length-1]).id)},[a]),j.useEffect(()=>{if(y.current||!r||o.length===0)return;const B=o.find(he=>he.id===r);B!=null&&B.agentRunId&&(x.current=!0,y.current=!0,w(B.agentRunId))},[r,o]),j.useEffect(()=>{p&&(x.current=!0,w(p.runId))},[p==null?void 0:p.runId]),j.useEffect(()=>{l&&Bc.includes(l.status)&&i()},[l==null?void 0:l.status]),!Number.isInteger(e)||e<=0)return s.jsx(Pe,{error:"Invalid job id"});const E=a.find(B=>B.id===g)??null,k=l&&l.type in Ao?ST(l.type,a):[],R=l?Bc.includes(l.status):!1,T=(l==null?void 0:l.type)==="pipeline"&&u?wT(u.pipeline.steps,a):null,D=(l==null?void 0:l.type)==="pipeline"&&u&&!T?NT(u,a):[],C=(l==null?void 0:l.args.maxHealRounds)??vb.maxHealRounds,{linear:L,loop:A}=l?CT(l,a):{linear:a,loop:[]},z=l&&Gi(l.type)?ET(l,A,C,R):null,U=A.filter(B=>B.agent==="healer").length,I=B=>{x.current=!0,w(B)},Q=B=>s.jsx(AT,{run:B,label:Nm(B,a),selected:g===B.id,waiting:(p==null?void 0:p.runId)===B.id,onSelect:()=>I(B.id)},B.id),J=(B,he,ze,Ke,W)=>s.jsx(IT,{agent:B,finished:R,note:ze,name:Ke,description:W},he),H=B=>B.kind==="agent"?J(B.agent,B.key,void 0,B.name,B.description):s.jsxs("div",{className:"loop-group idle","aria-label":`Loop ×${B.maxIterations}`,children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(is,{size:14}),s.jsxs("span",{children:["Loop ×",B.maxIterations]})]}),s.jsx("div",{className:"loop-body",children:B.items.map((he,ze)=>s.jsxs(j.Fragment,{children:[ze>0&&s.jsx("span",{className:"connector"}),H(he)]},he.key))})]},B.key),X=a.some(B=>{var he;return B.agent==="runner"&&((he=B.output)==null?void 0:he.htmlReport)}),S=async B=>{if(!l)return;const he=o.filter(W=>(W.status==="failed"||W.status==="flaky")&&W.specFile&&W.tcId).map(W=>({spec:W.specFile,tcId:W.tcId})),ze=`${l.args.name??`Test run #${l.id}`} (${B?"failed re-run":"re-run"})`;if(!l.args.selection&&!B){try{const W=await q.createJob({type:"testrun",name:ze,...l.target!=="all"?{spec:l.target}:{},...l.args.tcId?{tcId:l.args.tcId}:{},repeatEach:l.args.repeatEach??1,...l.args.retries!==void 0?{retries:l.args.retries}:{},htmlReport:l.args.htmlReport});t(`/runs/${W.id}`)}catch(W){b(W.message)}return}let Ke=l.args.selection??he;if(B){const W=new Set(he.map(fe=>`${fe.spec}#${fe.tcId}`));Ke=Ke.filter(fe=>W.has(`${fe.spec}#${fe.tcId}`))}Ke=[...new Map(Ke.map(W=>[`${W.spec}#${W.tcId}`,W])).values()],t("/test-runs/new",{state:{name:ze,selection:Ke,retries:l.args.retries}})},ae=o.some(B=>B.status==="failed"||B.status==="flaky"),O=async()=>{b(null);try{await q.rerunFailedJob(e),m()}catch(B){b(B.message)}},N=async()=>{try{const B=await q.createJob({type:"generate",spec:l.target});t(`/runs/${B.id}`)}catch(B){b(B.message)}},F=l&&(l.type==="testrun"||l.type==="heal"||l.type==="generate")&&R?[...new Set(o.filter(B=>B.status==="failed"&&B.specFile).map(B=>B.specFile))]:[],Z=async B=>{try{const he=await q.createJob({type:"heal",spec:B,sourceJobId:e});t(`/runs/${he.id}`)}catch(he){b(he.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs",to:"/runs"},{label:`Job #${e}`}]}),s.jsx(Pe,{error:d??v}),l&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"row between",style:{marginBottom:6},children:[s.jsxs("div",{className:"row",children:[s.jsxs("h1",{className:"page-title",children:[kr[l.type]," ·"," ",l.type==="testrun"?l.args.name:l.type==="context"?s.jsx(ye,{to:"/project",children:"CLAUDE.md"}):l.type==="custom"||l.type==="pipeline"?[l.type==="pipeline"?l.args.pipelineName:l.args.customAgentName,l.target.endsWith(".md")?l.target:null].filter(Boolean).join(" · ")||l.target:l.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${l.target}`,children:l.target}):l.target]}),s.jsx(kn,{status:l.status})]}),s.jsxs("div",{className:"row",children:[X&&s.jsxs("a",{className:"btn ghost",href:xh(e),target:"_blank",rel:"noreferrer",title:"Playwright HTML report (new tab)",children:[s.jsx(bh,{size:14})," HTML report"]}),l.type==="testrun"&&R&&s.jsxs(s.Fragment,{children:[ae&&s.jsxs("button",{className:"btn ghost",onClick:()=>void S(!0),title:"New test run with only the failed test cases",children:[s.jsx(ft,{size:14})," Re-run failed"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S(!1),title:"New test run with the same test cases",children:[s.jsx(ft,{size:14})," Re-run"]})]}),(l.type==="pipeline"||l.type==="generate"||l.type==="heal")&&(l.status==="failed"||l.status==="cancelled"||l.status==="interrupted")&&s.jsxs("button",{className:"btn ghost",onClick:()=>void O(),title:"Run this job again from the step that stopped it: the earlier steps are not run again, their outputs are reused",children:[s.jsx(ft,{size:14})," Re-run failed"]}),l.type==="context"&&l.status==="passed"&&s.jsxs(ye,{className:"btn ghost",to:"/project",children:[s.jsx(jr,{size:15})," View CLAUDE.md"]}),l.type==="spec"&&l.status==="passed"&&s.jsxs(s.Fragment,{children:[s.jsxs(ye,{className:"btn ghost",to:`/specs/${l.target}`,children:[s.jsx(jr,{size:15})," Open spec"]}),s.jsxs("button",{className:"btn",onClick:()=>void N(),title:"QA Explorer → QA Script Generator → QA Validator ⇄ QA Script Healer on the new spec",children:[s.jsx(jh,{size:15})," Generate tests"]})]}),F.map(B=>s.jsxs("button",{className:"btn",onClick:()=>void Z(B),title:"QA Script Healer fixes the scripts of failing tests, then QA Validator re-runs them",children:[s.jsx(Py,{size:15})," Heal ",B]},B)),!R&&s.jsxs("button",{className:"btn danger",onClick:()=>void q.cancelJob(e).catch(B=>b(B.message)),children:[s.jsx(Ay,{size:14})," Cancel"]})]})]}),s.jsxs("div",{className:"muted small",style:{marginBottom:14},children:["Started ",Pt(l.startedAt??l.createdAt)," · ",ds(l.startedAt,l.finishedAt),l.args.tcId&&` · ${l.args.tcId}`,l.args.repeatEach&&` · repeat ${l.args.repeatEach}×`,l.args.retries!==void 0&&` · retries ${l.args.retries}`,l.args.selection&&` · ${l.args.selection.length} test case${l.args.selection.length===1?"":"s"}`,l.type==="testrun"&&(l.args.htmlReport?" · line + HTML report":" · line report"),Gi(l.type)&&` · max ${C} heal round${C===1?"":"s"}`,l.args.sourceJobId&&s.jsxs(s.Fragment,{children:[" ","· from ",s.jsxs(ye,{to:`/runs/${l.args.sourceJobId}`,children:["job #",l.args.sourceJobId]})]}),l.summary&&s.jsxs(s.Fragment,{children:[" · ",l.summary]})]}),l.warning&&s.jsxs("div",{className:"warn-box",children:["⚠ ",l.warning]}),T&&u?s.jsx(gT,{nodes:kT(T),agents:u.agents,selected:g,onSelect:I,waitingRunId:(p==null?void 0:p.runId)??null,finished:R}):s.jsxs("div",{className:"timeline",role:"tablist","aria-label":"Agents",children:[L.map((B,he)=>s.jsxs(j.Fragment,{children:[he>0&&s.jsx("span",{className:`connector ${L[he-1].status==="passed"?"done":""}`}),Q(B)]},B.id)),k.map((B,he)=>s.jsxs(j.Fragment,{children:[(L.length>0||he>0)&&s.jsx("span",{className:"connector"}),J(B,`g-${B}-${he}`)]},`ghost-${B}-${he}`)),D.map((B,he)=>s.jsxs(j.Fragment,{children:[(L.length>0||he>0)&&s.jsx("span",{className:"connector"}),H(B)]},B.key)),Gi(l.type)&&s.jsxs(s.Fragment,{children:[(L.length>0||k.length>0)&&s.jsx("span",{className:`connector ${((oe=L[L.length-1])==null?void 0:oe.status)==="passed"?"done":""}`}),s.jsxs("div",{className:`loop-group ${A.length?"":"idle"}`,"aria-label":"Validator and Healer loop",children:[s.jsxs("div",{className:"loop-head",children:[s.jsx(is,{size:14}),s.jsx("span",{children:"Validate ⇄ Heal loop"}),s.jsxs("span",{className:"loop-count",title:"Healer rounds used / maximum (Settings)",children:["heal round ",U,"/",C]})]}),s.jsxs("div",{className:"loop-body",children:[A.map((B,he)=>s.jsxs(j.Fragment,{children:[he>0&&s.jsx("span",{className:`connector ${A[he-1].status==="passed"?"done":""} ${B.agent==="validator"?"back":"fail"}`,title:B.agent==="validator"?"QA Script Healer done → back to QA Validator":"QA Validator failed → QA Script Healer"}),Q(B)]},B.id)),z&&s.jsxs(s.Fragment,{children:[A.length>0&&s.jsx("span",{className:`connector ${z==="validator"?"back":"fail"}`}),J(z,"loop-ghost",z==="healer"&&A.length?"Runs if the QA Validator fails":void 0)]}),!A.length&&!z&&J(l.type==="heal"?"healer":"validator","loop-skip")]}),s.jsx("div",{className:"loop-return",title:`QA Validator fails → QA Script Healer fixes → back to QA Validator. Stops when tests pass, the QA Script Healer reports an app bug or gives up, or after ${C} heal round${C===1?"":"s"}.`,children:s.jsxs("span",{children:["↺ back to QA Validator · max ",C]})})]})]})]}),p&&s.jsx(LT,{jobId:e,label:p.label,questions:p.questions??[],onDone:()=>void f()},`review-${p.runId}`),E?s.jsx(DT,{jobId:e,job:l,run:E,label:Nm(E,a),log:h[E.id]??"",results:o.filter(B=>B.agentRunId===E.id),highlightResultId:r,reviewing:(p==null?void 0:p.runId)===E.id},E.id):s.jsx("div",{className:"card pad muted",children:"Waiting for the first agent to start…"})]})]})}const _s=-1,PT=e=>Object.fromEntries(e.map(t=>[t.id,Math.max(t.options.findIndex(n=>n.recommended),t.options.length?0:_s)]));function RT({questions:e,choice:t,other:n,onChoice:r,onOther:i}){return s.jsx("ol",{className:"question-list",children:e.map(l=>s.jsx("li",{className:"question",children:s.jsxs("fieldset",{children:[s.jsx("legend",{children:l.question}),l.options.map((a,o)=>s.jsxs("label",{className:`question-option ${t[l.id]===o?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===o,onChange:()=>r(l.id,o)}),s.jsxs("span",{children:[s.jsx("b",{children:a.label}),a.recommended&&s.jsx("span",{className:"chip ok small",children:"Recommended"}),a.description&&s.jsx("span",{className:"muted small question-desc",children:a.description})]})]},o)),s.jsxs("label",{className:`question-option ${t[l.id]===_s?"on":""}`,children:[s.jsx("input",{type:"radio",name:`q-${l.id}`,checked:t[l.id]===_s,onChange:()=>r(l.id,_s)}),s.jsxs("span",{className:"question-other",children:[s.jsx("b",{children:"Other"}),s.jsx("input",{className:"input",maxLength:kb,placeholder:"Type your answer",value:n[l.id]??"",onFocus:()=>r(l.id,_s),onChange:a=>i(l.id,a.target.value),"aria-label":`Other answer to: ${l.question}`})]})]})]})},l.id))})}function LT({jobId:e,label:t,questions:n,onDone:r}){const i=In(),[l,a]=j.useState(()=>PT(n)),[o,u]=j.useState({}),c=n.length>0,h=n.map(v=>{var b;return{id:v.id,answer:l[v.id]===_s?(o[v.id]??"").trim():((b=v.options[l[v.id]])==null?void 0:b.label)??""}}),d=h.filter(v=>!v.answer).length,[f,m]=j.useState(""),[p,g]=j.useState(!1),[w,x]=j.useState(null),y=async v=>{g(!0);try{await v(),r()}catch(b){x(b.message)}finally{g(!1)}};return s.jsxs("div",{className:"review-panel",role:"region","aria-label":"Review",children:[s.jsx("b",{children:c?`${t} has ${n.length} question${n.length>1?"s":""} for you.`:`${t} is waiting for your review.`}),s.jsx("span",{className:"muted small",children:c?`Pick an option or type your own answer. Sending runs ${t} again with your answers. Reject ends the pipeline.`:"Approve to continue the pipeline with this result. Reject ends the pipeline."}),c&&s.jsx(RT,{questions:n,choice:l,other:o,onChoice:(v,b)=>a(E=>({...E,[v]:b})),onOther:(v,b)=>u(E=>({...E,[v]:b}))}),s.jsx("textarea",{className:"input",rows:2,maxLength:xb,placeholder:"Reason (optional, saved with a rejection)",value:f,onChange:v=>m(v.target.value),"aria-label":"Reject reason"}),s.jsx(Pe,{error:w}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn danger",disabled:p,onClick:async()=>{await i({title:`Reject the output of ${t}?`,message:"The pipeline ends here and the job is marked failed.",confirmLabel:"Reject",danger:!0})&&await y(()=>q.rejectJob(e,f.trim()||void 0))},children:"Reject"}),c?s.jsx("button",{className:"btn",disabled:p||d>0,title:d?'Type an answer for every "Other"':void 0,onClick:()=>void y(()=>q.answerJob(e,h)),children:"Send answers"}):s.jsx("button",{className:"btn",disabled:p,onClick:()=>void y(()=>q.approveJob(e)),children:"Approve"})]})]})}function AT({run:e,label:t,selected:n,waiting:r,onSelect:i}){const l=e.usage;return s.jsxs("button",{role:"tab","aria-selected":n,className:`agent-card ${n?"selected":""} ${e.status} ${r?"waiting":""}`,onClick:i,children:[s.jsxs("span",{className:"agent-head",children:[s.jsx(Ot,{agent:e.agent}),s.jsxs("span",{children:[s.jsx("span",{className:"agent-name",children:t}),s.jsx("br",{}),s.jsx(kn,{status:e.status})]})]}),s.jsxs("span",{className:"agent-meta",children:[s.jsx("span",{children:ds(e.startedAt,e.finishedAt)}),e.turns!==null&&s.jsxs("span",{children:[e.turns," turns"]}),e.costUsd!==null&&s.jsx("span",{children:Gt(e.costUsd)}),l&&s.jsxs("span",{title:`input ${l.inputTokens} · output ${l.outputTokens} · cache read ${l.cacheReadTokens} · cache write ${l.cacheWriteTokens}`,children:[ln(l.inputTokens+l.cacheReadTokens+l.cacheWriteTokens)," in / ",ln(l.outputTokens)," out"]})]})]})}function IT({agent:e,finished:t,note:n,name:r,description:i}){return s.jsxs("div",{className:"agent-card ghost","aria-disabled":"true",children:[s.jsxs("span",{className:"agent-head",children:[s.jsx(Ot,{agent:e}),s.jsxs("span",{children:[s.jsx("span",{className:"agent-name",children:r??Se[e].label}),s.jsx("br",{}),s.jsx(dt,{status:t?"skipped":"pending"})]})]}),s.jsx("span",{className:"agent-meta",children:n??i??Se[e].description})]})}function DT({jobId:e,job:t,run:n,label:r,log:i,results:l,highlightResultId:a,reviewing:o}){const u=!!a&&l.some(x=>x.id===a),[c,h]=j.useState(u||o?"output":"log");j.useEffect(()=>{o&&h("output")},[o]);const[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=!["running","pending"].includes(n.status);j.useEffect(()=>{g&&q.agentRun(e,n.id).then(f).catch(()=>{})},[e,n.id,g]),j.useEffect(()=>{const x=m.current;x&&p.current&&(x.scrollTop=x.scrollHeight)},[i,c]),FT(m,c==="log");const w=i||(d==null?void 0:d.log)||"";return s.jsxs("div",{className:"card panel",children:[s.jsxs("div",{className:"panel-head",children:[s.jsx(Ot,{agent:n.agent,size:30}),s.jsxs("div",{className:"grow",children:[s.jsxs("div",{style:{fontWeight:600},children:[r," ",s.jsx(kn,{status:n.status})]}),s.jsx("div",{className:"muted small",children:Se[n.agent].description})]}),s.jsx(bn,{value:c,onChange:h,items:[{id:"log",label:"Log"},{id:"output",label:"Output"},{id:"perm",label:"Permissions"}]})]}),s.jsxs("div",{className:"panel-body",children:[c==="log"&&n.usage&&s.jsxs("div",{className:"muted small",style:{marginBottom:8},children:[n.usage.model??"model unknown"," · input ",ln(n.usage.inputTokens)," · output ",ln(n.usage.outputTokens)," · cache read"," ",ln(n.usage.cacheReadTokens)," · cache write ",ln(n.usage.cacheWriteTokens),n.costUsd!==null&&s.jsxs(s.Fragment,{children:[" · est. ",Gt(n.costUsd)]})]}),c==="log"&&s.jsx("pre",{className:"log",ref:m,onScroll:x=>{const y=x.currentTarget;p.current=y.scrollHeight-y.scrollTop-y.clientHeight<40},children:w?s.jsx(MT,{text:w}):n.status==="running"?"Waiting for output…":"(empty)"}),c==="output"&&s.jsx(_T,{jobId:t.id,run:n,full:d,results:l,highlightResultId:a}),c==="perm"&&s.jsx("div",{children:n.allowedTools?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": any action outside the allow list is denied."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:n.allowedTools.map(x=>s.jsx("code",{children:x},x))}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:bT.map(x=>s.jsx("code",{className:"deny",children:x},x))})]}):s.jsx("p",{className:"muted",children:"Non-LLM agent: runs Playwright Test directly (no shell) and cannot write any file other than the report."})})]})]})}function MT({text:e}){const t=j.useMemo(()=>e.split(`
374
374
  `),[e]);return s.jsx(s.Fragment,{children:t.map((n,r)=>{const i=/^\s*▶/.test(n)?"l-tool":/^\s*←/.test(n)?"l-ok":/^\s*✗|^\[(error|launch error)|^\[denied\]|✘|^\s*\d+\) \S|^\s*\d+ (failed|flaky)\b/.test(n)?"l-err":/^\[claude\]|^\[done\]|^⚠|^\$ /.test(n)?"l-meta":"";return s.jsxs("span",{className:i,children:[n,`
375
- `]},r)})})}function la({before:e,after:t}){const n=j.useMemo(()=>fb(e,t),[e,t]);return n.some(r=>r.type!=="same")?s.jsx("pre",{className:"diff",children:n.map((r,i)=>s.jsxs("div",{className:r.type==="same"?"":r.type,children:[r.type==="add"?"+ ":r.type==="del"?"- ":" ",r.text]},i))}):s.jsx("p",{className:"muted",children:"Test file unchanged."})}function IT({results:e,highlightId:t}){const n=Bh(e),r=j.useRef(null),i=j.useRef(!1);return j.useEffect(()=>{if(!t)return;const l=e.findIndex(o=>o.id===t);if(l<0)return;const a=Math.floor(l/n.props.pageSize)+1;a!==n.props.page&&n.props.onPage(a)},[t,e,n.props.pageSize]),j.useEffect(()=>{t&&r.current&&!i.current&&(r.current.scrollIntoView({behavior:"smooth",block:"center"}),i.current=!0)},[t,n.pageItems]),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC"}),s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"num",children:"ms"}),s.jsx("th",{children:"Error"})]})}),s.jsx("tbody",{children:n.pageItems.map(l=>s.jsxs("tr",{ref:l.id===t?r:void 0,className:l.id===t?"row-highlight":void 0,children:[s.jsx("td",{children:l.tcId?s.jsx("code",{children:l.tcId}):"—"}),s.jsxs("td",{children:[l.title,s.jsx("div",{className:"muted small",children:l.testFile})]}),s.jsx("td",{children:s.jsx(dt,{status:l.status})}),s.jsx("td",{className:"num",children:l.durationMs}),s.jsxs("td",{style:{maxWidth:440},children:[l.error&&s.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",color:"var(--fail)",maxHeight:140,overflow:"auto"},children:l.error}),l.attachments.filter(a=>a.name==="trace"&&a.path).map(a=>s.jsxs("div",{className:"muted small",children:["Trace: ",s.jsxs("code",{children:['npx playwright show-trace "',a.path,'"']})]},a.path))]})]},l.id))})]}),s.jsx(fs,{...n.props,label:"results"})]})}function Cm({jobId:e}){const[t,n]=j.useState(null);return j.useEffect(()=>{q.jobRequirement(e).then(r=>n(r.requirement)).catch(()=>n(null))},[e]),t?s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["BA requirement (",t.length.toLocaleString()," characters)"]}),s.jsx("pre",{className:"mono",style:{whiteSpace:"pre-wrap",maxHeight:320,overflow:"auto",marginTop:8},children:t})]}):null}function DT({jobId:e,run:t,full:n,results:r,highlightResultId:i}){var a,o,u,c,h,d,f,m;if(t.status==="running"||t.status==="pending")return s.jsx("p",{className:"muted",children:"Agent is running; output will be available when it finishes."});if(t.agent==="custom"&&t.output){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.status==="passed"?"passed":"failed"})," ",p.summary]}),s.jsx("div",{className:"md",children:s.jsx(ui,{children:p.details})}),!!((a=p.questions)!=null&&a.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Questions asked"}),s.jsx("ol",{children:p.questions.map(g=>s.jsxs("li",{children:[g.question,s.jsx("ul",{children:g.options.map((w,x)=>s.jsxs("li",{children:[w.label,w.recommended?" (recommended)":"",w.description?s.jsxs("span",{className:"muted",children:[" · ",w.description]}):null]},x))})]},g.id))})]}),!!((o=p.answered)!=null&&o.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Your answers"}),s.jsx("ol",{children:p.answered.map(g=>s.jsxs("li",{children:[g.question,s.jsx("br",{}),"→ ",s.jsx("b",{children:g.answer})]},g.id))})]})]})}if(t.agent==="validator"||t.agent==="runner"){const p=t.output;return s.jsxs("div",{children:[p&&s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.passed?"passed":"failed"}),Object.entries(p.counts).map(([g,w])=>s.jsxs("span",{className:"row",style:{gap:4},children:[s.jsx(dt,{status:g,children:w})," ",g]},g)),s.jsx("code",{className:"muted",children:p.command}),p.htmlReport&&s.jsxs("a",{href:gh(t.jobId),target:"_blank",rel:"noreferrer",children:[s.jsx(bh,{size:13})," Open HTML report"]})]}),!p&&s.jsx("p",{className:"muted",children:"No report."}),r.length>0&&s.jsx(IT,{results:r,highlightId:i})]})}if(!t.output)return s.jsxs("div",{children:[s.jsx("p",{className:"muted",children:"The agent did not write a result file. See the Log tab for details."}),t.agent==="specwriter"&&s.jsx(Cm,{jobId:e})]});if(t.agent==="contextwriter"){const p=t.output,g=(w,x)=>x!=null&&x.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:x.map((y,v)=>s.jsx("li",{children:y},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[g("Added / updated",p.added),g("Removed (old project)",p.removed),g("Notes added",p.notes),g("Security issues (notes not applied)",Array.isArray(p.security)?p.security.map(w=>typeof w=="string"?w:`"${w.note}" (${w.reason})`):void 0),g("Check these",p.warnings),p.failure?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Failed because"}),s.jsx("dd",{children:p.failure})]}):null]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}if(t.agent==="specwriter"){const p=t.output,g=(w,x)=>x!=null&&x.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:x.map((y,v)=>s.jsx("li",{children:y},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"Spec"}),s.jsx("dd",{children:s.jsx(ye,{to:`/specs/${p.specFile}`,children:s.jsxs("code",{children:["specs/",p.specFile]})})}),s.jsx("dt",{children:"Test cases"}),s.jsx("dd",{children:(u=p.tcIds)==null?void 0:u.map(w=>s.jsx("code",{style:{marginRight:6},children:w},w))}),g("Assumptions",p.assumptions),g("Questions for the BA",p.questions)]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading spec…"}),s.jsx(Cm,{jobId:e})]})}if(t.agent==="explorer"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.status})," ",p.summary]}),((c=p.environment)==null?void 0:c.ready)===!1&&s.jsxs("div",{className:"warn-box",style:{marginBottom:12},children:[s.jsx("b",{children:"Environment/setup not ready, pipeline stopped:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:((h=p.environment.issues)!=null&&h.length?p.environment.issues:["no details"]).map((g,w)=>s.jsx("li",{children:g},w))})]}),((d=p.environment)==null?void 0:d.ready)!==!1&&p.cases.some(g=>g.status==="failed")&&s.jsxs("p",{className:"muted small",children:["Failed cases: ",p.cases.filter(g=>g.status==="failed").map(g=>g.id).join(", ")," (possible app bugs). A Generate job does not stop here: it still writes their tests, asserting the expected result."]}),s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Evidence"})]})}),s.jsx("tbody",{children:p.cases.map(g=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{children:g.id})}),s.jsx("td",{children:s.jsx(dt,{status:g.status})}),s.jsx("td",{className:"small",style:{whiteSpace:"pre-wrap"},children:g.evidence})]},g.id))})]})}),p.assertions.length>0&&s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["Verified assertions (",p.assertions.length,")"]}),s.jsx("div",{className:"table-wrap",style:{marginTop:8},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Expression"}),s.jsx("th",{children:"Expected"}),s.jsx("th",{children:"Observed"})]})}),s.jsx("tbody",{children:p.assertions.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.case}),s.jsx("td",{children:s.jsx("code",{style:{whiteSpace:"pre-wrap"},children:g.expression})}),s.jsx("td",{className:"small",children:g.expected}),s.jsx("td",{className:"small",children:g.observed})]},w))})]})})]}),p.bugs.length>0&&s.jsxs("div",{className:"warn-box",children:[s.jsx("b",{children:"Potential bugs:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:p.bugs.map((g,w)=>s.jsx("li",{children:g},w))})]})]})}if(t.agent==="generator"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"File test"}),s.jsx("dd",{children:s.jsx("code",{children:p.testFile})}),s.jsx("dt",{children:"Test case"}),s.jsx("dd",{children:(f=p.tcIds)==null?void 0:f.map(g=>s.jsx("code",{style:{marginRight:6},children:g},g))}),p.pomChanges&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Page Object"}),s.jsx("dd",{children:p.pomChanges})]}),p.notes&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Notes"}),s.jsx("dd",{children:p.notes})]})]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const l=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:l.outcome})," ",l.diagnosis]}),((m=l.changes)==null?void 0:m.length)>0&&s.jsx("ul",{children:l.changes.map((p,g)=>s.jsx("li",{children:p},g))}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const MT=32,zT=240;function _T(e,t){j.useEffect(()=>{const n=e.current;if(!t||!n)return;const r=n.closest(".content"),i=r&&getComputedStyle(r).overflowY!=="visible"?r:null,l=()=>{const u=n.getBoundingClientRect(),c=i?i.clientHeight-(u.top-i.getBoundingClientRect().top+i.scrollTop):window.innerHeight-(u.top+window.scrollY);n.style.maxHeight=`${Math.max(zT,Math.floor(c-MT))}px`};l(),window.addEventListener("resize",l);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(l),o=(i??document.body).firstElementChild;return a&&o&&a.observe(o),()=>{window.removeEventListener("resize",l),a==null||a.disconnect(),n.style.maxHeight=""}},[e,t])}const $T=["all","mapped","missing","stale","orphan"],Lu=e=>e.charAt(0).toUpperCase()+e.slice(1);function OT(){const e=ut(),{specs:t,refresh:n}=un(),[r,i]=j.useState("all"),[l,a]=j.useState(""),[o,u]=j.useState(null),c=Pl([r,l]),{data:h,error:d,reload:f}=Ie(()=>q.mappingPage({page:c.page,pageSize:c.pageSize,status:r==="all"?void 0:r,spec:l||void 0}),[c.page,c.pageSize,r,l]),m=(h==null?void 0:h.items)??[],p=async g=>{try{const w=await q.createJob(g);e(`/runs/${w.id}`)}catch(w){u(w.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test cases"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test cases"}),s.jsx("p",{className:"page-sub",children:"Test case ↔ Playwright test traceability."})]})}),s.jsxs("div",{className:"toolbar",children:[s.jsx(bn,{value:r,onChange:i,items:$T.map(g=>({id:g,label:s.jsxs(s.Fragment,{children:[g==="all"?"All":Lu(g)," ",s.jsx("span",{className:"tab-count",children:(h==null?void 0:h.counts[g])??0})]})}))}),s.jsx("div",{className:"grow"}),s.jsxs("select",{className:"select",value:l,onChange:g=>a(g.target.value),"aria-label":"Filter by spec",children:[s.jsx("option",{value:"",children:"All specs"}),t.map(g=>s.jsx("option",{value:g.file,children:g.file},g.file))]}),s.jsxs("button",{className:"btn ghost",onClick:()=>{n(),f()},children:[s.jsx(Pr,{size:14})," Refresh"]})]}),s.jsx(Pe,{error:d??o}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"TC"}),s.jsx("th",{children:"TC name"}),s.jsx("th",{children:"Test file"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:m.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.specFile?s.jsx(ye,{to:`/specs/${g.specFile}`,className:"mono",children:g.specFile}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:g.tcId?s.jsx("code",{children:g.tcId}):"—"}),s.jsx("td",{children:g.tcTitle??g.testTitle??"—"}),s.jsx("td",{children:g.testFile?s.jsxs("code",{children:[g.testFile,":",g.testLine]}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:s.jsx(dt,{status:g.status,children:Lu(g.status)})}),s.jsx("td",{children:g.lastResult?s.jsx(ye,{to:`/runs/${g.lastResult.jobId}`,title:Pt(g.lastResult.at),children:s.jsx(dt,{status:g.lastResult.status,children:Lu(g.lastResult.status)})}):s.jsx(dt,{status:null})}),s.jsx("td",{style:{textAlign:"right"},children:g.testFile&&g.tcId&&g.specFile&&g.status!=="orphan"&&s.jsxs("button",{className:"btn ghost sm",onClick:()=>void p({type:"testrun",spec:g.specFile,tcId:g.tcId}),children:[s.jsx(ft,{size:12})," Run"]})})]},`${g.specFile??"__none"}-${g.tcId}-${g.testLine}-${w}`))})]}),h&&m.length===0&&s.jsx("p",{className:"muted pad",children:"No rows match the filter."}),h&&s.jsx(fs,{page:c.page,pageSize:c.pageSize,total:h.total,onPage:c.setPage,onPageSize:c.setPageSize,label:"test cases"})]})]})}const aa=(e,t)=>t?Math.round(e/t*100):0;function FT(){const e=ut(),{openNewSpec:t}=ds(),{specs:n,refresh:r}=un(),i=Ie(()=>q.dashboard()),l=Ie(()=>q.jobs()),[a,o]=j.useState(null),u=i.data,c=n.reduce((p,g)=>p+g.parsed.tcs.length,0),h=l.data??[],d=h[0],f=(u==null?void 0:u.failing)??[],m=()=>void q.createJob({type:"testrun",repeatEach:1}).then(p=>{r(),e(`/runs/${p.id}`)}).catch(p=>o(p.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Overview"}]}),s.jsx(Pe,{error:i.error??l.error??a}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Overview"}),s.jsx("p",{className:"page-sub",children:"Test coverage and run health across all specs."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>t(),children:[s.jsx(Qt,{size:15})," New spec"]}),s.jsxs("button",{className:"btn",onClick:m,children:[s.jsx(ft,{size:13})," Run all specs"]})]})]}),s.jsxs("div",{className:"stats",children:[s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Coverage"}),s.jsx("span",{className:"stat-icon",children:s.jsx(xh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[aa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.coverage.mapped)??0," / ",(u==null?void 0:u.coverage.total)??0," TC"]})]}),s.jsx("div",{className:"progress",children:s.jsx("i",{style:{width:`${aa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Pass rate"}),s.jsx("span",{className:"stat-icon ok",children:s.jsx(jh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[aa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.passRate.passed)??0," / ",(u==null?void 0:u.passRate.total)??0," TC"]})]}),s.jsx("div",{className:"progress ok",children:s.jsx("i",{style:{width:`${aa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Specs"}),s.jsx("span",{className:"stat-icon info",children:s.jsx(jr,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[n.length,s.jsxs("small",{children:[c," test cases"]})]}),s.jsx(ye,{to:"/specs",className:"stat-link",children:"Manage specs →"})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Recent runs"}),s.jsx("span",{className:"stat-icon warn",children:s.jsx(ft,{size:14})})]}),s.jsxs("div",{className:"stat-value",children:[h.length,s.jsx("small",{children:"runs"})]}),s.jsxs("div",{className:"muted small",children:["Last run: ",Pt((d==null?void 0:d.finishedAt)??(d==null?void 0:d.startedAt)??(d==null?void 0:d.createdAt))]})]})]}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent runs"}),s.jsx(ye,{to:"/runs",className:"card-link",children:"View all"})]}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Result"}),s.jsx("th",{className:"num",children:"Duration"})]})}),s.jsx("tbody",{children:h.slice(0,5).map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{className:"mono",children:["#",p.id]}),s.jsxs("td",{children:[p.target,p.args.tcId?s.jsxs("span",{className:"muted small",children:[" · ",p.args.tcId]}):null]}),s.jsx("td",{children:s.jsx(ti,{status:p.status,title:p.summary??void 0,children:p.summary&&p.summary.length<=24?p.summary:p.status})}),s.jsx("td",{className:"num muted",children:us(p.startedAt,p.finishedAt)})]},p.id))})]}),l.data&&h.length===0&&s.jsx("p",{className:"muted pad",children:"No runs yet."})]}),s.jsxs("div",{className:"card pad",children:[s.jsx("h3",{className:"card-title",children:"Pipeline agents"}),s.jsxs("p",{className:"muted small",style:{margin:"2px 0 14px"},children:["Runs with ",s.jsx("span",{className:"accent-text",children:"Claude Code"})," — no API key needed."]}),s.jsx("ol",{className:"agent-steps",children:["explorer","generator","validator","healer"].map((p,g)=>s.jsxs("li",{title:Se[p].description,children:[s.jsx("span",{className:"step-num",children:g+1}),Se[p].label,p==="healer"&&s.jsx("span",{className:"muted small accent-soft-text",children:"≤ 2 loops"})]},p))})]})]}),f.length>0&&s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Failing tests (",f.length,")"]})}),s.jsx("table",{className:"flat",children:s.jsx("tbody",{children:f.map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`),style:{cursor:"pointer"},title:"Open this failed test in Recent runs",children:[s.jsxs("td",{children:[s.jsx("div",{children:p.title}),s.jsx("div",{className:"mono small",style:{color:"var(--fail)"},children:(p.error??"").split(`
376
- `)[0].slice(0,160)})]}),s.jsx("td",{className:"num",children:s.jsxs(ye,{to:`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`,onClick:g=>g.stopPropagation(),children:["#",p.jobId]})})]},`${p.jobId}-${p.title}`))})})]}),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Specs at a glance"}),s.jsx(ye,{to:"/specs",className:"card-link",children:"Open Specs page"})]}),s.jsxs("div",{className:"glance",children:[((u==null?void 0:u.specs)??[]).map(p=>s.jsxs(ye,{to:`/specs/${p.file}`,className:"glance-row",children:[s.jsx("span",{className:"file-icon muted-icon",children:s.jsx(jr,{size:16})}),s.jsxs("div",{className:"grow",children:[s.jsx("div",{className:"mono strong",children:p.file}),s.jsx("div",{className:"muted small",children:p.title||"—"})]}),s.jsxs("span",{className:"muted small",children:[p.tcCount," test cases"]}),s.jsxs("span",{className:`chip ${p.mappedCount<p.tcCount?"warn":""}`,children:[p.mappedCount,"/",p.tcCount," mapped"]})]},p.file)),u&&u.specs.length===0&&s.jsx("p",{className:"muted pad",children:"No specs yet."})]})]})]})}async function Iv(){const e=await q.claudeMd();if(e.content===null)return;const t=URL.createObjectURL(new Blob([e.content],{type:"text/markdown"})),n=document.createElement("a");n.href=t,n.download=`CLAUDE-${new Date().toISOString().slice(0,10)}.md`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function UT(){var E,k,L,T,D;const e=ut(),t=Kn(),n=cs(),r=Ie(()=>q.claudeMd()),i=Ie(()=>q.jobsPage({page:1,pageSize:1,type:"context"})),l=Ie(()=>q.settings()),[a,o]=j.useState(""),[u,c]=j.useState("rendered"),[h,d]=j.useState(!1),[f,m]=j.useState(null),p=(E=i.data)==null?void 0:E.items[0],g=(k=l.data)==null?void 0:k.env,w=j.useRef(null),[x,y]=j.useState(null),v=async N=>{if(!N)return;if(!/\.md$/i.test(N.name))return m("Choose a Markdown (.md) file.");const P=await N.text();if(!await t({title:"Replace CLAUDE.md?",message:`CLAUDE.md is replaced with ${N.name}. The current file is backed up first.`,confirmLabel:"Replace",danger:!0})){w.current&&(w.current.value="");return}try{const z=await q.uploadClaudeMd(P);n.success("CLAUDE.md replaced"),y(`CLAUDE.md replaced with ${N.name}.${z.backup?` Previous version backed up to ${z.backup}.`:""}`),m(null),r.reload()}catch(z){m(z.message)}finally{w.current&&(w.current.value="")}},b=async N=>{N.preventDefault(),d(!0);try{const P=await q.createJob({type:"context",...a.trim()?{notes:a.trim()}:{}});e(`/runs/${P.id}`)}catch(P){m(P.message),d(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project context"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Project context"}),s.jsxs("p",{className:"page-sub",children:["Copied this QA template from another project? Update ",s.jsx("code",{children:"CLAUDE.md"})," so the agents work with this project's app, accounts and conventions, and drop the old project's."]})]})}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["CLAUDE.md"," ",((L=r.data)==null?void 0:L.mtimeMs)&&s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· modified ",Pt(new Date(r.data.mtimeMs).toISOString())]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>void Iv(),disabled:!((T=r.data)!=null&&T.content),children:"Download"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>{var N;return(N=w.current)==null?void 0:N.click()},title:"Replace CLAUDE.md with a file, e.g. this project's saved context",children:[s.jsx(wh,{size:13})," Upload"]}),s.jsx("input",{ref:w,type:"file",accept:".md,text/markdown",hidden:!0,onChange:N=>{var P;return void v((P=N.target.files)==null?void 0:P[0])}}),s.jsx(bn,{value:u,onChange:c,items:[{id:"rendered",label:"Preview"},{id:"source",label:"Source"}]})]})]}),x&&s.jsx("div",{className:"ok-box",style:{margin:12},children:x}),s.jsx(Pe,{error:r.error}),r.data&&r.data.content===null&&s.jsx("p",{className:"muted pad",children:"There is no CLAUDE.md at the repo root yet. The Context Writer will create one."}),((D=r.data)==null?void 0:D.content)&&(u==="rendered"?s.jsx("div",{className:"pad md claude-md",children:s.jsx(ui,{children:r.data.content.replace(/<!--[\s\S]*?-->/g,"")})}):s.jsx("pre",{className:"mono pad claude-md",style:{margin:0,whiteSpace:"pre-wrap"},children:r.data.content}))]}),s.jsxs("form",{className:"card pad req-form",onSubmit:b,children:[s.jsxs("div",{className:"row",children:[s.jsx(Ot,{agent:"contextwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"Context Writer"}),s.jsx("div",{className:"muted small",children:"LLM agent (Claude Code), may only edit CLAUDE.md"})]})]}),s.jsxs("ol",{className:"req-steps",children:[s.jsx("li",{children:"Reads this repo: specs, tests, fixtures, Page Objects, playwright.config.ts and README."}),s.jsxs("li",{children:["Gets the ",s.jsx("code",{children:".env"})," variable names (",g?g.provided.length?g.provided.join(", "):"no .env found":"…",") but only the values of URL/origin variables, never passwords or accounts."]}),s.jsxs("li",{children:["Rewrites one ",s.jsx("b",{children:"Project context"})," section in CLAUDE.md and removes facts about the old project. The generic QA rules stay as they are."]}),s.jsx("li",{children:"Lists leftovers from the old project (specs, tests, .env.example values) as warnings. It never deletes files."})]}),s.jsxs("label",{children:["Notes about this project (optional)",s.jsx("textarea",{className:"input",style:{minHeight:140},value:a,onChange:N=>o(N.target.value),placeholder:"e.g. <App name>: customer portal. Roles: admin, customer. Login with email + password. Test ids use data-testid."})]}),s.jsx("p",{className:"muted small",style:{margin:0},children:"The job fails if a password or account value from .env ends up in CLAUDE.md. Review the diff on the job page; git can undo it."}),s.jsx(Pe,{error:f}),s.jsxs("div",{className:"row between",children:[s.jsx("span",{className:"muted small",children:p?s.jsxs(s.Fragment,{children:["Last update: ",s.jsxs(ye,{to:`/runs/${p.id}`,children:["job #",p.id]})," ",s.jsx(kn,{status:p.status})," ",Pt(p.finishedAt??p.createdAt)]}):"Never updated by Agent Studio"}),s.jsxs("button",{type:"submit",className:"btn",disabled:h,children:[s.jsx(kh,{size:15})," ",h?"Starting…":"Update CLAUDE.md"]})]})]})]}),s.jsxs("div",{className:"card pad danger-zone row between",style:{marginTop:14},children:[s.jsxs("div",{children:[s.jsx("b",{children:"Reset project template"}),s.jsx("div",{className:"muted small",children:"Reusing this repository for another project? Remove the specs, Playwright tests, Page Objects, fixtures, results, logs and project context, and reset CLAUDE.md to the generic rules. You choose what to remove and see the list first."})]}),s.jsxs(ye,{className:"btn danger",to:"/project/reset",children:[s.jsx(Rr,{size:14})," Reset project template…"]})]})]})}const BT=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function Em({mentions:e,title:t}){const n=j.useMemo(()=>{const r=new Map;for(const i of e)r.set(i.file,[...r.get(i.file)??[],i]);return[...r.entries()]},[e]);return e.length?s.jsxs("details",{className:"rt-mentions",children:[s.jsxs("summary",{children:[t,": ",e.length," line",e.length===1?"":"s"," in ",n.length," file",n.length===1?"":"s"]}),s.jsx("p",{className:"muted small",children:"These files are not changed by the reset (source code, docs). Review and edit them by hand."}),n.map(([r,i])=>s.jsxs("div",{className:"rt-file",children:[s.jsx("code",{children:r}),i.map(l=>s.jsxs("div",{className:"rt-line",children:[s.jsx("span",{className:"muted",children:l.line})," ",l.text]},`${l.line}-${l.text}`))]},r))]}):s.jsx("p",{className:"muted small",children:"No other file mentions the project."})}function HT(){const{refresh:e}=un(),[t,n]=j.useState(null),[r,i]=j.useState(new Set),[l,a]=j.useState(""),[o,u]=j.useState(""),[c,h]=j.useState(!0),[d,f]=j.useState(!1),[m,p]=j.useState(null),[g,w]=j.useState(null),x=async(E=l)=>{try{const k=await q.resetPlan(E);n(k),i(L=>L.size?L:new Set(k.categories.filter(T=>T.defaultOn).map(T=>T.id))),p(null)}catch(k){p(k.message)}};j.useEffect(()=>{x()},[]);const y=E=>i(k=>{const L=new Set(k);return L.has(E)?L.delete(E):L.add(E),L}),v=async()=>{if(t){f(!0);try{const E=await q.resetProject({categories:[...r],confirm:o,backup:c,terms:l.split(",").map(k=>k.trim()).filter(Boolean)});w(E),u(""),e(),await x()}catch(E){p(E.message)}finally{f(!1)}}},b=t&&o===t.confirmWord&&r.size>0&&!t.busy&&!d;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project context",to:"/project"},{label:"Reset project template"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Reset project template"}),s.jsxs("p",{className:"page-sub",children:["Strip everything that belongs to the current project so this repository can be cloned and reused for another one. With ",s.jsx("b",{children:"Backup data"})," on, specs, tests, CLAUDE.md and chat history are backed up first; results and logs are always deleted for good."]})]})}),g&&s.jsxs("div",{className:"ok-box",children:[s.jsx("b",{children:"Project reset."})," ",Object.entries(g.removed).map(([E,k])=>{var L;return`${((L=t==null?void 0:t.categories.find(T=>T.id===E))==null?void 0:L.label)??E}: ${k}`}).join(" · "),g.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"Backup of the removed files (specs, tests, CLAUDE.md, chat history…): ",s.jsx("code",{children:g.backupDir})]}),!g.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"No backup was made: removed items were deleted permanently."]}),s.jsx("br",{}),"Next: add specs for the new project, then ",s.jsx(ye,{to:"/project",children:"update CLAUDE.md"})," with the Context Writer or upload the project's CLAUDE.md.",g.mentions.length>0&&s.jsx("div",{style:{marginTop:8},children:s.jsx(Em,{mentions:g.mentions,title:"Still mentioned"})})]}),s.jsx(Pe,{error:m}),(t==null?void 0:t.busy)&&s.jsx("div",{className:"warn-box",children:"A job is queued, running or waiting for review. Wait for it to finish (or cancel it) before resetting."}),t&&s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx("h3",{children:"What to reset"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void x(),children:[s.jsx(Pr,{size:13})," Refresh"]})]}),t.categories.map(E=>s.jsxs("label",{className:`rt-cat ${r.has(E.id)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:r.has(E.id),onChange:()=>y(E.id)}),s.jsxs("span",{className:"grow",children:[s.jsxs("span",{className:"rt-cat-head",children:[s.jsx("b",{children:E.label}),s.jsxs("span",{className:"muted small",children:[E.fileCount," ",E.id==="prompts"?"custom":`file${E.fileCount===1?"":"s"}`,E.bytes?` · ${BT(E.bytes)}`:""]}),s.jsx("span",{className:`rt-tag ${E.backedUp&&c?"":"gone"}`,children:E.backedUp&&c?"backed up":"deleted for good"})]}),s.jsx("span",{className:"muted small",children:E.description}),E.note&&s.jsx("span",{className:"small",children:E.note}),E.files.length>0&&s.jsxs("details",{className:"rt-files",children:[s.jsx("summary",{className:"small",children:"Show files"}),E.files.map(k=>s.jsx("code",{children:k},k)),E.fileCount>E.files.length&&s.jsxs("span",{className:"muted small",children:["…and ",E.fileCount-E.files.length," more"]})]})]})]},E.id))]}),s.jsxs("div",{style:{display:"grid",gap:14,alignContent:"start"},children:[s.jsxs("div",{className:"card pad",style:{display:"grid",gap:10},children:[s.jsx("h3",{className:"card-title",children:"Project mentions elsewhere"}),s.jsxs("p",{className:"muted small",style:{margin:0},children:["Words that identify this project (from spec, fixture and Page Object names and the app's hostnames):"," ",t.terms.length?t.terms.map(E=>s.jsx("code",{style:{marginRight:4},children:E},E)):"none found","."]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"More words, comma-separated (e.g. app or client name)",value:l,onChange:E=>a(E.target.value)}),s.jsx("button",{className:"btn ghost sm",onClick:()=>void x(l),children:"Scan"})]}),s.jsx(Em,{mentions:t.mentions,title:"Mentions the reset leaves"})]}),s.jsxs("div",{className:"card pad danger-zone",style:{display:"grid",gap:10},children:[s.jsx("h3",{className:"card-title",children:"Reset"}),s.jsxs("p",{className:"small",style:{margin:0},children:["Keep this project's context? ",s.jsx("button",{className:"link-btn",onClick:()=>void Iv(),children:"Download the current CLAUDE.md"})," first; upload it again later on the Project context page."]}),s.jsxs("label",{className:"small row",style:{gap:8,alignItems:"center"},children:[s.jsx("input",{type:"checkbox",checked:c,onChange:E=>h(E.target.checked)}),s.jsx("b",{children:"Backup data"})]}),!c&&s.jsx("div",{className:"warn-box small",style:{margin:0},children:"Backup is off: the selected items are deleted permanently and cannot be restored."}),s.jsxs("label",{className:"small",style:{display:"grid",gap:6},children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:t.confirmWord})," to confirm"]}),s.jsx("input",{className:"input mono",value:o,onChange:E=>u(E.target.value),"aria-label":"Confirmation word",autoComplete:"off"})]}),s.jsxs("button",{className:"btn danger-solid",disabled:!b,onClick:()=>void v(),children:[s.jsx(Rr,{size:14})," ",d?"Resetting…":`Reset ${r.size} item${r.size===1?"":"s"}`]})]})]})]})]})}const WT=/^[a-z0-9][a-z0-9_-]*$/;function VT(e){return e.replace(/\.(md|txt)$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)}function QT(){const e=ut(),{specs:t}=un(),[n,r]=j.useState(""),[i,l]=j.useState(""),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,d]=j.useState(null),f=j.useRef(null),m=n.trim().replace(/\.md$/,""),p=`${m}.md`,g=t.some(v=>v.file===p),w=i.length>vu,x=async v=>{if(v){if(!/\.(md|txt)$/i.test(v.name))return d("Only .md or .txt files can be loaded. Copy text from Word/Confluence and paste it instead.");l(await v.text()),m||r(VT(v.name)),d(null)}},y=async v=>{if(v.preventDefault(),!WT.test(m))return d('Spec name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');if(!i.trim())return d("Paste the requirement first.");if(w)return d(`The requirement is longer than ${vu.toLocaleString()} characters.`);if(g&&!a)return d(`specs/${p} already exists. Choose another name or tick "Overwrite".`);c(!0);try{const b=await q.createJob({type:"spec",spec:p,requirement:i,...g?{overwrite:!0}:{}});e(`/runs/${b.id}`)}catch(b){d(b.message),c(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Generator"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Generator"}),s.jsx("p",{className:"page-sub",children:"Paste a BA requirement or user story. The QA Test Case Writer agent turns it into a spec with test cases, which you then review and run."})]})}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("form",{className:"card pad req-form",onSubmit:y,children:[s.jsxs("label",{children:["Spec name",s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"e.g. login",value:n,onChange:v=>r(v.target.value),"aria-describedby":"spec-name-help"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsxs("span",{id:"spec-name-help",className:"muted small",style:{fontWeight:400},children:["Saved as ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})]})]}),g&&s.jsxs("label",{className:"row",style:{display:"flex",fontWeight:400},children:[s.jsx("input",{type:"checkbox",checked:a,onChange:v=>o(v.target.checked)}),s.jsxs("span",{children:[s.jsxs("b",{children:["specs/",p]})," already exists: overwrite it (existing TC-IDs are kept where they still apply)"]})]}),s.jsxs("label",{children:[s.jsxs("span",{className:"row between",children:[s.jsx("span",{children:"Requirement"}),s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},children:[s.jsx(wh,{size:14})," Load .md / .txt"]})]}),s.jsx("textarea",{className:"input",value:i,onChange:v=>l(v.target.value),placeholder:`As a <role>, I want to <action> so that <benefit>.
375
+ `]},r)})})}function la({before:e,after:t}){const n=j.useMemo(()=>pb(e,t),[e,t]);return n.some(r=>r.type!=="same")?s.jsx("pre",{className:"diff",children:n.map((r,i)=>s.jsxs("div",{className:r.type==="same"?"":r.type,children:[r.type==="add"?"+ ":r.type==="del"?"- ":" ",r.text]},i))}):s.jsx("p",{className:"muted",children:"Test file unchanged."})}function zT({results:e,highlightId:t}){const n=Bh(e),r=j.useRef(null),i=j.useRef(!1);return j.useEffect(()=>{if(!t)return;const l=e.findIndex(o=>o.id===t);if(l<0)return;const a=Math.floor(l/n.props.pageSize)+1;a!==n.props.page&&n.props.onPage(a)},[t,e,n.props.pageSize]),j.useEffect(()=>{t&&r.current&&!i.current&&(r.current.scrollIntoView({behavior:"smooth",block:"center"}),i.current=!0)},[t,n.pageItems]),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC"}),s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"num",children:"ms"}),s.jsx("th",{children:"Error"})]})}),s.jsx("tbody",{children:n.pageItems.map(l=>s.jsxs("tr",{ref:l.id===t?r:void 0,className:l.id===t?"row-highlight":void 0,children:[s.jsx("td",{children:l.tcId?s.jsx("code",{children:l.tcId}):"—"}),s.jsxs("td",{children:[l.title,s.jsx("div",{className:"muted small",children:l.testFile})]}),s.jsx("td",{children:s.jsx(dt,{status:l.status})}),s.jsx("td",{className:"num",children:l.durationMs}),s.jsxs("td",{style:{maxWidth:440},children:[l.error&&s.jsx("pre",{className:"mono",style:{margin:0,whiteSpace:"pre-wrap",color:"var(--fail)",maxHeight:140,overflow:"auto"},children:l.error}),l.attachments.filter(a=>a.name==="trace"&&a.path).map(a=>s.jsxs("div",{className:"muted small",children:["Trace: ",s.jsxs("code",{children:['npx playwright show-trace "',a.path,'"']})]},a.path))]})]},l.id))})]}),s.jsx(ps,{...n.props,label:"results"})]})}function Cm({jobId:e}){const[t,n]=j.useState(null);return j.useEffect(()=>{q.jobRequirement(e).then(r=>n(r.requirement)).catch(()=>n(null))},[e]),t?s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["BA requirement (",t.length.toLocaleString()," characters)"]}),s.jsx("pre",{className:"mono",style:{whiteSpace:"pre-wrap",maxHeight:320,overflow:"auto",marginTop:8},children:t})]}):null}function _T({jobId:e,run:t,full:n,results:r,highlightResultId:i}){var a,o,u,c,h,d,f,m;if(t.status==="running"||t.status==="pending")return s.jsx("p",{className:"muted",children:"Agent is running; output will be available when it finishes."});if(t.agent==="custom"&&t.output){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.status==="passed"?"passed":"failed"})," ",p.summary]}),s.jsx("div",{className:"md",children:s.jsx(ui,{children:p.details})}),!!((a=p.questions)!=null&&a.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Questions asked"}),s.jsx("ol",{children:p.questions.map(g=>s.jsxs("li",{children:[g.question,s.jsx("ul",{children:g.options.map((w,x)=>s.jsxs("li",{children:[w.label,w.recommended?" (recommended)":"",w.description?s.jsxs("span",{className:"muted",children:[" · ",w.description]}):null]},x))})]},g.id))})]}),!!((o=p.answered)!=null&&o.length)&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Your answers"}),s.jsx("ol",{children:p.answered.map(g=>s.jsxs("li",{children:[g.question,s.jsx("br",{}),"→ ",s.jsx("b",{children:g.answer})]},g.id))})]})]})}if(t.agent==="validator"||t.agent==="runner"){const p=t.output;return s.jsxs("div",{children:[p&&s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.passed?"passed":"failed"}),Object.entries(p.counts).map(([g,w])=>s.jsxs("span",{className:"row",style:{gap:4},children:[s.jsx(dt,{status:g,children:w})," ",g]},g)),s.jsx("code",{className:"muted",children:p.command}),p.htmlReport&&s.jsxs("a",{href:xh(t.jobId),target:"_blank",rel:"noreferrer",children:[s.jsx(bh,{size:13})," Open HTML report"]})]}),!p&&s.jsx("p",{className:"muted",children:"No report."}),r.length>0&&s.jsx(zT,{results:r,highlightId:i})]})}if(!t.output)return s.jsxs("div",{children:[s.jsx("p",{className:"muted",children:"The agent did not write a result file. See the Log tab for details."}),t.agent==="specwriter"&&s.jsx(Cm,{jobId:e})]});if(t.agent==="contextwriter"){const p=t.output,g=(w,x)=>x!=null&&x.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:x.map((y,v)=>s.jsx("li",{children:y},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[g("Added / updated",p.added),g("Removed (old project)",p.removed),g("Notes added",p.notes),g("Security issues (notes not applied)",Array.isArray(p.security)?p.security.map(w=>typeof w=="string"?w:`"${w.note}" (${w.reason})`):void 0),g("Check these",p.warnings),p.failure?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Failed because"}),s.jsx("dd",{children:p.failure})]}):null]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}if(t.agent==="specwriter"){const p=t.output,g=(w,x)=>x!=null&&x.length?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:s.jsx("ul",{style:{margin:0,paddingLeft:18},children:x.map((y,v)=>s.jsx("li",{children:y},v))})})]}):null;return s.jsxs("div",{children:[s.jsx("p",{children:p.summary}),s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"Spec"}),s.jsx("dd",{children:s.jsx(ye,{to:`/specs/${p.specFile}`,children:s.jsxs("code",{children:["specs/",p.specFile]})})}),s.jsx("dt",{children:"Test cases"}),s.jsx("dd",{children:(u=p.tcIds)==null?void 0:u.map(w=>s.jsx("code",{style:{marginRight:6},children:w},w))}),g("Assumptions",p.assumptions),g("Questions for the BA",p.questions)]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading spec…"}),s.jsx(Cm,{jobId:e})]})}if(t.agent==="explorer"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:p.status})," ",p.summary]}),((c=p.environment)==null?void 0:c.ready)===!1&&s.jsxs("div",{className:"warn-box",style:{marginBottom:12},children:[s.jsx("b",{children:"Environment/setup not ready, pipeline stopped:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:((h=p.environment.issues)!=null&&h.length?p.environment.issues:["no details"]).map((g,w)=>s.jsx("li",{children:g},w))})]}),((d=p.environment)==null?void 0:d.ready)!==!1&&p.cases.some(g=>g.status==="failed")&&s.jsxs("p",{className:"muted small",children:["Failed cases: ",p.cases.filter(g=>g.status==="failed").map(g=>g.id).join(", ")," (possible app bugs). A Generate job does not stop here: it still writes their tests, asserting the expected result."]}),s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Evidence"})]})}),s.jsx("tbody",{children:p.cases.map(g=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{children:g.id})}),s.jsx("td",{children:s.jsx(dt,{status:g.status})}),s.jsx("td",{className:"small",style:{whiteSpace:"pre-wrap"},children:g.evidence})]},g.id))})]})}),p.assertions.length>0&&s.jsxs("details",{style:{marginTop:12},children:[s.jsxs("summary",{children:["Verified assertions (",p.assertions.length,")"]}),s.jsx("div",{className:"table-wrap",style:{marginTop:8},children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Case"}),s.jsx("th",{children:"Expression"}),s.jsx("th",{children:"Expected"}),s.jsx("th",{children:"Observed"})]})}),s.jsx("tbody",{children:p.assertions.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.case}),s.jsx("td",{children:s.jsx("code",{style:{whiteSpace:"pre-wrap"},children:g.expression})}),s.jsx("td",{className:"small",children:g.expected}),s.jsx("td",{className:"small",children:g.observed})]},w))})]})})]}),p.bugs.length>0&&s.jsxs("div",{className:"warn-box",children:[s.jsx("b",{children:"Potential bugs:"}),s.jsx("ul",{style:{margin:"6px 0 0"},children:p.bugs.map((g,w)=>s.jsx("li",{children:g},w))})]})]})}if(t.agent==="generator"){const p=t.output;return s.jsxs("div",{children:[s.jsxs("dl",{className:"kv",style:{marginBottom:12},children:[s.jsx("dt",{children:"File test"}),s.jsx("dd",{children:s.jsx("code",{children:p.testFile})}),s.jsx("dt",{children:"Test case"}),s.jsx("dd",{children:(f=p.tcIds)==null?void 0:f.map(g=>s.jsx("code",{style:{marginRight:6},children:g},g))}),p.pomChanges&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Page Object"}),s.jsx("dd",{children:p.pomChanges})]}),p.notes&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Notes"}),s.jsx("dd",{children:p.notes})]})]}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const l=t.output;return s.jsxs("div",{children:[s.jsxs("p",{className:"row",children:[s.jsx(dt,{status:l.outcome})," ",l.diagnosis]}),((m=l.changes)==null?void 0:m.length)>0&&s.jsx("ul",{children:l.changes.map((p,g)=>s.jsx("li",{children:p},g))}),n?s.jsx(la,{before:n.fileBefore,after:n.fileAfter}):s.jsx("p",{className:"muted",children:"Loading diff…"})]})}const $T=32,OT=240;function FT(e,t){j.useEffect(()=>{const n=e.current;if(!t||!n)return;const r=n.closest(".content"),i=r&&getComputedStyle(r).overflowY!=="visible"?r:null,l=()=>{const u=n.getBoundingClientRect(),c=i?i.clientHeight-(u.top-i.getBoundingClientRect().top+i.scrollTop):window.innerHeight-(u.top+window.scrollY);n.style.maxHeight=`${Math.max(OT,Math.floor(c-$T))}px`};l(),window.addEventListener("resize",l);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(l),o=(i??document.body).firstElementChild;return a&&o&&a.observe(o),()=>{window.removeEventListener("resize",l),a==null||a.disconnect(),n.style.maxHeight=""}},[e,t])}const UT=["all","mapped","missing","stale","orphan"],Du=e=>e.charAt(0).toUpperCase()+e.slice(1);function BT(){const e=ut(),{specs:t,refresh:n}=Xt(),[r,i]=j.useState("all"),[l,a]=j.useState(""),[o,u]=j.useState(null),c=Pl([r,l]),{data:h,error:d,reload:f}=Me(()=>q.mappingPage({page:c.page,pageSize:c.pageSize,status:r==="all"?void 0:r,spec:l||void 0}),[c.page,c.pageSize,r,l]),m=(h==null?void 0:h.items)??[],p=async g=>{try{const w=await q.createJob(g);e(`/runs/${w.id}`)}catch(w){u(w.message)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test cases"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test cases"}),s.jsx("p",{className:"page-sub",children:"Test case ↔ Playwright test traceability."})]})}),s.jsxs("div",{className:"toolbar",children:[s.jsx(bn,{value:r,onChange:i,items:UT.map(g=>({id:g,label:s.jsxs(s.Fragment,{children:[g==="all"?"All":Du(g)," ",s.jsx("span",{className:"tab-count",children:(h==null?void 0:h.counts[g])??0})]})}))}),s.jsx("div",{className:"grow"}),s.jsxs("select",{className:"select",value:l,onChange:g=>a(g.target.value),"aria-label":"Filter by spec",children:[s.jsx("option",{value:"",children:"All specs"}),t.map(g=>s.jsx("option",{value:g.file,children:g.file},g.file))]}),s.jsxs("button",{className:"btn ghost",onClick:()=>{n(),f()},children:[s.jsx(Rr,{size:14})," Refresh"]})]}),s.jsx(Pe,{error:d??o}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"TC"}),s.jsx("th",{children:"TC name"}),s.jsx("th",{children:"Test file"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:m.map((g,w)=>s.jsxs("tr",{children:[s.jsx("td",{children:g.specFile?s.jsx(ye,{to:`/specs/${g.specFile}`,className:"mono",children:g.specFile}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:g.tcId?s.jsx("code",{children:g.tcId}):"—"}),s.jsx("td",{children:g.tcTitle??g.testTitle??"—"}),s.jsx("td",{children:g.testFile?s.jsxs("code",{children:[g.testFile,":",g.testLine]}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{children:s.jsx(dt,{status:g.status,children:Du(g.status)})}),s.jsx("td",{children:g.lastResult?s.jsx(ye,{to:`/runs/${g.lastResult.jobId}`,title:Pt(g.lastResult.at),children:s.jsx(dt,{status:g.lastResult.status,children:Du(g.lastResult.status)})}):s.jsx(dt,{status:null})}),s.jsx("td",{style:{textAlign:"right"},children:g.testFile&&g.tcId&&g.specFile&&g.status!=="orphan"&&s.jsxs("button",{className:"btn ghost sm",onClick:()=>void p({type:"testrun",spec:g.specFile,tcId:g.tcId}),children:[s.jsx(ft,{size:12})," Run"]})})]},`${g.specFile??"__none"}-${g.tcId}-${g.testLine}-${w}`))})]}),h&&m.length===0&&s.jsx("p",{className:"muted pad",children:"No rows match the filter."}),h&&s.jsx(ps,{page:c.page,pageSize:c.pageSize,total:h.total,onPage:c.setPage,onPageSize:c.setPageSize,label:"test cases"})]})]})}const aa=(e,t)=>t?Math.round(e/t*100):0;function HT(){const e=ut(),{openNewSpec:t}=hs(),{specs:n,refresh:r}=Xt(),i=Me(()=>q.dashboard()),l=Me(()=>q.jobs()),[a,o]=j.useState(null),u=i.data,c=n.reduce((p,g)=>p+g.parsed.tcs.length,0),h=l.data??[],d=h[0],f=(u==null?void 0:u.failing)??[],m=()=>void q.createJob({type:"testrun",repeatEach:1}).then(p=>{r(),e(`/runs/${p.id}`)}).catch(p=>o(p.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Overview"}]}),s.jsx(Pe,{error:i.error??l.error??a}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Overview"}),s.jsx("p",{className:"page-sub",children:"Test coverage and run health across all specs."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>t(),children:[s.jsx(Qt,{size:15})," New spec"]}),s.jsxs("button",{className:"btn",onClick:m,children:[s.jsx(ft,{size:13})," Run all specs"]})]})]}),s.jsxs("div",{className:"stats",children:[s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Coverage"}),s.jsx("span",{className:"stat-icon",children:s.jsx(yh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[aa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.coverage.mapped)??0," / ",(u==null?void 0:u.coverage.total)??0," TC"]})]}),s.jsx("div",{className:"progress",children:s.jsx("i",{style:{width:`${aa((u==null?void 0:u.coverage.mapped)??0,(u==null?void 0:u.coverage.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Pass rate"}),s.jsx("span",{className:"stat-icon ok",children:s.jsx(wh,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[aa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0),"%",s.jsxs("small",{children:[(u==null?void 0:u.passRate.passed)??0," / ",(u==null?void 0:u.passRate.total)??0," TC"]})]}),s.jsx("div",{className:"progress ok",children:s.jsx("i",{style:{width:`${aa((u==null?void 0:u.passRate.passed)??0,(u==null?void 0:u.passRate.total)??0)}%`}})})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Specs"}),s.jsx("span",{className:"stat-icon info",children:s.jsx(jr,{size:16})})]}),s.jsxs("div",{className:"stat-value",children:[n.length,s.jsxs("small",{children:[c," test cases"]})]}),s.jsx(ye,{to:"/specs",className:"stat-link",children:"Manage specs →"})]}),s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:"Recent runs"}),s.jsx("span",{className:"stat-icon warn",children:s.jsx(ft,{size:14})})]}),s.jsxs("div",{className:"stat-value",children:[h.length,s.jsx("small",{children:"runs"})]}),s.jsxs("div",{className:"muted small",children:["Last run: ",Pt((d==null?void 0:d.finishedAt)??(d==null?void 0:d.startedAt)??(d==null?void 0:d.createdAt))]})]})]}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent runs"}),s.jsx(ye,{to:"/runs",className:"card-link",children:"View all"})]}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Result"}),s.jsx("th",{className:"num",children:"Duration"})]})}),s.jsx("tbody",{children:h.slice(0,5).map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{className:"mono",children:["#",p.id]}),s.jsxs("td",{children:[p.target,p.args.tcId?s.jsxs("span",{className:"muted small",children:[" · ",p.args.tcId]}):null]}),s.jsx("td",{children:s.jsx(ni,{status:p.status,title:p.summary??void 0,children:p.summary&&p.summary.length<=24?p.summary:p.status})}),s.jsx("td",{className:"num muted",children:ds(p.startedAt,p.finishedAt)})]},p.id))})]}),l.data&&h.length===0&&s.jsx("p",{className:"muted pad",children:"No runs yet."})]}),s.jsxs("div",{className:"card pad",children:[s.jsx("h3",{className:"card-title",children:"Pipeline agents"}),s.jsxs("p",{className:"muted small",style:{margin:"2px 0 14px"},children:["Runs with ",s.jsx("span",{className:"accent-text",children:"Claude Code"})," — no API key needed."]}),s.jsx("ol",{className:"agent-steps",children:["explorer","generator","validator","healer"].map((p,g)=>s.jsxs("li",{title:Se[p].description,children:[s.jsx("span",{className:"step-num",children:g+1}),Se[p].label,p==="healer"&&s.jsx("span",{className:"muted small accent-soft-text",children:"≤ 2 loops"})]},p))})]})]}),f.length>0&&s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Failing tests (",f.length,")"]})}),s.jsx("table",{className:"flat",children:s.jsx("tbody",{children:f.map(p=>s.jsxs("tr",{onClick:()=>e(`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`),style:{cursor:"pointer"},title:"Open this failed test in Recent runs",children:[s.jsxs("td",{children:[s.jsx("div",{children:p.title}),s.jsx("div",{className:"mono small",style:{color:"var(--fail)"},children:(p.error??"").split(`
376
+ `)[0].slice(0,160)})]}),s.jsx("td",{className:"num",children:s.jsxs(ye,{to:`/runs/${p.jobId}${p.id?`?result=${p.id}`:""}`,onClick:g=>g.stopPropagation(),children:["#",p.jobId]})})]},`${p.jobId}-${p.title}`))})})]}),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Specs at a glance"}),s.jsx(ye,{to:"/specs",className:"card-link",children:"Open Specs page"})]}),s.jsxs("div",{className:"glance",children:[((u==null?void 0:u.specs)??[]).map(p=>s.jsxs(ye,{to:`/specs/${p.file}`,className:"glance-row",children:[s.jsx("span",{className:"file-icon muted-icon",children:s.jsx(jr,{size:16})}),s.jsxs("div",{className:"grow",children:[s.jsx("div",{className:"mono strong",children:p.file}),s.jsx("div",{className:"muted small",children:p.title||"—"})]}),s.jsxs("span",{className:"muted small",children:[p.tcCount," test cases"]}),s.jsxs("span",{className:`chip ${p.mappedCount<p.tcCount?"warn":""}`,children:[p.mappedCount,"/",p.tcCount," mapped"]})]},p.file)),u&&u.specs.length===0&&s.jsx("p",{className:"muted pad",children:"No specs yet."})]})]})]})}function WT({onImported:e}){const{refresh:t}=Xt(),n=Ar(),r=In(),i=Fb(),l=j.useRef(null),[a,o]=j.useState(!1),u=async d=>{o(!0);try{await i(d())}catch(f){n.error(f.message)}finally{o(!1)}},c=()=>u(async()=>{const d=URL.createObjectURL(await q.exportProject()),f=document.createElement("a");f.href=d,f.download=`agent-studio-export-${new Date().toISOString().slice(0,10)}.zip`,f.click(),URL.revokeObjectURL(d),n.success("Project exported")}),h=async d=>{await r({title:`Import ${d.name}?`,message:"Specs, tests, Playwright config, CLAUDE.md and Claude skills in the zip overwrite the files with the same name. Settings, all agents (built-in instructions and custom agents) and pipelines are replaced. Jobs and chats are kept.",confirmLabel:"Import",danger:!0})&&await u(async()=>{const m=await new Promise((g,w)=>{const x=new FileReader;x.onload=()=>g(String(x.result)),x.onerror=()=>w(x.error),x.readAsDataURL(d)}),p=await q.importProject(m.slice(m.indexOf(",")+1));t(),e==null||e(),n.success(`Imported ${p.files} files, ${p.agents} custom agents, ${p.pipelines} custom pipelines and ${p.instructions} built-in agent instructions`)})};return s.jsxs("span",{className:"row",children:[s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>{var d;return(d=l.current)==null?void 0:d.click()},disabled:a,title:"Import a project zip exported from Agent Studio",children:[s.jsx(Lo,{size:15})," Import"]}),s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>void c(),disabled:a,title:"Export specs, tests, Playwright config, CLAUDE.md, Claude skills, settings, agents and pipelines as a zip",children:[s.jsx(us,{size:15})," Export"]}),s.jsx("input",{ref:l,type:"file",accept:".zip",hidden:!0,onChange:d=>{var m;const f=(m=d.target.files)==null?void 0:m[0];d.target.value="",f&&h(f)}})]})}async function Dv(){const e=await q.claudeMd();if(e.content===null)return;const t=URL.createObjectURL(new Blob([e.content],{type:"text/markdown"})),n=document.createElement("a");n.href=t,n.download=`CLAUDE-${new Date().toISOString().slice(0,10)}.md`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),1e3)}function VT(){var v,b,E,k;const e=ut(),t=In(),n=Ar(),r=Me(()=>q.claudeMd()),i=Me(()=>q.jobsPage({page:1,pageSize:1,type:"context"})),[l,a]=j.useState(""),[o,u]=j.useState("rendered"),[c,h]=j.useState(!1),[d,f]=j.useState(null),m=(v=i.data)==null?void 0:v.items[0],p=j.useRef(null),[g,w]=j.useState(null),x=async R=>{if(!R)return;if(!/\.md$/i.test(R.name))return f("Choose a Markdown (.md) file.");const T=await R.text();if(!await t({title:"Replace CLAUDE.md?",message:`CLAUDE.md is replaced with ${R.name}. The current file is backed up first.`,confirmLabel:"Replace",danger:!0})){p.current&&(p.current.value="");return}try{const C=await q.uploadClaudeMd(T);n.success("CLAUDE.md replaced"),w(`CLAUDE.md replaced with ${R.name}.${C.backup?` Previous version backed up to ${C.backup}.`:""}`),f(null),r.reload()}catch(C){f(C.message)}finally{p.current&&(p.current.value="")}},y=async R=>{R.preventDefault(),h(!0);try{const T=await q.createJob({type:"context",...l.trim()?{notes:l.trim()}:{}});e(`/runs/${T.id}`)}catch(T){f(T.message),h(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Project"}),s.jsx("p",{className:"page-sub",children:"Project context (CLAUDE.md), import / export and reset."})]}),s.jsx(WT,{onImported:r.reload})]}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsxs("h3",{children:["CLAUDE.md"," ",((b=r.data)==null?void 0:b.mtimeMs)&&s.jsxs("span",{className:"muted small",style:{fontWeight:400},children:["· modified ",Pt(new Date(r.data.mtimeMs).toISOString())]})]}),s.jsxs("span",{className:"row",children:[s.jsx("button",{className:"btn ghost sm",onClick:()=>void Dv(),disabled:!((E=r.data)!=null&&E.content),children:"Download"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>{var R;return(R=p.current)==null?void 0:R.click()},title:"Replace CLAUDE.md with a file, e.g. this project's saved context",children:[s.jsx(Lo,{size:13})," Upload"]}),s.jsx("input",{ref:p,type:"file",accept:".md,text/markdown",hidden:!0,onChange:R=>{var T;return void x((T=R.target.files)==null?void 0:T[0])}}),s.jsx(bn,{value:o,onChange:u,items:[{id:"rendered",label:"Preview"},{id:"source",label:"Source"}]})]})]}),g&&s.jsx("div",{className:"ok-box",style:{margin:12},children:g}),s.jsx(Pe,{error:r.error}),r.data&&r.data.content===null&&s.jsx("p",{className:"muted pad",children:"There is no CLAUDE.md at the repo root yet. The Context Writer will create one."}),((k=r.data)==null?void 0:k.content)&&(o==="rendered"?s.jsx("div",{className:"pad md claude-md",children:s.jsx(ui,{children:r.data.content.replace(/<!--[\s\S]*?-->/g,"")})}):s.jsx("pre",{className:"mono pad claude-md",style:{margin:0,whiteSpace:"pre-wrap"},children:r.data.content}))]}),s.jsxs("form",{className:"card pad req-form",onSubmit:y,children:[s.jsxs("div",{className:"row",children:[s.jsx(Ot,{agent:"contextwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"Context Writer"}),s.jsx("div",{className:"muted small",children:"LLM agent (Claude Code), may only edit CLAUDE.md"})]})]}),s.jsxs("label",{children:["Notes about this project (optional)",s.jsx("textarea",{className:"input",style:{minHeight:140},value:l,onChange:R=>a(R.target.value),placeholder:"e.g. <App name>: customer portal. Roles: admin, customer. Login with email + password. Test ids use data-testid."})]}),s.jsx(Pe,{error:d}),s.jsxs("div",{className:"row between",children:[s.jsx("span",{className:"muted small",children:m?s.jsxs(s.Fragment,{children:["Last update: ",s.jsxs(ye,{to:`/runs/${m.id}`,children:["job #",m.id]})," ",s.jsx(kn,{status:m.status})," ",Pt(m.finishedAt??m.createdAt)]}):"Never updated by Agent Studio"}),s.jsxs("button",{type:"submit",className:"btn",disabled:c,children:[s.jsx(kh,{size:15})," ",c?"Starting…":"Update CLAUDE.md"]})]})]})]}),s.jsxs("div",{className:"card pad danger-zone row between",style:{marginTop:14},children:[s.jsxs("div",{children:[s.jsx("b",{children:"Reset project template"}),s.jsx("div",{className:"muted small",children:"Remove this project's specs, tests, results and context; you choose what and see the list first."})]}),s.jsxs(ye,{className:"btn danger",to:"/project/reset",children:[s.jsx(Lr,{size:14})," Reset project template…"]})]})]})}const QT=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function Em({mentions:e,title:t}){const n=j.useMemo(()=>{const r=new Map;for(const i of e)r.set(i.file,[...r.get(i.file)??[],i]);return[...r.entries()]},[e]);return e.length?s.jsxs("details",{className:"rt-mentions",children:[s.jsxs("summary",{children:[t,": ",e.length," line",e.length===1?"":"s"," in ",n.length," file",n.length===1?"":"s"]}),s.jsx("p",{className:"muted small",children:"These files are not changed by the reset (source code, docs). Review and edit them by hand."}),n.map(([r,i])=>s.jsxs("div",{className:"rt-file",children:[s.jsx("code",{children:r}),i.map(l=>s.jsxs("div",{className:"rt-line",children:[s.jsx("span",{className:"muted",children:l.line})," ",l.text]},`${l.line}-${l.text}`))]},r))]}):s.jsx("p",{className:"muted small",children:"No other file mentions the project."})}function qT(){const{refresh:e}=Xt(),[t,n]=j.useState(null),[r,i]=j.useState(new Set),[l,a]=j.useState(""),[o,u]=j.useState(""),[c,h]=j.useState(!0),[d,f]=j.useState(!1),[m,p]=j.useState(null),[g,w]=j.useState(null),x=async(E=l)=>{try{const k=await q.resetPlan(E);n(k),i(R=>R.size?R:new Set(k.categories.filter(T=>T.defaultOn).map(T=>T.id))),p(null)}catch(k){p(k.message)}};j.useEffect(()=>{x()},[]);const y=E=>i(k=>{const R=new Set(k);return R.has(E)?R.delete(E):R.add(E),R}),v=async()=>{if(t){f(!0);try{const E=await q.resetProject({categories:[...r],confirm:o,backup:c,terms:l.split(",").map(k=>k.trim()).filter(Boolean)});w(E),u(""),e(),await x()}catch(E){p(E.message)}finally{f(!1)}}},b=t&&o===t.confirmWord&&r.size>0&&!t.busy&&!d;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Project",to:"/project"},{label:"Reset project template"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Reset project template"}),s.jsxs("p",{className:"page-sub",children:["Strip everything that belongs to the current project so this repository can be cloned and reused for another one. With ",s.jsx("b",{children:"Backup data"})," on, specs, tests, CLAUDE.md and chat history are backed up first; results and logs are always deleted for good."]})]})}),g&&s.jsxs("div",{className:"ok-box",children:[s.jsx("b",{children:"Project reset."})," ",Object.entries(g.removed).map(([E,k])=>{var R;return`${((R=t==null?void 0:t.categories.find(T=>T.id===E))==null?void 0:R.label)??E}: ${k}`}).join(" · "),g.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"Backup of the removed files (specs, tests, CLAUDE.md, chat history…): ",s.jsx("code",{children:g.backupDir})]}),!g.backupDir&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),"No backup was made: removed items were deleted permanently."]}),s.jsx("br",{}),"Next: add specs for the new project, then ",s.jsx(ye,{to:"/project",children:"update CLAUDE.md"})," with the Context Writer or upload the project's CLAUDE.md.",g.mentions.length>0&&s.jsx("div",{style:{marginTop:8},children:s.jsx(Em,{mentions:g.mentions,title:"Still mentioned"})})]}),s.jsx(Pe,{error:m}),(t==null?void 0:t.busy)&&s.jsx("div",{className:"warn-box",children:"A job is queued, running or waiting for review. Wait for it to finish (or cancel it) before resetting."}),t&&s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx("h3",{children:"What to reset"}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void x(),children:[s.jsx(Rr,{size:13})," Refresh"]})]}),t.categories.map(E=>s.jsxs("label",{className:`rt-cat ${r.has(E.id)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:r.has(E.id),onChange:()=>y(E.id)}),s.jsxs("span",{className:"grow",children:[s.jsxs("span",{className:"rt-cat-head",children:[s.jsx("b",{children:E.label}),s.jsxs("span",{className:"muted small",children:[E.fileCount," ",E.id==="prompts"?"custom":`file${E.fileCount===1?"":"s"}`,E.bytes?` · ${QT(E.bytes)}`:""]}),s.jsx("span",{className:`rt-tag ${E.backedUp&&c?"":"gone"}`,children:E.backedUp&&c?"backed up":"deleted for good"})]}),s.jsx("span",{className:"muted small",children:E.description}),E.note&&s.jsx("span",{className:"small",children:E.note}),E.files.length>0&&s.jsxs("details",{className:"rt-files",children:[s.jsx("summary",{className:"small",children:"Show files"}),E.files.map(k=>s.jsx("code",{children:k},k)),E.fileCount>E.files.length&&s.jsxs("span",{className:"muted small",children:["…and ",E.fileCount-E.files.length," more"]})]})]})]},E.id))]}),s.jsxs("div",{style:{display:"grid",gap:14,alignContent:"start"},children:[s.jsxs("div",{className:"card pad",style:{display:"grid",gap:10},children:[s.jsx("h3",{className:"card-title",children:"Project mentions elsewhere"}),s.jsxs("p",{className:"muted small",style:{margin:0},children:["Words that identify this project (from spec, fixture and Page Object names and the app's hostnames):"," ",t.terms.length?t.terms.map(E=>s.jsx("code",{style:{marginRight:4},children:E},E)):"none found","."]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"More words, comma-separated (e.g. app or client name)",value:l,onChange:E=>a(E.target.value)}),s.jsx("button",{className:"btn ghost sm",onClick:()=>void x(l),children:"Scan"})]}),s.jsx(Em,{mentions:t.mentions,title:"Mentions the reset leaves"})]}),s.jsxs("div",{className:"card pad danger-zone",style:{display:"grid",gap:10},children:[s.jsx("h3",{className:"card-title",children:"Reset"}),s.jsxs("p",{className:"small",style:{margin:0},children:["Keep this project's context? ",s.jsx("button",{className:"link-btn",onClick:()=>void Dv(),children:"Download the current CLAUDE.md"})," first; upload it again later on the Project page."]}),s.jsxs("label",{className:"small row",style:{gap:8,alignItems:"center"},children:[s.jsx("input",{type:"checkbox",checked:c,onChange:E=>h(E.target.checked)}),s.jsx("b",{children:"Backup data"})]}),!c&&s.jsx("div",{className:"warn-box small",style:{margin:0},children:"Backup is off: the selected items are deleted permanently and cannot be restored."}),s.jsxs("label",{className:"small",style:{display:"grid",gap:6},children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:t.confirmWord})," to confirm"]}),s.jsx("input",{className:"input mono",value:o,onChange:E=>u(E.target.value),"aria-label":"Confirmation word",autoComplete:"off"})]}),s.jsxs("button",{className:"btn danger-solid",disabled:!b,onClick:()=>void v(),children:[s.jsx(Lr,{size:14})," ",d?"Resetting…":`Reset ${r.size} item${r.size===1?"":"s"}`]})]})]})]})]})}const GT=/^[a-z0-9][a-z0-9_-]*$/;function KT(e){return e.replace(/\.(md|txt)$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)}function YT(){const e=ut(),{specs:t}=Xt(),[n,r]=j.useState(""),[i,l]=j.useState(""),[a,o]=j.useState(!1),[u,c]=j.useState(!1),[h,d]=j.useState(null),f=j.useRef(null),m=n.trim().replace(/\.md$/,""),p=`${m}.md`,g=t.some(v=>v.file===p),w=i.length>wu,x=async v=>{if(v){if(!/\.(md|txt)$/i.test(v.name))return d("Only .md or .txt files can be loaded. Copy text from Word/Confluence and paste it instead.");l(await v.text()),m||r(KT(v.name)),d(null)}},y=async v=>{if(v.preventDefault(),!GT.test(m))return d('Spec name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');if(!i.trim())return d("Paste the requirement first.");if(w)return d(`The requirement is longer than ${wu.toLocaleString()} characters.`);if(g&&!a)return d(`specs/${p} already exists. Choose another name or tick "Overwrite".`);c(!0);try{const b=await q.createJob({type:"spec",spec:p,requirement:i,...g?{overwrite:!0}:{}});e(`/runs/${b.id}`)}catch(b){d(b.message),c(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Generator"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Generator"}),s.jsx("p",{className:"page-sub",children:"Paste a BA requirement or user story. The QA Test Case Writer agent turns it into a spec with test cases, which you then review and run."})]})}),s.jsxs("div",{className:"overview-grid",children:[s.jsxs("form",{className:"card pad req-form",onSubmit:y,children:[s.jsxs("label",{children:["Spec name",s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input grow",placeholder:"e.g. login",value:n,onChange:v=>r(v.target.value),"aria-describedby":"spec-name-help"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsxs("span",{id:"spec-name-help",className:"muted small",style:{fontWeight:400},children:["Saved as ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})]})]}),g&&s.jsxs("label",{className:"row",style:{display:"flex",fontWeight:400},children:[s.jsx("input",{type:"checkbox",checked:a,onChange:v=>o(v.target.checked)}),s.jsxs("span",{children:[s.jsxs("b",{children:["specs/",p]})," already exists: overwrite it (existing TC-IDs are kept where they still apply)"]})]}),s.jsxs("label",{children:[s.jsxs("span",{className:"row between",children:[s.jsx("span",{children:"Requirement"}),s.jsxs("button",{type:"button",className:"btn ghost",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},children:[s.jsx(Lo,{size:14})," Load .md / .txt"]})]}),s.jsx("textarea",{className:"input",value:i,onChange:v=>l(v.target.value),placeholder:`As a <role>, I want to <action> so that <benefit>.
377
377
 
378
378
  Business rules:
379
379
  - <rule, limits, ranges>
380
380
 
381
381
  Acceptance criteria:
382
382
  - Given ... when ... then ...
383
- - ...`,"aria-label":"Requirement text"}),s.jsxs("span",{className:`small ${w?"":"muted"}`,style:{fontWeight:400,color:w?"var(--fail)":void 0},children:[i.length.toLocaleString()," / ",vu.toLocaleString()," characters"]})]}),s.jsx("input",{ref:f,type:"file",accept:".md,.txt,text/markdown,text/plain",hidden:!0,onChange:v=>{var b;return void x((b=v.target.files)==null?void 0:b[0])}}),s.jsx(Pe,{error:h}),s.jsx("div",{className:"row",style:{justifyContent:"flex-end"},children:s.jsxs("button",{type:"submit",className:"btn",disabled:u,children:[s.jsx(fl,{size:15})," ",u?"Starting…":"Generate spec"]})})]}),s.jsxs("div",{className:"card pad",children:[s.jsxs("div",{className:"row",style:{marginBottom:12},children:[s.jsx(Ot,{agent:"specwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"How it works"}),s.jsx("div",{className:"muted small",children:"QA Test Case Writer agent (Claude Code)"})]})]}),s.jsxs("ol",{className:"req-steps",children:[s.jsx("li",{children:"The requirement is saved with the job. The agent reads it, plus existing specs for style."}),s.jsxs("li",{children:["It writes ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})," with one ",s.jsx("code",{children:"## TC-…"})," per behaviour, designed with equivalence partitioning, boundary values, decision tables, state transitions and use cases, always adding edge and security cases."]}),s.jsxs("li",{children:["Each test case gets a test level tag (",s.jsx("b",{children:"IT"}),", ",s.jsx("b",{children:"ST"}),", ",s.jsx("b",{children:"SIT"}),", ",s.jsx("b",{children:"UAT"}),") plus type tags (smoke, negative, boundary, security…) and its design technique."]}),s.jsx("li",{children:"Its assumptions and open questions for the BA are listed in the job output."}),s.jsxs("li",{children:["Review the spec in the editor, then run ",s.jsx("b",{children:"Generate tests"}),"."]})]}),s.jsxs("p",{className:"muted small",style:{marginTop:14},children:["The agent can only write that spec file. It does not open a browser and does not invent credentials. Accounts come from ",s.jsx("code",{children:".env"})," when tests are generated."]})]})]})]})}function qT(){const e=ut(),[t,n]=j.useState("all"),r=Pl([t]),{data:i,error:l,reload:a}=Ie(()=>q.jobsPage({page:r.page,pageSize:r.pageSize,type:t==="all"?void 0:t}),[r.page,r.pageSize,t]),[o,u]=j.useState(null),c=((i==null?void 0:i.items)??[]).some(d=>d.status==="queued"||d.status==="running");j.useEffect(()=>{if(!c)return;const d=setInterval(a,2e3);return()=>clearInterval(d)},[c,a]);const h=(i==null?void 0:i.items)??[];return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Recent runs"}),s.jsx("p",{className:"page-sub",children:"Explore, generate, run and heal jobs with their agent timeline."})]})}),s.jsxs("div",{className:"row between",style:{marginBottom:14},children:[s.jsx(bn,{value:t,onChange:n,items:["all","testrun","generate","explore","heal","spec","context"].map(d=>({id:d,label:d==="all"?"All":kr[d]}))}),s.jsx("div",{className:"row",children:s.jsxs("button",{className:"btn dark",onClick:()=>void q.createJob({type:"testrun",repeatEach:1}).then(d=>e(`/runs/${d.id}`)).catch(d=>u(d.message)),children:[s.jsx(ft,{size:14})," Run all tests"]})})]}),s.jsx(Pe,{error:l??o}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"})]})}),s.jsx("tbody",{children:h.map(d=>s.jsxs("tr",{onClick:()=>e(`/runs/${d.id}`),style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsxs("div",{className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(ft,{size:14})}),s.jsxs("div",{children:[s.jsxs("div",{children:["#",d.id," ",kr[d.type]]}),s.jsxs("div",{className:"sub",children:[d.args.name??d.target,d.args.tcId?` · ${d.args.tcId}`:"",d.args.repeatEach&&d.args.repeatEach>1?` · ${d.args.repeatEach}×`:""]})]})]})}),s.jsx("td",{children:s.jsx(Db,{agents:d.agents})}),s.jsxs("td",{children:[s.jsx(kn,{status:d.status}),d.warning&&s.jsx("span",{title:d.warning,style:{color:"var(--warn)"},children:" ⚠"})]}),s.jsx("td",{className:"muted small",children:d.summary??"—"}),s.jsx("td",{className:"muted small",children:Pt(d.startedAt??d.createdAt)}),s.jsx("td",{className:"muted small",children:us(d.startedAt,d.finishedAt)})]},d.id))})]}),i&&h.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:"No jobs yet."}),i&&s.jsx(fs,{page:r.page,pageSize:r.pageSize,total:i.total,onPage:r.setPage,onPageSize:r.setPageSize,label:"jobs"})]})]})}function Tm(e){return e.replace(/\.md$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|-+$/g,"")||"spec"}function GT(e){const t=e.filter(r=>r.lastResult);if(!t.length)return null;const n=t.filter(r=>r.lastResult.status==="passed").length;return n===t.length?{status:"passed",label:`${n}/${t.length} passed`}:{status:"failed",label:`${t.length-n}/${t.length} failed`}}function KT(){const e=ut(),{openNewSpec:t}=ds(),{specs:n,mapping:r,refresh:i}=un(),[l,a]=j.useState("all"),[o,u]=j.useState(""),[c,h]=j.useState(new Set),[d,f]=j.useState(!1),[m,p]=j.useState(null),g=j.useRef(null),w=j.useMemo(()=>n.map(P=>{const A=r.filter(U=>U.specFile===P.file&&U.status!=="orphan"),z=new Set(A.filter(U=>U.testFile).map(U=>U.tcId)).size;return{spec:P,mapped:z,total:P.parsed.tcs.length,last:GT(A)}}),[n,r]),x=P=>P.total>0&&P.mapped>=P.total,y=[...new Set(n.flatMap(P=>P.parsed.tags))].sort(),v=o.trim().toLowerCase(),b=w.filter(P=>(l==="all"||(l==="mapped"?x(P):!x(P)))&&(!v||`${P.spec.file} ${P.spec.parsed.title} ${P.spec.parsed.tags.join(" ")}`.toLowerCase().includes(v))&&(c.size===0||P.spec.parsed.tags.some(A=>c.has(A)))),E=Bh(b,[l,o,c]),k=w.reduce((P,A)=>P+A.total,0),L=w.reduce((P,A)=>P+Math.max(A.total-A.mapped,0),0),T=async P=>{const A=P.filter(U=>/\.md$/i.test(U.name));if(!A.length)return p("Only .md files are accepted");if(A.length===1){t({name:Tm(A[0].name),content:await A[0].text()});return}const z=[];for(const U of A)try{await q.createSpec(`${Tm(U.name)}.md`,await U.text())}catch(I){z.push(`${U.name}: ${I.message}`)}i(),p(z.length?z.join(`
384
- `):null)},D=P=>{T([...P.target.files??[]]),P.target.value=""},N=P=>void q.createJob({type:"testrun",spec:P,repeatEach:1}).then(A=>e(`/runs/${A.id}`)).catch(A=>p(A.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Specs"}),s.jsx("p",{className:"page-sub",children:"Markdown specs and the test cases mapped to Playwright scripts."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>{var P;return(P=g.current)==null?void 0:P.click()},children:[s.jsx(wh,{size:15})," Import .md"]}),s.jsx("input",{ref:g,type:"file",accept:".md,text/markdown",multiple:!0,hidden:!0,onChange:D}),s.jsxs(ye,{className:"btn ghost",to:"/specs/from-requirement",title:"QA Test Case Writer agent drafts the spec from a BA requirement",children:[s.jsx(fl,{size:15})," Generator"]}),s.jsxs("button",{className:"btn",onClick:()=>t(),children:[s.jsx(Qt,{size:15})," New spec"]})]})]}),s.jsx(Pe,{error:m}),s.jsxs("div",{className:"toolbar",children:[s.jsx(bn,{value:l,onChange:a,items:[{id:"all",label:s.jsxs(s.Fragment,{children:["All ",s.jsx("span",{className:"tab-count",children:w.length})]})},{id:"mapped",label:s.jsxs(s.Fragment,{children:["Mapped ",s.jsx("span",{className:"tab-count",children:w.filter(x).length})]})},{id:"needs",label:s.jsxs(s.Fragment,{children:["Needs mapping ",s.jsx("span",{className:"tab-count",children:w.filter(P=>!x(P)).length})]})}]}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"search-input",children:[s.jsx(Po,{size:15}),s.jsx("input",{value:o,onChange:P=>u(P.target.value),placeholder:"Search by file, title or tag","aria-label":"Search specs"})]}),s.jsxs("div",{className:"menu-wrap",children:[s.jsxs("button",{className:`btn ghost ${c.size?"on":""}`,onClick:()=>f(P=>!P),"aria-expanded":d,children:[s.jsx(ab,{size:15})," Tags",c.size?` (${c.size})`:""]}),d&&s.jsxs("div",{className:"menu",onMouseLeave:()=>f(!1),children:[y.length===0&&s.jsx("div",{className:"muted small pad-sm",children:"No tags yet"}),y.map(P=>s.jsxs("label",{className:"menu-item",children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:c.has(P),onChange:()=>h(A=>{const z=new Set(A);return z.has(P)?z.delete(P):z.add(P),z})}),P]},P)),c.size>0&&s.jsx("button",{className:"btn ghost sm",style:{margin:6},onClick:()=>h(new Set),children:"Clear"})]})]})]}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{className:"num",children:"Test cases"}),s.jsx("th",{children:"Coverage"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:E.pageItems.map(({spec:P,mapped:A,total:z,last:U})=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs(ye,{to:`/specs/${P.file}`,className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(jr,{size:16})}),s.jsxs("div",{children:[s.jsx("div",{className:"strong",children:P.parsed.title||P.file}),s.jsxs("div",{className:"sub mono",children:[P.file,P.parsed.warnings.length>0&&s.jsxs("span",{style:{color:"var(--warn)"},children:[" · ⚠ ",P.parsed.warnings.length]})]})]})]})}),s.jsx("td",{children:P.parsed.tags.map(I=>s.jsx("span",{className:"tag",children:I},I))}),s.jsx("td",{className:"num",children:z}),s.jsx("td",{children:s.jsxs("div",{className:"cov",children:[s.jsx("span",{className:"progress",children:s.jsx("i",{style:{width:`${z?A/z*100:0}%`}})}),s.jsxs("span",{className:"small",children:[A,"/",z]})]})}),s.jsx("td",{children:U?s.jsx(ti,{status:U.status,children:U.label}):s.jsx(ti,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"row",style:{justifyContent:"flex-end",flexWrap:"nowrap",gap:6},children:[s.jsx(ye,{to:`/specs/${P.file}`,className:"btn ghost sm",children:"Open"}),s.jsx("button",{className:"btn ghost sm icon",onClick:()=>N(P.file),disabled:A===0,title:A?`Run ${P.file}`:"Spec has no test file yet","aria-label":`Run ${P.file}`,children:s.jsx(ft,{size:12})})]})})]},P.file))})]}),b.length===0&&s.jsx("p",{className:"muted pad",children:w.length?"No specs match the filter.":"No specs yet."}),b.length>0&&s.jsx(fs,{...E.props,label:"specs"}),s.jsxs("div",{className:"table-foot",children:[s.jsxs("span",{children:[w.length," specs · ",k," test cases"]}),s.jsx("span",{children:L?`${L} test cases need mapping`:"All test cases mapped"})]})]})]})}function YT({value:e,onChange:t}){const n=j.useRef(null),r=e.split(`
385
- `).length;return s.jsxs("div",{className:"line-editor",children:[s.jsx("div",{className:"gutter",ref:n,"aria-hidden":"true",children:Array.from({length:r},(i,l)=>s.jsx("div",{children:l+1},l))}),s.jsx("textarea",{value:e,onChange:i=>t(i.target.value),onScroll:i=>{n.current&&(n.current.scrollTop=i.currentTarget.scrollTop)},spellCheck:!1,wrap:"off","aria-label":"Spec content (markdown)"})]})}const Dv=/^(given|when|then|and|but)\b[: ]?\s*(.*)$/i,JT=/^\s*(tags|technique)\s*:/i;function XT(e){let t="given";return e.map(n=>{const r=n.trim().match(Dv),i=r[1].toLowerCase(),l=i==="and"||i==="but";return l||(t=i),{keyword:r[1][0].toUpperCase()+r[1].slice(1).toLowerCase(),kw:t,continuation:l,text:r[2].trim()}})}function ZT({text:e}){return s.jsx(ui,{components:{p:({children:t})=>s.jsx(s.Fragment,{children:t})},children:e})}function eP({lines:e}){return s.jsx("ol",{className:"gherkin-steps",children:XT(e).map((t,n)=>s.jsxs("li",{className:`gherkin-step kw-${t.kw}${t.continuation?" continuation":""}`,children:[s.jsx("span",{className:"gherkin-kw",children:t.keyword})," ",s.jsx("span",{className:"gherkin-text",children:s.jsx(ZT,{text:t.text})})]},n))})}function tP(e){const t=[];for(const n of e.split(/\r?\n/)){if(JT.test(n))continue;const r=Dv.test(n.trim()),i=t[t.length-1];i&&i.gherkin===r?i.lines.push(n):t.push({gherkin:r,lines:[n]})}return t}function nP({text:e}){return s.jsx(s.Fragment,{children:tP(e).map((t,n)=>{if(t.gherkin)return s.jsx(eP,{lines:t.lines},n);const r=t.lines.join(`
386
- `).trim();return r?s.jsx("div",{className:"md",children:s.jsx(ui,{children:r})},n):null})})}function rP({content:e,parsed:t}){var l;const n=e.split(/\r?\n/),r=((l=t.tcs[0])==null?void 0:l.line)??n.length+1,i=n.slice(0,r-1).filter(a=>!/^\s*#\s+/.test(a)&&!/^\s*(tags|preconditions)\s*:/i.test(a)).join(`
383
+ - ...`,"aria-label":"Requirement text"}),s.jsxs("span",{className:`small ${w?"":"muted"}`,style:{fontWeight:400,color:w?"var(--fail)":void 0},children:[i.length.toLocaleString()," / ",wu.toLocaleString()," characters"]})]}),s.jsx("input",{ref:f,type:"file",accept:".md,.txt,text/markdown,text/plain",hidden:!0,onChange:v=>{var b;return void x((b=v.target.files)==null?void 0:b[0])}}),s.jsx(Pe,{error:h}),s.jsx("div",{className:"row",style:{justifyContent:"flex-end"},children:s.jsxs("button",{type:"submit",className:"btn",disabled:u,children:[s.jsx(fl,{size:15})," ",u?"Starting…":"Generate spec"]})})]}),s.jsxs("div",{className:"card pad",children:[s.jsxs("div",{className:"row",style:{marginBottom:12},children:[s.jsx(Ot,{agent:"specwriter",size:36}),s.jsxs("div",{children:[s.jsx("b",{children:"How it works"}),s.jsx("div",{className:"muted small",children:"QA Test Case Writer agent (Claude Code)"})]})]}),s.jsxs("ol",{className:"req-steps",children:[s.jsx("li",{children:"The requirement is saved with the job. The agent reads it, plus existing specs for style."}),s.jsxs("li",{children:["It writes ",s.jsxs("code",{children:["specs/",m||"<name>",".md"]})," with one ",s.jsx("code",{children:"## TC-…"})," per behaviour, designed with equivalence partitioning, boundary values, decision tables, state transitions and use cases, always adding edge and security cases."]}),s.jsxs("li",{children:["Each test case gets a test level tag (",s.jsx("b",{children:"IT"}),", ",s.jsx("b",{children:"ST"}),", ",s.jsx("b",{children:"SIT"}),", ",s.jsx("b",{children:"UAT"}),") plus type tags (smoke, negative, boundary, security…) and its design technique."]}),s.jsx("li",{children:"Its assumptions and open questions for the BA are listed in the job output."}),s.jsxs("li",{children:["Review the spec in the editor, then run ",s.jsx("b",{children:"Generate tests"}),"."]})]}),s.jsxs("p",{className:"muted small",style:{marginTop:14},children:["The agent can only write that spec file. It does not open a browser and does not invent credentials. Accounts come from ",s.jsx("code",{children:".env"})," when tests are generated."]})]})]})]})}function JT(){const e=ut(),[t,n]=j.useState("all"),r=Pl([t]),{data:i,error:l,reload:a}=Me(()=>q.jobsPage({page:r.page,pageSize:r.pageSize,type:t==="all"?void 0:t}),[r.page,r.pageSize,t]),[o,u]=j.useState(null),c=((i==null?void 0:i.items)??[]).some(d=>d.status==="queued"||d.status==="running");j.useEffect(()=>{if(!c)return;const d=setInterval(a,2e3);return()=>clearInterval(d)},[c,a]);const h=(i==null?void 0:i.items)??[];return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Recent runs"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Recent runs"}),s.jsx("p",{className:"page-sub",children:"Explore, generate, run and heal jobs with their agent timeline."})]})}),s.jsxs("div",{className:"row between",style:{marginBottom:14},children:[s.jsx(bn,{value:t,onChange:n,items:["all","testrun","generate","explore","heal","spec","context"].map(d=>({id:d,label:d==="all"?"All":kr[d]}))}),s.jsx("div",{className:"row",children:s.jsxs("button",{className:"btn dark",onClick:()=>void q.createJob({type:"testrun",repeatEach:1}).then(d=>e(`/runs/${d.id}`)).catch(d=>u(d.message)),children:[s.jsx(ft,{size:14})," Run all tests"]})})]}),s.jsx(Pe,{error:l??o}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"})]})}),s.jsx("tbody",{children:h.map(d=>s.jsxs("tr",{onClick:()=>e(`/runs/${d.id}`),style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsxs("div",{className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(ft,{size:14})}),s.jsxs("div",{children:[s.jsxs("div",{children:["#",d.id," ",kr[d.type]]}),s.jsxs("div",{className:"sub",children:[d.args.name??d.target,d.args.tcId?` · ${d.args.tcId}`:"",d.args.repeatEach&&d.args.repeatEach>1?` · ${d.args.repeatEach}×`:""]})]})]})}),s.jsx("td",{children:s.jsx(Mb,{agents:d.agents})}),s.jsxs("td",{children:[s.jsx(kn,{status:d.status}),d.warning&&s.jsx("span",{title:d.warning,style:{color:"var(--warn)"},children:" ⚠"})]}),s.jsx("td",{className:"muted small",children:d.summary??"—"}),s.jsx("td",{className:"muted small",children:Pt(d.startedAt??d.createdAt)}),s.jsx("td",{className:"muted small",children:ds(d.startedAt,d.finishedAt)})]},d.id))})]}),i&&h.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:"No jobs yet."}),i&&s.jsx(ps,{page:r.page,pageSize:r.pageSize,total:i.total,onPage:r.setPage,onPageSize:r.setPageSize,label:"jobs"})]})]})}function Tm(e){return e.replace(/\.md$/i,"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/đ/g,"d").replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|-+$/g,"")||"spec"}function XT(e){const t=e.filter(r=>r.lastResult);if(!t.length)return null;const n=t.filter(r=>r.lastResult.status==="passed").length;return n===t.length?{status:"passed",label:`${n}/${t.length} passed`}:{status:"failed",label:`${t.length-n}/${t.length} failed`}}function ZT(){const e=ut(),{openNewSpec:t}=hs(),{specs:n,mapping:r,refresh:i}=Xt(),[l,a]=j.useState("all"),[o,u]=j.useState(""),[c,h]=j.useState(new Set),[d,f]=j.useState(!1),[m,p]=j.useState(null),g=j.useRef(null),w=j.useMemo(()=>n.map(L=>{const A=r.filter(U=>U.specFile===L.file&&U.status!=="orphan"),z=new Set(A.filter(U=>U.testFile).map(U=>U.tcId)).size;return{spec:L,mapped:z,total:L.parsed.tcs.length,last:XT(A)}}),[n,r]),x=L=>L.total>0&&L.mapped>=L.total,y=[...new Set(n.flatMap(L=>L.parsed.tags))].sort(),v=o.trim().toLowerCase(),b=w.filter(L=>(l==="all"||(l==="mapped"?x(L):!x(L)))&&(!v||`${L.spec.file} ${L.spec.parsed.title} ${L.spec.parsed.tags.join(" ")}`.toLowerCase().includes(v))&&(c.size===0||L.spec.parsed.tags.some(A=>c.has(A)))),E=Bh(b,[l,o,c]),k=w.reduce((L,A)=>L+A.total,0),R=w.reduce((L,A)=>L+Math.max(A.total-A.mapped,0),0),T=async L=>{const A=L.filter(U=>/\.md$/i.test(U.name));if(!A.length)return p("Only .md files are accepted");if(A.length===1){t({name:Tm(A[0].name),content:await A[0].text()});return}const z=[];for(const U of A)try{await q.createSpec(`${Tm(U.name)}.md`,await U.text())}catch(I){z.push(`${U.name}: ${I.message}`)}i(),p(z.length?z.join(`
384
+ `):null)},D=L=>{T([...L.target.files??[]]),L.target.value=""},C=L=>void q.createJob({type:"testrun",spec:L,repeatEach:1}).then(A=>e(`/runs/${A.id}`)).catch(A=>p(A.message));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Specs"}),s.jsx("p",{className:"page-sub",children:"Markdown specs and the test cases mapped to Playwright scripts."})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>{var L;return(L=g.current)==null?void 0:L.click()},children:[s.jsx(Lo,{size:15})," Import .md"]}),s.jsx("input",{ref:g,type:"file",accept:".md,text/markdown",multiple:!0,hidden:!0,onChange:D}),s.jsxs(ye,{className:"btn ghost",to:"/specs/from-requirement",title:"QA Test Case Writer agent drafts the spec from a BA requirement",children:[s.jsx(fl,{size:15})," Generator"]}),s.jsxs("button",{className:"btn",onClick:()=>t(),children:[s.jsx(Qt,{size:15})," New spec"]})]})]}),s.jsx(Pe,{error:m}),s.jsxs("div",{className:"toolbar",children:[s.jsx(bn,{value:l,onChange:a,items:[{id:"all",label:s.jsxs(s.Fragment,{children:["All ",s.jsx("span",{className:"tab-count",children:w.length})]})},{id:"mapped",label:s.jsxs(s.Fragment,{children:["Mapped ",s.jsx("span",{className:"tab-count",children:w.filter(x).length})]})},{id:"needs",label:s.jsxs(s.Fragment,{children:["Needs mapping ",s.jsx("span",{className:"tab-count",children:w.filter(L=>!x(L)).length})]})}]}),s.jsx("div",{className:"grow"}),s.jsxs("label",{className:"search-input",children:[s.jsx(Ro,{size:15}),s.jsx("input",{value:o,onChange:L=>u(L.target.value),placeholder:"Search by file, title or tag","aria-label":"Search specs"})]}),s.jsxs("div",{className:"menu-wrap",children:[s.jsxs("button",{className:`btn ghost ${c.size?"on":""}`,onClick:()=>f(L=>!L),"aria-expanded":d,children:[s.jsx(ob,{size:15})," Tags",c.size?` (${c.size})`:""]}),d&&s.jsxs("div",{className:"menu",onMouseLeave:()=>f(!1),children:[y.length===0&&s.jsx("div",{className:"muted small pad-sm",children:"No tags yet"}),y.map(L=>s.jsxs("label",{className:"menu-item",children:[s.jsx("input",{type:"checkbox",className:"check-box",checked:c.has(L),onChange:()=>h(A=>{const z=new Set(A);return z.has(L)?z.delete(L):z.add(L),z})}),L]},L)),c.size>0&&s.jsx("button",{className:"btn ghost sm",style:{margin:6},onClick:()=>h(new Set),children:"Clear"})]})]})]}),s.jsxs("div",{className:"table-wrap table-fit",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{className:"num",children:"Test cases"}),s.jsx("th",{children:"Coverage"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:E.pageItems.map(({spec:L,mapped:A,total:z,last:U})=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs(ye,{to:`/specs/${L.file}`,className:"file-cell",children:[s.jsx("span",{className:"file-icon",children:s.jsx(jr,{size:16})}),s.jsxs("div",{children:[s.jsx("div",{className:"strong",children:L.parsed.title||L.file}),s.jsxs("div",{className:"sub mono",children:[L.file,L.parsed.warnings.length>0&&s.jsxs("span",{style:{color:"var(--warn)"},children:[" · ⚠ ",L.parsed.warnings.length]})]})]})]})}),s.jsx("td",{children:L.parsed.tags.map(I=>s.jsx("span",{className:"tag",children:I},I))}),s.jsx("td",{className:"num",children:z}),s.jsx("td",{children:s.jsxs("div",{className:"cov",children:[s.jsx("span",{className:"progress",children:s.jsx("i",{style:{width:`${z?A/z*100:0}%`}})}),s.jsxs("span",{className:"small",children:[A,"/",z]})]})}),s.jsx("td",{children:U?s.jsx(ni,{status:U.status,children:U.label}):s.jsx(ni,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"row",style:{justifyContent:"flex-end",flexWrap:"nowrap",gap:6},children:[s.jsx(ye,{to:`/specs/${L.file}`,className:"btn ghost sm",children:"Open"}),s.jsx("button",{className:"btn ghost sm icon",onClick:()=>C(L.file),disabled:A===0,title:A?`Run ${L.file}`:"Spec has no test file yet","aria-label":`Run ${L.file}`,children:s.jsx(ft,{size:12})})]})})]},L.file))})]}),b.length===0&&s.jsx("p",{className:"muted pad",children:w.length?"No specs match the filter.":"No specs yet."}),b.length>0&&s.jsx(ps,{...E.props,label:"specs"}),s.jsxs("div",{className:"table-foot",children:[s.jsxs("span",{children:[w.length," specs · ",k," test cases"]}),s.jsx("span",{children:R?`${R} test cases need mapping`:"All test cases mapped"})]})]})]})}function eP({value:e,onChange:t}){const n=j.useRef(null),r=e.split(`
385
+ `).length;return s.jsxs("div",{className:"line-editor",children:[s.jsx("div",{className:"gutter",ref:n,"aria-hidden":"true",children:Array.from({length:r},(i,l)=>s.jsx("div",{children:l+1},l))}),s.jsx("textarea",{value:e,onChange:i=>t(i.target.value),onScroll:i=>{n.current&&(n.current.scrollTop=i.currentTarget.scrollTop)},spellCheck:!1,wrap:"off","aria-label":"Spec content (markdown)"})]})}const Mv=/^(given|when|then|and|but)\b[: ]?\s*(.*)$/i,tP=/^\s*(tags|technique)\s*:/i;function nP(e){let t="given";return e.map(n=>{const r=n.trim().match(Mv),i=r[1].toLowerCase(),l=i==="and"||i==="but";return l||(t=i),{keyword:r[1][0].toUpperCase()+r[1].slice(1).toLowerCase(),kw:t,continuation:l,text:r[2].trim()}})}function rP({text:e}){return s.jsx(ui,{components:{p:({children:t})=>s.jsx(s.Fragment,{children:t})},children:e})}function sP({lines:e}){return s.jsx("ol",{className:"gherkin-steps",children:nP(e).map((t,n)=>s.jsxs("li",{className:`gherkin-step kw-${t.kw}${t.continuation?" continuation":""}`,children:[s.jsx("span",{className:"gherkin-kw",children:t.keyword})," ",s.jsx("span",{className:"gherkin-text",children:s.jsx(rP,{text:t.text})})]},n))})}function iP(e){const t=[];for(const n of e.split(/\r?\n/)){if(tP.test(n))continue;const r=Mv.test(n.trim()),i=t[t.length-1];i&&i.gherkin===r?i.lines.push(n):t.push({gherkin:r,lines:[n]})}return t}function lP({text:e}){return s.jsx(s.Fragment,{children:iP(e).map((t,n)=>{if(t.gherkin)return s.jsx(sP,{lines:t.lines},n);const r=t.lines.join(`
386
+ `).trim();return r?s.jsx("div",{className:"md",children:s.jsx(ui,{children:r})},n):null})})}function aP({content:e,parsed:t}){var l;const n=e.split(/\r?\n/),r=((l=t.tcs[0])==null?void 0:l.line)??n.length+1,i=n.slice(0,r-1).filter(a=>!/^\s*#\s+/.test(a)&&!/^\s*(tags|preconditions)\s*:/i.test(a)).join(`
387
387
  `).trim();return s.jsxs("div",{className:"spec-preview",children:[s.jsx("h2",{children:t.title||"Untitled spec"}),(t.tags.length>0||t.preconditions)&&s.jsxs("p",{className:"meta",children:[t.tags.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Tags:"})," ",t.tags.join(", ")]}),t.tags.length>0&&t.preconditions&&" · ",t.preconditions&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Preconditions:"})," ",t.preconditions]})]}),i&&s.jsx("div",{className:"md",children:s.jsx(ui,{children:i})}),t.tcs.map((a,o)=>{var h;const u=((h=t.tcs[o+1])==null?void 0:h.line)??n.length+1,c=n.slice(a.line,u-1).join(`
388
- `).trim();return s.jsxs("div",{className:"tc-card",children:[s.jsxs("div",{className:"tc-card-head",children:[s.jsx("span",{className:"tc-chip",children:a.id}),s.jsx("b",{children:a.title}),a.tags.map(d=>s.jsx("span",{className:"tag",children:d},d)),a.technique&&s.jsxs("span",{className:"muted small",children:["Technique: ",a.technique]})]}),c&&s.jsx(nP,{text:c})]},`${a.id}-${o}`)})]})}function sP(){const{file:e=""}=ii(),t=ut(),{refresh:n,mapping:r}=un(),i=Kn(),l=cs(),[a,o]=j.useState(""),[u,c]=j.useState(""),[h,d]=j.useState(),[f,m]=j.useState(!1),[p,g]=j.useState(null),[w,x]=j.useState(null),[y,v]=j.useState(!1),[b,E]=j.useState(1),[k,L]=j.useState("split"),T=j.useRef(!1),D=Ie(()=>q.jobs(),[e]),N=f&&a!==u,P=j.useMemo(()=>hb(a),[a]),A=r.filter(F=>F.specFile===e&&F.status!=="orphan"),z=new Set(A.filter(F=>F.testFile).map(F=>F.tcId)),U=A.filter(F=>F.lastResult),I=U.filter(F=>F.lastResult.status==="passed").length,Q=(D.data??[]).filter(F=>F.target===e).slice(0,5),J=j.useCallback(async()=>{try{const F=await q.spec(e);o(F.content),c(F.content),d(F.mtimeMs),m(!0),g(null)}catch(F){g(F.message)}},[e]);j.useEffect(()=>{m(!1),T.current=!1,J()},[J]);const H=ph(({currentLocation:F,nextLocation:Z})=>N&&!T.current&&F.pathname!==Z.pathname);Th(H,{title:"Leave with unsaved changes?",message:"Your edits to this spec are not saved and will be lost.",confirmLabel:"Discard changes",danger:!0}),j.useEffect(()=>{const F=Z=>{N&&Z.preventDefault()};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[N]);const X=j.useCallback(async(F=!1)=>{v(!0),x(null);try{const Z=await q.saveSpec(e,a,F?void 0:h);return c(a),d(Z.mtimeMs),g(null),x("Saved."),n(),!0}catch(Z){return Z instanceof Oc&&Z.status===409&&await i({title:"Spec changed on disk",message:`${Z.message} Overwrite it with your current edits?`,confirmLabel:"Overwrite",danger:!0})?(v(!1),X(!0)):(g(Z.message),!1)}finally{v(!1)}},[a,e,h,n,i]);j.useEffect(()=>{const F=Z=>{(Z.ctrlKey||Z.metaKey)&&Z.key.toLowerCase()==="s"&&(Z.preventDefault(),N&&X())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[N,X]);const S=async F=>{if(!(N&&!await X()))try{const Z=await q.createJob(F);T.current=!0,t(`/runs/${Z.id}`)}catch(Z){g(Z.message)}},ae=async()=>{if(await i({title:`Delete ${e}?`,message:"The spec file is removed. Its test file in tests/e2e (if any) is NOT deleted. This cannot be undone.",confirmLabel:"Delete spec",danger:!0}))try{await q.deleteSpec(e),T.current=!0,n(),l.success(`Deleted ${e}`),t("/specs")}catch(Z){g(Z.message)}},O=P.tcs.length===0,C=Bh(P.tcs,[e]);return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs",to:"/specs"},{label:e}]}),s.jsxs(Yb,{children:[s.jsxs("span",{className:"chip",children:["Coverage ",z.size,"/",P.tcs.length]}),s.jsxs("span",{className:`chip ${I<U.length?"fail":"ok"}`,children:["Pass rate ",I,"/",U.length]})]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{className:"row",style:{alignItems:"flex-start",flexWrap:"nowrap"},children:[s.jsx("button",{className:"btn ghost icon square",onClick:()=>t("/specs"),"aria-label":"Back to specs list",title:"Back to Specs",children:s.jsx(ib,{size:16})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[P.title||e," ",N&&s.jsx("span",{className:"badge stale",children:"unsaved"})]}),s.jsxs("p",{className:"page-sub row",style:{gap:6},children:[s.jsx("span",{className:"mono",children:e}),P.tags.map(F=>s.jsxs("span",{children:["· ",s.jsx("span",{className:"tag",children:F})]},F))]})]})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void X(),disabled:!N||y,title:"Ctrl+S",children:[s.jsx(li,{size:15})," Save"]}),s.jsx("button",{className:"btn ghost icon square",onClick:()=>void(async()=>{N&&!await i({title:"Discard unsaved changes?",message:"Reloading replaces your edits with the file on disk.",confirmLabel:"Discard & reload",danger:!0})||await J()})(),disabled:y,title:"Reload from disk","aria-label":"Reload from disk",children:s.jsx(Pr,{size:15})}),s.jsx("button",{className:"btn danger icon square",onClick:()=>void ae(),disabled:y,title:"Delete spec","aria-label":"Delete spec",children:s.jsx(Rr,{size:15})})]})]}),s.jsxs("div",{className:"pipeline-bar",children:[s.jsxs("div",{className:"pipeline-steps",title:"Runs with Claude Code, no API key needed",children:[s.jsx("b",{children:"Pipeline"}),s.jsx("span",{className:"step",children:Se.explorer.label}),"→",s.jsx("span",{className:"step",children:Se.generator.label}),"→",s.jsx("span",{className:"step",children:Se.validator.label}),"→",s.jsxs("span",{className:"step",children:[Se.healer.label," ≤ 2"]})]}),s.jsx("div",{className:"grow"}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S({type:"explore",spec:e}),disabled:y||O,children:[s.jsx(Ty,{size:15})," Explore"]}),s.jsxs("button",{className:"btn",onClick:()=>void S({type:"generate",spec:e}),disabled:y||O,children:[s.jsx(vh,{size:15})," Generate"]}),s.jsx("select",{className:"select",value:b,onChange:F=>E(Number(F.target.value)),"aria-label":"Repeat count",children:[1,2,3,5,10].map(F=>s.jsxs("option",{value:F,children:[F,"×"]},F))}),s.jsxs("button",{className:"btn dark",onClick:()=>void S({type:"testrun",spec:e,repeatEach:b}),disabled:y||z.size===0,title:z.size?"":"Spec has no test file yet",children:[s.jsx(ft,{size:13})," Run"]})]}),s.jsx(Pe,{error:p}),w&&s.jsx("div",{className:"info-box",children:w}),f&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Spec content"}),s.jsx(bn,{value:k,onChange:L,items:[{id:"editor",label:"Editor"},{id:"split",label:"Split"},{id:"preview",label:"Preview"}]})]}),s.jsxs("div",{className:`spec-body ${k}`,children:[k!=="preview"&&s.jsx(YT,{value:a,onChange:o}),k!=="editor"&&s.jsx(rP,{content:a,parsed:P})]})]}),P.warnings.map(F=>s.jsxs("div",{className:"warn-box",children:["⚠ ",F]},F)),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Test cases ",s.jsxs("span",{className:"muted",children:["(",P.tcs.length,")"]})]})}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC-ID"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:C.pageItems.map(F=>{const Z=A.find(B=>B.tcId===F.id),oe=Z==null?void 0:Z.lastResult;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{className:"strong",children:F.id})}),s.jsx("td",{children:F.title}),s.jsx("td",{children:Z!=null&&Z.testFile?s.jsxs("span",{className:"map-link",title:`${Z.testFile}:${Z.testLine??""}`,children:[s.jsx(xh,{size:13}),s.jsx("code",{children:Z.testFile.split("/").pop()}),Z.status==="stale"&&s.jsx(dt,{status:"stale"})]}):s.jsx(dt,{status:(Z==null?void 0:Z.status)??"missing"})}),s.jsx("td",{children:oe?s.jsx(ye,{to:`/runs/${oe.jobId}`,children:s.jsx(ti,{status:oe.status,children:oe.status.charAt(0).toUpperCase()+oe.status.slice(1)})}):s.jsx(ti,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"tc-actions",children:[s.jsx("button",{className:"btn ghost icon tc-action gen",disabled:y,title:z.has(F.id)?`Regenerate the test of ${F.id} only (Explorer → Generator → Validator)`:`Generate a test for ${F.id} only (Explorer → Generator → Validator)`,"aria-label":`Generate ${F.id}`,onClick:()=>void S({type:"generate",spec:e,tcId:F.id}),children:s.jsx(tb,{size:16})}),s.jsx("button",{className:"btn ghost icon tc-action run",disabled:!z.has(F.id)||y,title:z.has(F.id)?`Run ${F.id}`:"TC has no test yet, run Generate","aria-label":`Run ${F.id}`,onClick:()=>void S({type:"testrun",spec:e,tcId:F.id,repeatEach:b}),children:s.jsx(eb,{size:14})})]})})]},`${F.id}-${F.line}`)})})]}),O&&s.jsx("p",{className:"muted pad",children:"No test cases yet. Add a heading like “## TC-XXX-001: Name”."}),!O&&s.jsx(fs,{...C.props,label:"test cases"})]}),Q.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"Recent jobs for this spec"}),s.jsx("div",{className:"row",children:Q.map(F=>s.jsxs(ye,{to:`/runs/${F.id}`,className:"card pad row",style:{padding:"8px 12px"},children:["#",F.id," ",F.type," ",s.jsx(kn,{status:F.status})]},F.id))})]})]})]})}const iP={settings:"path set below",env:"QA_STUDIO_CLAUDE_BIN",path:"found on PATH"};function Iu({label:e,check:t,pending:n}){const r=t?t.ok?"ok":"fail":"pending";return s.jsxs("div",{className:`cc-row ${r}`,children:[s.jsx("span",{className:"cc-mark","aria-hidden":"true",children:r==="ok"?s.jsx(yh,{size:13}):r==="fail"?s.jsx(wr,{size:13}):"?"}),s.jsx("span",{className:"cc-label",children:e}),s.jsx("span",{className:"cc-detail",children:t?t.detail:n})]})}function lP({status:e}){const t=e.binary.ok?e.version.ok?e.test&&!e.test.ok?e.test.hint:null:"version":"path";return!t&&e.state!=="unverified"?null:s.jsxs("div",{className:"cc-guide",children:[t==="path"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Install Claude Code, or tell Agent Studio where it is"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Install it: in PowerShell ",s.jsx("code",{children:"irm https://claude.ai/install.ps1 | iex"}),", or with Node.js ",s.jsx("code",{children:"npm install -g @anthropic-ai/claude-code"}),"."]}),s.jsxs("li",{children:["Open a new terminal and check: ",s.jsx("code",{children:"claude --version"}),"."]}),s.jsxs("li",{children:["If Agent Studio still cannot find it, paste the full path of ",s.jsx("code",{children:"claude.exe"})," below (find it with ",s.jsx("code",{children:"where.exe claude"}),"; for an npm install use the"," ",s.jsx("code",{children:"claude.exe"})," inside ",s.jsx("code",{children:"node_modules\\@anthropic-ai\\claude-code\\bin"}),", not ",s.jsx("code",{children:"claude.cmd"}),")."]})]})]}),t==="version"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"The binary was found but does not start"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsxs("code",{children:[e.binary.detail," --version"]})," in a terminal to see the error."]}),s.jsx("li",{children:"Reinstall or update Claude Code, or point the path below to a working claude.exe."})]})]}),t==="login"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Log Claude Code in"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["In a terminal run ",s.jsx("code",{children:"claude"}),", type ",s.jsx("code",{children:"/login"})," and sign in with your Claude account (or a Console API key)."]}),s.jsxs("li",{children:["Using an API key instead: set ",s.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the environment that starts Agent Studio (not only in ",s.jsx("code",{children:".env"}),"), then restart Agent Studio."]}),s.jsx("li",{children:"Come back and run the test prompt again."})]})]}),t==="network"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code did not answer"}),s.jsxs("ol",{children:[s.jsx("li",{children:"Check the internet connection, proxy or VPN of this machine."}),s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal to see the error, then test again."]})]})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code returned an error"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal from the repo folder to see the full message."]}),s.jsxs("li",{children:["Check usage limits with ",s.jsx("code",{children:"/usage"})," in Claude Code, then test again."]})]})]}),!t&&e.state==="unverified"&&s.jsxs("span",{children:["Claude Code is installed. Run the ",s.jsx("b",{children:"test prompt"})," once to confirm it is logged in and can answer (one short request on the smallest model; on a subscription it only counts toward usage limits)."]})]})}function aP({onChange:e}){const[t,n]=j.useState(null),[r,i]=j.useState(!1),[l,a]=j.useState(!1),[o,u]=j.useState(""),[c,h]=j.useState(null),d=async()=>{i(!0);try{const g=await q.claudeStatus();n(g),u(w=>w||g.configuredPath),h(null),e==null||e()}catch(g){h(g.message)}finally{i(!1)}};j.useEffect(()=>{d()},[]);const f=async()=>{a(!0);try{await q.claudeTest(),await d()}catch(g){h(g.message)}finally{a(!1)}},m=async g=>{try{await q.saveSettings({claudeBin:g}),u(g),h(null),await d()}catch(w){h(w.message)}},p=(t==null?void 0:t.state)==="ready"?"Ready":(t==null?void 0:t.state)==="unverified"?"Installed, not verified":t?"Not ready":"Checking…";return s.jsxs("div",{className:"pad cc",children:[s.jsxs("div",{className:"row between",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Claude Code"})," ",s.jsxs("span",{className:`cc-state ${(t==null?void 0:t.state)??"pending"}`,children:[s.jsx("i",{})," ",p]}),s.jsx("div",{className:"muted small",children:"The QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer and Context Writer run through headless Claude Code (claude.exe)."})]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost sm",onClick:()=>void d(),disabled:r||l,children:[s.jsx(Pr,{size:13})," ",r?"Checking…":"Check again"]}),s.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:l||!(t!=null&&t.binary.ok)||!(t!=null&&t.version.ok),title:"Sends one short prompt through Claude Code",children:l?"Testing… (up to 2 min)":"Run test prompt"})]})]}),s.jsx(Pe,{error:c}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cc-checks",children:[s.jsx(Iu,{label:"Binary",check:t.binary}),s.jsx(Iu,{label:"Starts",check:t.version}),s.jsx(Iu,{label:"Logged in & answers",check:t.test?{ok:t.test.ok,detail:`${t.test.message} · ${Pt(t.test.at)}${t.test.model?` · ${t.test.model}`:""}${t.test.costUsd!==null?` · ${Gt(t.test.costUsd)}`:""}`}:null,pending:"Not tested yet for this binary"})]}),t.source&&s.jsxs("div",{className:"muted small",children:["Using ",iP[t.source],"."]}),s.jsx(lP,{status:t})]}),s.jsxs("div",{className:"cc-path",children:[s.jsxs("label",{htmlFor:"claude-bin",className:"small",style:{fontWeight:600},children:["Path to claude.exe ",s.jsx("span",{className:"muted",style:{fontWeight:400},children:"(leave empty to use QA_STUDIO_CLAUDE_BIN or PATH)"})]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{id:"claude-bin",className:"input grow mono",placeholder:"C:\\Users\\<you>\\.local\\bin\\claude.exe",value:o,onChange:g=>u(g.target.value)}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void m(o),disabled:o===((t==null?void 0:t.configuredPath)??""),children:[s.jsx(li,{size:13})," Save path"]}),(t==null?void 0:t.configuredPath)&&s.jsx("button",{className:"btn ghost sm",onClick:()=>void m(""),children:"Use automatic"})]})]})]})}function oP(){const{data:e,error:t,reload:n}=Ie(()=>q.settings()),[r,i]=j.useState(null),[l,a]=j.useState(null),[o,u]=j.useState(!1);j.useEffect(()=>{e&&i(e.settings.maxHealRounds)},[e]);const c=e==null?void 0:e.settings.maxHealRounds,h=r!==null&&r!==c,d=async()=>{if(r!==null)try{await q.saveSettings({maxHealRounds:r}),a(null),u(!0),setTimeout(()=>u(!1),2e3),n()}catch(f){a(f.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Maximum heal rounds"}),s.jsxs("div",{className:"muted small",children:["QA Validator fails → QA Script Healer fixes → back to QA Validator. The loop stops when tests pass, the QA Script Healer reports an app bug or gives up, or after this many heal rounds (prevents an infinite loop). 0 turns the QA Script Healer off. Default ",(e==null?void 0:e.defaults.maxHealRounds)??2,". Applies to jobs queued after saving."]}),s.jsx(Pe,{error:t??l})]}),s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input",type:"number",min:0,max:Mp,step:1,style:{width:80},value:r??"",onChange:f=>i(f.target.value===""?null:Math.max(0,Math.min(Mp,Math.round(Number(f.target.value))))),"aria-label":"Maximum heal rounds"}),s.jsxs("button",{className:"btn",disabled:!h,onClick:()=>void d(),children:[s.jsx(li,{size:14})," ",o?"Saved":"Save"]})]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Playwright HTML report"}),s.jsx("div",{className:"muted small",children:"Default for new test runs. The line reporter is always on; when this is on, runs also write the HTML report (traces, screenshots), which opens from the run page. Each run can override it."})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.settings.htmlReport)??!1,disabled:!e,onChange:f=>void q.saveSettings({htmlReport:f.target.checked}).then(n,m=>a(m.message))}),s.jsx("span",{children:e!=null&&e.settings.htmlReport?"On":"Off"})]})]})]})}function uP(){const{theme:e,toggleTheme:t,refreshClaude:n}=ds();return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"General"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-sub",children:"Pipeline settings are saved in Agent Studio; appearance is stored in this browser."})]})}),s.jsxs("div",{className:"card",style:{marginBottom:12},id:"claude",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"LLM runtime"})}),s.jsx(aP,{onChange:n})]}),s.jsxs("div",{className:"settings-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Pipeline"})}),s.jsx(oP,{})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Appearance"})}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Theme"}),s.jsx("div",{className:"muted small",children:"Light or dark theme."})]}),s.jsxs("button",{className:"btn ghost",onClick:t,children:[e==="dark"?s.jsx(Ay,{size:15}):s.jsx(Ry,{size:15})," ",e==="dark"?"Dark":"Light"]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Keyboard shortcuts"}),s.jsx("div",{className:"muted small",children:"Search / command palette, save spec."})]}),s.jsxs("span",{className:"row small",children:[s.jsx("span",{className:"kbd-light",children:"Ctrl K"}),s.jsx("span",{className:"kbd-light",children:"Ctrl S"})]})]})]})]})]})}function Mv({title:e,onStart:t,onClose:n,specRequired:r,newSpec:i,promptOnly:l,specAgent:a}){var E,k,L;const o=ut(),u=Ie(()=>q.specs()),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(null),[g,w]=j.useState(!1);j.useEffect(()=>{const T=D=>D.key==="Escape"&&n();return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const x=async()=>{w(!0);try{let T=c.trim();i&&T&&!T.endsWith(".md")&&(T=`${T}.md`);const D=await t(T,d);o(`/runs/${D.id}`)}catch(T){p(T.message),w(!1)}},y=r?"Spec":"Spec (optional)",v=l?c?"Prompt (optional)":"Prompt":"Input (optional)",b=r?!!c.trim():l?!!c.trim()||!!d.trim():!0;return s.jsx("div",{className:"overlay",onClick:n,children:s.jsx("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":e,onClick:T=>T.stopPropagation(),children:s.jsxs("div",{className:"modal-body",style:{display:"grid",gap:12},children:[s.jsx("h3",{style:{margin:0},children:e}),s.jsx(Pe,{error:m??u.error}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:y}),i?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"input",list:"run-dialog-specs",value:c,onChange:T=>h(T.target.value),placeholder:"new-spec.md"}),s.jsx("datalist",{id:"run-dialog-specs",children:(E=u.data)==null?void 0:E.map(T=>s.jsx("option",{value:T.file},T.file))})]}):s.jsxs("select",{className:"input",value:c,onChange:T=>h(T.target.value),children:[s.jsx("option",{value:"",children:r?"Select a spec…":l?"No spec (prompt only)":"No spec"}),(k=u.data)==null?void 0:k.map(T=>s.jsx("option",{value:T.file,children:T.file},T.file))]}),l&&a&&!c&&s.jsxs("span",{className:"muted small",children:["Without a spec, the pipeline stops at the ",((L=Se[a])==null?void 0:L.label)??a,"."]})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:v}),s.jsx("textarea",{className:"input",rows:6,value:d,onChange:T=>f(T.target.value),placeholder:i?"The requirement to turn into the spec":"What should the agents do this time?"})]}),s.jsxs("span",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn ghost",onClick:n,children:"Cancel"}),s.jsxs("button",{className:"btn",onClick:()=>void x(),disabled:g||!b,children:[s.jsx(ft,{size:14})," Start job"]})]})]})})})}const Du=e=>{var t;return((t=e.steps[0])==null?void 0:t.kind)==="agent"&&e.steps[0].agent==="specwriter"},zv=Object.keys(Se).filter(e=>e!=="custom"),Pm=zv.filter(e=>Se[e].llm),Rm=zv.filter(e=>!Se[e].llm),Am=Object.keys(Ro),cP=[{tone:"opus",label:"Opus"},{tone:"sonnet",label:"Sonnet"},{tone:"haiku",label:"Haiku"},{tone:"none",label:"No LLM"}];function _v(e){const t=e.replace(/^QA\s+/,"").split(/\s+/).filter(Boolean);return t.length>1?t.map(n=>n[0].toUpperCase()).join("").slice(0,2):(t[0]??e).slice(0,2)}function dP(){var y,v,b,E,k,L,T;const e=cs(),t=Kn(),n=ut(),[r,i]=mh(),l=r.get("tab")==="custom"?"custom":"default",a=D=>i(D==="custom"?{tab:"custom"}:{},{replace:!0}),o=Ie(()=>q.settings()),u=Ie(()=>q.agentPrompts()),c=Ie(()=>q.pipelines()),h=Ie(()=>q.customAgents()),[d,f]=j.useState(null),m=((y=o.data)==null?void 0:y.settings.maxHealRounds)??null,p=D=>{var N;return(N=u.data)==null?void 0:N.find(P=>P.agent===D)},g=D=>{var P,A,z;const N=Sl(D);return N?((A=(P=h.data)==null?void 0:P.find(U=>U.id===N))==null?void 0:A.model)??"none":Se[D].llm?((z=p(D))==null?void 0:z.model)??"none":"none"},w=async D=>{if(await t({title:`Delete the pipeline "${D.name}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0}))try{await q.deletePipeline(D.id),e.success(`Pipeline "${D.name}" deleted`),c.reload()}catch(P){e.error(P.message)}},x=(v=c.data)==null?void 0:v.length;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents"}]}),s.jsxs("div",{className:"page-head ap-page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Agents & pipelines"}),s.jsx("p",{className:"page-sub",children:"Agents are the building blocks. Pipelines chain them into jobs. All agents run through Claude Code; Playwright steps run without an LLM."})]}),s.jsxs("span",{className:"row",children:[s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost",children:[s.jsx(Qt,{size:15})," New agent"]}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn",children:[s.jsx(Qt,{size:15})," New pipeline"]})]})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsxs("div",{className:"ap-head-title",children:[s.jsx("h3",{children:"Agents"}),s.jsxs("span",{className:"muted small",children:[Pm.length," Built-in agents · ",((b=h.data)==null?void 0:b.length)??0," custom · ",Rm.length," Playwright steps · click an agent to open its details"]})]}),s.jsx("span",{className:"ap-legend","aria-label":"Model colours",children:cP.map(D=>s.jsxs("span",{children:[s.jsx("i",{className:`tone-dot tone-${D.tone}`})," ",D.label]},D.tone))})]}),s.jsx(Pe,{error:u.error}),s.jsx("div",{className:"ap-group-label",children:"Built-in agents"}),s.jsx("div",{className:"ap-grid",children:Pm.map(D=>s.jsx(Lm,{agent:D,tone:g(D),info:p(D)},D))}),s.jsx("div",{className:"ap-group-label",children:"Custom agents"}),s.jsx(Pe,{error:h.error}),((E=h.data)==null?void 0:E.length)===0&&s.jsxs("p",{className:"ap-note",children:["No custom agents yet. Click ",s.jsx("b",{children:"New agent"})," to create one."]}),!!((k=h.data)!=null&&k.length)&&s.jsx("div",{className:"ap-grid",children:h.data.map(D=>s.jsxs(ye,{to:`/agents/custom/${D.id}`,className:"ap-agent","aria-label":`${D.name}: ${D.description||"Custom agent"}`,children:[s.jsx("span",{className:`ap-avatar tone-${D.model}`,children:_v(D.name)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[D.name,D.skills.length>0&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${D.skills.join(", ")}`,children:[D.skills.length," skill",D.skills.length===1?"":"s"]})]}),s.jsx("span",{title:D.description,children:D.description||"Custom agent"})]}),s.jsx("span",{className:`ap-pill tone-${D.model}`,children:D.model[0].toUpperCase()+D.model.slice(1)}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ei,{size:14})})]},D.id))}),s.jsx("div",{className:"ap-group-label",children:"Playwright steps · No LLM"}),s.jsx("div",{className:"ap-grid",children:Rm.map(D=>s.jsx(Lm,{agent:D,tone:"none"},D))})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsx("div",{className:"ap-head-title",children:s.jsx("h3",{children:"Pipelines"})}),s.jsx(bn,{value:l,onChange:a,items:[{id:"default",label:s.jsxs(s.Fragment,{children:["Default ",s.jsx("span",{className:"tab-count",children:Am.length})]})},{id:"custom",label:s.jsxs(s.Fragment,{children:["Custom ",s.jsx("span",{className:"tab-count",children:x??"…"})]})}]})]}),l==="default"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Built-in job types. Duplicate one to start a custom pipeline. Loops repeat until the QA Validator passes or the round limit is reached."}),s.jsx("div",{className:"ap-rows",children:Am.map(D=>s.jsxs("div",{className:"ap-row",children:[s.jsx("span",{className:"ap-row-name",children:kr[D]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(hP,{type:D,maxRounds:m,toneOf:g})}),s.jsxs("span",{className:"ap-row-meta",children:[s.jsx(ob,{size:13})," Built-in"]}),s.jsx("span",{className:"ap-row-actions",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(`/agents/pipelines/new?from=${D}`),"aria-label":`Duplicate ${kr[D]}`,children:"Duplicate"})})]},D))})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Your own pipelines. Each loop repeats its agents until the first one passes, or up to its maximum iterations."}),s.jsx(Pe,{error:c.error}),((L=c.data)==null?void 0:L.length)===0&&s.jsxs("div",{className:"ap-empty",children:[s.jsx("p",{className:"muted",children:"No custom pipelines yet."}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn sm",children:[s.jsx(Qt,{size:14})," New pipeline"]})]}),s.jsx("div",{className:"ap-rows",children:(T=c.data)==null?void 0:T.map(D=>s.jsxs("div",{className:"ap-row",children:[s.jsxs("span",{className:"ap-row-name",children:[s.jsx(ye,{to:`/agents/pipelines/${D.id}`,children:D.name}),D.description&&s.jsx("span",{className:"muted small ap-row-desc",children:D.description})]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(fP,{steps:D.steps,toneOf:g,custom:h.data??[]})}),s.jsx("span",{className:"ap-row-meta",title:`Updated ${Pt(D.updatedAt)}`,children:Pt(D.updatedAt)}),s.jsxs("span",{className:"ap-row-actions",children:[s.jsx("button",{className:"btn sm",onClick:()=>f(D),"aria-label":`Run pipeline ${D.name}`,children:"Run"}),s.jsx(ye,{to:`/agents/pipelines/${D.id}`,className:"btn ghost sm","aria-label":`Edit pipeline ${D.name}`,children:"Edit"}),s.jsx("button",{className:"btn danger sm icon",onClick:()=>void w(D),"aria-label":`Delete pipeline ${D.name}`,title:"Delete",children:s.jsx(Rr,{size:14})})]})]},D.id))})]})]}),d&&s.jsx(Mv,{title:`Run ${d.name}`,specRequired:Du(d),promptOnly:!Du(d),specAgent:Cb(d.steps),newSpec:Du(d),onClose:()=>f(null),onStart:(D,N)=>q.createJob({type:"pipeline",pipelineId:d.id,...D?{spec:D}:{},...N.trim()?{input:N}:{}})})]})}function Lm({agent:e,tone:t,info:n}){const r=Se[e],i=(n==null?void 0:n.customized)||(n==null?void 0:n.modelCustomized);return s.jsxs(ye,{to:`/agents/${e}`,className:`ap-agent ${r.llm?"":"step"}`,"aria-label":`${r.label}: ${r.description}`,children:[s.jsx("span",{className:`ap-avatar tone-${t}`,children:_v(r.label)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[r.label,i&&s.jsx("span",{className:"ap-custom",title:n!=null&&n.customized?"Custom prompt":"Custom model",children:"custom"}),!!(n!=null&&n.skills.length)&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${n.skills.join(", ")}`,children:[n.skills.length," skill",n.skills.length===1?"":"s"]})]}),s.jsx("span",{title:r.description,children:r.description})]}),s.jsx("span",{className:`ap-pill tone-${t}`,children:r.llm?n?n.model[0].toUpperCase()+n.model.slice(1):"…":"No LLM"}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ei,{size:14})})]})}const id=(e,t)=>{var n;return((n=t.find(r=>Eh(r.id)===e))==null?void 0:n.review)==="human"};function $v({agent:e,toneOf:t,custom:n}){const r=id(e,n);return s.jsxs("span",{className:`ap-chip tone-${t(e)}`,title:r?"Human review":void 0,children:[Rl(e,n),r&&" 👤"]})}const ld=()=>s.jsx("span",{className:"ap-arrow",children:"→"});function hP({type:e,maxRounds:t,toneOf:n}){const r=Ro[e],i=e==="generate"||e==="heal",l=i?r.filter(o=>!Nh.includes(o)):r,a=e==="heal"?["healer","validator"]:["validator","healer"];return s.jsxs(s.Fragment,{children:[l.map((o,u)=>s.jsxs(j.Fragment,{children:[u>0&&s.jsx(ld,{}),s.jsx($v,{agent:o,toneOf:n,custom:[]})]},o)),i&&s.jsxs(s.Fragment,{children:[l.length>0&&s.jsx(ld,{}),s.jsx(Wh,{agents:a,toneOf:n,custom:[],suffix:t===null?null:`max ${t} round${t===1?"":"s"}`,swap:!0})]})]})}function fP({steps:e,toneOf:t,custom:n}){return s.jsx(s.Fragment,{children:e.map((r,i)=>s.jsxs(j.Fragment,{children:[i>0&&s.jsx(ld,{}),r.kind==="agent"?s.jsx($v,{agent:r.agent,toneOf:t,custom:n}):s.jsx(Wh,{agents:r.steps,toneOf:t,custom:n,suffix:`max ${r.maxIterations}×${r.endsWhen==="last"?" · until last passes":""}`,endsWhen:r.endsWhen})]},i))})}function Wh({agents:e,toneOf:t,custom:n,suffix:r,swap:i,endsWhen:l}){return s.jsxs("span",{className:"ap-loop",title:`Repeats its agents; stops when the ${l==="last"?"last":"first"} one passes or the maximum is reached`,children:[s.jsx(rs,{size:12}),e.map((a,o)=>s.jsxs(j.Fragment,{children:[o>0&&(i?s.jsx("span",{className:"ap-loop-sep",children:"⇄"}):s.jsx("span",{className:"ap-loop-sep",children:"→"})),typeof a=="string"?s.jsxs("span",{className:`ap-loop-name tone-${t(a)}`,title:id(a,n)?"Human review":void 0,children:[Rl(a,n),id(a,n)&&" 👤"]}):s.jsx(Wh,{agents:a.steps,toneOf:t,custom:n,suffix:`max ${a.maxIterations}×${a.endsWhen==="last"?" · until last passes":""}`,endsWhen:a.endsWhen})]},o)),r&&s.jsx("span",{className:"ap-loop-max",children:r})]})}function Im(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function pP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mP(e,t,n){const i=zo((n||{}).ignore||[]),l=gP(t);let a=-1;for(;++a<l.length;)ed(e,o);function o(c,h,d){if(c.type==="text"&&typeof d=="number")return u(c,h,d);if(i(c,d,h[h.length-1]))return Zc}function u(c,h,d){const f=h[h.length-1],m=l[a][0],p=l[a][1];let g=0,w=!1,x=[];m.lastIndex=0;let y=m.exec(c.value);for(;y;){const b=y.index,E={index:y.index,input:y.input,stack:[...h,c]};let k=p(...y,E);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1)m.lastIndex=b+1;else{if(g!==b&&v({type:"text",value:c.value.slice(g,b)}),Array.isArray(k))for(const L of k)v(L);else k&&v(k);g=b+y[0].length,w=!0}if(!m.global)break;y=m.exec(c.value)}return w?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),f.children.splice(d,1,...x)):x=[c],d+x.length;function v(b){const E=x[x.length-1];E&&E.type==="text"&&b.type==="text"?E.value+=b.value:x.push(b)}}}function gP(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([xP(i[0]),yP(i[1])])}return t}function xP(e){return typeof e=="string"?new RegExp(pP(e),"g"):e}function yP(e){return typeof e=="function"?e:function(){return e}}const Mu="phrasing",zu=["autolink","link","image","label"];function vP(){return{transforms:[CP],enter:{literalAutolink:wP,literalAutolinkEmail:_u,literalAutolinkHttp:_u,literalAutolinkWww:_u},exit:{literalAutolink:NP,literalAutolinkEmail:SP,literalAutolinkHttp:kP,literalAutolinkWww:bP}}}function jP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mu,notInConstruct:zu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mu,notInConstruct:zu},{character:":",before:"[ps]",after:"\\/",inConstruct:Mu,notInConstruct:zu}]}}function wP(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function _u(e){this.config.enter.autolinkProtocol.call(this,e)}function kP(e){this.config.exit.autolinkProtocol.call(this,e)}function bP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function SP(e){this.config.exit.autolinkEmail.call(this,e)}function NP(e){this.exit(e)}function CP(e){mP(e,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),EP],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),RP],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),PP],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),TP]],{ignore:["link","linkReference"]})}function EP(e,t,n,r,i){if(!IP(i))return!1;let l="";if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),Cl(n.charCodeAt(0))||!AP(n))return!1;const a=LP(n+r),o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0],position:void 0}],position:void 0};return a[1]?[o,{type:"text",value:a[1],position:void 0}]:o}function TP(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function PP(e,t,n){if(/[\d\-_]$/.test(n))return!1;const r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function RP(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;const l="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:l,children:[{type:"text",value:l,position:void 0}],position:void 0}}function AP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function LP(e){let t=e.length;for(;t>0;){const a=e.charCodeAt(t-1);if(a===33||a===34||a===38||a===39||a===41||a===44||a===46||a===58||a===59||a===60||a===62||a===63||a===93||a===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")");const i=Im(e,"(");let l=Im(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function IP(e){const t=e.input.charCodeAt(e.index-1);return e.index===0||ss(t)||Cl(t)}Ov.peek=BP;function DP(){this.buffer()}function MP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zP(){this.buffer()}function _P(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $P(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function OP(e){this.exit(e)}function FP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UP(e){this.exit(e)}function BP(){return"["}function Ov(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function HP(){return{enter:{gfmFootnoteCallString:DP,gfmFootnoteCall:MP,gfmFootnoteDefinitionLabelString:zP,gfmFootnoteDefinition:_P},exit:{gfmFootnoteCallString:$P,gfmFootnoteCall:OP,gfmFootnoteDefinitionLabelString:FP,gfmFootnoteDefinition:UP}}}function WP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ov},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let u=o.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return u+=o.move(l.safe(l.associationId(r),{before:u,after:"]"})),h(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
389
- `:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Fv:VP))),c(),u}}function VP(e,t,n){return t===0?e:Fv(e,t,n)}function Fv(e,t,n){return(n?"":" ")+e}const QP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Vh.attention=JP;Vh.peek=XP;function qP(){return{canContainEols:["delete"],enter:{strikethrough:KP},exit:{strikethrough:YP}}}function GP(){return{handlers:{delete:Vh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:QP}]}}function KP(e){this.enter({type:"delete",children:[],position:void 0},e)}function YP(e){this.exit(e)}function Vh(e,t,n,r){const i=n.createTracker(r),l=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let o=i.move(l);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(l),a(),o}function JP(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function XP(){return"~"}function ZP(e){return e.length}function eR(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZP,l=[],a=[],o=[],u=[];let c=0,h=-1;for(;++h<e.length;){const g=[],w=[];let x=-1;for(e[h].length>c&&(c=e[h].length);++x<e[h].length;){const y=tR(e[h][x]);if(n.alignDelimiters!==!1){const v=i(y);w[x]=v,(u[x]===void 0||v>u[x])&&(u[x]=v)}g.push(y)}a[h]=g,o[h]=w}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)l[d]=Dm(r[d]);else{const g=Dm(r);for(;++d<c;)l[d]=g}d=-1;const f=[],m=[];for(;++d<c;){const g=l[d];let w="",x="";g===99?(w=":",x=":"):g===108?w=":":g===114&&(x=":");let y=n.alignDelimiters===!1?1:Math.max(1,u[d]-w.length-x.length);const v=w+"-".repeat(y)+x;n.alignDelimiters!==!1&&(y=w.length+y+x.length,y>u[d]&&(u[d]=y),m[d]=y),f[d]=v}a.splice(1,0,f),o.splice(1,0,m),h=-1;const p=[];for(;++h<a.length;){const g=a[h],w=o[h],x=n.fillRows===!1?Math.max(1,a[h===1?0:h].length):c;d=-1;const y=[];for(;++d<x;){const v=g[d]||"";let b="",E="";if(n.alignDelimiters!==!1){const k=u[d]-(w[d]||0),L=l[d];if(L===114)b=" ".repeat(k);else if(L===99){const T=k/2;k%2?(b=" ".repeat(T+.5),E=" ".repeat(T-.5)):(b=" ".repeat(T),E=b)}else E=" ".repeat(k)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(b),y.push(v),n.alignDelimiters!==!1&&y.push(E),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==x-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
390
- `)}function tR(e){return e==null?"":String(e)}function Dm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const nR=zo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rR(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),sR);return i(),a}function sR(e,t,n){return">"+(n?"":" ")+e}function iR(e,t){return Mm(e,t.inConstruct,!0)&&!Mm(e,t.notInConstruct,!1)}function Mm(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const l=n.unsafe[i];if(l.character===`
391
- `&&!l.before&&!l.after&&iR(n.stack,l))return/[\t ]/.test(r.before)?"":" "}return`\\
392
- `}function lR(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function aR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function oR(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uR(e,t,n,r){const i=oR(n),l=e.value||"";if(aR(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(l,cR);return d(),f}const a=n.createTracker(r),o=i.repeat(Math.max(lR(l,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let h=a.move(o);if(e.lang){const d=n.enter(`codeFencedLang${c}`);h+=a.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${c}`);h+=a.move(" "),h+=a.move(n.safe(e.meta,{before:h,after:`
388
+ `).trim();return s.jsxs("div",{className:"tc-card",children:[s.jsxs("div",{className:"tc-card-head",children:[s.jsx("span",{className:"tc-chip",children:a.id}),s.jsx("b",{children:a.title}),a.tags.map(d=>s.jsx("span",{className:"tag",children:d},d)),a.technique&&s.jsxs("span",{className:"muted small",children:["Technique: ",a.technique]})]}),c&&s.jsx(lP,{text:c})]},`${a.id}-${o}`)})]})}function oP(){const{file:e=""}=li(),t=ut(),{refresh:n,mapping:r}=Xt(),i=In(),l=Ar(),[a,o]=j.useState(""),[u,c]=j.useState(""),[h,d]=j.useState(),[f,m]=j.useState(!1),[p,g]=j.useState(null),[w,x]=j.useState(null),[y,v]=j.useState(!1),[b,E]=j.useState(1),[k,R]=j.useState("split"),T=j.useRef(!1),D=Me(()=>q.jobs(),[e]),C=f&&a!==u,L=j.useMemo(()=>fb(a),[a]),A=r.filter(F=>F.specFile===e&&F.status!=="orphan"),z=new Set(A.filter(F=>F.testFile).map(F=>F.tcId)),U=A.filter(F=>F.lastResult),I=U.filter(F=>F.lastResult.status==="passed").length,Q=(D.data??[]).filter(F=>F.target===e).slice(0,5),J=j.useCallback(async()=>{try{const F=await q.spec(e);o(F.content),c(F.content),d(F.mtimeMs),m(!0),g(null)}catch(F){g(F.message)}},[e]);j.useEffect(()=>{m(!1),T.current=!1,J()},[J]);const H=mh(({currentLocation:F,nextLocation:Z})=>C&&!T.current&&F.pathname!==Z.pathname);Th(H,{title:"Leave with unsaved changes?",message:"Your edits to this spec are not saved and will be lost.",confirmLabel:"Discard changes",danger:!0}),j.useEffect(()=>{const F=Z=>{C&&Z.preventDefault()};return window.addEventListener("beforeunload",F),()=>window.removeEventListener("beforeunload",F)},[C]);const X=j.useCallback(async(F=!1)=>{v(!0),x(null);try{const Z=await q.saveSpec(e,a,F?void 0:h);return c(a),d(Z.mtimeMs),g(null),x("Saved."),n(),!0}catch(Z){return Z instanceof to&&Z.status===409&&await i({title:"Spec changed on disk",message:`${Z.message} Overwrite it with your current edits?`,confirmLabel:"Overwrite",danger:!0})?(v(!1),X(!0)):(g(Z.message),!1)}finally{v(!1)}},[a,e,h,n,i]);j.useEffect(()=>{const F=Z=>{(Z.ctrlKey||Z.metaKey)&&Z.key.toLowerCase()==="s"&&(Z.preventDefault(),C&&X())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[C,X]);const S=async F=>{if(!(C&&!await X()))try{const Z=await q.createJob(F);T.current=!0,t(`/runs/${Z.id}`)}catch(Z){g(Z.message)}},ae=async()=>{if(await i({title:`Delete ${e}?`,message:"The spec file is removed. Its test file in tests/e2e (if any) is NOT deleted. This cannot be undone.",confirmLabel:"Delete spec",danger:!0}))try{await q.deleteSpec(e),T.current=!0,n(),l.success(`Deleted ${e}`),t("/specs")}catch(Z){g(Z.message)}},O=L.tcs.length===0,N=Bh(L.tcs,[e]);return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Specification"},{label:"Specs",to:"/specs"},{label:e}]}),s.jsxs(Zb,{children:[s.jsxs("span",{className:"chip",children:["Coverage ",z.size,"/",L.tcs.length]}),s.jsxs("span",{className:`chip ${I<U.length?"fail":"ok"}`,children:["Pass rate ",I,"/",U.length]})]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{className:"row",style:{alignItems:"flex-start",flexWrap:"nowrap"},children:[s.jsx("button",{className:"btn ghost icon square",onClick:()=>t("/specs"),"aria-label":"Back to specs list",title:"Back to Specs",children:s.jsx(lb,{size:16})}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[L.title||e," ",C&&s.jsx("span",{className:"badge stale",children:"unsaved"})]}),s.jsxs("p",{className:"page-sub row",style:{gap:6},children:[s.jsx("span",{className:"mono",children:e}),L.tags.map(F=>s.jsxs("span",{children:["· ",s.jsx("span",{className:"tag",children:F})]},F))]})]})]}),s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void X(),disabled:!C||y,title:"Ctrl+S",children:[s.jsx(us,{size:15})," Save"]}),s.jsx("button",{className:"btn ghost icon square",onClick:()=>void(async()=>{C&&!await i({title:"Discard unsaved changes?",message:"Reloading replaces your edits with the file on disk.",confirmLabel:"Discard & reload",danger:!0})||await J()})(),disabled:y,title:"Reload from disk","aria-label":"Reload from disk",children:s.jsx(Rr,{size:15})}),s.jsx("button",{className:"btn danger icon square",onClick:()=>void ae(),disabled:y,title:"Delete spec","aria-label":"Delete spec",children:s.jsx(Lr,{size:15})})]})]}),s.jsxs("div",{className:"pipeline-bar",children:[s.jsxs("div",{className:"pipeline-steps",title:"Runs with Claude Code, no API key needed",children:[s.jsx("b",{children:"Pipeline"}),s.jsx("span",{className:"step",children:Se.explorer.label}),"→",s.jsx("span",{className:"step",children:Se.generator.label}),"→",s.jsx("span",{className:"step",children:Se.validator.label}),"→",s.jsxs("span",{className:"step",children:[Se.healer.label," ≤ 2"]})]}),s.jsx("div",{className:"grow"}),s.jsxs("button",{className:"btn ghost",onClick:()=>void S({type:"explore",spec:e}),disabled:y||O,children:[s.jsx(Ty,{size:15})," Explore"]}),s.jsxs("button",{className:"btn",onClick:()=>void S({type:"generate",spec:e}),disabled:y||O,children:[s.jsx(jh,{size:15})," Generate"]}),s.jsx("select",{className:"select",value:b,onChange:F=>E(Number(F.target.value)),"aria-label":"Repeat count",children:[1,2,3,5,10].map(F=>s.jsxs("option",{value:F,children:[F,"×"]},F))}),s.jsxs("button",{className:"btn dark",onClick:()=>void S({type:"testrun",spec:e,repeatEach:b}),disabled:y||z.size===0,title:z.size?"":"Spec has no test file yet",children:[s.jsx(ft,{size:13})," Run"]})]}),s.jsx(Pe,{error:p}),w&&s.jsx("div",{className:"info-box",children:w}),f&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Spec content"}),s.jsx(bn,{value:k,onChange:R,items:[{id:"editor",label:"Editor"},{id:"split",label:"Split"},{id:"preview",label:"Preview"}]})]}),s.jsxs("div",{className:`spec-body ${k}`,children:[k!=="preview"&&s.jsx(eP,{value:a,onChange:o}),k!=="editor"&&s.jsx(aP,{content:a,parsed:L})]})]}),L.warnings.map(F=>s.jsxs("div",{className:"warn-box",children:["⚠ ",F]},F)),s.jsxs("div",{className:"card",style:{marginTop:18},children:[s.jsx("div",{className:"card-head",children:s.jsxs("h3",{children:["Test cases ",s.jsxs("span",{className:"muted",children:["(",L.tcs.length,")"]})]})}),s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"TC-ID"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Mapping"}),s.jsx("th",{children:"Last result"}),s.jsx("th",{className:"num",children:"Actions"})]})}),s.jsx("tbody",{children:N.pageItems.map(F=>{const Z=A.find(B=>B.tcId===F.id),oe=Z==null?void 0:Z.lastResult;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{className:"strong",children:F.id})}),s.jsx("td",{children:F.title}),s.jsx("td",{children:Z!=null&&Z.testFile?s.jsxs("span",{className:"map-link",title:`${Z.testFile}:${Z.testLine??""}`,children:[s.jsx(yh,{size:13}),s.jsx("code",{children:Z.testFile.split("/").pop()}),Z.status==="stale"&&s.jsx(dt,{status:"stale"})]}):s.jsx(dt,{status:(Z==null?void 0:Z.status)??"missing"})}),s.jsx("td",{children:oe?s.jsx(ye,{to:`/runs/${oe.jobId}`,children:s.jsx(ni,{status:oe.status,children:oe.status.charAt(0).toUpperCase()+oe.status.slice(1)})}):s.jsx(ni,{status:null})}),s.jsx("td",{className:"num",children:s.jsxs("div",{className:"tc-actions",children:[s.jsx("button",{className:"btn ghost icon tc-action gen",disabled:y,title:z.has(F.id)?`Regenerate the test of ${F.id} only (Explorer → Generator → Validator)`:`Generate a test for ${F.id} only (Explorer → Generator → Validator)`,"aria-label":`Generate ${F.id}`,onClick:()=>void S({type:"generate",spec:e,tcId:F.id}),children:s.jsx(nb,{size:16})}),s.jsx("button",{className:"btn ghost icon tc-action run",disabled:!z.has(F.id)||y,title:z.has(F.id)?`Run ${F.id}`:"TC has no test yet, run Generate","aria-label":`Run ${F.id}`,onClick:()=>void S({type:"testrun",spec:e,tcId:F.id,repeatEach:b}),children:s.jsx(tb,{size:14})})]})})]},`${F.id}-${F.line}`)})})]}),O&&s.jsx("p",{className:"muted pad",children:"No test cases yet. Add a heading like “## TC-XXX-001: Name”."}),!O&&s.jsx(ps,{...N.props,label:"test cases"})]}),Q.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"Recent jobs for this spec"}),s.jsx("div",{className:"row",children:Q.map(F=>s.jsxs(ye,{to:`/runs/${F.id}`,className:"card pad row",style:{padding:"8px 12px"},children:["#",F.id," ",F.type," ",s.jsx(kn,{status:F.status})]},F.id))})]})]})]})}const uP={settings:"path set below",env:"QA_STUDIO_CLAUDE_BIN",path:"found on PATH"};function Mu({label:e,check:t,pending:n}){const r=t?t.ok?"ok":"fail":"pending";return s.jsxs("div",{className:`cc-row ${r}`,children:[s.jsx("span",{className:"cc-mark","aria-hidden":"true",children:r==="ok"?s.jsx(vh,{size:13}):r==="fail"?s.jsx(wr,{size:13}):"?"}),s.jsx("span",{className:"cc-label",children:e}),s.jsx("span",{className:"cc-detail",children:t?t.detail:n})]})}function cP({status:e}){const t=e.binary.ok?e.version.ok?e.test&&!e.test.ok?e.test.hint:null:"version":"path";return!t&&e.state!=="unverified"?null:s.jsxs("div",{className:"cc-guide",children:[t==="path"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Install Claude Code, or tell Agent Studio where it is"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Install it: in PowerShell ",s.jsx("code",{children:"irm https://claude.ai/install.ps1 | iex"}),", or with Node.js ",s.jsx("code",{children:"npm install -g @anthropic-ai/claude-code"}),"."]}),s.jsxs("li",{children:["Open a new terminal and check: ",s.jsx("code",{children:"claude --version"}),"."]}),s.jsxs("li",{children:["If Agent Studio still cannot find it, paste the full path of ",s.jsx("code",{children:"claude.exe"})," below (find it with ",s.jsx("code",{children:"where.exe claude"}),"; for an npm install use the"," ",s.jsx("code",{children:"claude.exe"})," inside ",s.jsx("code",{children:"node_modules\\@anthropic-ai\\claude-code\\bin"}),", not ",s.jsx("code",{children:"claude.cmd"}),")."]})]})]}),t==="version"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"The binary was found but does not start"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsxs("code",{children:[e.binary.detail," --version"]})," in a terminal to see the error."]}),s.jsx("li",{children:"Reinstall or update Claude Code, or point the path below to a working claude.exe."})]})]}),t==="login"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Log Claude Code in"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["In a terminal run ",s.jsx("code",{children:"claude"}),", type ",s.jsx("code",{children:"/login"})," and sign in with your Claude account (or a Console API key)."]}),s.jsxs("li",{children:["Using an API key instead: set ",s.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the environment that starts Agent Studio (not only in ",s.jsx("code",{children:".env"}),"), then restart Agent Studio."]}),s.jsx("li",{children:"Come back and run the test prompt again."})]})]}),t==="network"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code did not answer"}),s.jsxs("ol",{children:[s.jsx("li",{children:"Check the internet connection, proxy or VPN of this machine."}),s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal to see the error, then test again."]})]})]}),t==="other"&&s.jsxs(s.Fragment,{children:[s.jsx("b",{children:"Claude Code returned an error"}),s.jsxs("ol",{children:[s.jsxs("li",{children:["Run ",s.jsx("code",{children:'claude -p "hi"'})," in a terminal from the repo folder to see the full message."]}),s.jsxs("li",{children:["Check usage limits with ",s.jsx("code",{children:"/usage"})," in Claude Code, then test again."]})]})]}),!t&&e.state==="unverified"&&s.jsxs("span",{children:["Claude Code is installed. Run the ",s.jsx("b",{children:"test prompt"})," once to confirm it is logged in and can answer (one short request on the smallest model; on a subscription it only counts toward usage limits)."]})]})}function dP({onChange:e}){const[t,n]=j.useState(null),[r,i]=j.useState(!1),[l,a]=j.useState(!1),[o,u]=j.useState(""),[c,h]=j.useState(null),d=async()=>{i(!0);try{const g=await q.claudeStatus();n(g),u(w=>w||g.configuredPath),h(null),e==null||e()}catch(g){h(g.message)}finally{i(!1)}};j.useEffect(()=>{d()},[]);const f=async()=>{a(!0);try{await q.claudeTest(),await d()}catch(g){h(g.message)}finally{a(!1)}},m=async g=>{try{await q.saveSettings({claudeBin:g}),u(g),h(null),await d()}catch(w){h(w.message)}},p=(t==null?void 0:t.state)==="ready"?"Ready":(t==null?void 0:t.state)==="unverified"?"Installed, not verified":t?"Not ready":"Checking…";return s.jsxs("div",{className:"pad cc",children:[s.jsxs("div",{className:"row between",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Claude Code"})," ",s.jsxs("span",{className:`cc-state ${(t==null?void 0:t.state)??"pending"}`,children:[s.jsx("i",{})," ",p]}),s.jsx("div",{className:"muted small",children:"The QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer and Context Writer run through headless Claude Code (claude.exe)."})]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost sm",onClick:()=>void d(),disabled:r||l,children:[s.jsx(Rr,{size:13})," ",r?"Checking…":"Check again"]}),s.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:l||!(t!=null&&t.binary.ok)||!(t!=null&&t.version.ok),title:"Sends one short prompt through Claude Code",children:l?"Testing… (up to 2 min)":"Run test prompt"})]})]}),s.jsx(Pe,{error:c}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cc-checks",children:[s.jsx(Mu,{label:"Binary",check:t.binary}),s.jsx(Mu,{label:"Starts",check:t.version}),s.jsx(Mu,{label:"Logged in & answers",check:t.test?{ok:t.test.ok,detail:`${t.test.message} · ${Pt(t.test.at)}${t.test.model?` · ${t.test.model}`:""}${t.test.costUsd!==null?` · ${Gt(t.test.costUsd)}`:""}`}:null,pending:"Not tested yet for this binary"})]}),t.source&&s.jsxs("div",{className:"muted small",children:["Using ",uP[t.source],"."]}),s.jsx(cP,{status:t})]}),s.jsxs("div",{className:"cc-path",children:[s.jsxs("label",{htmlFor:"claude-bin",className:"small",style:{fontWeight:600},children:["Path to claude.exe ",s.jsx("span",{className:"muted",style:{fontWeight:400},children:"(leave empty to use QA_STUDIO_CLAUDE_BIN or PATH)"})]}),s.jsxs("div",{className:"row",children:[s.jsx("input",{id:"claude-bin",className:"input grow mono",placeholder:"C:\\Users\\<you>\\.local\\bin\\claude.exe",value:o,onChange:g=>u(g.target.value)}),s.jsxs("button",{className:"btn ghost sm",onClick:()=>void m(o),disabled:o===((t==null?void 0:t.configuredPath)??""),children:[s.jsx(us,{size:13})," Save path"]}),(t==null?void 0:t.configuredPath)&&s.jsx("button",{className:"btn ghost sm",onClick:()=>void m(""),children:"Use automatic"})]})]})]})}function hP(){const{data:e,error:t,reload:n}=Me(()=>q.settings()),[r,i]=j.useState(null),[l,a]=j.useState(null),[o,u]=j.useState(!1);j.useEffect(()=>{e&&i(e.settings.maxHealRounds)},[e]);const c=e==null?void 0:e.settings.maxHealRounds,h=r!==null&&r!==c,d=async()=>{if(r!==null)try{await q.saveSettings({maxHealRounds:r}),a(null),u(!0),setTimeout(()=>u(!1),2e3),n()}catch(f){a(f.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Maximum heal rounds"}),s.jsxs("div",{className:"muted small",children:["QA Validator fails → QA Script Healer fixes → back to QA Validator. The loop stops when tests pass, the QA Script Healer reports an app bug or gives up, or after this many heal rounds (prevents an infinite loop). 0 turns the QA Script Healer off. Default ",(e==null?void 0:e.defaults.maxHealRounds)??2,". Applies to jobs queued after saving."]}),s.jsx(Pe,{error:t??l})]}),s.jsxs("span",{className:"row",children:[s.jsx("input",{className:"input",type:"number",min:0,max:Mp,step:1,style:{width:80},value:r??"",onChange:f=>i(f.target.value===""?null:Math.max(0,Math.min(Mp,Math.round(Number(f.target.value))))),"aria-label":"Maximum heal rounds"}),s.jsxs("button",{className:"btn",disabled:!h,onClick:()=>void d(),children:[s.jsx(us,{size:14})," ",o?"Saved":"Save"]})]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Playwright HTML report"}),s.jsx("div",{className:"muted small",children:"Default for new test runs. The line reporter is always on; when this is on, runs also write the HTML report (traces, screenshots), which opens from the run page. Each run can override it."})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.settings.htmlReport)??!1,disabled:!e,onChange:f=>void q.saveSettings({htmlReport:f.target.checked}).then(n,m=>a(m.message))}),s.jsx("span",{children:e!=null&&e.settings.htmlReport?"On":"Off"})]})]})]})}function fP(){const{theme:e,toggleTheme:t,refreshClaude:n}=hs();return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"General"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-sub",children:"Pipeline settings are saved in Agent Studio; appearance is stored in this browser."})]})}),s.jsxs("div",{className:"card",style:{marginBottom:12},id:"claude",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"LLM runtime"})}),s.jsx(dP,{onChange:n})]}),s.jsxs("div",{className:"settings-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Pipeline"})}),s.jsx(hP,{})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Appearance"})}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Theme"}),s.jsx("div",{className:"muted small",children:"Light or dark theme."})]}),s.jsxs("button",{className:"btn ghost",onClick:t,children:[e==="dark"?s.jsx(Ly,{size:15}):s.jsx(Ry,{size:15})," ",e==="dark"?"Dark":"Light"]})]}),s.jsxs("div",{className:"setting-row",children:[s.jsxs("div",{children:[s.jsx("b",{children:"Keyboard shortcuts"}),s.jsx("div",{className:"muted small",children:"Search / command palette, save spec."})]}),s.jsxs("span",{className:"row small",children:[s.jsx("span",{className:"kbd-light",children:"Ctrl K"}),s.jsx("span",{className:"kbd-light",children:"Ctrl S"})]})]})]})]})]})}function zv({title:e,onStart:t,onClose:n,specRequired:r,newSpec:i,promptOnly:l,specAgent:a}){var E,k,R;const o=ut(),u=Me(()=>q.specs()),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(null),[g,w]=j.useState(!1);j.useEffect(()=>{const T=D=>D.key==="Escape"&&n();return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const x=async()=>{w(!0);try{let T=c.trim();i&&T&&!T.endsWith(".md")&&(T=`${T}.md`);const D=await t(T,d);o(`/runs/${D.id}`)}catch(T){p(T.message),w(!1)}},y=r?"Spec":"Spec (optional)",v=l?c?"Prompt (optional)":"Prompt":"Input (optional)",b=r?!!c.trim():l?!!c.trim()||!!d.trim():!0;return s.jsx("div",{className:"overlay",onClick:n,children:s.jsx("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":e,onClick:T=>T.stopPropagation(),children:s.jsxs("div",{className:"modal-body",style:{display:"grid",gap:12},children:[s.jsx("h3",{style:{margin:0},children:e}),s.jsx(Pe,{error:m??u.error}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:y}),i?s.jsxs(s.Fragment,{children:[s.jsx("input",{className:"input",list:"run-dialog-specs",value:c,onChange:T=>h(T.target.value),placeholder:"new-spec.md"}),s.jsx("datalist",{id:"run-dialog-specs",children:(E=u.data)==null?void 0:E.map(T=>s.jsx("option",{value:T.file},T.file))})]}):s.jsxs("select",{className:"input",value:c,onChange:T=>h(T.target.value),children:[s.jsx("option",{value:"",children:r?"Select a spec…":l?"No spec (prompt only)":"No spec"}),(k=u.data)==null?void 0:k.map(T=>s.jsx("option",{value:T.file,children:T.file},T.file))]}),l&&a&&!c&&s.jsxs("span",{className:"muted small",children:["Without a spec, the pipeline stops at the ",((R=Se[a])==null?void 0:R.label)??a,"."]})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:v}),s.jsx("textarea",{className:"input",rows:6,value:d,onChange:T=>f(T.target.value),placeholder:i?"The requirement to turn into the spec":"What should the agents do this time?"})]}),s.jsxs("span",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{className:"btn ghost",onClick:n,children:"Cancel"}),s.jsxs("button",{className:"btn",onClick:()=>void x(),disabled:g||!b,children:[s.jsx(ft,{size:14})," Start job"]})]})]})})})}const zu=e=>{var t;return((t=e.steps[0])==null?void 0:t.kind)==="agent"&&e.steps[0].agent==="specwriter"},_v=Object.keys(Se).filter(e=>e!=="custom"),Pm=_v.filter(e=>Se[e].llm),Rm=_v.filter(e=>!Se[e].llm),Lm=Object.keys(Ao),pP=[{tone:"opus",label:"Opus"},{tone:"sonnet",label:"Sonnet"},{tone:"haiku",label:"Haiku"},{tone:"none",label:"No LLM"}];function $v(e){const t=e.replace(/^QA\s+/,"").split(/\s+/).filter(Boolean);return t.length>1?t.map(n=>n[0].toUpperCase()).join("").slice(0,2):(t[0]??e).slice(0,2)}function mP(){var y,v,b,E,k,R,T;const e=Ar(),t=In(),n=ut(),[r,i]=gh(),l=r.get("tab")==="custom"?"custom":"default",a=D=>i(D==="custom"?{tab:"custom"}:{},{replace:!0}),o=Me(()=>q.settings()),u=Me(()=>q.agentPrompts()),c=Me(()=>q.pipelines()),h=Me(()=>q.customAgents()),[d,f]=j.useState(null),m=((y=o.data)==null?void 0:y.settings.maxHealRounds)??null,p=D=>{var C;return(C=u.data)==null?void 0:C.find(L=>L.agent===D)},g=D=>{var L,A,z;const C=Sl(D);return C?((A=(L=h.data)==null?void 0:L.find(U=>U.id===C))==null?void 0:A.model)??"none":Se[D].llm?((z=p(D))==null?void 0:z.model)??"none":"none"},w=async D=>{if(await t({title:`Delete the pipeline "${D.name}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0}))try{await q.deletePipeline(D.id),e.success(`Pipeline "${D.name}" deleted`),c.reload()}catch(L){e.error(L.message)}},x=(v=c.data)==null?void 0:v.length;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents"}]}),s.jsxs("div",{className:"page-head ap-page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Agents & pipelines"}),s.jsx("p",{className:"page-sub",children:"Agents are the building blocks. Pipelines chain them into jobs. All agents run through Claude Code; Playwright steps run without an LLM."})]}),s.jsxs("span",{className:"row",children:[s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost",children:[s.jsx(Qt,{size:15})," New agent"]}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn",children:[s.jsx(Qt,{size:15})," New pipeline"]})]})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsxs("div",{className:"ap-head-title",children:[s.jsx("h3",{children:"Agents"}),s.jsxs("span",{className:"muted small",children:[Pm.length," Built-in agents · ",((b=h.data)==null?void 0:b.length)??0," custom · ",Rm.length," Playwright steps · click an agent to open its details"]})]}),s.jsx("span",{className:"ap-legend","aria-label":"Model colours",children:pP.map(D=>s.jsxs("span",{children:[s.jsx("i",{className:`tone-dot tone-${D.tone}`})," ",D.label]},D.tone))})]}),s.jsx(Pe,{error:u.error}),s.jsx("div",{className:"ap-group-label",children:"Built-in agents"}),s.jsx("div",{className:"ap-grid",children:Pm.map(D=>s.jsx(Am,{agent:D,tone:g(D),info:p(D)},D))}),s.jsx("div",{className:"ap-group-label",children:"Custom agents"}),s.jsx(Pe,{error:h.error}),((E=h.data)==null?void 0:E.length)===0&&s.jsxs("p",{className:"ap-note",children:["No custom agents yet. Click ",s.jsx("b",{children:"New agent"})," to create one."]}),!!((k=h.data)!=null&&k.length)&&s.jsx("div",{className:"ap-grid",children:h.data.map(D=>s.jsxs(ye,{to:`/agents/custom/${D.id}`,className:"ap-agent","aria-label":`${D.name}: ${D.description||"Custom agent"}`,children:[s.jsx("span",{className:`ap-avatar tone-${D.model}`,children:$v(D.name)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[D.name,D.skills.length>0&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${D.skills.join(", ")}`,children:[D.skills.length," skill",D.skills.length===1?"":"s"]})]}),s.jsx("span",{title:D.description,children:D.description||"Custom agent"})]}),s.jsx("span",{className:`ap-pill tone-${D.model}`,children:D.model[0].toUpperCase()+D.model.slice(1)}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ti,{size:14})})]},D.id))}),s.jsx("div",{className:"ap-group-label",children:"Playwright steps · No LLM"}),s.jsx("div",{className:"ap-grid",children:Rm.map(D=>s.jsx(Am,{agent:D,tone:"none"},D))})]}),s.jsxs("div",{className:"card ap-card",children:[s.jsxs("div",{className:"ap-head",children:[s.jsx("div",{className:"ap-head-title",children:s.jsx("h3",{children:"Pipelines"})}),s.jsx(bn,{value:l,onChange:a,items:[{id:"default",label:s.jsxs(s.Fragment,{children:["Default ",s.jsx("span",{className:"tab-count",children:Lm.length})]})},{id:"custom",label:s.jsxs(s.Fragment,{children:["Custom ",s.jsx("span",{className:"tab-count",children:x??"…"})]})}]})]}),l==="default"?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Built-in job types. Duplicate one to start a custom pipeline. Loops repeat until the QA Validator passes or the round limit is reached."}),s.jsx("div",{className:"ap-rows",children:Lm.map(D=>s.jsxs("div",{className:"ap-row",children:[s.jsx("span",{className:"ap-row-name",children:kr[D]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(gP,{type:D,maxRounds:m,toneOf:g})}),s.jsxs("span",{className:"ap-row-meta",children:[s.jsx(ub,{size:13})," Built-in"]}),s.jsx("span",{className:"ap-row-actions",children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(`/agents/pipelines/new?from=${D}`),"aria-label":`Duplicate ${kr[D]}`,children:"Duplicate"})})]},D))})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"ap-note",children:"Your own pipelines. Each loop repeats its agents until the first one passes, or up to its maximum iterations."}),s.jsx(Pe,{error:c.error}),((R=c.data)==null?void 0:R.length)===0&&s.jsxs("div",{className:"ap-empty",children:[s.jsx("p",{className:"muted",children:"No custom pipelines yet."}),s.jsxs(ye,{to:"/agents/pipelines/new",className:"btn sm",children:[s.jsx(Qt,{size:14})," New pipeline"]})]}),s.jsx("div",{className:"ap-rows",children:(T=c.data)==null?void 0:T.map(D=>s.jsxs("div",{className:"ap-row",children:[s.jsxs("span",{className:"ap-row-name",children:[s.jsx(ye,{to:`/agents/pipelines/${D.id}`,children:D.name}),D.description&&s.jsx("span",{className:"muted small ap-row-desc",children:D.description})]}),s.jsx("span",{className:"ap-row-steps",children:s.jsx(xP,{steps:D.steps,toneOf:g,custom:h.data??[]})}),s.jsx("span",{className:"ap-row-meta",title:`Updated ${Pt(D.updatedAt)}`,children:Pt(D.updatedAt)}),s.jsxs("span",{className:"ap-row-actions",children:[s.jsx("button",{className:"btn sm",onClick:()=>f(D),"aria-label":`Run pipeline ${D.name}`,children:"Run"}),s.jsx(ye,{to:`/agents/pipelines/${D.id}`,className:"btn ghost sm","aria-label":`Edit pipeline ${D.name}`,children:"Edit"}),s.jsx("button",{className:"btn danger sm icon",onClick:()=>void w(D),"aria-label":`Delete pipeline ${D.name}`,title:"Delete",children:s.jsx(Lr,{size:14})})]})]},D.id))})]})]}),d&&s.jsx(zv,{title:`Run ${d.name}`,specRequired:zu(d),promptOnly:!zu(d),specAgent:Eb(d.steps),newSpec:zu(d),onClose:()=>f(null),onStart:(D,C)=>q.createJob({type:"pipeline",pipelineId:d.id,...D?{spec:D}:{},...C.trim()?{input:C}:{}})})]})}function Am({agent:e,tone:t,info:n}){const r=Se[e],i=(n==null?void 0:n.customized)||(n==null?void 0:n.modelCustomized);return s.jsxs(ye,{to:`/agents/${e}`,className:`ap-agent ${r.llm?"":"step"}`,"aria-label":`${r.label}: ${r.description}`,children:[s.jsx("span",{className:`ap-avatar tone-${t}`,children:$v(r.label)}),s.jsxs("span",{className:"ap-agent-text",children:[s.jsxs("b",{children:[r.label,i&&s.jsx("span",{className:"ap-custom",title:n!=null&&n.customized?"Custom prompt":"Custom model",children:"custom"}),!!(n!=null&&n.skills.length)&&s.jsxs("span",{className:"ap-custom",title:`Skills: ${n.skills.join(", ")}`,children:[n.skills.length," skill",n.skills.length===1?"":"s"]})]}),s.jsx("span",{title:r.description,children:r.description})]}),s.jsx("span",{className:`ap-pill tone-${t}`,children:r.llm?n?n.model[0].toUpperCase()+n.model.slice(1):"…":"No LLM"}),s.jsx("span",{className:"ap-chevron","aria-hidden":"true",children:s.jsx(ti,{size:14})})]})}const ld=(e,t)=>{var n;return((n=t.find(r=>Eh(r.id)===e))==null?void 0:n.review)==="human"};function Ov({agent:e,toneOf:t,custom:n}){const r=ld(e,n);return s.jsxs("span",{className:`ap-chip tone-${t(e)}`,title:r?"Human review":void 0,children:[Rl(e,n),r&&" 👤"]})}const ad=()=>s.jsx("span",{className:"ap-arrow",children:"→"});function gP({type:e,maxRounds:t,toneOf:n}){const r=Ao[e],i=e==="generate"||e==="heal",l=i?r.filter(o=>!Nh.includes(o)):r,a=e==="heal"?["healer","validator"]:["validator","healer"];return s.jsxs(s.Fragment,{children:[l.map((o,u)=>s.jsxs(j.Fragment,{children:[u>0&&s.jsx(ad,{}),s.jsx(Ov,{agent:o,toneOf:n,custom:[]})]},o)),i&&s.jsxs(s.Fragment,{children:[l.length>0&&s.jsx(ad,{}),s.jsx(Wh,{agents:a,toneOf:n,custom:[],suffix:t===null?null:`max ${t} round${t===1?"":"s"}`,swap:!0})]})]})}function xP({steps:e,toneOf:t,custom:n}){return s.jsx(s.Fragment,{children:e.map((r,i)=>s.jsxs(j.Fragment,{children:[i>0&&s.jsx(ad,{}),r.kind==="agent"?s.jsx(Ov,{agent:r.agent,toneOf:t,custom:n}):s.jsx(Wh,{agents:r.steps,toneOf:t,custom:n,suffix:`max ${r.maxIterations}×${r.endsWhen==="last"?" · until last passes":""}`,endsWhen:r.endsWhen})]},i))})}function Wh({agents:e,toneOf:t,custom:n,suffix:r,swap:i,endsWhen:l}){return s.jsxs("span",{className:"ap-loop",title:`Repeats its agents; stops when the ${l==="last"?"last":"first"} one passes or the maximum is reached`,children:[s.jsx(is,{size:12}),e.map((a,o)=>s.jsxs(j.Fragment,{children:[o>0&&(i?s.jsx("span",{className:"ap-loop-sep",children:"⇄"}):s.jsx("span",{className:"ap-loop-sep",children:"→"})),typeof a=="string"?s.jsxs("span",{className:`ap-loop-name tone-${t(a)}`,title:ld(a,n)?"Human review":void 0,children:[Rl(a,n),ld(a,n)&&" 👤"]}):s.jsx(Wh,{agents:a.steps,toneOf:t,custom:n,suffix:`max ${a.maxIterations}×${a.endsWhen==="last"?" · until last passes":""}`,endsWhen:a.endsWhen})]},o)),r&&s.jsx("span",{className:"ap-loop-max",children:r})]})}function Im(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function yP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function vP(e,t,n){const i=$o((n||{}).ignore||[]),l=jP(t);let a=-1;for(;++a<l.length;)td(e,o);function o(c,h,d){if(c.type==="text"&&typeof d=="number")return u(c,h,d);if(i(c,d,h[h.length-1]))return ed}function u(c,h,d){const f=h[h.length-1],m=l[a][0],p=l[a][1];let g=0,w=!1,x=[];m.lastIndex=0;let y=m.exec(c.value);for(;y;){const b=y.index,E={index:y.index,input:y.input,stack:[...h,c]};let k=p(...y,E);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1)m.lastIndex=b+1;else{if(g!==b&&v({type:"text",value:c.value.slice(g,b)}),Array.isArray(k))for(const R of k)v(R);else k&&v(k);g=b+y[0].length,w=!0}if(!m.global)break;y=m.exec(c.value)}return w?(g<c.value.length&&v({type:"text",value:c.value.slice(g)}),f.children.splice(d,1,...x)):x=[c],d+x.length;function v(b){const E=x[x.length-1];E&&E.type==="text"&&b.type==="text"?E.value+=b.value:x.push(b)}}}function jP(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=[],n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([wP(i[0]),kP(i[1])])}return t}function wP(e){return typeof e=="string"?new RegExp(yP(e),"g"):e}function kP(e){return typeof e=="function"?e:function(){return e}}const _u="phrasing",$u=["autolink","link","image","label"];function bP(){return{transforms:[RP],enter:{literalAutolink:NP,literalAutolinkEmail:Ou,literalAutolinkHttp:Ou,literalAutolinkWww:Ou},exit:{literalAutolink:PP,literalAutolinkEmail:TP,literalAutolinkHttp:CP,literalAutolinkWww:EP}}}function SP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:_u,notInConstruct:$u},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:_u,notInConstruct:$u},{character:":",before:"[ps]",after:"\\/",inConstruct:_u,notInConstruct:$u}]}}function NP(e){this.enter({type:"link",title:null,url:"",children:[],position:void 0},e)}function Ou(e){this.config.enter.autolinkProtocol.call(this,e)}function CP(e){this.config.exit.autolinkProtocol.call(this,e)}function EP(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function TP(e){this.config.exit.autolinkEmail.call(this,e)}function PP(e){this.exit(e)}function RP(e){vP(e,[[new RegExp("(?<![\\da-z])(https?:\\/\\/|www(?=\\.))([\\w-]*\\.[\\w\\-.]*)([^\\t\\n\\r ]*)","gi"),LP],[new RegExp("(?<![\\w+\\-.@])xmpp:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)(\\/(?:[\\w\\-/]|\\.(?=[\\dA-Za-z]))*)?","g"),DP],[new RegExp("(?<![\\w+\\-.@])mailto:([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),IP],[new RegExp("(?<![\\w+\\-.]|(?:^|[^\\d@A-Za-z])(?:mailto|xmpp):)([\\w+\\-.]+)@([\\w-]+(?:\\.[\\w-]+)+)","g"),AP]],{ignore:["link","linkReference"]})}function LP(e,t,n,r,i){if(!_P(i))return!1;let l="";if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),Cl(n.charCodeAt(0))||!MP(n))return!1;const a=zP(n+r),o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0],position:void 0}],position:void 0};return a[1]?[o,{type:"text",value:a[1],position:void 0}]:o}function AP(e,t,n){return/[\d\-_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n,position:void 0}],position:void 0}}function IP(e,t,n){if(/[\d\-_]$/.test(n))return!1;const r="mailto:"+t+"@"+n;return{type:"link",title:null,url:r,children:[{type:"text",value:r,position:void 0}],position:void 0}}function DP(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)==="@"))return!1;const l="xmpp:"+t+"@"+n+(r||"");return{type:"link",title:null,url:l,children:[{type:"text",value:l,position:void 0}],position:void 0}}function MP(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function zP(e){let t=e.length;for(;t>0;){const a=e.charCodeAt(t-1);if(a===33||a===34||a===38||a===39||a===41||a===44||a===46||a===58||a===59||a===60||a===62||a===63||a===93||a===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(")");const i=Im(e,"(");let l=Im(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function _P(e){const t=e.input.charCodeAt(e.index-1);return e.index===0||ls(t)||Cl(t)}Fv.peek=QP;function $P(){this.buffer()}function OP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function FP(){this.buffer()}function UP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HP(e){this.exit(e)}function WP(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=vn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VP(e){this.exit(e)}function QP(){return"["}function Fv(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function qP(){return{enter:{gfmFootnoteCallString:$P,gfmFootnoteCall:OP,gfmFootnoteDefinitionLabelString:FP,gfmFootnoteDefinition:UP},exit:{gfmFootnoteCallString:BP,gfmFootnoteCall:HP,gfmFootnoteDefinitionLabelString:WP,gfmFootnoteDefinition:VP}}}function GP(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let u=o.move("[^");const c=l.enter("footnoteDefinition"),h=l.enter("label");return u+=o.move(l.safe(l.associationId(r),{before:u,after:"]"})),h(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
389
+ `:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Uv:KP))),c(),u}}function KP(e,t,n){return t===0?e:Uv(e,t,n)}function Uv(e,t,n){return(n?"":" ")+e}const YP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Vh.attention=tR;Vh.peek=nR;function JP(){return{canContainEols:["delete"],enter:{strikethrough:ZP},exit:{strikethrough:eR}}}function XP(){return{handlers:{delete:Vh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:YP}]}}function ZP(e){this.enter({type:"delete",children:[],position:void 0},e)}function eR(e){this.exit(e)}function Vh(e,t,n,r){const i=n.createTracker(r),l=n.stack.includes("strikethrough")?"~":"~~",a=n.enter("strikethrough");let o=i.move(l);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move(l),a(),o}function tR(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function nR(){return"~"}function rR(e){return e.length}function sR(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rR,l=[],a=[],o=[],u=[];let c=0,h=-1;for(;++h<e.length;){const g=[],w=[];let x=-1;for(e[h].length>c&&(c=e[h].length);++x<e[h].length;){const y=iR(e[h][x]);if(n.alignDelimiters!==!1){const v=i(y);w[x]=v,(u[x]===void 0||v>u[x])&&(u[x]=v)}g.push(y)}a[h]=g,o[h]=w}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)l[d]=Dm(r[d]);else{const g=Dm(r);for(;++d<c;)l[d]=g}d=-1;const f=[],m=[];for(;++d<c;){const g=l[d];let w="",x="";g===99?(w=":",x=":"):g===108?w=":":g===114&&(x=":");let y=n.alignDelimiters===!1?1:Math.max(1,u[d]-w.length-x.length);const v=w+"-".repeat(y)+x;n.alignDelimiters!==!1&&(y=w.length+y+x.length,y>u[d]&&(u[d]=y),m[d]=y),f[d]=v}a.splice(1,0,f),o.splice(1,0,m),h=-1;const p=[];for(;++h<a.length;){const g=a[h],w=o[h],x=n.fillRows===!1?Math.max(1,a[h===1?0:h].length):c;d=-1;const y=[];for(;++d<x;){const v=g[d]||"";let b="",E="";if(n.alignDelimiters!==!1){const k=u[d]-(w[d]||0),R=l[d];if(R===114)b=" ".repeat(k);else if(R===99){const T=k/2;k%2?(b=" ".repeat(T+.5),E=" ".repeat(T-.5)):(b=" ".repeat(T),E=b)}else E=" ".repeat(k)}n.delimiterStart!==!1&&!d&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&y.push(" "),n.alignDelimiters!==!1&&y.push(b),y.push(v),n.alignDelimiters!==!1&&y.push(E),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||d!==x-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
390
+ `)}function iR(e){return e==null?"":String(e)}function Dm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const lR=$o(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function aR(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),oR);return i(),a}function oR(e,t,n){return">"+(n?"":" ")+e}function uR(e,t){return Mm(e,t.inConstruct,!0)&&!Mm(e,t.notInConstruct,!1)}function Mm(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){const l=n.unsafe[i];if(l.character===`
391
+ `&&!l.before&&!l.after&&uR(n.stack,l))return/[\t ]/.test(r.before)?"":" "}return`\\
392
+ `}function cR(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function dR(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^\n\r ]/.test(e.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function hR(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function fR(e,t,n,r){const i=hR(n),l=e.value||"";if(dR(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(l,pR);return d(),f}const a=n.createTracker(r),o=i.repeat(Math.max(cR(l,i)+1,3)),u=n.enter("codeFenced"),c=i==="`"?"GraveAccent":"Tilde";let h=a.move(o);if(e.lang){const d=n.enter(`codeFencedLang${c}`);h+=a.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${c}`);h+=a.move(" "),h+=a.move(n.safe(e.meta,{before:h,after:`
393
393
  `,encode:["`"],...a.current()})),d()}return h+=a.move(`
394
394
  `),l&&(h+=a.move(l+`
395
- `)),h+=a.move(o),u(),h}function cR(e,t,n){return(n?"":" ")+e}function Qh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function dR(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
396
- `,...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),a(),c}function hR(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ao(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Hs(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Uv(e){return"&#x"+e.toString(16).toUpperCase()+";"}function _m(e,t,n){const r=br(e),i=br(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function fR(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:yt(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,l=e.charCodeAt(i);if(!yt(l))return;for(;l===45||vt(l);)l=e.charCodeAt(++i);const a=e.slice(r,i).toLowerCase();return!n&&l!==47&&Xc.includes(a)?1:xv.includes(a)?6:7}const Bv=new Map([["*",!1],["_",!0]]);function pR(e,t,n){const r=new Set;for(const l of e){const a=n.get(l);if(a&&l.attention&&t.some(o=>o.attention===l.attention))for(const o of a.tokens)r.add(o.attention)}const i=[];for(const l of e)l.attention&&r.delete(l.attention)&&i.push(l.attention);return i.reverse(),i}function Hv(e,t,n){const r=[],i=new Map,l=new Map;let a=0;for(;a<e.length;){if(!e[a].attention){a++;continue}const o=e[a].value.charAt(0),u=Bv.get(o);let c=a+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const h=a?e[a-1].value:t,d=br(h.charCodeAt(h.length-1)),f=br((c<e.length?e[c].value:n).charCodeAt(0)),m=!f||f===2&&!!d,p=!d||d===2&&!!f,g={tokens:e.slice(a,c),markers:[],start:0,end:0,open:u?m&&(!!d||!p):m,close:u?p&&(!!f||!m):p,split:u!==void 0};for(const w of g.tokens){i.set(w,[...g.tokens]),l.set(w,g);let x=w.value.length;for(;x--;)g.markers.push(w)}g.end=g.markers.length,r.push(g),a=c}for(gR(r,i),a=-1;++a<e.length;){const o=i.get(e[a]);if(o)return{attention:pR(e,o,l),index:a}}}function oa(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?ao(n.value):Hs(n.value),i=Uv(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let l=n.value.slice(0,n.value.length-r.length),a=0;for(;l.charCodeAt(l.length-1-a)===92;)a++;a%2&&(l+="\\"),n.value=l+i}}function mR(e,t,n,r,i){for(const l of n.attention){const a=t.get(l)||l.sequences[0];for(const o of l.sequences){if(o===a)continue;const u=new Map(t);u.set(l,o);const c=Oo(e,u,r,i),h=Hv(c,r,i);if(!h||h.index>n.index)return{chosen:u,mistake:h,tokens:c}}}}function gR(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let l=n.get(i);l||(l=[],n.set(i,l));let a=r.close?l.length:0;for(;a--&&r.start<r.end;){const o=l[a],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const h=r.split?u>1&&c>1?2:1:c,d=o.markers.slice(o.end-h,o.end),f=r.markers.slice(r.start,r.start+h),m=d[0],p=f[0];if(m===d[h-1]&&m.value.length===h&&p===f[h-1]&&p.value.length===h&&m.attention===p.attention)t.delete(m),t.delete(p);else{const g=[...new Set([...d,...f])];for(const w of g){const x=t.get(w);x&&x.push(...g)}}o.end-=h,r.start+=h,o.start===o.end&&l.splice(a,1),a=l.length}r.open&&r.start<r.end&&l.push(r)}}function xR(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!ov(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const l of n)r.push(i.repeat(l))}return r}function yR(e,t,n){const r=t.indexStack,i=e.children||[],l=[];let a=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++a<i.length;){const c=i[a];let h;if(r[r.length-1]=a,a+1<i.length){let m=t.handle.handlers[i[a+1].type];m&&m.peek&&(m=m.peek),h=m?ao(m(i[a+1],e,t,{before:"",after:"",...u.current()})):""}else h=n.after;const d=l[l.length-1];typeof d=="string"&&(o==="\r"||o===`
397
- `)&&c.type==="html"&&fR(c.value)!==7&&(l[l.length-1]=d.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(Fo(l,n.before,n.after)));const f=t.handle.handlers[c.type];if(f&&f.attention){const m=qh(c,f.attention,t,u);if(!m)continue;l.push(m),o=Hs(m.sequences[0])}else{const m=t.handle(c,e,t,{...u.current(),after:h,before:o});if(!m)continue;u.move(m),l.push(m),o=Hs(m)}}return r.pop(),l}function qh(e,t,n,r){const{construct:i,markers:l,sizes:a}=t(e,n),o=xR(e.type,l,a),u=o[0],c=n.enter(i),h=n.createTracker(r.current());h.move(u);const d=yR(e,n,{...h.current(),before:u,after:u});if(c(),d.length!==0)return r.move(u),r.move(Fo(d,u,u)),r.move(u),{children:d,sequences:o}}function $m(e,t,n,r){let i=Oo(e,t,n,r),l=Hv(i,n,r);for(;l;){const a=mR(e,t,l,n,r);if(!a)return;t=a.chosen,i=a.tokens,l=a.mistake}return i}function Wv(e,t,n,r){let i=n,l=-1;for(;++l<e.length;){const a=e[l];if(typeof a=="string"){i="";continue}const o=l===e.length-1?r:"",u=a.sequences.find(function(c){const h=c.charAt(0);return h!==i.charAt(0)&&h!==o.charAt(0)||e.length===1&&Bv.has(h)&&c.length>n.length})||a.sequences[0];u!==a.sequences[0]&&t.set(a,u),Wv(a.children,t,u,u),i=u}}function Oo(e,t,n,r){const i=[];let l,a=Hs(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};l&&l===ao(u)&&oa([v],!0),l=void 0,i.push(v),v.value&&(a=Hs(v.value));continue}const c=t.get(u)||u.sequences[0],h=c.charAt(0),d=e[o+1],f=a,m=ao(d===void 0?r:typeof d=="string"?d:t.get(d)||d.sequences[0]),p=Oo(u.children,t,c,c),g=p[0].value,w=_m(f.charCodeAt(f.length-1),g.charCodeAt(0),h);w.inside&&oa(p,!0);const x=Hs(p[p.length-1].value),y=_m(m.charCodeAt(0),x.charCodeAt(x.length-1),h);y.inside&&oa(p,!1),w.outside&&f!==`
398
- `&&f!=="\r"&&oa(i,!1),y.outside&&(l=m),i.push({value:c,attention:u},...p,{value:c,attention:u}),a=c.charAt(c.length-1)}return i}function Fo(e,t,n){const r=new Map;Wv(e,r,t,n);const i=(r.size>0?$m(e,r,t,n):void 0)||$m(e,new Map,t,n)||Oo(e,new Map,t,n);let l="";for(const a of i)l+=a.value;return l}Gh.attention=Vv;Gh.peek=vR;function Gh(e,t,n,r){const i=n.enter("phrasing"),l=qh(e,Vv,n,n.createTracker(r)),a=l?Fo([l],r.before,r.after):"";return i(),a}function Vv(e,t){return{construct:"emphasis",markers:hR(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function vR(e,t,n){return n.options.emphasis||"*"}function jR(e,t){let n=!1;return $o(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,qi}),!!((!e.depth||e.depth<3)&&Io(e)&&(t.options.setext||n))}function wR(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(jR(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),m=n.containerPhrasing(e,{...l.current(),before:`
395
+ `)),h+=a.move(o),u(),h}function pR(e,t,n){return(n?"":" ")+e}function Qh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function mR(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
396
+ `,...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),a(),c}function gR(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function oo(e){const t=e.codePointAt(0);return t===void 0?"":String.fromCodePoint(t)}function Ws(e){const t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function Bv(e){return"&#x"+e.toString(16).toUpperCase()+";"}function _m(e,t,n){const r=br(e),i=br(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function xR(e){if(e.charCodeAt(0)!==60)return;const t=e.charCodeAt(1);if(t===33){const o=e.charCodeAt(2);return o===45?2:o===91?5:yt(o)?4:void 0}if(t===63)return 3;const n=t===47,r=n?2:1;let i=r,l=e.charCodeAt(i);if(!yt(l))return;for(;l===45||vt(l);)l=e.charCodeAt(++i);const a=e.slice(r,i).toLowerCase();return!n&&l!==47&&Zc.includes(a)?1:yv.includes(a)?6:7}const Hv=new Map([["*",!1],["_",!0]]);function yR(e,t,n){const r=new Set;for(const l of e){const a=n.get(l);if(a&&l.attention&&t.some(o=>o.attention===l.attention))for(const o of a.tokens)r.add(o.attention)}const i=[];for(const l of e)l.attention&&r.delete(l.attention)&&i.push(l.attention);return i.reverse(),i}function Wv(e,t,n){const r=[],i=new Map,l=new Map;let a=0;for(;a<e.length;){if(!e[a].attention){a++;continue}const o=e[a].value.charAt(0),u=Hv.get(o);let c=a+1;for(;c<e.length&&e[c].attention&&e[c].value.charAt(0)===o;)c++;const h=a?e[a-1].value:t,d=br(h.charCodeAt(h.length-1)),f=br((c<e.length?e[c].value:n).charCodeAt(0)),m=!f||f===2&&!!d,p=!d||d===2&&!!f,g={tokens:e.slice(a,c),markers:[],start:0,end:0,open:u?m&&(!!d||!p):m,close:u?p&&(!!f||!m):p,split:u!==void 0};for(const w of g.tokens){i.set(w,[...g.tokens]),l.set(w,g);let x=w.value.length;for(;x--;)g.markers.push(w)}g.end=g.markers.length,r.push(g),a=c}for(jR(r,i),a=-1;++a<e.length;){const o=i.get(e[a]);if(o)return{attention:yR(e,o,l),index:a}}}function oa(e,t){const n=e[t?0:e.length-1];if(!n||n.attention)return;const r=t?oo(n.value):Ws(n.value),i=Bv(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let l=n.value.slice(0,n.value.length-r.length),a=0;for(;l.charCodeAt(l.length-1-a)===92;)a++;a%2&&(l+="\\"),n.value=l+i}}function vR(e,t,n,r,i){for(const l of n.attention){const a=t.get(l)||l.sequences[0];for(const o of l.sequences){if(o===a)continue;const u=new Map(t);u.set(l,o);const c=Uo(e,u,r,i),h=Wv(c,r,i);if(!h||h.index>n.index)return{chosen:u,mistake:h,tokens:c}}}}function jR(e,t){const n=new Map;for(const r of e){const i=r.tokens[0].value.charAt(0);let l=n.get(i);l||(l=[],n.set(i,l));let a=r.close?l.length:0;for(;a--&&r.start<r.end;){const o=l[a],u=o.end-o.start,c=r.end-r.start;if(r.split?(o.close||r.open)&&c%3&&!((u+c)%3):u!==o.markers.length||u!==c)continue;const h=r.split?u>1&&c>1?2:1:c,d=o.markers.slice(o.end-h,o.end),f=r.markers.slice(r.start,r.start+h),m=d[0],p=f[0];if(m===d[h-1]&&m.value.length===h&&p===f[h-1]&&p.value.length===h&&m.attention===p.attention)t.delete(m),t.delete(p);else{const g=[...new Set([...d,...f])];for(const w of g){const x=t.get(w);x&&x.push(...g)}}o.end-=h,r.start+=h,o.start===o.end&&l.splice(a,1),a=l.length}r.open&&r.start<r.end&&l.push(r)}}function wR(e,t,n){if(t.length===0)throw new Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw new Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(const i of n)if(!Number.isSafeInteger(i)||i<1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as size, expected positive integer");const r=[];for(const i of t){if(i.length!==1)throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!uv(i.charCodeAt(0)))throw new Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(const l of n)r.push(i.repeat(l))}return r}function kR(e,t,n){const r=t.indexStack,i=e.children||[],l=[];let a=-1,o=n.before;r.push(-1);let u=t.createTracker(n);for(;++a<i.length;){const c=i[a];let h;if(r[r.length-1]=a,a+1<i.length){let m=t.handle.handlers[i[a+1].type];m&&m.peek&&(m=m.peek),h=m?oo(m(i[a+1],e,t,{before:"",after:"",...u.current()})):""}else h=n.after;const d=l[l.length-1];typeof d=="string"&&(o==="\r"||o===`
397
+ `)&&c.type==="html"&&xR(c.value)!==7&&(l[l.length-1]=d.replace(/(\r?\n|\r)$/," "),o=" ",u=t.createTracker(n),u.move(Bo(l,n.before,n.after)));const f=t.handle.handlers[c.type];if(f&&f.attention){const m=qh(c,f.attention,t,u);if(!m)continue;l.push(m),o=Ws(m.sequences[0])}else{const m=t.handle(c,e,t,{...u.current(),after:h,before:o});if(!m)continue;u.move(m),l.push(m),o=Ws(m)}}return r.pop(),l}function qh(e,t,n,r){const{construct:i,markers:l,sizes:a}=t(e,n),o=wR(e.type,l,a),u=o[0],c=n.enter(i),h=n.createTracker(r.current());h.move(u);const d=kR(e,n,{...h.current(),before:u,after:u});if(c(),d.length!==0)return r.move(u),r.move(Bo(d,u,u)),r.move(u),{children:d,sequences:o}}function $m(e,t,n,r){let i=Uo(e,t,n,r),l=Wv(i,n,r);for(;l;){const a=vR(e,t,l,n,r);if(!a)return;t=a.chosen,i=a.tokens,l=a.mistake}return i}function Vv(e,t,n,r){let i=n,l=-1;for(;++l<e.length;){const a=e[l];if(typeof a=="string"){i="";continue}const o=l===e.length-1?r:"",u=a.sequences.find(function(c){const h=c.charAt(0);return h!==i.charAt(0)&&h!==o.charAt(0)||e.length===1&&Hv.has(h)&&c.length>n.length})||a.sequences[0];u!==a.sequences[0]&&t.set(a,u),Vv(a.children,t,u,u),i=u}}function Uo(e,t,n,r){const i=[];let l,a=Ws(n),o=-1;for(;++o<e.length;){const u=e[o];if(typeof u=="string"){const v={value:u,attention:void 0};l&&l===oo(u)&&oa([v],!0),l=void 0,i.push(v),v.value&&(a=Ws(v.value));continue}const c=t.get(u)||u.sequences[0],h=c.charAt(0),d=e[o+1],f=a,m=oo(d===void 0?r:typeof d=="string"?d:t.get(d)||d.sequences[0]),p=Uo(u.children,t,c,c),g=p[0].value,w=_m(f.charCodeAt(f.length-1),g.charCodeAt(0),h);w.inside&&oa(p,!0);const x=Ws(p[p.length-1].value),y=_m(m.charCodeAt(0),x.charCodeAt(x.length-1),h);y.inside&&oa(p,!1),w.outside&&f!==`
398
+ `&&f!=="\r"&&oa(i,!1),y.outside&&(l=m),i.push({value:c,attention:u},...p,{value:c,attention:u}),a=c.charAt(c.length-1)}return i}function Bo(e,t,n){const r=new Map;Vv(e,r,t,n);const i=(r.size>0?$m(e,r,t,n):void 0)||$m(e,new Map,t,n)||Uo(e,new Map,t,n);let l="";for(const a of i)l+=a.value;return l}Gh.attention=Qv;Gh.peek=bR;function Gh(e,t,n,r){const i=n.enter("phrasing"),l=qh(e,Qv,n,n.createTracker(r)),a=l?Bo([l],r.before,r.after):"";return i(),a}function Qv(e,t){return{construct:"emphasis",markers:gR(t)==="*"?["*","_"]:["_","*"],sizes:[1]}}function bR(e,t,n){return n.options.emphasis||"*"}function SR(e,t){let n=!1;return Fo(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,qi}),!!((!e.depth||e.depth<3)&&Mo(e)&&(t.options.setext||n))}function NR(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(SR(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),m=n.containerPhrasing(e,{...l.current(),before:`
399
399
  `,after:`
400
400
  `});return f(),d(),m+`
401
401
  `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
402
402
  `))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");l.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
403
- `,...l.current()});const h=c.charCodeAt(0);return(h===9||h===32)&&(c=Uv(h)+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),u(),o(),c}Qv.peek=kR;function Qv(e){return e.value||""}function kR(){return"<"}qv.peek=bR;function qv(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),a(),c}function bR(){return"!"}Gv.peek=SR;function Gv(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function SR(){return"!"}Kv.peek=NR;function Kv(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);if(!a.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function NR(){return"`"}function Yv(e,t){const n=Io(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Jv.peek=CR;function Jv(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);if(Yv(e,n)){const p=n.stack;n.stack=p.filter(function(x){return x!=="phrasing"});const g=n.enter("autolink");let w=a.move("<");return w+=a.move(n.containerPhrasing(e,{before:w,after:">",...a.current()})),w+=a.move(">"),g(),n.stack=p,w}const o=n.enter("link");let u=n.enter("label"),c=a.move("[");const h=n.containerPhrasing(e,{before:c,after:"](",...a.current()});c+=a.move(h),u(),c+=a.move("](");const d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1);let m=e.title||void 0;if(!m&&!d&&(f===`
404
- `||f==="\r")){let p=0;for(;p<h.length&&h.charCodeAt(p)!==93;)p+=h.charCodeAt(p)===92?2:1;h.charCodeAt(p+1)===58&&(m="")}return!e.url&&typeof m=="string"||d?(u=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(u=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:typeof m=="string"?" ":")",...a.current()}))),u(),typeof m=="string"&&(u=n.enter(`title${l}`),c+=a.move(" "+i),c+=a.move(n.safe(m,{before:c,after:i,...a.current()})),c+=a.move(i),u()),c+=a.move(")"),o(),c}function CR(e,t,n){return Yv(e,n)?"<":"["}Xv.peek=ER;function Xv(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function ER(){return"["}function Kh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function TR(e){const t=Kh(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function PR(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zv(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function RR(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?PR(n):Kh(n);const o=e.ordered?a==="."?")":".":TR(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Zv(n)===a&&h){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),c}function AR(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function LR(e,t,n,r){const i=AR(n);let l=n.bulletCurrent||Kh(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return u(),c;function h(d,f,m){return f?(m?"":" ".repeat(a))+d:(m?l:l+" ".repeat(a-l.length))+d}}function IR(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}function DR(e,t,n,r){if(!e.children.some(function(o){return nR(o)}))return n.containerFlow(e,r);const l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),a}function MR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Yh.attention=ej;Yh.peek=zR;function Yh(e,t,n,r){const i=n.enter("phrasing"),l=qh(e,ej,n,n.createTracker(r)),a=l?Fo([l],r.before,r.after):"";return i(),a}function ej(e,t){return{construct:"strong",markers:MR(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function zR(e,t,n){return n.options.strong||"*"}function _R(e,t,n,r){const i=t?t.children:[],l=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[l+1],beforeNode:i[l-1]})}function $R(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function OR(e,t,n){const r=(Zv(n)+(n.options.ruleSpaces?" ":"")).repeat($R(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ad={blockquote:rR,break:zm,code:uR,definition:dR,emphasis:Gh,hardBreak:zm,heading:wR,html:Qv,image:qv,imageReference:Gv,inlineCode:Kv,link:Jv,linkReference:Xv,list:RR,listItem:LR,paragraph:IR,root:DR,strong:Yh,text:_R,thematicBreak:OR};function FR(){return{enter:{table:UR,tableData:Om,tableHeader:Om,tableRow:HR},exit:{codeText:WR,table:BR,tableData:$u,tableHeader:$u,tableRow:$u}}}function UR(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function BR(e){this.exit(e),this.data.inTable=void 0}function HR(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function $u(e){this.exit(e)}function Om(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function WR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,VR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function VR(e,t){return t==="|"?t:e}function QR(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,l=n?" ":"|";return{handlers:{inlineCode:f,table:a,tableCell:u,tableRow:o},join:[qR],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
403
+ `,...l.current()});const h=c.charCodeAt(0);return(h===9||h===32)&&(c=Bv(h)+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),u(),o(),c}qv.peek=CR;function qv(e){return e.value||""}function CR(){return"<"}Gv.peek=ER;function Gv(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${l}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),a(),c}function ER(){return"!"}Kv.peek=TR;function Kv(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const c=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function TR(){return"!"}Yv.peek=PR;function Yv(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);if(!a.atBreak)continue;let u;for(;u=o.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function PR(){return"`"}function Jv(e,t){const n=Mo(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][+\-.a-z]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xv.peek=RR;function Xv(e,t,n,r){const i=Qh(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);if(Jv(e,n)){const p=n.stack;n.stack=p.filter(function(x){return x!=="phrasing"});const g=n.enter("autolink");let w=a.move("<");return w+=a.move(n.containerPhrasing(e,{before:w,after:">",...a.current()})),w+=a.move(">"),g(),n.stack=p,w}const o=n.enter("link");let u=n.enter("label"),c=a.move("[");const h=n.containerPhrasing(e,{before:c,after:"](",...a.current()});c+=a.move(h),u(),c+=a.move("](");const d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1);let m=e.title||void 0;if(!m&&!d&&(f===`
404
+ `||f==="\r")){let p=0;for(;p<h.length&&h.charCodeAt(p)!==93;)p+=h.charCodeAt(p)===92?2:1;h.charCodeAt(p+1)===58&&(m="")}return!e.url&&typeof m=="string"||d?(u=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(u=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:typeof m=="string"?" ":")",...a.current()}))),u(),typeof m=="string"&&(u=n.enter(`title${l}`),c+=a.move(" "+i),c+=a.move(n.safe(m,{before:c,after:i,...a.current()})),c+=a.move(i),u()),c+=a.move(")"),o(),c}function RR(e,t,n){return Jv(e,n)?"<":"["}Zv.peek=LR;function Zv(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(c+"]["),a();const h=n.stack;n.stack=h.filter(function(f){return f!=="phrasing"}),a=n.enter("reference");const d=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=h,l(),i==="full"||!c||c!==d?u+=o.move(d+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function LR(){return"["}function Kh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function AR(e){const t=Kh(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function IR(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ej(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function DR(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?IR(n):Kh(n);const o=e.ordered?a==="."?")":".":AR(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ej(n)===a&&h){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),c}function MR(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zR(e,t,n,r){const i=MR(n);let l=n.bulletCurrent||Kh(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),h);return u(),c;function h(d,f,m){return f?(m?"":" ".repeat(a))+d:(m?l:l+" ".repeat(a-l.length))+d}}function _R(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}function $R(e,t,n,r){if(!e.children.some(function(o){return lR(o)}))return n.containerFlow(e,r);const l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),a}function OR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Yh.attention=tj;Yh.peek=FR;function Yh(e,t,n,r){const i=n.enter("phrasing"),l=qh(e,tj,n,n.createTracker(r)),a=l?Bo([l],r.before,r.after):"";return i(),a}function tj(e,t){return{construct:"strong",markers:OR(t)==="*"?["*","_"]:["_","*"],sizes:[2]}}function FR(e,t,n){return n.options.strong||"*"}function UR(e,t,n,r){const i=t?t.children:[],l=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[l+1],beforeNode:i[l-1]})}function BR(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function HR(e,t,n){const r=(ej(n)+(n.options.ruleSpaces?" ":"")).repeat(BR(n));return n.options.ruleSpaces?r.slice(0,-1):r}const od={blockquote:aR,break:zm,code:fR,definition:mR,emphasis:Gh,hardBreak:zm,heading:NR,html:qv,image:Gv,imageReference:Kv,inlineCode:Yv,link:Xv,linkReference:Zv,list:DR,listItem:zR,paragraph:_R,root:$R,strong:Yh,text:UR,thematicBreak:HR};function WR(){return{enter:{table:VR,tableData:Om,tableHeader:Om,tableRow:qR},exit:{codeText:GR,table:QR,tableData:Fu,tableHeader:Fu,tableRow:Fu}}}function VR(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[],position:void 0},e),this.data.inTable=!0}function QR(e){this.exit(e),this.data.inTable=void 0}function qR(e){this.enter({type:"tableRow",children:[],position:void 0},e)}function Fu(e){this.exit(e)}function Om(e){this.enter({type:"tableCell",children:[],position:void 0},e)}function GR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,KR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function KR(e,t){return t==="|"?t:e}function YR(e){const t=e||{},{tableCellPadding:n,tablePipeAlign:r,stringLength:i}=t,l=n?" ":"|";return{handlers:{inlineCode:f,table:a,tableCell:u,tableRow:o},join:[JR],unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
405
405
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}]};function a(m,p,g,w){const x=h(m,g,w),y=x[0];if(y){let v=m.align?m.align.length:0,b=-1;if(!v)for(;++b<x.length;)x[b].length>v&&(v=x[b].length);for(;y.length<v;)y.push("")}return c(x,m.align)}function o(m,p,g,w){const x=d(m,g,w),y=c([x]);return y.slice(0,y.indexOf(`
406
- `))}function u(m,p,g,w){const x=g.enter("tableCell"),y=g.enter("phrasing"),v=g.containerPhrasing(m,{...w,before:l,after:l});return y(),x(),v}function c(m,p){return eR(m,{align:p,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function h(m,p,g){const{children:w}=m;let x=-1;const y=[],v=p.enter("table");for(;++x<w.length;)y[x]=d(w[x],p,g);return v(),y}function d(m,p,g){const{children:w}=m;let x=-1;const y=[],v=p.enter("tableRow");for(;++x<w.length;)y[x]=u(w[x],m,p,g);return v(),y}function f(m,p,g){const w=ad.inlineCode(m,p,g);if(!g.stack.includes("tableCell"))return w;const x=[];let y=0,v=w.indexOf("|");for(;v!==-1;){let b=v;for(;b>y&&w.charCodeAt(b-1)===92;)b--;x.push(w.slice(y,v)),(v-b)%2===0&&x.push("\\"),y=v,v=w.indexOf("|",v+1)}return x.push(w.slice(y)),x.join("")}}function qR(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&GR(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function GR(e,t){let n=!1;return $o(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,qi}),!!((!e.depth||e.depth<3)&&Io(e)&&(t.options.setext||n))}function KR(){return{exit:{taskListCheckValueChecked:Fm,taskListCheckValueUnchecked:Fm,paragraph:JR}}}function YR(){return{handlers:{paragraph:XR},join:[ZR]}}function Fm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function JR(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function XR(e,t,n,r){if(!t||t.type!=="listItem"||tj(t)!==e)return ad.paragraph(e,t,n,r);const i="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);l.move(i);const a=ad.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...l.current()});return i+a}function ZR(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;const r=tj(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function tj(e){if(typeof e.checked=="boolean")for(const t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function eA(){return[vP(),HP(),qP(),FR(),KR()]}function tA(e){return{extensions:[jP(),WP(e),GP(),QR(e),YR()]}}const nA={tokenize:oA,partial:!0},nj={tokenize:uA,partial:!0},rj={tokenize:cA,partial:!0},sj={tokenize:dA,partial:!0},rA={tokenize:hA,partial:!0},ij={name:"wwwAutolink",tokenize:lA,previous:aj},lj={name:"protocolAutolink",tokenize:aA,previous:oj},Yn={name:"emailAutolink",tokenize:iA,previous:uj},In={};function sA(){return{text:In}}let _r=48;for(;_r<123;)In[_r]=Yn,_r++,_r===58?_r=65:_r===91&&(_r=97);In[43]=Yn;In[45]=Yn;In[46]=Yn;In[95]=Yn;In[72]=[Yn,lj];In[104]=[Yn,lj];In[87]=[Yn,ij];In[119]=[Yn,ij];function iA(e,t,n){const r=this;let i,l;return a;function a(d){return!od(d)||!uj.call(r,r.previous)||Jh(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return od(d)?(e.consume(d),o):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(rA,h,c)(d):d===45||d===95||vt(d)?(l=!0,e.consume(d),u):h(d)}function c(d){return e.consume(d),i=!0,u}function h(d){return l&&i&&yt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function lA(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!aj.call(r,r.previous)||Jh(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nA,e.attempt(nj,e.attempt(rj,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function aA(e,t,n){const r=this;let i="",l=!1;return a;function a(d){return(d===72||d===104)&&oj.call(r,r.previous)&&!Jh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(yt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),l?c:(l=!0,u)):n(d)}function c(d){return d===null||ro(d)||Oe(d)||ss(d)||Cl(d)?n(d):e.attempt(nj,e.attempt(rj,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function oA(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function uA(e,t,n){let r,i,l;return a;function a(c){return c===46||c===95?e.check(sj,u,o)(c):c===null||Oe(c)||ss(c)||c!==45&&Cl(c)?u(c):(l=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function u(c){return i||r||!l?n(c):t(c)}}function cA(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(sj,t,l)(a):a===null||Oe(a)||ss(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function dA(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Oe(o)||ss(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Oe(o)||ss(o)?t(o):r(o)}function l(o){return yt(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):yt(o)?(e.consume(o),a):n(o)}}function hA(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return vt(l)?n(l):t(l)}}function aj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Oe(e)}function oj(e){return!yt(e)}function uj(e){return!(e===47||od(e))}function od(e){return e===43||e===45||e===46||e===95||vt(e)}function Jh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fA={tokenize:wA,partial:!0};function pA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yA,continuation:{tokenize:vA},exit:jA}},text:{91:{name:"gfmFootnoteCall",tokenize:xA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mA,resolveTo:gA}}}}function mA(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const c=vn(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function gA(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function xA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(l>999||d===93&&!a||d===null||d===91||Oe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(vn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Oe(d)||(a=!0),l++,e.consume(d),d===92?h:c}function h(d){return d===91||d===92||d===93?(e.consume(d),l++,c):c(d)}}function yA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(p)}function h(p){if(a>999||p===93&&!o||p===null||p===91||Oe(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return l=vn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Oe(p)||(o=!0),a++,e.consume(p),p===92?d:h}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}function f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(l)||i.push(l),Ae(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function vA(e,t,n){return e.check(El,t,e.attempt(fA,t,n))}function jA(e){e.exit("gfmFootnoteDefinition")}function wA(e,t,n){const r=this;return Ae(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function kA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let c=u;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[u][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[u][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[u][1].start)},f=[["enter",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&yn(f,f.length,0,Do(m,a.slice(c+1,u),o)),yn(f,f.length,0,[["exit",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",h,o]]),yn(a,c-1,u-c+3,f),u=c+f.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function l(a,o,u){const c=this.previous,h=this.events;let d=0;return f;function f(p){return c===126&&h[h.length-1][1].type!=="characterEscape"?u(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const g=br(c);if(p===126)return d>1?u(p):(a.consume(p),d++,m);if(d<2&&!n)return u(p);const w=a.exit("strikethroughSequenceTemporary"),x=br(p);return w._open=!x||x===2&&!!g,w._close=!g||g===2&&!!x,o(p)}}}class bA{constructor(){this.map=[],this.index=new Map}add(t,n,r){SA(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}}function SA(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}function NA(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function CA(){return{flow:{null:{name:"table",tokenize:EA,resolveAll:TA}}}}function EA(e,t,n){const r=this;let i=0,l=0,a;return o;function o(N){let P=r.events.length-1;for(;P>-1;){const{type:U}=r.events[P][1];if(U==="lineEnding"||U==="linePrefix")P--;else break}const A=P>-1?r.events[P][1].type:null,z=A==="tableHead"||A==="tableRow"?k:u;return z===k&&r.parser.lazy[r.now().line]?n(N):z(N)}function u(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(a=!0,l+=1),h(N)}function h(N){return N===null?n(N):de(N)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):ve(N)?Ae(e,h,"whitespace")(N):(l+=1,a&&(a=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(N)))}function d(N){return N===null||N===124||Oe(N)?(e.exit("data"),h(N)):(e.consume(N),N===92?f:d)}function f(N){return N===92||N===124?(e.consume(N),d):d(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,ve(N)?Ae(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):p(N))}function p(N){return N===45||N===58?w(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),g):E(N)}function g(N){return ve(N)?Ae(e,w,"whitespace")(N):w(N)}function w(N){return N===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),x):N===45?(l+=1,x(N)):N===null||de(N)?b(N):E(N)}function x(N){return N===45?(e.enter("tableDelimiterFiller"),y(N)):E(N)}function y(N){return N===45?(e.consume(N),y):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(N))}function v(N){return ve(N)?Ae(e,b,"whitespace")(N):b(N)}function b(N){return N===124?p(N):N===null||de(N)?!a||i!==l?E(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):E(N)}function E(N){return n(N)}function k(N){return e.enter("tableRow"),L(N)}function L(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),L):N===null||de(N)?(e.exit("tableRow"),t(N)):ve(N)?Ae(e,L,"whitespace")(N):(e.enter("data"),T(N))}function T(N){return N===null||N===124||Oe(N)?(e.exit("data"),L(N)):(e.consume(N),N===92?D:T)}function D(N){return N===92||N===124?(e.consume(N),T):T(N)}}function TA(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,c,h,d;const f=new bA;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,u!==0&&(Um(f,t,u,c,h),h=void 0,u=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",h,t]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],d=ua(f,t,l,i,void 0,d),l=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],d=ua(f,t,l,i,void 0,d)),l=a,a=[l[1],n,0,0])):p.type==="tableHead"?(o=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,l[1]!==0?(a[0]=a[1],d=ua(f,t,l,i,n,d)):a[1]!==0&&(d=ua(f,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Um(f,t,u,c,h),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=NA(t.events,n))}return e}function ua(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},bs(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=bs(t.events,n[1]);if(l={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const c=bs(t.events,n[2]),h=bs(t.events,n[3]),d={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(l.end=Object.assign({},bs(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Um(e,t,n,r,i){const l=[],a=bs(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function bs(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const PA={name:"tasklistCheck",tokenize:AA};function RA(){return{text:{91:PA}}}function AA(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return Oe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return de(u)?t(u):ve(u)?e.check({tokenize:LA},t,n)(u):n(u)}}function LA(e,t,n){return Ae(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function IA(e){return lv([sA(),pA(),kA(e),CA(),RA()])}const DA={};function MA(e){const t=this,n=e||DA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(IA(n)),l.push(eA()),a.push(tA(n))}const zA={builtin:"built-in",project:"project",user:"user",synced:"claude.ai",plugin:"",other:""},Ou=60;function _A(e,t){var h,d;const n=((h=t.catalog)==null?void 0:h.pipelines)??[],r=e.match(/^\/p:([a-z0-9-]+) (\S*)$/i);if(r){const f=n.find(p=>p.name===r[1].toLowerCase());if(!(f!=null&&f.runnable)||!/^[<[]spec\.md[>\]]/.test(f.argumentHint))return[];const m=r[2].toLowerCase();return t.specs.filter(p=>p.toLowerCase().startsWith(m)).slice(0,Ou).map(p=>({insert:`/p:${f.name} ${p} `,label:p,hint:"",description:"",badge:"spec"}))}const i=e.match(/^\/p:([a-z0-9-]*)$/i);if(i)return na(n,i[1]).slice(0,Ou).map(f=>({insert:`/p:${f.name} `,label:`/p:${f.name}`,hint:f.argumentHint,description:f.label===f.description||!f.description?f.label:`${f.label} — ${f.description}`,badge:f.builtin?"built-in":"custom"}));const l=e.match(/^\/(\S*)$/);if(!l)return[];const a=l[1],o=na(t.local.map(f=>({name:f.cmd.slice(1),description:f.help,l:f})),a).map(({l:f})=>({insert:`${f.cmd} `,label:f.cmd,hint:f.args,description:f.help,badge:"Agent Studio"})),u=n.length?na([{name:"p:",description:"Run an Agent Studio pipeline"}],a).map(()=>({insert:"/p:",label:"/p:<pipeline>",hint:"",description:"Run an Agent Studio pipeline",badge:"Agent Studio"})):[],c=na(((d=t.catalog)==null?void 0:d.commands)??[],a).map(f=>({insert:`/${f.name} `,label:`/${f.name}`,hint:f.argumentHint,description:f.description,badge:f.source==="plugin"?f.name.split(":")[0]:zA[f.source]}));return[...o,...u,...c].slice(0,Ou)}const cj="qa-studio.chat.settings",Bm={model:"default",effort:"default",permissionMode:"acceptEdits"};function $A(){try{return{...Bm,...JSON.parse(localStorage.getItem(cj)??"{}")}}catch{return Bm}}function OA(e){try{localStorage.setItem(cj,JSON.stringify(e))}catch{}}const ud=e=>typeof e=="number"?`$${e<.01&&e>0?e.toFixed(3):e.toFixed(2)}`:"",FA=e=>typeof e=="number"?e<6e4?`${(e/1e3).toFixed(1)} s`:`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:"",UA=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`,oo=[{cmd:"/model",args:"<default|fable|opus|sonnet|haiku|full-id>",help:"Change the model"},{cmd:"/effort",args:`<${qr.join("|")}>`,help:"Change the reasoning effort"},{cmd:"/mode",args:"<plan|acceptEdits|auto|bypassPermissions>",help:"Change the permission mode"},{cmd:"/new",args:"",help:"Start a new chat"},{cmd:"/help",args:"",help:"List the commands"}];function BA(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>n(r.error??new Error("Could not read the file")),r.readAsDataURL(e)})}const dj=j.createContext(async()=>{}),HA={allowed:"Allowed",always:"Always allowed (saved to .claude/settings.local.json)",denied:"Denied",expired:"No longer waiting"};function WA({b:e}){const t=j.useContext(dj),[n,r]=j.useState(!1),i=a=>{r(!0),t(e.requestId,a).finally(()=>r(!1))},l=e.state==="pending";return s.jsxs("div",{className:`chat-perm ${e.state}`,role:l?"alertdialog":void 0,"aria-label":`Permission for ${e.toolName}`,children:[s.jsxs("div",{className:"chat-perm-head",children:[s.jsx("b",{children:l?`Allow Claude to use ${e.toolName}?`:e.toolName}),!l&&s.jsx("span",{className:`chat-perm-state ${e.state}`,children:HA[e.state]})]}),e.summary&&s.jsx("code",{className:"chat-perm-cmd",children:e.summary}),l&&e.reason&&s.jsx("div",{className:"muted small",children:e.reason}),e.input&&s.jsxs("details",{children:[s.jsx("summary",{className:"muted small",children:"Full input"}),s.jsx("pre",{children:e.input})]}),l&&s.jsxs("div",{className:"row chat-perm-actions",children:[s.jsx("button",{className:"btn sm",disabled:n,onClick:()=>i("allow"),autoFocus:!0,children:"Allow"}),e.canRemember&&s.jsx("button",{className:"btn ghost sm",disabled:n,onClick:()=>i("always"),title:"Allow now and don't ask again for this in this project (.claude/settings.local.json)",children:"Always allow"}),s.jsx("button",{className:"btn ghost sm chat-perm-deny",disabled:n,onClick:()=>i("deny"),children:"Deny"})]})]})}const VA=[MA],QA={table:({node:e,...t})=>s.jsx("div",{className:"chat-table-wrap",children:s.jsx("table",{...t})}),a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noreferrer"})};function qA({b:e}){const t=e.done?e.isError?"error":"ok":"running";return s.jsxs("details",{className:`chat-tool ${t}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"chat-tool-state",children:t==="running"?s.jsx("span",{className:"chat-spinner"}):t==="error"?s.jsx(wr,{size:12}):s.jsx(yh,{size:12})}),s.jsx("b",{children:e.name}),e.summary&&s.jsx("code",{className:"chat-tool-sum",children:e.summary})]}),e.input&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:"Input"}),s.jsx("pre",{children:e.input})]}),e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:e.isError?"Error":"Result"}),s.jsx("pre",{children:e.result||"(empty)"})]})]})}function GA({b:e}){switch(e.kind){case"text":return s.jsx("div",{className:"chat-md",children:s.jsx(ui,{remarkPlugins:VA,components:QA,children:e.text})});case"thinking":return s.jsxs("details",{className:"chat-thinking",children:[s.jsx("summary",{children:"Thinking"}),s.jsx("div",{className:"chat-thinking-body",children:e.text})]});case"tool":return s.jsx(qA,{b:e});case"permission":return s.jsx(WA,{b:e});case"error":return s.jsx("div",{className:"error-box chat-error",role:"alert",children:e.text});case"notice":return s.jsx("div",{className:"chat-notice",children:e.text});case"job":return s.jsxs("div",{className:"chat-job",children:[s.jsxs("span",{children:["Started ",s.jsx("strong",{children:e.pipeline})," · ",s.jsx("code",{children:e.target})]}),s.jsxs(ye,{className:"btn ghost",to:`/runs/${e.jobId}`,children:["Open job #",e.jobId]})]})}}function hj({a:e,onRemove:t}){return s.jsxs("span",{className:"chat-att",title:e.path,children:[s.jsx(My,{size:12}),s.jsx("span",{className:"chat-att-name",children:e.name}),s.jsx("span",{className:"muted",children:UA(e.size)}),t&&s.jsx("button",{type:"button",className:"chat-att-x",onClick:t,"aria-label":`Remove ${e.name}`,children:s.jsx(wr,{size:11})})]})}function KA({m:e}){var n;if(e.role==="user"){const r=e.blocks.find(i=>i.kind==="text");return s.jsxs("div",{className:"chat-msg user",children:[s.jsxs("div",{className:"chat-bubble",children:[r&&r.kind==="text"&&s.jsx("div",{className:"chat-user-text",children:r.text}),!!((n=e.attachments)!=null&&n.length)&&s.jsx("div",{className:"chat-atts",children:e.attachments.map(i=>s.jsx(hj,{a:i},i.id))})]}),e.settings&&s.jsxs("div",{className:"chat-meta",children:[e.settings.model," · effort ",e.settings.effort," · ",e.settings.permissionMode]})]})}const t=[e.model,ud(e.costUsd),FA(e.durationMs),e.turns?`${e.turns} turn${e.turns>1?"s":""}`:""].filter(Boolean);return s.jsxs("div",{className:"chat-msg assistant",children:[s.jsx("span",{className:"chat-avatar","aria-hidden":"true",children:s.jsx(Sh,{size:15})}),s.jsxs("div",{className:"chat-body",children:[e.blocks.map((r,i)=>s.jsx(GA,{b:r},i)),e.pending&&s.jsxs("div",{className:"chat-typing","aria-label":"Claude is working",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),!e.pending&&t.length>0&&s.jsx("div",{className:"chat-meta",children:t.join(" · ")})]})]})}function YA({settings:e,onSettings:t,busy:n,onSend:r,onStop:i,ensureSession:l,onSlash:a}){var ae;const o=cs(),[u,c]=j.useState(""),[h,d]=j.useState([]),[f,m]=j.useState(0),[p,g]=j.useState(!1),w=j.useRef(null),x=j.useRef(null),[y,v]=j.useState(null),[b,E]=j.useState([]),[k,L]=j.useState(0),[T,D]=j.useState(null),N=j.useRef(!1),P=j.useRef(null);j.useEffect(()=>{!u.startsWith("/")||N.current||(N.current=!0,q.chatCommands().then(v,()=>v(null)),q.specs().then(O=>E(O.map(C=>C.file)),()=>E([])))},[u]),j.useEffect(()=>L(0),[u]),j.useLayoutEffect(()=>{const O=x.current;O&&(O.style.height="auto",O.style.height=`${Math.min(O.scrollHeight,260)}px`)},[u]);const A=async O=>{if(O.length){m(C=>C+O.length);try{const C=await l();for(const F of O)try{const Z=await BA(F),oe=await q.uploadChatFile(C,{name:F.name||"pasted.png",mime:F.type||"application/octet-stream",data:Z});d(B=>[...B,oe])}catch(Z){o.error(`${F.name}: ${Z.message}`)}finally{m(Z=>Z-1)}}catch(C){m(0),o.error(C.message)}}},z=async()=>{const O=u.trim(),C=O.match(/^(\/[a-z]+)(?:\s+(.*))?$/i);if(C&&oo.some(F=>F.cmd===C[1].toLowerCase())){a(C[1].toLowerCase(),(C[2]??"").trim())&&c("");return}n||f||!O&&!h.length||await r(O,h)&&(c(""),d([]))},U=O=>{var F;const C=H[O];!C||C.disabled||(c(C.insert),L(0),(F=x.current)==null||F.focus())},I=O=>{if(H.length&&!O.nativeEvent.isComposing){const C=F=>{var oe,B;O.preventDefault();const Z=(X+F+H.length)%H.length;L(Z),(B=(oe=P.current)==null?void 0:oe.children[Z])==null||B.scrollIntoView({block:"nearest"})};if(O.key==="ArrowDown")return C(1);if(O.key==="ArrowUp")return C(-1);if(O.key==="Escape")return O.preventDefault(),D(u);if(O.key==="Tab"||O.key==="Enter"&&!O.shiftKey&&H[X]&&H[X].insert.trim()!==u.trim())return O.preventDefault(),U(X)}O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&(O.preventDefault(),z()),O.key==="Escape"&&n&&i()},Q=O=>{const C=[...O.clipboardData.files];C.length&&(O.preventDefault(),A(C))},J=O=>{O.preventDefault(),g(!1),A([...O.dataTransfer.files])},H=T===u?[]:_A(u,{local:oo,catalog:y,specs:b}),X=Math.min(k,Math.max(0,H.length-1)),S=_p.some(O=>O.id===e.model);return s.jsxs("div",{className:`chat-composer ${p?"dragging":""}`,onDragOver:O=>(O.preventDefault(),g(!0)),onDragLeave:()=>g(!1),onDrop:J,children:[H.length>0&&s.jsxs("div",{className:"chat-slash",role:"listbox",ref:P,children:[H.map((O,C)=>s.jsxs("button",{type:"button",role:"option","aria-selected":C===X,"aria-disabled":O.disabled,title:O.disabledReason??O.description,className:`chat-slash-item ${C===X?"active":""} ${O.disabled?"disabled":""}`,onMouseEnter:()=>L(C),onMouseDown:F=>F.preventDefault(),onClick:()=>U(C),children:[s.jsxs("code",{children:[O.label,O.hint&&s.jsxs("span",{className:"muted",children:[" ",O.hint]})]}),s.jsx("span",{className:"chat-slash-desc muted",children:O.description}),O.badge&&s.jsx("span",{className:"chat-slash-badge",children:O.badge})]},O.insert)),u.startsWith("/")&&!u.startsWith("/p:")&&(y==null?void 0:y.error)&&s.jsx("div",{className:"chat-slash-note muted",children:y.error})]}),(h.length>0||f>0)&&s.jsxs("div",{className:"chat-atts",children:[h.map(O=>s.jsx(hj,{a:O,onRemove:()=>d(C=>C.filter(F=>F.id!==O.id))},O.id)),f>0&&s.jsxs("span",{className:"chat-att muted",children:["Uploading ",f,"…"]})]}),s.jsx("textarea",{ref:x,className:"chat-input",rows:1,autoFocus:!0,placeholder:n?"Claude is answering… (Esc to stop)":"Message Claude Code - Enter to send, Shift+Enter for a new line, / for commands",value:u,onChange:O=>c(O.target.value),onKeyDown:I,onPaste:Q,"aria-label":"Message"}),s.jsxs("div",{className:"chat-toolbar",children:[s.jsx("input",{ref:w,type:"file",multiple:!0,hidden:!0,onChange:O=>(A([...O.target.files??[]]),O.target.value="")}),s.jsx("button",{type:"button",className:"btn ghost icon square",onClick:()=>{var O;return(O=w.current)==null?void 0:O.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:s.jsx(My,{size:16})}),s.jsxs("label",{className:"chat-select",title:"Model",children:[s.jsx("span",{children:"Model"}),s.jsxs("select",{value:e.model,onChange:O=>t({model:O.target.value}),"aria-label":"Model",children:[!S&&s.jsx("option",{value:e.model,children:e.model}),_p.map(O=>s.jsx("option",{value:O.id,children:O.label},O.id))]})]}),s.jsxs("label",{className:"chat-select chat-effort",title:"Reasoning effort: higher thinks longer (slower, more tokens). Default = Claude Code's own setting",children:[s.jsx("span",{children:"Effort"}),s.jsx("input",{type:"range",min:0,max:qr.length-1,step:1,value:Math.max(0,qr.indexOf(e.effort)),onChange:O=>t({effort:qr[Number(O.target.value)]}),"aria-label":"Effort","aria-valuetext":e.effort,list:"chat-effort-ticks"}),s.jsx("datalist",{id:"chat-effort-ticks",children:qr.map((O,C)=>s.jsx("option",{value:C},O))}),s.jsx("b",{className:"chat-effort-value",children:e.effort==="default"?"Default":e.effort})]}),s.jsxs("label",{className:"chat-select",title:(ae=no.find(O=>O.id===e.permissionMode))==null?void 0:ae.description,children:[s.jsx("span",{children:"Permissions"}),s.jsx("select",{value:e.permissionMode,onChange:O=>t({permissionMode:O.target.value}),"aria-label":"Permission mode",children:no.map(O=>s.jsx("option",{value:O.id,title:O.description,children:O.label},O.id))})]}),s.jsx("div",{className:"grow"}),n?s.jsxs("button",{type:"button",className:"btn danger sm",onClick:i,title:"Stop (Esc)",children:[s.jsx(Ly,{size:14})," Stop"]}):s.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void z(),disabled:f>0||!u.trim()&&!h.length,"aria-label":"Send",children:[s.jsx(ub,{size:14})," Send"]})]})]})}function JA(){const{id:e}=ii(),t=ut(),n=cs(),r=Kn(),i=Ie(()=>q.chats(),[]),[l,a]=j.useState(null),[o,u]=j.useState($A),[c,h]=j.useState(null),[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=j.useRef(null),w=i.reload;j.useEffect(()=>{if(a(null),h(null),p.current=!0,!e)return;let A=!0;q.chat(e).then(U=>A&&a(I=>I??U)).catch(U=>A&&h(U.message));const z=q0(e,U=>{A&&(U.type==="session"?(a(U.session),U.session.busy||w()):a(I=>I&&{...I,messages:I.messages.map(Q=>Q.id===U.message.id?U.message:Q)}))});return()=>{A=!1,z()}},[e,w]),j.useLayoutEffect(()=>{const A=m.current;A&&p.current&&(A.scrollTop=A.scrollHeight)},[l]);const x=l?{model:l.model,effort:l.effort,permissionMode:l.permissionMode}:o,y=j.useCallback(async()=>{if(e)return e;g.current??(g.current=q.createChat(o).then(A=>(a(A),t(`/chat/${A.id}`,{replace:!0}),w(),A.id)));try{return await g.current}finally{g.current=null}},[e,o,t,w]),v=async A=>{const z={...x,...A};if(u(z),OA(z),!!l){a({...l,...A});try{await q.updateChat(l.id,A)}catch(U){n.error(U.message)}}},b=async(A,z)=>{try{const U=await y();p.current=!0;const I=await q.sendChat(U,A,z.map(Q=>Q.id));return a(Q=>Q&&Q.messages.length>I.messages.length?Q:I),!0}catch(U){return n.error(U.message),!1}},E=j.useCallback(async(A,z)=>{if(e)try{await q.answerChatPermission(e,A,z)}catch(U){n.error(U.message)}},[e,n]),k=()=>{l&&q.stopChat(l.id).catch(A=>n.error(A.message))},L=(A,z)=>{var U;if(A==="/new")return t("/chat"),!0;if(A==="/help")return n.info(s.jsx("div",{children:oo.map(I=>s.jsxs("div",{children:[s.jsx("code",{children:I.cmd})," ",I.help]},I.cmd))})),!0;if(!z)return n.warning(`Usage: ${A} ${(U=oo.find(I=>I.cmd===A))==null?void 0:U.args}`),!1;if(A==="/model")return v({model:z}),n.success(`Model: ${z}`),!0;if(A==="/effort")return qr.includes(z)?(v({effort:z}),n.success(`Effort: ${z}`),!0):(n.error(`Effort must be one of ${qr.join(", ")}`),!1);if(A==="/mode"){const I=no.find(Q=>Q.id.toLowerCase()===z.toLowerCase());return I?(v({permissionMode:I.id}),n.success(`Permissions: ${I.label}`),!0):(n.error(`Mode must be one of ${no.map(Q=>Q.id).join(", ")}`),!1)}return!1},T=async A=>{if(await r({title:`Delete "${A.title}"?`,message:"The chat and its attachments are removed from Agent Studio. The Claude Code session itself stays in Claude Code’s history.",danger:!0,confirmLabel:"Delete"}))try{await q.deleteChat(A.id),A.id===e&&t("/chat"),w()}catch(z){n.error(z.message)}},D=async()=>{if(!l||d===null)return;const A=d.trim();if(f(null),!(!A||A===l.title))try{a(await q.updateChat(l.id,{title:A})),w()}catch(z){n.error(z.message)}},N=()=>{l&&navigator.clipboard.writeText(`claude --resume ${l.id}`).then(()=>n.success("Copied: run it in a terminal at the repo root to continue there")).catch(()=>n.error("Could not copy"))},P=i.data??[];return s.jsxs("div",{className:"chat-page",children:[s.jsx(ot,{items:[{label:"Claude chat",to:"/chat"},...l?[{label:l.title}]:[]]}),s.jsxs("aside",{className:"chat-list",children:[s.jsxs("button",{className:"btn chat-new",onClick:()=>t("/chat"),children:[s.jsx(Qt,{size:15})," New chat"]}),s.jsxs("div",{className:"chat-list-items",children:[P.length===0&&s.jsx("p",{className:"muted small chat-list-empty",children:"No chats yet."}),P.map(A=>s.jsxs("div",{className:`chat-list-item ${A.id===e?"active":""}`,children:[s.jsxs(ye,{to:`/chat/${A.id}`,className:"chat-list-link",children:[s.jsxs("span",{className:"chat-list-title",children:[A.busy&&s.jsx("span",{className:"chat-dot",title:"Answering"}),A.title]}),s.jsxs("span",{className:"muted small",children:[Pt(A.updatedAt),A.costUsd>0&&` · ${ud(A.costUsd)}`]})]}),s.jsx("button",{className:"chat-list-del",onClick:()=>void T(A),"aria-label":`Delete ${A.title}`,title:"Delete chat",children:s.jsx(Rr,{size:13})})]},A.id))]})]}),s.jsxs("section",{className:"chat-main",children:[s.jsxs("header",{className:"chat-head",children:[l&&d!==null?s.jsx("input",{className:"input chat-rename",autoFocus:!0,value:d,onChange:A=>f(A.target.value),onBlur:()=>void D(),onKeyDown:A=>A.key==="Enter"?void D():A.key==="Escape"&&f(null),"aria-label":"Chat title"}):s.jsx("h1",{className:"chat-title",onDoubleClick:()=>l&&f(l.title),title:l?"Double-click to rename":void 0,children:(l==null?void 0:l.title)??"New chat"}),s.jsx("div",{className:"grow"}),l&&l.costUsd>0&&s.jsxs("span",{className:"muted small",children:["Total ",ud(l.costUsd)]}),(l==null?void 0:l.started)&&s.jsx("button",{className:"btn ghost sm",onClick:N,title:"Copy the command that continues this session in a terminal",children:s.jsx("code",{children:"claude --resume"})})]}),s.jsxs("div",{className:"chat-scroll",ref:m,onScroll:A=>p.current=A.currentTarget.scrollHeight-A.currentTarget.scrollTop-A.currentTarget.clientHeight<80,children:[c&&s.jsx("div",{className:"error-box",children:c}),!c&&(!l||l.messages.length===0)&&s.jsxs("div",{className:"chat-empty",children:[s.jsx("span",{className:"chat-empty-icon",children:s.jsx(Sh,{size:26})}),s.jsx("h2",{children:"Chat with Claude Code"}),s.jsxs("p",{className:"muted",children:["Runs Claude Code in this repository, like the terminal: it reads ",s.jsx("code",{children:"CLAUDE.md"}),", your skills and settings, and can edit files depending on the permission mode. Attach files with the paperclip, paste or drop them. Type ",s.jsx("code",{children:"/"})," for commands."]})]}),s.jsx(dj.Provider,{value:E,children:l==null?void 0:l.messages.map(A=>s.jsx(KA,{m:A},A.id))})]}),s.jsx(YA,{settings:x,onSettings:A=>void v(A),busy:!!(l!=null&&l.busy),onSend:b,onStop:k,ensureSession:y,onSlash:L})]})]})}const XA={name:"",description:"",instructions:"",model:"sonnet",skills:[],claudeMdSections:[],permissions:jb,review:"auto"},ZA=[{key:"browser",label:"Browser",hint:"Drive a real browser with playwright cli; gets the .env values (base URL, accounts)."},{key:"editTests",label:"Edit tests",hint:"Edit tests/e2e, tests/pages and tests/fixtures."},{key:"editSpecs",label:"Edit specs",hint:"Edit files in specs/."},{key:"typecheck",label:"Typecheck",hint:"Run npm run typecheck."}],Hm=e=>({name:e.name,description:e.description,instructions:e.instructions,model:e.model,skills:e.skills,claudeMdSections:e.claudeMdSections,permissions:e.permissions,review:e.review??"auto"}),Wm=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],eL=[{id:"scoped",label:"Scoped",hint:"Read the repository; write only its job directory plus what the toggles allow."},{id:"full",label:"Full edit",hint:"Create and edit any file and run any shell command, except the denied commands and protected folders below."}],tL=[{key:"deniedCommands",label:"Denied commands",hint:"One command per line; it is blocked with any arguments (Bash(<command>:*)).",placeholder:`git push
406
+ `))}function u(m,p,g,w){const x=g.enter("tableCell"),y=g.enter("phrasing"),v=g.containerPhrasing(m,{...w,before:l,after:l});return y(),x(),v}function c(m,p){return sR(m,{align:p,alignDelimiters:r,fillRows:!1,padding:n,stringLength:i})}function h(m,p,g){const{children:w}=m;let x=-1;const y=[],v=p.enter("table");for(;++x<w.length;)y[x]=d(w[x],p,g);return v(),y}function d(m,p,g){const{children:w}=m;let x=-1;const y=[],v=p.enter("tableRow");for(;++x<w.length;)y[x]=u(w[x],m,p,g);return v(),y}function f(m,p,g){const w=od.inlineCode(m,p,g);if(!g.stack.includes("tableCell"))return w;const x=[];let y=0,v=w.indexOf("|");for(;v!==-1;){let b=v;for(;b>y&&w.charCodeAt(b-1)===92;)b--;x.push(w.slice(y,v)),(v-b)%2===0&&x.push("\\"),y=v,v=w.indexOf("|",v+1)}return x.push(w.slice(y)),x.join("")}}function JR(e,t,n,r){if(e.type==="table"&&n.type==="listItem"&&n.spread===!1&&(t.type==="definition"||t.type==="heading"&&XR(t,r)||t.type==="paragraph"||t.type==="table"))return 1}function XR(e,t){let n=!1;return Fo(e,function(r){if(r.type==="break"||"value"in r&&/\r?\n|\r/.test(r.value))return n=!0,qi}),!!((!e.depth||e.depth<3)&&Mo(e)&&(t.options.setext||n))}function ZR(){return{exit:{taskListCheckValueChecked:Fm,taskListCheckValueUnchecked:Fm,paragraph:tL}}}function eL(){return{handlers:{paragraph:nL},join:[rL]}}function Fm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tL(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start={...r.position.start}))}}this.exit(e)}function nL(e,t,n,r){if(!t||t.type!=="listItem"||nj(t)!==e)return od.paragraph(e,t,n,r);const i="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);l.move(i);const a=od.paragraph(e.children.length>0?e:{type:"paragraph",children:[{type:"text",value:" "}]},t,n,{...r,...l.current()});return i+a}function rL(e,t,n){if(!(e.type==="definition"&&n.type==="listItem"))return;const r=nj(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function nj(e){if(typeof e.checked=="boolean")for(const t of e.children){if(t.type==="paragraph")return t;if(t.type!=="definition")return}}function sL(){return[bP(),qP(),JP(),WR(),ZR()]}function iL(e){return{extensions:[SP(),GP(e),XP(),YR(e),eL()]}}const lL={tokenize:hL,partial:!0},rj={tokenize:fL,partial:!0},sj={tokenize:pL,partial:!0},ij={tokenize:mL,partial:!0},aL={tokenize:gL,partial:!0},lj={name:"wwwAutolink",tokenize:cL,previous:oj},aj={name:"protocolAutolink",tokenize:dL,previous:uj},Yn={name:"emailAutolink",tokenize:uL,previous:cj},Dn={};function oL(){return{text:Dn}}let Or=48;for(;Or<123;)Dn[Or]=Yn,Or++,Or===58?Or=65:Or===91&&(Or=97);Dn[43]=Yn;Dn[45]=Yn;Dn[46]=Yn;Dn[95]=Yn;Dn[72]=[Yn,aj];Dn[104]=[Yn,aj];Dn[87]=[Yn,lj];Dn[119]=[Yn,lj];function uL(e,t,n){const r=this;let i,l;return a;function a(d){return!ud(d)||!cj.call(r,r.previous)||Jh(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(d))}function o(d){return ud(d)?(e.consume(d),o):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(aL,h,c)(d):d===45||d===95||vt(d)?(l=!0,e.consume(d),u):h(d)}function c(d){return e.consume(d),i=!0,u}function h(d){return l&&i&&yt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function cL(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!oj.call(r,r.previous)||Jh(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(lL,e.attempt(rj,e.attempt(sj,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function dL(e,t,n){const r=this;let i="",l=!1;return a;function a(d){return(d===72||d===104)&&uj.call(r,r.previous)&&!Jh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),o):n(d)}function o(d){if(yt(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),o;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),l?c:(l=!0,u)):n(d)}function c(d){return d===null||so(d)||Oe(d)||ls(d)||Cl(d)?n(d):e.attempt(rj,e.attempt(sj,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function hL(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function fL(e,t,n){let r,i,l;return a;function a(c){return c===46||c===95?e.check(ij,u,o)(c):c===null||Oe(c)||ls(c)||c!==45&&Cl(c)?u(c):(l=!0,e.consume(c),a)}function o(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function u(c){return i||r||!l?n(c):t(c)}}function pL(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(ij,t,l)(a):a===null||Oe(a)||ls(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function mL(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Oe(o)||ls(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Oe(o)||ls(o)?t(o):r(o)}function l(o){return yt(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):yt(o)?(e.consume(o),a):n(o)}}function gL(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return vt(l)?n(l):t(l)}}function oj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Oe(e)}function uj(e){return!yt(e)}function cj(e){return!(e===47||ud(e))}function ud(e){return e===43||e===45||e===46||e===95||vt(e)}function Jh(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const xL={tokenize:NL,partial:!0};function yL(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:kL,continuation:{tokenize:bL},exit:SL}},text:{91:{name:"gfmFootnoteCall",tokenize:wL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vL,resolveTo:jL}}}}function vL(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const c=vn(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!l.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function jL(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function wL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(l>999||d===93&&!a||d===null||d===91||Oe(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(vn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Oe(d)||(a=!0),l++,e.consume(d),d===92?h:c}function h(d){return d===91||d===92||d===93?(e.consume(d),l++,c):c(d)}}function kL(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(p)}function h(p){if(a>999||p===93&&!o||p===null||p===91||Oe(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return l=vn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Oe(p)||(o=!0),a++,e.consume(p),p===92?d:h}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}function f(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(l)||i.push(l),Le(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function bL(e,t,n){return e.check(El,t,e.attempt(xL,t,n))}function SL(e){e.exit("gfmFootnoteDefinition")}function NL(e,t,n){const r=this;return Le(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function CL(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let c=u;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[u][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[u][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[u][1].start)},f=[["enter",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["enter",d,o]],m=o.parser.constructs.insideSpan.null;m&&yn(f,f.length,0,zo(m,a.slice(c+1,u),o)),yn(f,f.length,0,[["exit",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",h,o]]),yn(a,c-1,u-c+3,f),u=c+f.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function l(a,o,u){const c=this.previous,h=this.events;let d=0;return f;function f(p){return c===126&&h[h.length-1][1].type!=="characterEscape"?u(p):(a.enter("strikethroughSequenceTemporary"),m(p))}function m(p){const g=br(c);if(p===126)return d>1?u(p):(a.consume(p),d++,m);if(d<2&&!n)return u(p);const w=a.exit("strikethroughSequenceTemporary"),x=br(p);return w._open=!x||x===2&&!!g,w._close=!g||g===2&&!!x,o(p)}}}class EL{constructor(){this.map=[],this.index=new Map}add(t,n,r){TL(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}}function TL(e,t,n,r){if(n===0&&r.length===0)return;const i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}const l=[t,n,r];e.map.push(l),e.index.set(t,l)}function PL(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function RL(){return{flow:{null:{name:"table",tokenize:LL,resolveAll:AL}}}}function LL(e,t,n){const r=this;let i=0,l=0,a;return o;function o(C){let L=r.events.length-1;for(;L>-1;){const{type:U}=r.events[L][1];if(U==="lineEnding"||U==="linePrefix")L--;else break}const A=L>-1?r.events[L][1].type:null,z=A==="tableHead"||A==="tableRow"?k:u;return z===k&&r.parser.lazy[r.now().line]?n(C):z(C)}function u(C){return e.enter("tableHead"),e.enter("tableRow"),c(C)}function c(C){return C===124||(a=!0,l+=1),h(C)}function h(C){return C===null?n(C):de(C)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),m):n(C):ve(C)?Le(e,h,"whitespace")(C):(l+=1,a&&(a=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),a=!0,h):(e.enter("data"),d(C)))}function d(C){return C===null||C===124||Oe(C)?(e.exit("data"),h(C)):(e.consume(C),C===92?f:d)}function f(C){return C===92||C===124?(e.consume(C),d):d(C)}function m(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),a=!1,ve(C)?Le(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):p(C))}function p(C){return C===45||C===58?w(C):C===124?(a=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):E(C)}function g(C){return ve(C)?Le(e,w,"whitespace")(C):w(C)}function w(C){return C===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),x):C===45?(l+=1,x(C)):C===null||de(C)?b(C):E(C)}function x(C){return C===45?(e.enter("tableDelimiterFiller"),y(C)):E(C)}function y(C){return C===45?(e.consume(C),y):C===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(C))}function v(C){return ve(C)?Le(e,b,"whitespace")(C):b(C)}function b(C){return C===124?p(C):C===null||de(C)?!a||i!==l?E(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):E(C)}function E(C){return n(C)}function k(C){return e.enter("tableRow"),R(C)}function R(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),R):C===null||de(C)?(e.exit("tableRow"),t(C)):ve(C)?Le(e,R,"whitespace")(C):(e.enter("data"),T(C))}function T(C){return C===null||C===124||Oe(C)?(e.exit("data"),R(C)):(e.consume(C),C===92?D:T)}function D(C){return C===92||C===124?(e.consume(C),T):T(C)}}function AL(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,c,h,d;const f=new EL;for(;++n<e.length;){const m=e[n],p=m[1];m[0]==="enter"?p.type==="tableHead"?(o=!1,u!==0&&(Um(f,t,u,c,h),h=void 0,u=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(n,0,[["enter",h,t]])),i=p.type==="tableDelimiterRow"?2:h?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],d=ua(f,t,l,i,void 0,d),l=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],d=ua(f,t,l,i,void 0,d)),l=a,a=[l[1],n,0,0])):p.type==="tableHead"?(o=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,l[1]!==0?(a[0]=a[1],d=ua(f,t,l,i,n,d)):a[1]!==0&&(d=ua(f,t,a,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&Um(f,t,u,c,h),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=PL(t.events,n))}return e}function ua(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},Ss(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const u=Ss(t.events,n[1]);if(l={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const c=Ss(t.events,n[2]),h=Ss(t.events,n[3]),d={type:o,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(l.end=Object.assign({},Ss(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Um(e,t,n,r,i){const l=[],a=Ss(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function Ss(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const IL={name:"tasklistCheck",tokenize:ML};function DL(){return{text:{91:IL}}}function ML(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return Oe(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return de(u)?t(u):ve(u)?e.check({tokenize:zL},t,n)(u):n(u)}}function zL(e,t,n){return Le(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function _L(e){return av([oL(),yL(),CL(e),RL(),DL()])}const $L={};function OL(e){const t=this,n=e||$L,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(_L(n)),l.push(sL()),a.push(iL(n))}const FL={builtin:"built-in",project:"project",user:"user",synced:"claude.ai",plugin:"",other:""},Uu=60;function UL(e,t){var h,d;const n=((h=t.catalog)==null?void 0:h.pipelines)??[],r=e.match(/^\/p:([a-z0-9-]+) (\S*)$/i);if(r){const f=n.find(p=>p.name===r[1].toLowerCase());if(!(f!=null&&f.runnable)||!/^[<[]spec\.md[>\]]/.test(f.argumentHint))return[];const m=r[2].toLowerCase();return t.specs.filter(p=>p.toLowerCase().startsWith(m)).slice(0,Uu).map(p=>({insert:`/p:${f.name} ${p} `,label:p,hint:"",description:"",badge:"spec"}))}const i=e.match(/^\/p:([a-z0-9-]*)$/i);if(i)return na(n,i[1]).slice(0,Uu).map(f=>({insert:`/p:${f.name} `,label:`/p:${f.name}`,hint:f.argumentHint,description:f.label===f.description||!f.description?f.label:`${f.label} — ${f.description}`,badge:f.builtin?"built-in":"custom"}));const l=e.match(/^\/(\S*)$/);if(!l)return[];const a=l[1],o=na(t.local.map(f=>({name:f.cmd.slice(1),description:f.help,l:f})),a).map(({l:f})=>({insert:`${f.cmd} `,label:f.cmd,hint:f.args,description:f.help,badge:"Agent Studio"})),u=n.length?na([{name:"p:",description:"Run an Agent Studio pipeline"}],a).map(()=>({insert:"/p:",label:"/p:<pipeline>",hint:"",description:"Run an Agent Studio pipeline",badge:"Agent Studio"})):[],c=na(((d=t.catalog)==null?void 0:d.commands)??[],a).map(f=>({insert:`/${f.name} `,label:`/${f.name}`,hint:f.argumentHint,description:f.description,badge:f.source==="plugin"?f.name.split(":")[0]:FL[f.source]}));return[...o,...u,...c].slice(0,Uu)}const dj="qa-studio.chat.settings",Bm={model:"default",effort:"default",permissionMode:"acceptEdits"};function BL(){try{return{...Bm,...JSON.parse(localStorage.getItem(dj)??"{}")}}catch{return Bm}}function HL(e){try{localStorage.setItem(dj,JSON.stringify(e))}catch{}}const cd=e=>typeof e=="number"?`$${e<.01&&e>0?e.toFixed(3):e.toFixed(2)}`:"",WL=e=>typeof e=="number"?e<6e4?`${(e/1e3).toFixed(1)} s`:`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:"",VL=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(1)} MB`,uo=[{cmd:"/model",args:"<default|fable|opus|sonnet|haiku|full-id>",help:"Change the model"},{cmd:"/effort",args:`<${Kr.join("|")}>`,help:"Change the reasoning effort"},{cmd:"/mode",args:"<plan|acceptEdits|auto|bypassPermissions>",help:"Change the permission mode"},{cmd:"/new",args:"",help:"Start a new chat"},{cmd:"/help",args:"",help:"List the commands"}];function QL(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>n(r.error??new Error("Could not read the file")),r.readAsDataURL(e)})}const hj=j.createContext(async()=>{}),qL={allowed:"Allowed",always:"Always allowed (saved to .claude/settings.local.json)",denied:"Denied",expired:"No longer waiting"};function GL({b:e}){const t=j.useContext(hj),[n,r]=j.useState(!1),i=a=>{r(!0),t(e.requestId,a).finally(()=>r(!1))},l=e.state==="pending";return s.jsxs("div",{className:`chat-perm ${e.state}`,role:l?"alertdialog":void 0,"aria-label":`Permission for ${e.toolName}`,children:[s.jsxs("div",{className:"chat-perm-head",children:[s.jsx("b",{children:l?`Allow Claude to use ${e.toolName}?`:e.toolName}),!l&&s.jsx("span",{className:`chat-perm-state ${e.state}`,children:qL[e.state]})]}),e.summary&&s.jsx("code",{className:"chat-perm-cmd",children:e.summary}),l&&e.reason&&s.jsx("div",{className:"muted small",children:e.reason}),e.input&&s.jsxs("details",{children:[s.jsx("summary",{className:"muted small",children:"Full input"}),s.jsx("pre",{children:e.input})]}),l&&s.jsxs("div",{className:"row chat-perm-actions",children:[s.jsx("button",{className:"btn sm",disabled:n,onClick:()=>i("allow"),autoFocus:!0,children:"Allow"}),e.canRemember&&s.jsx("button",{className:"btn ghost sm",disabled:n,onClick:()=>i("always"),title:"Allow now and don't ask again for this in this project (.claude/settings.local.json)",children:"Always allow"}),s.jsx("button",{className:"btn ghost sm chat-perm-deny",disabled:n,onClick:()=>i("deny"),children:"Deny"})]})]})}const KL=[OL],YL={table:({node:e,...t})=>s.jsx("div",{className:"chat-table-wrap",children:s.jsx("table",{...t})}),a:({node:e,...t})=>s.jsx("a",{...t,target:"_blank",rel:"noreferrer"})};function JL({b:e}){const t=e.done?e.isError?"error":"ok":"running";return s.jsxs("details",{className:`chat-tool ${t}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"chat-tool-state",children:t==="running"?s.jsx("span",{className:"chat-spinner"}):t==="error"?s.jsx(wr,{size:12}):s.jsx(vh,{size:12})}),s.jsx("b",{children:e.name}),e.summary&&s.jsx("code",{className:"chat-tool-sum",children:e.summary})]}),e.input&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:"Input"}),s.jsx("pre",{children:e.input})]}),e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"chat-tool-label",children:e.isError?"Error":"Result"}),s.jsx("pre",{children:e.result||"(empty)"})]})]})}function XL({b:e}){switch(e.kind){case"text":return s.jsx("div",{className:"chat-md",children:s.jsx(ui,{remarkPlugins:KL,components:YL,children:e.text})});case"thinking":return s.jsxs("details",{className:"chat-thinking",children:[s.jsx("summary",{children:"Thinking"}),s.jsx("div",{className:"chat-thinking-body",children:e.text})]});case"tool":return s.jsx(JL,{b:e});case"permission":return s.jsx(GL,{b:e});case"error":return s.jsx("div",{className:"error-box chat-error",role:"alert",children:e.text});case"notice":return s.jsx("div",{className:"chat-notice",children:e.text});case"job":return s.jsxs("div",{className:"chat-job",children:[s.jsxs("span",{children:["Started ",s.jsx("strong",{children:e.pipeline})," · ",s.jsx("code",{children:e.target})]}),s.jsxs(ye,{className:"btn ghost",to:`/runs/${e.jobId}`,children:["Open job #",e.jobId]})]})}}function fj({a:e,onRemove:t}){return s.jsxs("span",{className:"chat-att",title:e.path,children:[s.jsx(My,{size:12}),s.jsx("span",{className:"chat-att-name",children:e.name}),s.jsx("span",{className:"muted",children:VL(e.size)}),t&&s.jsx("button",{type:"button",className:"chat-att-x",onClick:t,"aria-label":`Remove ${e.name}`,children:s.jsx(wr,{size:11})})]})}function ZL({m:e}){var n;if(e.role==="user"){const r=e.blocks.find(i=>i.kind==="text");return s.jsxs("div",{className:"chat-msg user",children:[s.jsxs("div",{className:"chat-bubble",children:[r&&r.kind==="text"&&s.jsx("div",{className:"chat-user-text",children:r.text}),!!((n=e.attachments)!=null&&n.length)&&s.jsx("div",{className:"chat-atts",children:e.attachments.map(i=>s.jsx(fj,{a:i},i.id))})]}),e.settings&&s.jsxs("div",{className:"chat-meta",children:[e.settings.model," · effort ",e.settings.effort," · ",e.settings.permissionMode]})]})}const t=[e.model,cd(e.costUsd),WL(e.durationMs),e.turns?`${e.turns} turn${e.turns>1?"s":""}`:""].filter(Boolean);return s.jsxs("div",{className:"chat-msg assistant",children:[s.jsx("span",{className:"chat-avatar","aria-hidden":"true",children:s.jsx(Sh,{size:15})}),s.jsxs("div",{className:"chat-body",children:[e.blocks.map((r,i)=>s.jsx(XL,{b:r},i)),e.pending&&s.jsxs("div",{className:"chat-typing","aria-label":"Claude is working",children:[s.jsx("i",{}),s.jsx("i",{}),s.jsx("i",{})]}),!e.pending&&t.length>0&&s.jsx("div",{className:"chat-meta",children:t.join(" · ")})]})]})}function eA({settings:e,onSettings:t,busy:n,onSend:r,onStop:i,ensureSession:l,onSlash:a}){var ae;const o=Ar(),[u,c]=j.useState(""),[h,d]=j.useState([]),[f,m]=j.useState(0),[p,g]=j.useState(!1),w=j.useRef(null),x=j.useRef(null),[y,v]=j.useState(null),[b,E]=j.useState([]),[k,R]=j.useState(0),[T,D]=j.useState(null),C=j.useRef(!1),L=j.useRef(null);j.useEffect(()=>{!u.startsWith("/")||C.current||(C.current=!0,q.chatCommands().then(v,()=>v(null)),q.specs().then(O=>E(O.map(N=>N.file)),()=>E([])))},[u]),j.useEffect(()=>R(0),[u]),j.useLayoutEffect(()=>{const O=x.current;O&&(O.style.height="auto",O.style.height=`${Math.min(O.scrollHeight,260)}px`)},[u]);const A=async O=>{if(O.length){m(N=>N+O.length);try{const N=await l();for(const F of O)try{const Z=await QL(F),oe=await q.uploadChatFile(N,{name:F.name||"pasted.png",mime:F.type||"application/octet-stream",data:Z});d(B=>[...B,oe])}catch(Z){o.error(`${F.name}: ${Z.message}`)}finally{m(Z=>Z-1)}}catch(N){m(0),o.error(N.message)}}},z=async()=>{const O=u.trim(),N=O.match(/^(\/[a-z]+)(?:\s+(.*))?$/i);if(N&&uo.some(F=>F.cmd===N[1].toLowerCase())){a(N[1].toLowerCase(),(N[2]??"").trim())&&c("");return}n||f||!O&&!h.length||await r(O,h)&&(c(""),d([]))},U=O=>{var F;const N=H[O];!N||N.disabled||(c(N.insert),R(0),(F=x.current)==null||F.focus())},I=O=>{if(H.length&&!O.nativeEvent.isComposing){const N=F=>{var oe,B;O.preventDefault();const Z=(X+F+H.length)%H.length;R(Z),(B=(oe=L.current)==null?void 0:oe.children[Z])==null||B.scrollIntoView({block:"nearest"})};if(O.key==="ArrowDown")return N(1);if(O.key==="ArrowUp")return N(-1);if(O.key==="Escape")return O.preventDefault(),D(u);if(O.key==="Tab"||O.key==="Enter"&&!O.shiftKey&&H[X]&&H[X].insert.trim()!==u.trim())return O.preventDefault(),U(X)}O.key==="Enter"&&!O.shiftKey&&!O.nativeEvent.isComposing&&(O.preventDefault(),z()),O.key==="Escape"&&n&&i()},Q=O=>{const N=[...O.clipboardData.files];N.length&&(O.preventDefault(),A(N))},J=O=>{O.preventDefault(),g(!1),A([...O.dataTransfer.files])},H=T===u?[]:UL(u,{local:uo,catalog:y,specs:b}),X=Math.min(k,Math.max(0,H.length-1)),S=_p.some(O=>O.id===e.model);return s.jsxs("div",{className:`chat-composer ${p?"dragging":""}`,onDragOver:O=>(O.preventDefault(),g(!0)),onDragLeave:()=>g(!1),onDrop:J,children:[H.length>0&&s.jsxs("div",{className:"chat-slash",role:"listbox",ref:L,children:[H.map((O,N)=>s.jsxs("button",{type:"button",role:"option","aria-selected":N===X,"aria-disabled":O.disabled,title:O.disabledReason??O.description,className:`chat-slash-item ${N===X?"active":""} ${O.disabled?"disabled":""}`,onMouseEnter:()=>R(N),onMouseDown:F=>F.preventDefault(),onClick:()=>U(N),children:[s.jsxs("code",{children:[O.label,O.hint&&s.jsxs("span",{className:"muted",children:[" ",O.hint]})]}),s.jsx("span",{className:"chat-slash-desc muted",children:O.description}),O.badge&&s.jsx("span",{className:"chat-slash-badge",children:O.badge})]},O.insert)),u.startsWith("/")&&!u.startsWith("/p:")&&(y==null?void 0:y.error)&&s.jsx("div",{className:"chat-slash-note muted",children:y.error})]}),(h.length>0||f>0)&&s.jsxs("div",{className:"chat-atts",children:[h.map(O=>s.jsx(fj,{a:O,onRemove:()=>d(N=>N.filter(F=>F.id!==O.id))},O.id)),f>0&&s.jsxs("span",{className:"chat-att muted",children:["Uploading ",f,"…"]})]}),s.jsx("textarea",{ref:x,className:"chat-input",rows:1,autoFocus:!0,placeholder:n?"Claude is answering… (Esc to stop)":"Message Claude Code - Enter to send, Shift+Enter for a new line, / for commands",value:u,onChange:O=>c(O.target.value),onKeyDown:I,onPaste:Q,"aria-label":"Message"}),s.jsxs("div",{className:"chat-toolbar",children:[s.jsx("input",{ref:w,type:"file",multiple:!0,hidden:!0,onChange:O=>(A([...O.target.files??[]]),O.target.value="")}),s.jsx("button",{type:"button",className:"btn ghost icon square",onClick:()=>{var O;return(O=w.current)==null?void 0:O.click()},title:"Attach files (or paste / drop them)","aria-label":"Attach files",children:s.jsx(My,{size:16})}),s.jsxs("label",{className:"chat-select",title:"Model",children:[s.jsx("span",{children:"Model"}),s.jsxs("select",{value:e.model,onChange:O=>t({model:O.target.value}),"aria-label":"Model",children:[!S&&s.jsx("option",{value:e.model,children:e.model}),_p.map(O=>s.jsx("option",{value:O.id,children:O.label},O.id))]})]}),s.jsxs("label",{className:"chat-select chat-effort",title:"Reasoning effort: higher thinks longer (slower, more tokens). Default = Claude Code's own setting",children:[s.jsx("span",{children:"Effort"}),s.jsx("input",{type:"range",min:0,max:Kr.length-1,step:1,value:Math.max(0,Kr.indexOf(e.effort)),onChange:O=>t({effort:Kr[Number(O.target.value)]}),"aria-label":"Effort","aria-valuetext":e.effort,list:"chat-effort-ticks"}),s.jsx("datalist",{id:"chat-effort-ticks",children:Kr.map((O,N)=>s.jsx("option",{value:N},O))}),s.jsx("b",{className:"chat-effort-value",children:e.effort==="default"?"Default":e.effort})]}),s.jsxs("label",{className:"chat-select",title:(ae=ro.find(O=>O.id===e.permissionMode))==null?void 0:ae.description,children:[s.jsx("span",{children:"Permissions"}),s.jsx("select",{value:e.permissionMode,onChange:O=>t({permissionMode:O.target.value}),"aria-label":"Permission mode",children:ro.map(O=>s.jsx("option",{value:O.id,title:O.description,children:O.label},O.id))})]}),s.jsx("div",{className:"grow"}),n?s.jsxs("button",{type:"button",className:"btn danger sm",onClick:i,title:"Stop (Esc)",children:[s.jsx(Ay,{size:14})," Stop"]}):s.jsxs("button",{type:"button",className:"btn sm",onClick:()=>void z(),disabled:f>0||!u.trim()&&!h.length,"aria-label":"Send",children:[s.jsx(cb,{size:14})," Send"]})]})]})}function tA(){const{id:e}=li(),t=ut(),n=Ar(),r=In(),i=Me(()=>q.chats(),[]),[l,a]=j.useState(null),[o,u]=j.useState(BL),[c,h]=j.useState(null),[d,f]=j.useState(null),m=j.useRef(null),p=j.useRef(!0),g=j.useRef(null),w=i.reload;j.useEffect(()=>{if(a(null),h(null),p.current=!0,!e)return;let A=!0;q.chat(e).then(U=>A&&a(I=>I??U)).catch(U=>A&&h(U.message));const z=G0(e,U=>{A&&(U.type==="session"?(a(U.session),U.session.busy||w()):a(I=>I&&{...I,messages:I.messages.map(Q=>Q.id===U.message.id?U.message:Q)}))});return()=>{A=!1,z()}},[e,w]),j.useLayoutEffect(()=>{const A=m.current;A&&p.current&&(A.scrollTop=A.scrollHeight)},[l]);const x=l?{model:l.model,effort:l.effort,permissionMode:l.permissionMode}:o,y=j.useCallback(async()=>{if(e)return e;g.current??(g.current=q.createChat(o).then(A=>(a(A),t(`/chat/${A.id}`,{replace:!0}),w(),A.id)));try{return await g.current}finally{g.current=null}},[e,o,t,w]),v=async A=>{const z={...x,...A};if(u(z),HL(z),!!l){a({...l,...A});try{await q.updateChat(l.id,A)}catch(U){n.error(U.message)}}},b=async(A,z)=>{try{const U=await y();p.current=!0;const I=await q.sendChat(U,A,z.map(Q=>Q.id));return a(Q=>Q&&Q.messages.length>I.messages.length?Q:I),!0}catch(U){return n.error(U.message),!1}},E=j.useCallback(async(A,z)=>{if(e)try{await q.answerChatPermission(e,A,z)}catch(U){n.error(U.message)}},[e,n]),k=()=>{l&&q.stopChat(l.id).catch(A=>n.error(A.message))},R=(A,z)=>{var U;if(A==="/new")return t("/chat"),!0;if(A==="/help")return n.info(s.jsx("div",{children:uo.map(I=>s.jsxs("div",{children:[s.jsx("code",{children:I.cmd})," ",I.help]},I.cmd))})),!0;if(!z)return n.warning(`Usage: ${A} ${(U=uo.find(I=>I.cmd===A))==null?void 0:U.args}`),!1;if(A==="/model")return v({model:z}),n.success(`Model: ${z}`),!0;if(A==="/effort")return Kr.includes(z)?(v({effort:z}),n.success(`Effort: ${z}`),!0):(n.error(`Effort must be one of ${Kr.join(", ")}`),!1);if(A==="/mode"){const I=ro.find(Q=>Q.id.toLowerCase()===z.toLowerCase());return I?(v({permissionMode:I.id}),n.success(`Permissions: ${I.label}`),!0):(n.error(`Mode must be one of ${ro.map(Q=>Q.id).join(", ")}`),!1)}return!1},T=async A=>{if(await r({title:`Delete "${A.title}"?`,message:"The chat and its attachments are removed from Agent Studio. The Claude Code session itself stays in Claude Code’s history.",danger:!0,confirmLabel:"Delete"}))try{await q.deleteChat(A.id),A.id===e&&t("/chat"),w()}catch(z){n.error(z.message)}},D=async()=>{if(!l||d===null)return;const A=d.trim();if(f(null),!(!A||A===l.title))try{a(await q.updateChat(l.id,{title:A})),w()}catch(z){n.error(z.message)}},C=()=>{l&&navigator.clipboard.writeText(`claude --resume ${l.id}`).then(()=>n.success("Copied: run it in a terminal at the repo root to continue there")).catch(()=>n.error("Could not copy"))},L=i.data??[];return s.jsxs("div",{className:"chat-page",children:[s.jsx(ot,{items:[{label:"Claude chat",to:"/chat"},...l?[{label:l.title}]:[]]}),s.jsxs("aside",{className:"chat-list",children:[s.jsxs("button",{className:"btn chat-new",onClick:()=>t("/chat"),children:[s.jsx(Qt,{size:15})," New chat"]}),s.jsxs("div",{className:"chat-list-items",children:[L.length===0&&s.jsx("p",{className:"muted small chat-list-empty",children:"No chats yet."}),L.map(A=>s.jsxs("div",{className:`chat-list-item ${A.id===e?"active":""}`,children:[s.jsxs(ye,{to:`/chat/${A.id}`,className:"chat-list-link",children:[s.jsxs("span",{className:"chat-list-title",children:[A.busy&&s.jsx("span",{className:"chat-dot",title:"Answering"}),A.title]}),s.jsxs("span",{className:"muted small",children:[Pt(A.updatedAt),A.costUsd>0&&` · ${cd(A.costUsd)}`]})]}),s.jsx("button",{className:"chat-list-del",onClick:()=>void T(A),"aria-label":`Delete ${A.title}`,title:"Delete chat",children:s.jsx(Lr,{size:13})})]},A.id))]})]}),s.jsxs("section",{className:"chat-main",children:[s.jsxs("header",{className:"chat-head",children:[l&&d!==null?s.jsx("input",{className:"input chat-rename",autoFocus:!0,value:d,onChange:A=>f(A.target.value),onBlur:()=>void D(),onKeyDown:A=>A.key==="Enter"?void D():A.key==="Escape"&&f(null),"aria-label":"Chat title"}):s.jsx("h1",{className:"chat-title",onDoubleClick:()=>l&&f(l.title),title:l?"Double-click to rename":void 0,children:(l==null?void 0:l.title)??"New chat"}),s.jsx("div",{className:"grow"}),l&&l.costUsd>0&&s.jsxs("span",{className:"muted small",children:["Total ",cd(l.costUsd)]}),(l==null?void 0:l.started)&&s.jsx("button",{className:"btn ghost sm",onClick:C,title:"Copy the command that continues this session in a terminal",children:s.jsx("code",{children:"claude --resume"})})]}),s.jsxs("div",{className:"chat-scroll",ref:m,onScroll:A=>p.current=A.currentTarget.scrollHeight-A.currentTarget.scrollTop-A.currentTarget.clientHeight<80,children:[c&&s.jsx("div",{className:"error-box",children:c}),!c&&(!l||l.messages.length===0)&&s.jsxs("div",{className:"chat-empty",children:[s.jsx("span",{className:"chat-empty-icon",children:s.jsx(Sh,{size:26})}),s.jsx("h2",{children:"Chat with Claude Code"}),s.jsxs("p",{className:"muted",children:["Runs Claude Code in this repository, like the terminal: it reads ",s.jsx("code",{children:"CLAUDE.md"}),", your skills and settings, and can edit files depending on the permission mode. Attach files with the paperclip, paste or drop them. Type ",s.jsx("code",{children:"/"})," for commands."]})]}),s.jsx(hj.Provider,{value:E,children:l==null?void 0:l.messages.map(A=>s.jsx(ZL,{m:A},A.id))})]}),s.jsx(eA,{settings:x,onSettings:A=>void v(A),busy:!!(l!=null&&l.busy),onSend:b,onStop:k,ensureSession:y,onSlash:R})]})]})}const nA={name:"",description:"",instructions:"",model:"sonnet",skills:[],claudeMdSections:[],permissions:wb,review:"auto"},rA=[{key:"browser",label:"Browser",hint:"Drive a real browser with playwright cli; gets the .env values (base URL, accounts)."},{key:"editTests",label:"Edit tests",hint:"Edit tests/e2e, tests/pages and tests/fixtures."},{key:"editSpecs",label:"Edit specs",hint:"Edit files in specs/."},{key:"typecheck",label:"Typecheck",hint:"Run npm run typecheck."}],Hm=e=>({name:e.name,description:e.description,instructions:e.instructions,model:e.model,skills:e.skills,claudeMdSections:e.claudeMdSections,permissions:e.permissions,review:e.review??"auto"}),Wm=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],sA=[{id:"scoped",label:"Scoped",hint:"Read the repository; write only its job directory plus what the toggles allow."},{id:"full",label:"Full edit",hint:"Create and edit any file and run any shell command, except the denied commands and protected folders below."}],iA=[{key:"deniedCommands",label:"Denied commands",hint:"One command per line; it is blocked with any arguments (Bash(<command>:*)).",placeholder:`git push
407
407
  rm -rf`},{key:"protectedPaths",label:"Protected folders",hint:"One folder per line, relative to the repository root; the agent cannot edit or create files inside it (Edit(<folder>/**)).",placeholder:`qa-studio
408
- .git`}];function Vm(){var A,z,U;const{id:e}=ii(),t=!e,n=ut(),r=cs(),i=Kn(),l=Ie(()=>e?q.customAgent(e):Promise.resolve(null),[e]),a=Ie(()=>q.claudeMdSections()),o=Ie(()=>q.skills()),[u,c]=j.useState(XA),[h,d]=j.useState("instructions"),[f,m]=j.useState(null),[p,g]=j.useState(null),[w,x]=j.useState(!1),[y,v]=j.useState(!1);j.useEffect(()=>{l.data&&c(Hm(l.data))},[l.data]);const b=(I,Q)=>c(J=>({...J,[I]:Q})),E=I=>c(Q=>{const J=Q.permissions,H=I==="full"&&!J.deniedCommands.length&&!J.protectedPaths.length;return{...Q,permissions:{...J,mode:I,...H?{deniedCommands:_y,protectedPaths:$y}:{}}}}),k=async I=>{const Q=Ib(I);u.instructions.trim()&&u.instructions!==Q.instructions&&!await i({title:`Load the ${Wc.find(H=>H.id===I).label} template?`,message:"It replaces the instructions, description, model, review mode and permissions of this draft. Nothing is saved until you click Save.",confirmLabel:"Load template"})||(c(J=>({...J,name:t||!J.name.trim()?Q.name:J.name,description:Q.description,instructions:Q.instructions,model:Q.model,review:Q.review,permissions:Q.permissions})),d("instructions"),r.success(`Template loaded${t?"":": click Save to keep it"}`))},L=async()=>{var I;x(!0),g(null);try{const Q=t?await q.createCustomAgent(u):await q.saveCustomAgent(e,u,(I=l.data)==null?void 0:I.updatedAt);r.success(t?`Agent "${Q.name}" created`:`Agent "${Q.name}" saved`),t?n(`/agents/custom/${Q.id}`,{replace:!0}):l.reload()}catch(Q){g(Q.message)}finally{x(!1)}},T=async()=>{if(await i({title:`Delete the agent "${u.name}"?`,message:"Past jobs keep their results. This cannot be undone.",confirmLabel:"Delete agent",danger:!0}))try{await q.deleteCustomAgent(e),r.success("Agent deleted"),n("/agents")}catch(Q){r.error(Q.message)}};j.useEffect(()=>{if(h!=="preview"&&h!=="permissions")return;let I=!0;const Q=setTimeout(()=>{q.previewCustomAgent(t?null:e,{agent:u}).then(J=>I&&(m(J),g(null))).catch(J=>I&&g(J.message))},300);return()=>{I=!1,clearTimeout(Q)}},[h,u]);const D=!!l.data&&JSON.stringify(Hm(l.data))!==JSON.stringify(u),N=!w&&(t||!!l.data&&!l.error),P=u.claudeMdSections.filter(I=>a.data&&!a.data.includes(I));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:t?"New agent":u.name||"…"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:t?"New agent":u.name}),s.jsx("p",{className:"page-sub",children:"A custom LLM agent. It runs through Claude Code with the tools you allow below; .env reads, WebFetch and WebSearch are always blocked."})]}),s.jsxs("span",{className:"row",children:[s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back"}),s.jsxs("select",{className:"input",style:{width:"auto"},value:"",onChange:I=>I.target.value&&void k(I.target.value),"aria-label":"Load template",title:"Fill this agent from a built-in SDLC template",children:[s.jsx("option",{value:"",children:"Load template…"}),Wc.map(I=>s.jsx("option",{value:I.id,children:I.label},I.id))]}),!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void T(),disabled:w,children:[s.jsx(Rr,{size:14})," Delete"]}),!t&&s.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:D||!l.data,title:D?"Save your changes first":void 0,children:[s.jsx(ft,{size:14})," Run"]}),s.jsxs("button",{className:"btn",onClick:()=>void L(),disabled:!N,children:[t?s.jsx(Qt,{size:14}):s.jsx(li,{size:14})," ",t?"Create agent":"Save"]})]})]}),s.jsx(Pe,{error:l.error??p}),s.jsxs("div",{className:"card pl-meta four",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:u.name,maxLength:80,onChange:I=>b("name",I.target.value),placeholder:"e.g. Accessibility reviewer"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:u.description,maxLength:500,onChange:I=>b("description",I.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Model"}),s.jsx("select",{className:"input",value:u.model,onChange:I=>b("model",I.target.value),children:Ch.map(I=>s.jsx("option",{value:I.id,children:I.label},I.id))})]}),s.jsxs("div",{className:"pl-field",children:[s.jsx("span",{children:"Review"}),s.jsx("div",{className:"seg",role:"radiogroup","aria-label":"Review mode",children:["auto","human"].map(I=>s.jsx("button",{type:"button",role:"radio","aria-checked":u.review===I,className:`seg-btn ${u.review===I?"on":""}`,onClick:()=>b("review",I),children:I==="auto"?"Auto":"Human"},I))}),s.jsx("span",{className:"muted small",children:u.review==="human"?"The pipeline pauses after this agent until someone approves or rejects its output.":"The pipeline goes on as soon as this agent finishes."})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head row between",children:s.jsx(bn,{value:h,onChange:d,items:[{id:"instructions",label:"Instructions"},{id:"context",label:u.claudeMdSections.length?`CLAUDE.md (${u.claudeMdSections.length})`:"CLAUDE.md"},{id:"skills",label:u.skills.length?`Skills (${u.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]})}),h==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Placeholders: ",vb.map(I=>`{{${I}}}`).join(", "),". Agent Studio adds the fixed part (environment, tool rules, result file) after your instructions."]}),s.jsx("textarea",{className:"input prompt-editor",value:u.instructions,onChange:I=>b("instructions",I.target.value),spellCheck:!1,"aria-label":"Instructions"}),s.jsxs("span",{className:"muted small",children:[u.instructions.length.toLocaleString()," characters"]})]}),h==="context"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("p",{className:"muted small",style:{margin:0},children:"CLAUDE.md is always loaded. Pick the sections this agent must follow; the prompt names them explicitly."}),P.length>0&&s.jsx("div",{children:s.jsxs("span",{className:"chip warn",children:["Not in CLAUDE.md any more: ",P.join(", ")]})}),s.jsx(Pe,{error:a.error}),((A=a.data)==null?void 0:A.length)===0&&s.jsx("p",{className:"muted",children:"CLAUDE.md has no sections yet."}),s.jsx("div",{className:"skill-list",children:[...a.data??[],...P].map(I=>s.jsxs("label",{className:`skill-item ${u.claudeMdSections.includes(I)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.claudeMdSections.includes(I),onChange:()=>b("claudeMdSections",Wm(u.claudeMdSections,I)),"aria-label":`Section ${I}`}),s.jsx("b",{children:I})]},I))})]}),h==="skills"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"}),". The agent loads the selected skills itself when it runs."]}),s.jsx(Pe,{error:o.error}),((z=o.data)==null?void 0:z.length)===0&&s.jsx("p",{className:"muted",children:"No skills found in .claude/skills."}),s.jsx("div",{className:"skill-list",children:(U=o.data)==null?void 0:U.map(I=>{const Q=u.skills.includes(I.name);return s.jsxs("label",{className:`skill-item ${Q?"on":""} ${I.error&&!Q?"invalid":""}`,title:I.error??I.dir,children:[s.jsx("input",{type:"checkbox",checked:Q,disabled:!!I.error&&!Q,onChange:()=>b("skills",Wm(u.skills,I.name)),"aria-label":`Attach skill ${I.name}`}),s.jsx("b",{children:I.name}),s.jsx("span",{className:"skill-desc muted small",children:I.error??I.description})]},I.name)})})]}),h==="permissions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. The lists below follow your changes."]}),s.jsx("div",{className:"skill-list",children:eL.map(I=>s.jsxs("label",{className:`skill-item ${u.permissions.mode===I.id?"on":""}`,children:[s.jsx("input",{type:"radio",name:"permission-mode",checked:u.permissions.mode===I.id,onChange:()=>E(I.id)}),s.jsx("b",{children:I.label}),s.jsx("span",{className:"skill-desc muted small",children:I.hint})]},I.id))}),s.jsx("h4",{children:u.permissions.mode==="full"?"Options":"Allow"}),s.jsx("div",{className:"skill-list",children:ZA.filter(I=>u.permissions.mode==="scoped"||I.key==="browser").map(I=>s.jsxs("label",{className:`skill-item ${u.permissions[I.key]?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.permissions[I.key],onChange:Q=>b("permissions",{...u.permissions,[I.key]:Q.target.checked})}),s.jsx("b",{children:I.label}),s.jsx("span",{className:"skill-desc muted small",children:I.hint})]},I.key))}),s.jsx("h4",{children:"Deny"}),u.permissions.mode==="full"&&s.jsx("p",{className:"muted small",style:{margin:0},children:"Command rules match the start of a command, so they are a guard rail, not a sandbox: an agent with full shell access can still reach a protected folder or .env another way. Use Full edit only for agents you trust."}),tL.map(I=>s.jsxs("label",{className:"pl-field",children:[s.jsxs("span",{children:[s.jsx("b",{children:I.label})," ",s.jsx("span",{className:"muted small",children:I.hint})]}),s.jsx("textarea",{className:"input",rows:4,spellCheck:!1,placeholder:I.placeholder,value:u.permissions[I.key].join(`
408
+ .git`}];function Vm(){var A,z,U;const{id:e}=li(),t=!e,n=ut(),r=Ar(),i=In(),l=Me(()=>e?q.customAgent(e):Promise.resolve(null),[e]),a=Me(()=>q.claudeMdSections()),o=Me(()=>q.skills()),[u,c]=j.useState(nA),[h,d]=j.useState("instructions"),[f,m]=j.useState(null),[p,g]=j.useState(null),[w,x]=j.useState(!1),[y,v]=j.useState(!1);j.useEffect(()=>{l.data&&c(Hm(l.data))},[l.data]);const b=(I,Q)=>c(J=>({...J,[I]:Q})),E=I=>c(Q=>{const J=Q.permissions,H=I==="full"&&!J.deniedCommands.length&&!J.protectedPaths.length;return{...Q,permissions:{...J,mode:I,...H?{deniedCommands:_y,protectedPaths:$y}:{}}}}),k=async I=>{const Q=Db(I);u.instructions.trim()&&u.instructions!==Q.instructions&&!await i({title:`Load the ${Vc.find(H=>H.id===I).label} template?`,message:"It replaces the instructions, description, model, review mode and permissions of this draft. Nothing is saved until you click Save.",confirmLabel:"Load template"})||(c(J=>({...J,name:t||!J.name.trim()?Q.name:J.name,description:Q.description,instructions:Q.instructions,model:Q.model,review:Q.review,permissions:Q.permissions})),d("instructions"),r.success(`Template loaded${t?"":": click Save to keep it"}`))},R=async()=>{var I;x(!0),g(null);try{const Q=t?await q.createCustomAgent(u):await q.saveCustomAgent(e,u,(I=l.data)==null?void 0:I.updatedAt);r.success(t?`Agent "${Q.name}" created`:`Agent "${Q.name}" saved`),t?n(`/agents/custom/${Q.id}`,{replace:!0}):l.reload()}catch(Q){g(Q.message)}finally{x(!1)}},T=async()=>{if(await i({title:`Delete the agent "${u.name}"?`,message:"Past jobs keep their results. This cannot be undone.",confirmLabel:"Delete agent",danger:!0}))try{await q.deleteCustomAgent(e),r.success("Agent deleted"),n("/agents")}catch(Q){r.error(Q.message)}};j.useEffect(()=>{if(h!=="preview"&&h!=="permissions")return;let I=!0;const Q=setTimeout(()=>{q.previewCustomAgent(t?null:e,{agent:u}).then(J=>I&&(m(J),g(null))).catch(J=>I&&g(J.message))},300);return()=>{I=!1,clearTimeout(Q)}},[h,u]);const D=!!l.data&&JSON.stringify(Hm(l.data))!==JSON.stringify(u),C=!w&&(t||!!l.data&&!l.error),L=u.claudeMdSections.filter(I=>a.data&&!a.data.includes(I));return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:t?"New agent":u.name||"…"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:t?"New agent":u.name}),s.jsx("p",{className:"page-sub",children:"A custom LLM agent. It runs through Claude Code with the tools you allow below; .env reads, WebFetch and WebSearch are always blocked."})]}),s.jsxs("span",{className:"row",children:[s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back"}),s.jsxs("select",{className:"input",style:{width:"auto"},value:"",onChange:I=>I.target.value&&void k(I.target.value),"aria-label":"Load template",title:"Fill this agent from a built-in SDLC template",children:[s.jsx("option",{value:"",children:"Load template…"}),Vc.map(I=>s.jsx("option",{value:I.id,children:I.label},I.id))]}),!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void T(),disabled:w,children:[s.jsx(Lr,{size:14})," Delete"]}),!t&&s.jsxs("button",{className:"btn ghost",onClick:()=>v(!0),disabled:D||!l.data,title:D?"Save your changes first":void 0,children:[s.jsx(ft,{size:14})," Run"]}),s.jsxs("button",{className:"btn",onClick:()=>void R(),disabled:!C,children:[t?s.jsx(Qt,{size:14}):s.jsx(us,{size:14})," ",t?"Create agent":"Save"]})]})]}),s.jsx(Pe,{error:l.error??p}),s.jsxs("div",{className:"card pl-meta four",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:u.name,maxLength:80,onChange:I=>b("name",I.target.value),placeholder:"e.g. Accessibility reviewer"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:u.description,maxLength:500,onChange:I=>b("description",I.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Model"}),s.jsx("select",{className:"input",value:u.model,onChange:I=>b("model",I.target.value),children:Ch.map(I=>s.jsx("option",{value:I.id,children:I.label},I.id))})]}),s.jsxs("div",{className:"pl-field",children:[s.jsx("span",{children:"Review"}),s.jsx("div",{className:"seg",role:"radiogroup","aria-label":"Review mode",children:["auto","human"].map(I=>s.jsx("button",{type:"button",role:"radio","aria-checked":u.review===I,className:`seg-btn ${u.review===I?"on":""}`,onClick:()=>b("review",I),children:I==="auto"?"Auto":"Human"},I))}),s.jsx("span",{className:"muted small",children:u.review==="human"?"The pipeline pauses after this agent until someone approves or rejects its output.":"The pipeline goes on as soon as this agent finishes."})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head row between",children:s.jsx(bn,{value:h,onChange:d,items:[{id:"instructions",label:"Instructions"},{id:"context",label:u.claudeMdSections.length?`CLAUDE.md (${u.claudeMdSections.length})`:"CLAUDE.md"},{id:"skills",label:u.skills.length?`Skills (${u.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]})}),h==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Placeholders: ",jb.map(I=>`{{${I}}}`).join(", "),". Agent Studio adds the fixed part (environment, tool rules, result file) after your instructions."]}),s.jsx("textarea",{className:"input prompt-editor",value:u.instructions,onChange:I=>b("instructions",I.target.value),spellCheck:!1,"aria-label":"Instructions"}),s.jsxs("span",{className:"muted small",children:[u.instructions.length.toLocaleString()," characters"]})]}),h==="context"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("p",{className:"muted small",style:{margin:0},children:"CLAUDE.md is always loaded. Pick the sections this agent must follow; the prompt names them explicitly."}),L.length>0&&s.jsx("div",{children:s.jsxs("span",{className:"chip warn",children:["Not in CLAUDE.md any more: ",L.join(", ")]})}),s.jsx(Pe,{error:a.error}),((A=a.data)==null?void 0:A.length)===0&&s.jsx("p",{className:"muted",children:"CLAUDE.md has no sections yet."}),s.jsx("div",{className:"skill-list",children:[...a.data??[],...L].map(I=>s.jsxs("label",{className:`skill-item ${u.claudeMdSections.includes(I)?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.claudeMdSections.includes(I),onChange:()=>b("claudeMdSections",Wm(u.claudeMdSections,I)),"aria-label":`Section ${I}`}),s.jsx("b",{children:I})]},I))})]}),h==="skills"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"}),". The agent loads the selected skills itself when it runs."]}),s.jsx(Pe,{error:o.error}),((z=o.data)==null?void 0:z.length)===0&&s.jsx("p",{className:"muted",children:"No skills found in .claude/skills."}),s.jsx("div",{className:"skill-list",children:(U=o.data)==null?void 0:U.map(I=>{const Q=u.skills.includes(I.name);return s.jsxs("label",{className:`skill-item ${Q?"on":""} ${I.error&&!Q?"invalid":""}`,title:I.error??I.dir,children:[s.jsx("input",{type:"checkbox",checked:Q,disabled:!!I.error&&!Q,onChange:()=>b("skills",Wm(u.skills,I.name)),"aria-label":`Attach skill ${I.name}`}),s.jsx("b",{children:I.name}),s.jsx("span",{className:"skill-desc muted small",children:I.error??I.description})]},I.name)})})]}),h==="permissions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. The lists below follow your changes."]}),s.jsx("div",{className:"skill-list",children:sA.map(I=>s.jsxs("label",{className:`skill-item ${u.permissions.mode===I.id?"on":""}`,children:[s.jsx("input",{type:"radio",name:"permission-mode",checked:u.permissions.mode===I.id,onChange:()=>E(I.id)}),s.jsx("b",{children:I.label}),s.jsx("span",{className:"skill-desc muted small",children:I.hint})]},I.id))}),s.jsx("h4",{children:u.permissions.mode==="full"?"Options":"Allow"}),s.jsx("div",{className:"skill-list",children:rA.filter(I=>u.permissions.mode==="scoped"||I.key==="browser").map(I=>s.jsxs("label",{className:`skill-item ${u.permissions[I.key]?"on":""}`,children:[s.jsx("input",{type:"checkbox",checked:u.permissions[I.key],onChange:Q=>b("permissions",{...u.permissions,[I.key]:Q.target.checked})}),s.jsx("b",{children:I.label}),s.jsx("span",{className:"skill-desc muted small",children:I.hint})]},I.key))}),s.jsx("h4",{children:"Deny"}),u.permissions.mode==="full"&&s.jsx("p",{className:"muted small",style:{margin:0},children:"Command rules match the start of a command, so they are a guard rail, not a sandbox: an agent with full shell access can still reach a protected folder or .env another way. Use Full edit only for agents you trust."}),iA.map(I=>s.jsxs("label",{className:"pl-field",children:[s.jsxs("span",{children:[s.jsx("b",{children:I.label})," ",s.jsx("span",{className:"muted small",children:I.hint})]}),s.jsx("textarea",{className:"input",rows:4,spellCheck:!1,placeholder:I.placeholder,value:u.permissions[I.key].join(`
409
409
  `),onChange:Q=>b("permissions",{...u.permissions,[I.key]:Q.target.value.split(`
410
410
  `)}),"aria-label":I.label})]},I.key)),f&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:f.allowedTools.map(I=>s.jsx("code",{children:I},I))}),s.jsx("h4",{children:"Denied"}),s.jsx("div",{className:"perm",children:f.disallowedTools.map(I=>s.jsx("code",{className:"deny",children:I},I))})]})]}),h==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsx("span",{className:"muted small",children:"What Claude Code receives, with your unsaved edits (updates as you type). Placeholders stay generic; secret values are never shown."}),f?s.jsxs("pre",{className:"prompt-preview",children:[f.instructionsPart,`
411
411
 
412
412
  `,f.fixedPart.split(`
413
413
  `).map((I,Q)=>s.jsxs("span",{className:Q===0?"fixed-head":"fixed",children:[I,`
414
- `]},Q))]}):!p&&s.jsx("p",{className:"muted",children:"Building preview…"})]})]}),y&&e&&s.jsx(Mv,{title:"Run agent",onClose:()=>v(!1),onStart:(I,Q)=>q.createJob({type:"custom",agentId:e,...I?{spec:I}:{},...Q.trim()?{input:Q}:{}})})]})}const nL=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"],rL={validator:{command:"playwright test tests/e2e/<spec>.spec.ts --project=chrome --repeat-each=3 --retries=0 --reporter=line,json",notes:["Runs after the QA Script Generator and after each QA Script Healer round (QA Validator ⇄ QA Script Healer loop, max rounds in Settings).","Passes only when every repetition passes: catches flaky scripts before they are accepted."]},runner:{command:"playwright test [files] [--grep <TC-IDs>] --project=chrome --repeat-each=<n> --reporter=line,json[,html]",notes:["Used by Run tests and Test runs.",'The HTML reporter is added when the run has "HTML report" on (default in Settings).']}};function sL(){const e=ii().agent,t=Se[e];return t?t.llm?s.jsx(aL,{agent:e}):s.jsx(iL,{agent:e}):s.jsx(Pe,{error:`Unknown agent: ${e}`})}function fj({agent:e,extra:t}){const n=Se[e];return s.jsxs(s.Fragment,{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:n.label}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{className:"row",style:{alignItems:"flex-start"},children:[s.jsx(Ot,{agent:e,size:44}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[n.label," ",t]}),s.jsxs("p",{className:"page-sub",children:[n.description," · ",n.llm?"LLM agent (Claude Code)":"Deterministic step"]})]})]})})]})}function iL({agent:e}){const t=rL[e];return s.jsxs("section",{children:[s.jsx(fj,{agent:e}),s.jsxs("div",{className:"card pad",children:[s.jsx("p",{className:"muted",children:"This step has no prompt: it runs Playwright Test directly (no shell, no LLM). It cannot write any file other than its report."}),t&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Command"}),s.jsx("pre",{className:"prompt-preview",children:t.command}),s.jsx("ul",{children:t.notes.map(n=>s.jsx("li",{children:n},n))})]})]})]})}function lL({info:e,onSaved:t}){const[n,r]=j.useState(!1),[i,l]=j.useState(null),a=async u=>{if(u!==e.model){r(!0);try{await q.saveAgentModel(e.agent,u),l(null),t()}catch(c){l(c.message)}finally{r(!1)}}},o=async()=>{r(!0);try{await q.resetAgentModel(e.agent),l(null),t()}catch(u){l(u.message)}finally{r(!1)}};return s.jsxs("div",{className:"row",style:{gap:10,margin:"4px 0 14px"},children:[s.jsx("span",{className:"muted small",children:"Model:"}),s.jsx("select",{className:"select",value:e.model,disabled:n,onChange:u=>void a(u.target.value),"aria-label":`${Se[e.agent].label} model`,children:Ch.map(u=>s.jsx("option",{value:u.id,title:u.label,children:u.label},u.id))}),s.jsx(dt,{status:e.modelCustomized?"stale":"neutral",children:e.modelCustomized?"custom model":"default model"}),e.modelCustomized&&s.jsxs("button",{type:"button",className:"btn ghost sm",disabled:n,onClick:()=>void o(),title:"Use the default model",children:[s.jsx(Pr,{size:12})," Reset"]}),s.jsx(Pe,{error:i})]})}function aL({agent:e}){var A;const{specs:t}=un(),n=Kn(),r=Ie(()=>q.agentPrompts(),[e]),i=(A=r.data)==null?void 0:A.find(z=>z.agent===e),[l,a]=j.useState(null),[o,u]=j.useState("instructions"),[c,h]=j.useState(""),[d,f]=j.useState(null),[m,p]=j.useState(null),[g,w]=j.useState(null),[x,y]=j.useState(null),[v,b]=j.useState(!1),E=j.useRef(null);j.useEffect(()=>{i&&l===null&&a(i.instructions)},[i,l]),j.useEffect(()=>a(null),[e]);const k=i!==void 0&&l!==null&&l!==i.instructions,L=i!==void 0&&l!==null&&l.trim()!==i.defaultInstructions.trim(),T=ph(({currentLocation:z,nextLocation:U})=>k&&z.pathname!==U.pathname);Th(T,{title:"Discard the unsaved instructions?",message:"Your edits to this prompt will be lost.",confirmLabel:"Discard",danger:!0}),j.useEffect(()=>{if(o!=="preview"||l===null)return;const z=setTimeout(()=>{q.previewAgentPrompt(e,{instructions:l,...c?{spec:c}:{}}).then(U=>(f(U),p(null))).catch(U=>p(U.message))},300);return()=>clearTimeout(z)},[o,l,c,e]);const D=async()=>{if(l!==null){b(!0);try{const z=await q.saveAgentPrompt(e,l);a(z.instructions),r.reload(),w(null),y(z.customized?"Saved. New jobs use these instructions.":"Saved: same as the default, so the default is used.")}catch(z){w(z.message)}finally{b(!1)}}},N=async()=>{if(await n({title:`Reset the ${Se[e].label} instructions?`,message:"Your custom instructions are replaced with the built-in default. New jobs use the default.",confirmLabel:"Reset to default",danger:!0})){b(!0);try{const U=await q.resetAgentPrompt(e);a(U.instructions),r.reload(),w(null),y("Reset to the default instructions.")}catch(U){w(U.message)}finally{b(!1)}}},P=z=>{const U=E.current;if(!U||l===null)return;const I=`{{${z}}}`,Q=l.slice(0,U.selectionStart)+I+l.slice(U.selectionEnd),J=U.selectionStart+I.length;a(Q),requestAnimationFrame(()=>(U.focus(),U.setSelectionRange(J,J)))};return s.jsxs("section",{children:[s.jsx(fj,{agent:e,extra:i&&(i.customized?s.jsx(dt,{status:"stale",children:"custom instructions"}):s.jsx(dt,{status:"neutral",children:"default instructions"}))}),i&&s.jsx(lL,{info:i,onSaved:r.reload}),s.jsx(Pe,{error:r.error??g}),x&&!k&&s.jsx("div",{className:"ok-box",children:x}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx(bn,{value:o,onChange:u,items:[{id:"instructions",label:k?"Instructions •":"Instructions"},{id:"skills",label:i!=null&&i.skills.length?`Skills (${i.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void N(),disabled:v||!(i!=null&&i.customized),title:"Use the built-in instructions",children:[s.jsx(Pr,{size:14})," Reset to default"]}),s.jsxs("button",{className:"btn",onClick:()=>void D(),disabled:v||!k,children:[s.jsx(li,{size:14})," Save"]})]})]}),o==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["The agent's role and working rules. Agent Studio appends a fixed part to every prompt: input files, the ",s.jsx("code",{children:".env"})," environment, tool rules and the output JSON the pipeline reads. That part cannot be edited here; see ",s.jsx("b",{children:"Full prompt preview"}),". Project rules shared by all agents live in"," ",s.jsx(ye,{to:"/project",children:"CLAUDE.md"}),". Changes apply to jobs that start after saving."]}),i&&s.jsxs("div",{className:"ph-list","aria-label":"Insert placeholder",children:[s.jsx("span",{className:"muted small",children:"Insert:"}),Object.entries(i.placeholders).map(([z,U])=>s.jsx("button",{type:"button",className:"chip",title:U,onClick:()=>P(z),children:`{{${z}}}`},z))]}),s.jsx("textarea",{ref:E,className:"input prompt-editor",value:l??"",onChange:z=>(a(z.target.value),y(null)),spellCheck:!1,"aria-label":`${Se[e].label} instructions`,disabled:l===null}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[(l==null?void 0:l.length.toLocaleString())??0," characters",L?" · differs from the default":" · same as the default"]}),k&&s.jsx("button",{type:"button",className:"link-btn",onClick:()=>a(i.instructions),children:"Discard changes"})]})]}),o==="skills"&&i&&s.jsx(oL,{info:i,onSaved:()=>(r.reload(),f(null))}),o==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("div",{className:"row between",children:[s.jsxs("span",{className:"muted small",children:["What Claude Code receives",k?" (with your unsaved edits)":"",". Generic shows placeholders; pick a spec to see a real job with .env values (passwords and accounts masked)."]}),s.jsxs("select",{className:"select",value:c,onChange:z=>h(z.target.value),"aria-label":"Sample spec",children:[s.jsx("option",{value:"",children:"Generic (placeholders, no project data)"}),t.map(z=>s.jsx("option",{value:z.file,children:z.file},z.file))]})]}),s.jsx(Pe,{error:m}),d?s.jsxs("pre",{className:"prompt-preview",children:[d.instructionsPart,`
414
+ `]},Q))]}):!p&&s.jsx("p",{className:"muted",children:"Building preview…"})]})]}),y&&e&&s.jsx(zv,{title:"Run agent",onClose:()=>v(!1),onStart:(I,Q)=>q.createJob({type:"custom",agentId:e,...I?{spec:I}:{},...Q.trim()?{input:Q}:{}})})]})}const lA=["Read(.env)","Read(**/.env)","Read(.env.local)","Read(**/.env.local)","WebFetch","WebSearch"],aA={validator:{command:"playwright test tests/e2e/<spec>.spec.ts --project=chrome --repeat-each=3 --retries=0 --reporter=line,json",notes:["Runs after the QA Script Generator and after each QA Script Healer round (QA Validator ⇄ QA Script Healer loop, max rounds in Settings).","Passes only when every repetition passes: catches flaky scripts before they are accepted."]},runner:{command:"playwright test [files] [--grep <TC-IDs>] --project=chrome --repeat-each=<n> --reporter=line,json[,html]",notes:["Used by Run tests and Test runs.",'The HTML reporter is added when the run has "HTML report" on (default in Settings).']}};function oA(){const e=li().agent,t=Se[e];return t?t.llm?s.jsx(dA,{agent:e}):s.jsx(uA,{agent:e}):s.jsx(Pe,{error:`Unknown agent: ${e}`})}function pj({agent:e,extra:t}){const n=Se[e];return s.jsxs(s.Fragment,{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:n.label}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{className:"row",style:{alignItems:"flex-start"},children:[s.jsx(Ot,{agent:e,size:44}),s.jsxs("div",{children:[s.jsxs("h1",{className:"page-title",children:[n.label," ",t]}),s.jsxs("p",{className:"page-sub",children:[n.description," · ",n.llm?"LLM agent (Claude Code)":"Deterministic step"]})]})]})})]})}function uA({agent:e}){const t=aA[e];return s.jsxs("section",{children:[s.jsx(pj,{agent:e}),s.jsxs("div",{className:"card pad",children:[s.jsx("p",{className:"muted",children:"This step has no prompt: it runs Playwright Test directly (no shell, no LLM). It cannot write any file other than its report."}),t&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{children:"Command"}),s.jsx("pre",{className:"prompt-preview",children:t.command}),s.jsx("ul",{children:t.notes.map(n=>s.jsx("li",{children:n},n))})]})]})]})}function cA({info:e,onSaved:t}){const[n,r]=j.useState(!1),[i,l]=j.useState(null),a=async u=>{if(u!==e.model){r(!0);try{await q.saveAgentModel(e.agent,u),l(null),t()}catch(c){l(c.message)}finally{r(!1)}}},o=async()=>{r(!0);try{await q.resetAgentModel(e.agent),l(null),t()}catch(u){l(u.message)}finally{r(!1)}};return s.jsxs("div",{className:"row",style:{gap:10,margin:"4px 0 14px"},children:[s.jsx("span",{className:"muted small",children:"Model:"}),s.jsx("select",{className:"select",value:e.model,disabled:n,onChange:u=>void a(u.target.value),"aria-label":`${Se[e.agent].label} model`,children:Ch.map(u=>s.jsx("option",{value:u.id,title:u.label,children:u.label},u.id))}),s.jsx(dt,{status:e.modelCustomized?"stale":"neutral",children:e.modelCustomized?"custom model":"default model"}),e.modelCustomized&&s.jsxs("button",{type:"button",className:"btn ghost sm",disabled:n,onClick:()=>void o(),title:"Use the default model",children:[s.jsx(Rr,{size:12})," Reset"]}),s.jsx(Pe,{error:i})]})}function dA({agent:e}){var A;const{specs:t}=Xt(),n=In(),r=Me(()=>q.agentPrompts(),[e]),i=(A=r.data)==null?void 0:A.find(z=>z.agent===e),[l,a]=j.useState(null),[o,u]=j.useState("instructions"),[c,h]=j.useState(""),[d,f]=j.useState(null),[m,p]=j.useState(null),[g,w]=j.useState(null),[x,y]=j.useState(null),[v,b]=j.useState(!1),E=j.useRef(null);j.useEffect(()=>{i&&l===null&&a(i.instructions)},[i,l]),j.useEffect(()=>a(null),[e]);const k=i!==void 0&&l!==null&&l!==i.instructions,R=i!==void 0&&l!==null&&l.trim()!==i.defaultInstructions.trim(),T=mh(({currentLocation:z,nextLocation:U})=>k&&z.pathname!==U.pathname);Th(T,{title:"Discard the unsaved instructions?",message:"Your edits to this prompt will be lost.",confirmLabel:"Discard",danger:!0}),j.useEffect(()=>{if(o!=="preview"||l===null)return;const z=setTimeout(()=>{q.previewAgentPrompt(e,{instructions:l,...c?{spec:c}:{}}).then(U=>(f(U),p(null))).catch(U=>p(U.message))},300);return()=>clearTimeout(z)},[o,l,c,e]);const D=async()=>{if(l!==null){b(!0);try{const z=await q.saveAgentPrompt(e,l);a(z.instructions),r.reload(),w(null),y(z.customized?"Saved. New jobs use these instructions.":"Saved: same as the default, so the default is used.")}catch(z){w(z.message)}finally{b(!1)}}},C=async()=>{if(await n({title:`Reset the ${Se[e].label} instructions?`,message:"Your custom instructions are replaced with the built-in default. New jobs use the default.",confirmLabel:"Reset to default",danger:!0})){b(!0);try{const U=await q.resetAgentPrompt(e);a(U.instructions),r.reload(),w(null),y("Reset to the default instructions.")}catch(U){w(U.message)}finally{b(!1)}}},L=z=>{const U=E.current;if(!U||l===null)return;const I=`{{${z}}}`,Q=l.slice(0,U.selectionStart)+I+l.slice(U.selectionEnd),J=U.selectionStart+I.length;a(Q),requestAnimationFrame(()=>(U.focus(),U.setSelectionRange(J,J)))};return s.jsxs("section",{children:[s.jsx(pj,{agent:e,extra:i&&(i.customized?s.jsx(dt,{status:"stale",children:"custom instructions"}):s.jsx(dt,{status:"neutral",children:"default instructions"}))}),i&&s.jsx(cA,{info:i,onSaved:r.reload}),s.jsx(Pe,{error:r.error??g}),x&&!k&&s.jsx("div",{className:"ok-box",children:x}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head row between",children:[s.jsx(bn,{value:o,onChange:u,items:[{id:"instructions",label:k?"Instructions •":"Instructions"},{id:"skills",label:i!=null&&i.skills.length?`Skills (${i.skills.length})`:"Skills"},{id:"preview",label:"Full prompt preview"},{id:"permissions",label:"Permissions"}]}),s.jsxs("span",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>void C(),disabled:v||!(i!=null&&i.customized),title:"Use the built-in instructions",children:[s.jsx(Rr,{size:14})," Reset to default"]}),s.jsxs("button",{className:"btn",onClick:()=>void D(),disabled:v||!k,children:[s.jsx(us,{size:14})," Save"]})]})]}),o==="instructions"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["The agent's role and working rules. Agent Studio appends a fixed part to every prompt: input files, the ",s.jsx("code",{children:".env"})," environment, tool rules and the output JSON the pipeline reads. That part cannot be edited here; see ",s.jsx("b",{children:"Full prompt preview"}),". Project rules shared by all agents live in"," ",s.jsx(ye,{to:"/project",children:"CLAUDE.md"}),". Changes apply to jobs that start after saving."]}),i&&s.jsxs("div",{className:"ph-list","aria-label":"Insert placeholder",children:[s.jsx("span",{className:"muted small",children:"Insert:"}),Object.entries(i.placeholders).map(([z,U])=>s.jsx("button",{type:"button",className:"chip",title:U,onClick:()=>L(z),children:`{{${z}}}`},z))]}),s.jsx("textarea",{ref:E,className:"input prompt-editor",value:l??"",onChange:z=>(a(z.target.value),y(null)),spellCheck:!1,"aria-label":`${Se[e].label} instructions`,disabled:l===null}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[(l==null?void 0:l.length.toLocaleString())??0," characters",R?" · differs from the default":" · same as the default"]}),k&&s.jsx("button",{type:"button",className:"link-btn",onClick:()=>a(i.instructions),children:"Discard changes"})]})]}),o==="skills"&&i&&s.jsx(hA,{info:i,onSaved:()=>(r.reload(),f(null))}),o==="preview"&&s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("div",{className:"row between",children:[s.jsxs("span",{className:"muted small",children:["What Claude Code receives",k?" (with your unsaved edits)":"",". Generic shows placeholders; pick a spec to see a real job with .env values (passwords and accounts masked)."]}),s.jsxs("select",{className:"select",value:c,onChange:z=>h(z.target.value),"aria-label":"Sample spec",children:[s.jsx("option",{value:"",children:"Generic (placeholders, no project data)"}),t.map(z=>s.jsx("option",{value:z.file,children:z.file},z.file))]})]}),s.jsx(Pe,{error:m}),d?s.jsxs("pre",{className:"prompt-preview",children:[d.instructionsPart,`
415
415
 
416
416
  `,d.fixedPart.split(`
417
417
  `).map((z,U)=>s.jsxs("span",{className:U===0?"fixed-head":"fixed",children:[z,`
418
- `]},U))]}):!m&&s.jsx("p",{className:"muted",children:"Building preview…"})]}),o==="permissions"&&s.jsxs("div",{className:"pad",children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. Permissions are fixed by Agent Studio."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:d?d.allowedTools.map(z=>s.jsx("code",{children:z},z)):s.jsx(uL,{agent:e,onLoad:f})}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:((d==null?void 0:d.disallowedTools)??nL).map(z=>s.jsx("code",{className:"deny",children:z},z))})]})]})]})}function oL({info:e,onSaved:t}){var d,f,m;const n=Ie(()=>q.skills(),[e.agent]),[r,i]=j.useState(!1),[l,a]=j.useState(null),o=e.skills,u=new Set((d=n.data)==null?void 0:d.map(p=>p.name)),c=async p=>{i(!0);try{await q.saveAgentSkills(e.agent,p),a(null),t()}catch(g){a(g.message)}finally{i(!1)}},h=p=>{const g=o.includes(p.name);p.error&&!g||c(g?o.filter(w=>w!==p.name):[...o,p.name])};return s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Select Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," (frontmatter ",s.jsx("code",{children:"name"})," + ",s.jsx("code",{children:"description"}),", then the skill's instructions). The skill content is not copied into the instructions: when the agent runs, Claude Code loads the selected skills itself with its Skill tool and applies them on top of the agent's role and persona. Claude Code's own skills (built-in, plugins such as superpowers) stay available too; nothing is blocked. The agent log shows every skill used (",s.jsx("code",{children:"[skill]"})," lines). Changes apply to jobs that start after saving."]}),s.jsx(Pe,{error:n.error??l}),e.skillsUnavailable.length>0&&s.jsxs("div",{className:"row",style:{gap:8},children:[s.jsxs("span",{className:"chip warn",children:["Skipped when jobs run: ",e.skillsUnavailable.join(", ")]}),s.jsx("span",{className:"muted small",children:"missing or invalid on disk"}),n.data&&e.skillsUnavailable.some(p=>!u.has(p))&&s.jsx("button",{type:"button",className:"link-btn",disabled:r,onClick:()=>void c(o.filter(p=>u.has(p))),children:"Remove missing"})]}),((f=n.data)==null?void 0:f.length)===0&&s.jsxs("p",{className:"muted",children:["No skills found. Create ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," in the project, then click ",s.jsx("b",{children:"Rescan folder"}),"."]}),s.jsx("div",{className:"skill-list",children:(m=n.data)==null?void 0:m.map(p=>{const g=o.includes(p.name);return s.jsxs("label",{className:`skill-item ${g?"on":""} ${p.error&&!g?"invalid":""}`,title:p.error??p.dir,children:[s.jsx("input",{type:"checkbox",checked:g,disabled:r||!!p.error&&!g,onChange:()=>h(p),"aria-label":`Attach skill ${p.name}`}),s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("b",{children:p.name}),g&&s.jsx(dt,{status:"stale",children:o.length>1?`attached #${o.indexOf(p.name)+1}`:"attached"}),p.error&&s.jsx("span",{className:"chip fail",children:"invalid"})]}),s.jsx("span",{className:"skill-desc muted small",children:p.error??p.description}),s.jsxs("span",{className:"skill-meta muted small",children:[s.jsxs("code",{children:[p.dir,"/SKILL.md"]}),s.jsxs("span",{children:[p.chars.toLocaleString()," characters"]}),p.files.length>0&&s.jsxs("span",{title:p.files.join(", "),children:["+",p.files.length," file",p.files.length===1?"":"s"]}),p.allowedTools.length>0&&s.jsxs("span",{className:"chip warn",title:"From the skill's frontmatter: Claude Code allows these tools while the skill is active, on top of the agent's permissions",children:["allowed-tools: ",p.allowedTools.join(" ")]})]})]},p.name)})}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[o.length," attached · see Full prompt preview for the result"]}),s.jsxs("button",{type:"button",className:"btn ghost sm",onClick:n.reload,disabled:r,children:[s.jsx(Pr,{size:12})," Rescan folder"]})]})]})}function uL({agent:e,onLoad:t}){return j.useEffect(()=>{q.previewAgentPrompt(e,{}).then(t).catch(()=>{})},[e,t]),s.jsx("span",{className:"muted small",children:"Loading…"})}let cL=0;const pj=()=>`b${Date.now().toString(36)}${(cL++).toString(36)}`;function mj(e,t=pj){return e.map(n=>n.kind==="agent"?{uid:t(),kind:"agent",agent:n.agent}:{uid:t(),kind:"loop",maxIterations:n.maxIterations,endsWhen:n.endsWhen??"first",steps:mj(n.steps.map(os),t)})}const gj=e=>({kind:"loop",steps:e.steps.map(t=>t.kind==="agent"?t.agent:gj(t)),maxIterations:e.maxIterations,...e.endsWhen==="last"?{endsWhen:"last"}:{}});function xj(e){return e.map(t=>t.kind==="agent"?{kind:"agent",agent:t.agent}:gj(t))}const cd=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),yj=(e,t)=>e.length<=t.length&&e.every((n,r)=>n===t[r]);function Xh(e,t){let n=e,r;for(const i of t){if(r=n[i],!r)return;n=r.kind==="loop"?r.steps:[]}return r}function vj(e,t){if(t.length===0)return e;const n=Xh(e,t);return(n==null?void 0:n.kind)==="loop"?n.steps:null}const jj=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(jj));function gl(e,t,n){if(t.length===0)return n(e);const[r,...i]=t;return e.map((l,a)=>a===r&&l.kind==="loop"?{...l,steps:gl(l.steps,i,n)}:l)}const dL=(e,t)=>t.from==="block"?Xh(e,t.path)??null:null;function wj(e,t,n){const r=vj(e,n.parent);if(!r||n.index<0||n.index>r.length)return!1;let i;if(t.from==="palette")i=0;else if(t.from==="palette-loop")i=1;else{const a=dL(e,t);if(!a||yj(t.path,n.parent))return!1;i=jj(a)}return n.parent.length+i>to?!1:t.from==="block"&&cd(t.path.slice(0,-1),n.parent)||r.length<(n.parent.length===0?Sa:Na)}function dd(e,t,n,r=pj){if(!wj(e,t,n))return e;let i,l=e,a=n;if(t.from==="palette")i={uid:r(),kind:"agent",agent:t.agent};else if(t.from==="palette-loop")i={uid:r(),kind:"loop",steps:[],maxIterations:bb,endsWhen:"first"};else{const o=t.path.slice(0,-1),u=t.path[t.path.length-1];if(cd(o,n.parent)&&(n.index===u||n.index===u+1))return e;if(i=Xh(e,t.path),l=gl(e,o,c=>c.filter((h,d)=>d!==u)),cd(o,n.parent))n.index>u&&(a={...n,index:n.index-1});else if(yj(o,n.parent)&&n.parent[o.length]>u){const c=[...n.parent];c[o.length]-=1,a={...n,parent:c}}}return gl(l,a.parent,o=>[...o.slice(0,a.index),i,...o.slice(a.index)])}function Qm(e,t,n){const r=t.slice(0,-1),i=t[t.length-1],l=vj(e,r),a=i+n;return!l||a<0||a>=l.length?e:dd(e,{from:"block",path:t},{parent:r,index:n<0?a:a+1})}function hL(e,t){const n=t[t.length-1];return gl(e,t.slice(0,-1),r=>r.filter((i,l)=>l!==n))}function qm(e,t,n){const r=t[t.length-1];return gl(e,t.slice(0,-1),i=>i.map((l,a)=>a===r&&l.kind==="loop"?{...l,...n}:l))}const fL=Object.keys(Se).filter(e=>e!=="custom"),Fu=(e,t,n,r="")=>JSON.stringify({name:e.trim(),description:t.trim(),workDir:r.trim(),steps:xj(n)});function Gm(){const{id:e}=ii(),t=!e||e==="new",[n]=mh(),r=ut(),i=Kn(),l=cs(),a=Ie(()=>q.settings()),o=Ie(()=>q.customAgents()).data??[],u=Ie(()=>t?Promise.resolve(null):q.pipeline(e),[e]),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(""),[g,w]=j.useState([]),[x,y]=j.useState(),[v,b]=j.useState(null),[E,k]=j.useState(!1),[L,T]=j.useState(null),[D,N]=j.useState(null),[P,A]=j.useState(!1),[z,U]=j.useState(!1),I=j.useRef(!1),Q=j.useMemo(()=>{var W;return Tb(((W=a.data)==null?void 0:W.settings.maxHealRounds)??2)},[a.data]),J=(W,fe,Ze=!0)=>{const Xt=mj(W.steps);h(W.name),f(W.description),p(W.workDir??""),w(Xt),y(fe),b(Ze?Fu(W.name,W.description,Xt,W.workDir??""):Fu("","",[],"")),k(!0)};j.useEffect(()=>{if(!t){u.data&&J(u.data,u.data.updatedAt);return}const W=n.get("from");if(W&&!a.data)return;const fe=Q.find(Ze=>Ze.id===W);fe?J({...fe,name:`${fe.name} (custom)`},void 0,!1):J({name:"",description:"",steps:[]},void 0)},[t,u.data,a.data]);const H=Fu(c,d,g,m),X=E&&v!==null&&H!==v,S=Eb({name:c,description:d,workDir:m,steps:xj(g)}),ae=S.ok?[]:S.errors,O=ph(({currentLocation:W,nextLocation:fe})=>X&&!I.current&&W.pathname!==fe.pathname);Th(O,{title:"Discard the unsaved pipeline changes?",message:"Your changes to this pipeline will be lost.",confirmLabel:"Discard",danger:!0});const C=async()=>{if(S.ok){A(!0);try{const W=t?await q.createPipeline(S.value):await q.savePipeline(e,S.value,x);N(null),J(W,W.updatedAt),U(!0),setTimeout(()=>U(!1),2e3),l.success(t?`Pipeline "${W.name}" created`:`Pipeline "${W.name}" saved`),t&&(I.current=!0,r(`/agents/pipelines/${W.id}`,{replace:!0}))}catch(W){N(W.message)}finally{A(!1)}}},F=async()=>{var Ze;if(t)return;const W=((Ze=u.data)==null?void 0:Ze.name)||c||e;if(await i({title:`Delete the pipeline "${W}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0})){A(!0);try{await q.deletePipeline(e),I.current=!0,l.success(`Pipeline "${W}" deleted`),r("/agents?tab=custom",{replace:!0})}catch(Xt){N(Xt.message),A(!1)}}},Z=(W,fe)=>{W.dataTransfer.effectAllowed=fe.from==="palette"||fe.from==="palette-loop"?"copy":"move",W.dataTransfer.setData("text/plain","qa-pipeline"),T(fe)},oe=()=>T(null),B=W=>{L&&w(fe=>dd(fe,L,W)),T(null)},he=W=>w(fe=>dd(fe,W,{parent:[],index:fe.length})),ze={blocks:g,drag:L,customAgents:o,setBlocks:w,startDrag:Z,endDrag:oe,drop:B},Ke=t?"New pipeline":c||"Pipeline";return!t&&u.error?s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:"Pipeline"}]}),s.jsx(Pe,{error:u.error}),s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back to Agents"})]}):s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:Ke}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:Ke}),s.jsxs("p",{className:"page-sub",children:["Drag agents from the palette into the pipeline, reorder them by dragging, and add a ",s.jsx("b",{children:"Loop"})," to repeat agents. Each loop runs its entries in order and ends when its first entry passes (check first) or when its last entry passes (work first, then check), or after its maximum number of iterations. Drop a loop inside another loop to nest it (up to ",to," levels); a nested loop in the check position (first, or last for loops that end when the last entry passes) ends the outer loop when it passes. Run it from the chat with ",s.jsx("code",{children:"/p:<name> <spec.md> [input]"})," or a prompt that names a spec or TC-ID (",s.jsx("code",{children:"/p:<name> check TC-LOGIN-001 on mobile"}),"); a pipeline with only custom agents or the Context Writer also runs from a prompt alone: ",s.jsx("code",{children:"/p:<name> <prompt>"}),"."]})]}),s.jsxs("span",{className:"row",children:[!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void F(),disabled:P,children:[s.jsx(Rr,{size:14})," Delete"]}),s.jsxs("button",{className:"btn",onClick:()=>void C(),disabled:P||!E||!S.ok||!t&&!X,title:ae[0],children:[s.jsx(li,{size:14})," ",z?"Saved":t?"Create pipeline":"Save"]})]})]}),s.jsx(Pe,{error:D}),s.jsxs("div",{className:"card pl-meta",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:c,maxLength:Bc,onChange:W=>h(W.target.value),placeholder:"e.g. Nightly regression"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:d,maxLength:Hc,onChange:W=>f(W.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field wide",children:[s.jsx("span",{children:"Working directory"}),s.jsx("input",{className:"input",value:m,onChange:W=>p(W.target.value),placeholder:"Optional"}),s.jsx("span",{className:"muted small",children:"Custom agents run here (e.g. D:\\my-app). Empty: this QA repository."})]}),t&&s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Start from"}),s.jsxs("select",{className:"input",value:n.get("from")??"",onChange:async W=>{const fe=W.target.value;if(g.length&&!await i({title:"Replace the current steps?",message:"The pipeline steps are replaced with the chosen starting point.",confirmLabel:"Replace",danger:!0}))return;r(fe?`/agents/pipelines/new?from=${fe}`:"/agents/pipelines/new",{replace:!0});const Ze=Q.find(Xt=>Xt.id===fe);J(Ze?{...Ze,name:`${Ze.name} (custom)`}:{name:"",description:"",steps:[]},void 0,!Ze)},children:[s.jsx("option",{value:"",children:"Blank pipeline"}),Q.map(W=>s.jsxs("option",{value:W.id,children:["Built-in: ",W.name]},W.id))]})]})]}),s.jsxs("div",{className:"pl-layout",children:[s.jsxs("aside",{className:"card pl-palette","aria-label":"Agent palette",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Palette"})}),s.jsx("p",{className:"muted small pl-hint",children:"Drag onto the pipeline, or press + to add at the end."}),s.jsxs("div",{className:"pl-tile pl-tile-loop",draggable:!0,onDragStart:W=>Z(W,{from:"palette-loop"}),onDragEnd:oe,children:[s.jsx("span",{className:"pl-loop-icon",children:s.jsx(rs,{size:16})}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:"Loop"}),s.jsx("span",{className:"muted small",children:"Repeat agents up to a maximum count; loops can be nested"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":"Add a loop",onClick:()=>he({from:"palette-loop"}),children:s.jsx(Qt,{size:14})})]}),fL.map(W=>s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:fe=>Z(fe,{from:"palette",agent:W}),onDragEnd:oe,children:[s.jsx(Ot,{agent:W,size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:Se[W].label}),s.jsx("span",{className:"muted small",children:Se[W].llm?"LLM agent":"Playwright step"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${Se[W].label}`,onClick:()=>he({from:"palette",agent:W}),children:s.jsx(Qt,{size:14})})]},W)),o.map(W=>{const fe=Eh(W.id);return s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:Ze=>Z(Ze,{from:"palette",agent:fe}),onDragEnd:oe,children:[s.jsx(Ot,{agent:"custom",size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:W.name}),s.jsx("span",{className:"muted small",children:"Custom agent"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${W.name}`,onClick:()=>he({from:"palette",agent:fe}),children:s.jsx(Qt,{size:14})})]},W.id)}),o.length===0&&s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost sm",children:[s.jsx(Qt,{size:14})," New agent"]})]}),s.jsxs("div",{className:"card pl-canvas","aria-label":"Pipeline",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Pipeline"}),s.jsxs("span",{className:"muted small",children:[g.length," block",g.length===1?"":"s"]})]}),s.jsxs("div",{className:"pl-flow",children:[s.jsx("span",{className:"pl-terminal",children:"Start"}),g.map((W,fe)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(uo,{tree:ze,target:{parent:[],index:fe}}),s.jsx(Sj,{tree:ze,block:W,path:[fe],siblings:g.length})]},W.uid)),s.jsx(uo,{tree:ze,target:{parent:[],index:g.length},empty:g.length===0}),s.jsx("span",{className:"pl-terminal",children:"End"})]}),E&&ae.length>0&&(g.length>0||c)&&s.jsx("div",{className:"warn-box",role:"status",children:ae.join(`
419
- `)})]})]})]})}const kj=e=>e.map(t=>t+1).join("."),bj=(e,t)=>(e==null?void 0:e.from)==="block"&&e.path.length===t.length&&e.path.every((n,r)=>n===t[r]);function Sj({tree:e,block:t,path:n,siblings:r,parentEndsWhen:i}){var m;const{drag:l,customAgents:a,startDrag:o,endDrag:u}=e,c=n.length>1,h=n[n.length-1],d=c&&(i==="last"?h===r-1:h===0),f=p=>{p.stopPropagation(),o(p,{from:"block",path:n})};if(t.kind==="agent"){const p=Rl(t.agent,a);return s.jsxs("div",{className:`pl-block ${c?"inner":""} ${bj(l,n)?"dragging":""}`,draggable:!0,onDragStart:f,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:kj(n)}),s.jsx(Ot,{agent:Hh(t.agent),size:c?26:30}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:p}),((m=a.find(g=>Eh(g.id)===t.agent))==null?void 0:m.review)==="human"&&s.jsx("span",{className:"hr-badge",children:"Human review"}),d?s.jsx("span",{className:"muted small",children:"Loop ends when this agent passes"}):!c&&s.jsx("span",{className:"muted small",children:Sl(t.agent)?"Custom agent":Se[t.agent].description})]}),s.jsx(Nj,{tree:e,path:n,count:r,label:p})]})}return s.jsx(pL,{tree:e,loop:t,path:n,siblings:r,first:d,onDragStart:f})}function pL({tree:e,loop:t,path:n,siblings:r,first:i,onDragStart:l}){const{drag:a,setBlocks:o,endDrag:u}=e,c=kj(n),h=`loop ${c}`;return s.jsxs("div",{className:`pl-loop ${n.length>1?"nested":""} ${bj(a,n)?"dragging":""}`,"data-depth":n.length,children:[s.jsxs("div",{className:"pl-loop-head",draggable:!0,onDragStart:l,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:c}),s.jsx("span",{className:"pl-loop-icon",children:s.jsx(rs,{size:15})}),s.jsxs("span",{className:"pl-loop-title",children:[s.jsx("b",{children:n.length>1?"Nested loop":"Loop"}),i&&s.jsx("span",{className:"muted small",children:"Outer loop ends when this loop passes"})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Max iterations"}),s.jsx("input",{className:"input",type:"number",min:1,max:pl,step:1,value:t.maxIterations??"","aria-label":`Maximum iterations of ${h}`,onChange:d=>o(f=>qm(f,n,{maxIterations:d.target.value===""?null:Math.max(1,Math.min(pl,Math.round(Number(d.target.value))))}))})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Ends when"}),s.jsxs("select",{className:"input",value:t.endsWhen,"aria-label":`When ${h} ends`,onChange:d=>o(f=>qm(f,n,{endsWhen:d.target.value})),children:[s.jsx("option",{value:"first",children:"first entry passes"}),s.jsx("option",{value:"last",children:"last entry passes"})]})]}),s.jsx(Nj,{tree:e,path:n,count:r,label:h})]}),s.jsxs("div",{className:"pl-loop-body",children:[t.steps.map((d,f)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(uo,{tree:e,target:{parent:n,index:f},inner:!0}),s.jsx(Sj,{tree:e,block:d,path:[...n,f],siblings:t.steps.length,parentEndsWhen:t.endsWhen})]},d.uid)),s.jsx(uo,{tree:e,target:{parent:n,index:t.steps.length},inner:!0,empty:t.steps.length===0}),s.jsxs("div",{className:"pl-loop-foot muted small",children:[s.jsx(rs,{size:12})," repeats up to ",t.maxIterations??"?"," time",t.maxIterations===1?"":"s"]})]})]})}function uo({tree:e,target:t,inner:n,empty:r}){const{blocks:i,drag:l,drop:a}=e,[o,u]=j.useState(!1),c=l!==null&&wj(i,l,t);return s.jsx("div",{className:`pl-gap ${n?"inner":""} ${r?"empty":""} ${c?"active":""} ${o&&c?"over":""}`,onDragOver:h=>{c&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer.dropEffect=l.from==="palette"||l.from==="palette-loop"?"copy":"move",o||u(!0))},onDragLeave:()=>u(!1),onDrop:h=>{h.preventDefault(),h.stopPropagation(),u(!1),a(t)},children:r?s.jsx("span",{className:"muted small",children:n?"Drop agents or a loop here to repeat them":"Drag agents or a loop here"}):s.jsx("span",{className:"pl-arrow",children:"↓"})})}function Nj({tree:e,path:t,count:n,label:r}){const{setBlocks:i}=e,l=t[t.length-1];return s.jsxs("span",{className:"pl-actions",children:[s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} up`,disabled:l===0,onClick:()=>i(a=>Qm(a,t,-1)),children:"↑"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} down`,disabled:l===n-1,onClick:()=>i(a=>Qm(a,t,1)),children:"↓"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Remove ${r}`,onClick:()=>i(a=>hL(a,t)),children:s.jsx(wr,{size:13})})]})}const mL=[{id:"1",label:"24 h"},{id:"7",label:"7 days"},{id:"30",label:"30 days"},{id:"90",label:"90 days"}],ur=e=>e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,Rn=(e,t)=>e.trackedRuns?sn(t):"—";function gL(e){const t=new Map(e.byDay.map(i=>[i.day,i])),n=[],r=new Date;for(let i=Math.max(e.days,1)-1;i>=0;i--){const l=new Date(r.getTime()-i*864e5).toISOString().slice(0,10);n.push(t.get(l)??{day:l,runs:0,trackedRuns:0,costUsd:0,turns:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0})}return n}function xL(e){if(e<=0)return 1;const t=10**Math.floor(Math.log10(e));return([1,2,2.5,5,10].find(n=>n*t>=e)??10)*t}const Ti=e=>new Date(`${e}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric"});function yL({report:e}){const t=gL(e),n=xL(Math.max(...t.map(r=>r.costUsd)));return s.jsxs("div",{children:[s.jsxs("div",{className:"usage-chart",role:"img","aria-label":`Estimated cost per day over the last ${e.days} days`,children:[[.5,1].map(r=>s.jsx("div",{className:"usage-chart-gridline",style:{bottom:`${r*100}%`},children:s.jsx("span",{children:Gt(n*r)})},r)),t.map(r=>s.jsxs("div",{className:`bar-col ${r.costUsd?"":"zero"}`,tabIndex:0,"aria-label":`${Ti(r.day)}: ${Gt(r.costUsd)}, ${r.runs} runs`,children:[s.jsx("i",{style:{height:`${Math.max(r.costUsd/n*100,r.costUsd?2:0)}%`}}),s.jsxs("span",{className:"tip",children:[s.jsx("b",{children:Ti(r.day)})," · ",Gt(r.costUsd),s.jsx("br",{}),r.runs," run",r.runs===1?"":"s"," · ",sn(ur(r))," in / ",sn(r.outputTokens)," out"]})]},r.day))]}),s.jsxs("div",{className:"usage-axis",children:[s.jsx("span",{children:Ti(t[0].day)}),t.length>2&&s.jsx("span",{children:Ti(t[Math.floor(t.length/2)].day)}),s.jsx("span",{children:Ti(t[t.length-1].day)})]})]})}function ca({icon:e,label:t,value:n,sub:r}){return s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:t}),s.jsx("span",{className:"stat-icon",children:e})]}),s.jsx("div",{className:"stat-value",children:n}),r&&s.jsx("div",{className:"muted small",children:r})]})}function Uu({title:e,rows:t,name:n,total:r}){return s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:e})}),t.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{className:"num",children:"Runs"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"Share"})]})}),s.jsx("tbody",{children:t.map((i,l)=>s.jsxs("tr",{children:[s.jsx("td",{children:n(i)}),s.jsx("td",{className:"num",children:i.runs}),s.jsx("td",{className:"num",children:Rn(i,ur(i))}),s.jsx("td",{className:"num",children:Rn(i,i.outputTokens)}),s.jsx("td",{className:"num",children:Gt(i.costUsd)}),s.jsx("td",{children:s.jsx("div",{className:"share-bar",title:`${r?Math.round(i.costUsd/r*100):0}% of cost`,children:s.jsx("i",{style:{width:`${r?i.costUsd/r*100:0}%`}})})})]},l))})]})})]})}const Cj="qa-studio.usage.recentView";function vL(){try{return localStorage.getItem(Cj)==="jobs"?"jobs":"runs"}catch{return"runs"}}function jL({job:e}){return s.jsxs(s.Fragment,{children:[s.jsxs(ye,{to:`/runs/${e.jobId}`,children:["#",e.jobId," ",kr[e.jobType]??e.jobType]}),s.jsx("div",{className:"muted small",children:e.name??e.target})]})}function wL({jobs:e}){const[t,n]=j.useState(()=>new Set),r=l=>n(a=>{const o=new Set(a);return o.has(l)?o.delete(l):o.add(l),o}),i=e.length>0&&e.every(l=>t.has(l.jobId));return e.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat usage-jobs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(i?new Set:new Set(e.map(l=>l.jobId))),children:i?"Collapse all":"Expand all"})}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:e.map(l=>{const a=t.has(l.jobId),o=[...new Set(l.agentRuns.map(u=>u.model).filter(Boolean))];return s.jsxs(j.Fragment,{children:[s.jsxs("tr",{className:"usage-job-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-job-cell",children:[s.jsx("button",{className:"usage-expand",onClick:()=>r(l.jobId),"aria-expanded":a,"aria-label":`${a?"Hide":"Show"} the LLM runs of job #${l.jobId}`,children:s.jsx(ei,{size:12,open:a})}),s.jsx("span",{children:s.jsx(jL,{job:l})})]})}),s.jsx("td",{children:s.jsxs("span",{className:"usage-agent-icons",title:l.agentRuns.map(u=>{var c;return((c=Se[u.agent])==null?void 0:c.label)??u.agent}).join(" → "),children:[l.agentRuns.slice(0,6).map(u=>s.jsx(Ot,{agent:u.agent,size:20},u.runId)),s.jsxs("span",{className:"muted small",children:[l.runs," run",l.runs===1?"":"s"]})]})}),s.jsx("td",{children:s.jsx(kn,{status:l.status})}),s.jsx("td",{children:o.length?o.map(u=>s.jsx("code",{children:u},u)):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:l.turns}),s.jsx("td",{className:"num",children:Rn(l,ur(l))}),s.jsx("td",{className:"num",children:Rn(l,l.outputTokens)}),s.jsx("td",{className:"num strong",children:Gt(l.costUsd)}),s.jsx("td",{className:"small",children:Pt(l.at)})]}),a&&l.agentRuns.map(u=>{var c;return s.jsxs("tr",{className:"usage-sub-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-sub-name",children:[s.jsx(Ot,{agent:u.agent,size:20})," ",((c=Se[u.agent])==null?void 0:c.label)??u.agent]})}),s.jsxs("td",{className:"muted small",children:["run #",u.runId]}),s.jsx("td",{children:s.jsx(kn,{status:u.status})}),s.jsx("td",{children:u.model?s.jsx("code",{children:u.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:u.turns}),s.jsx("td",{className:"num",children:Rn(u,ur(u))}),s.jsx("td",{className:"num",children:Rn(u,u.outputTokens)}),s.jsx("td",{className:"num",children:Gt(u.costUsd)}),s.jsx("td",{className:"small",children:Pt(u.at)})]},u.runId)})]},l.jobId)})})]})})}function kL(){const[e,t]=j.useState(vL),n=d=>{t(d);try{localStorage.setItem(Cj,d)}catch{}},[r,i]=j.useState("30"),{data:l,error:a,reload:o}=Ie(()=>q.usage(Number(r)),[r]),u=l==null?void 0:l.totals,c=u&&ur(u)?Math.round(u.cacheReadTokens/ur(u)*100):0,h=u?u.runs-u.trackedRuns:0;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Claude usage"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Claude usage"}),s.jsxs("p",{className:"page-sub",children:["Tokens and estimated cost of the Claude Code agents run by Agent Studio (QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer, Context Writer). The cost is Claude Code's API-price estimate. On a Claude subscription, check plan limits with ",s.jsx("code",{children:"/usage"})," in Claude Code."]})]}),s.jsxs("div",{className:"row",children:[s.jsx(bn,{value:r,onChange:i,items:mL}),s.jsx("button",{className:"btn ghost",onClick:o,title:"Refresh","aria-label":"Refresh",children:s.jsx(Pr,{size:15})})]})]}),s.jsx(Pe,{error:a}),l&&u&&s.jsxs(s.Fragment,{children:[h>0&&s.jsxs("div",{className:"warn-box",style:{marginBottom:14},children:[h," of ",u.runs," runs in this range were recorded before token tracking was added: they count toward cost and runs, but their tokens show as —."]}),s.jsxs("div",{className:"stats usage-stats",children:[s.jsx(ca,{icon:s.jsx(Dy,{size:16}),label:"Estimated cost",value:Gt(u.costUsd),sub:`${u.runs?Gt(u.costUsd/u.runs):"—"} per run`}),s.jsx(ca,{icon:s.jsx(Iy,{size:16}),label:"LLM agent runs",value:u.runs,sub:`${u.turns.toLocaleString()} turns`}),s.jsx(ca,{icon:s.jsx(ft,{size:16}),label:"Tokens in",value:Rn(u,ur(u)),sub:u.trackedRuns?`${c}% served from cache`:"No token data yet"}),s.jsx(ca,{icon:s.jsx(ft,{size:16}),label:"Tokens out",value:Rn(u,u.outputTokens),sub:u.trackedRuns?`${sn(u.inputTokens)} uncached input`:"No token data yet"})]}),s.jsxs("div",{className:"card pad",style:{marginBottom:14},children:[s.jsxs("div",{className:"row between",style:{marginBottom:18},children:[s.jsx("h3",{className:"card-title",children:"Estimated cost per day"}),s.jsxs("span",{className:"muted small",children:["Since ",new Date(l.since).toLocaleString("en-US",{hour12:!1})]})]}),s.jsx(yL,{report:l})]}),s.jsxs("div",{className:"overview-grid",style:{marginBottom:14},children:[s.jsx(Uu,{title:"By spec",rows:l.bySpec,total:u.costUsd,name:d=>d.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${d.target}`,children:d.target}):d.target}),s.jsx(Uu,{title:"By agent",rows:l.byAgent,total:u.costUsd,name:d=>{var f;return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,whiteSpace:"nowrap"},children:[s.jsx(Ot,{agent:d.agent,size:22})," ",((f=Se[d.agent])==null?void 0:f.label)??d.agent]})}})]}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(Uu,{title:"By model",rows:l.byModel,total:u.costUsd,name:d=>s.jsx("code",{children:d.model})})}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent LLM runs"}),s.jsx(bn,{value:e,onChange:n,items:[{id:"runs",label:"Runs"},{id:"jobs",label:"Group by job"}]})]}),e==="jobs"?s.jsx(wL,{jobs:l.recentJobs}):l.recent.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range. Usage is recorded for agent runs from this version of Agent Studio onward."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:l.recent.map(d=>{var f;return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsxs(ye,{to:`/runs/${d.jobId}`,children:["#",d.jobId," ",kr[d.jobType]]}),s.jsx("div",{className:"muted small",children:d.target})]}),s.jsx("td",{children:((f=Se[d.agent])==null?void 0:f.label)??d.agent}),s.jsx("td",{children:s.jsx(kn,{status:d.status})}),s.jsx("td",{children:d.model?s.jsx("code",{children:d.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:d.turns}),s.jsx("td",{className:"num",children:Rn(d,ur(d))}),s.jsx("td",{className:"num",children:Rn(d,d.outputTokens)}),s.jsx("td",{className:"num",children:Gt(d.costUsd)}),s.jsx("td",{className:"small",children:Pt(d.at)})]},d.runId)})})]})})]})]})]})}const Pi=e=>`${e.spec}#${e.tcId}`;function bL(e){return e.target==="all"?"All tests":e.args.tcId?"1 TC":"Whole spec"}function SL({counts:e}){const t=Object.values(e).reduce((r,i)=>r+i,0);if(!t)return s.jsx("span",{className:"muted small",children:"—"});const n=["passed","flaky","failed","skipped"];return s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("span",{className:"tr-progress",role:"img","aria-label":n.filter(r=>e[r]).map(r=>`${e[r]} ${r}`).join(", "),children:n.map(r=>e[r]?s.jsx("i",{className:r,style:{width:`${e[r]/t*100}%`},title:`${e[r]} ${r}`},r):null)}),s.jsxs("span",{className:"small",children:[e.passed??0,"/",t]})]})}function NL(){const e=ut(),t=Pl(),{data:n,error:r,reload:i}=Ie(()=>q.testRuns({page:t.page,pageSize:t.pageSize}),[t.page,t.pageSize]),l=(n==null?void 0:n.items)??[],a=l.some(o=>o.status==="queued"||o.status==="running");return j.useEffect(()=>{if(!a)return;const o=setInterval(i,2e3);return()=>clearInterval(o)},[a,i]),s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test runs"}),s.jsx("p",{className:"page-sub",children:"Pick test cases, name the run, execute it and review the results. Results use the line reporter; the Playwright HTML report is optional."})]}),s.jsxs(ye,{className:"btn",to:"/test-runs/new",children:[s.jsx(Qt,{size:15})," New test run"]})]}),s.jsx(Pe,{error:r}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Results"}),s.jsx("th",{className:"num",children:"Cases"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Report"})]})}),s.jsx("tbody",{children:l.map(o=>s.jsxs("tr",{onClick:()=>e(`/runs/${o.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{children:[s.jsx("div",{className:"strong",children:o.args.name??`Test run #${o.id}`}),s.jsxs("div",{className:"muted small",children:["#",o.id,o.args.repeatEach&&o.args.repeatEach>1?` · ${o.args.repeatEach}×`:"",o.args.retries!==void 0?` · retries ${o.args.retries}`:""]})]}),s.jsx("td",{children:s.jsx(kn,{status:o.status})}),s.jsx("td",{children:s.jsx(SL,{counts:o.counts})}),s.jsx("td",{className:"num",children:o.args.selection?o.caseCount:s.jsx("span",{className:"muted small",children:bL(o)})}),s.jsx("td",{className:"muted small",children:Pt(o.startedAt??o.createdAt)}),s.jsx("td",{className:"muted small",children:us(o.startedAt,o.finishedAt)}),s.jsx("td",{onClick:u=>u.stopPropagation(),children:o.hasHtmlReport?s.jsxs("a",{className:"btn ghost",href:gh(o.id),target:"_blank",rel:"noreferrer",children:[s.jsx(bh,{size:13})," HTML"]}):s.jsx("span",{className:"muted small",children:"line only"})})]},o.id))})]}),n&&l.length===0&&s.jsxs("p",{className:"muted",style:{padding:16},children:["No test runs yet. ",s.jsx(ye,{to:"/test-runs/new",children:"Create the first one"}),"."]}),n&&s.jsx(fs,{page:t.page,pageSize:t.pageSize,total:n.total,onPage:t.setPage,onPageSize:t.setPageSize,label:"runs"})]})]})}const CL=8;function EL({query:e,onQuery:t,tags:n,allTags:r,onToggleTag:i,onClearTags:l}){const[a,o]=j.useState(!1),[u,c]=j.useState(0),h=j.useRef(null),d=e.trim().toLowerCase().replace(/^#/,""),f=r.filter(w=>!n.has(w)&&(!d||w.toLowerCase().includes(d))).sort((w,x)=>+!w.toLowerCase().startsWith(d)-+!x.toLowerCase().startsWith(d)).slice(0,CL),m=a&&f.length>0&&(d.length>0||n.size===0||e==="");j.useEffect(()=>c(0),[d]);const p=w=>{var x;i(w),t(""),c(0),(x=h.current)==null||x.focus()},g=w=>{var x;w.key==="ArrowDown"&&m?(w.preventDefault(),c(y=>(y+1)%f.length)):w.key==="ArrowUp"&&m?(w.preventDefault(),c(y=>(y-1+f.length)%f.length)):w.key==="Enter"?(w.preventDefault(),m&&d&&p(f[u])):w.key==="Escape"?e?t(""):(x=h.current)==null||x.blur():w.key==="Backspace"&&e===""&&n.size>0&&i([...n][n.size-1])};return s.jsxs("div",{className:"tag-search grow",onClick:()=>{var w;return(w=h.current)==null?void 0:w.focus()},children:[s.jsx(Po,{size:15}),[...n].map(w=>s.jsxs("span",{className:"tag-token",children:["#",w,s.jsx("button",{type:"button","aria-label":`Remove tag filter ${w}`,onClick:x=>{x.stopPropagation(),i(w)},children:s.jsx(wr,{size:11})})]},w)),s.jsx("input",{ref:h,className:"tag-search-input",placeholder:n.size?"Add text or another tag…":"Search TC-ID, title, spec or tag…",value:e,onChange:w=>t(w.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:g,role:"combobox","aria-expanded":m,"aria-controls":"tag-suggestions","aria-activedescendant":m?`tag-opt-${u}`:void 0,"aria-label":"Search test cases or filter by tag"}),n.size>0&&s.jsx("button",{type:"button",className:"tag-search-clear",onClick:w=>{w.stopPropagation(),l()},title:"Clear tag filters","aria-label":"Clear tag filters",children:"Clear tags"}),m&&s.jsxs("ul",{id:"tag-suggestions",className:"tag-suggestions",role:"listbox","aria-label":"Tags",children:[s.jsx("li",{className:"tag-suggestions-head","aria-hidden":"true",children:"Filter by tag"}),f.map((w,x)=>s.jsxs("li",{id:`tag-opt-${x}`,role:"option","aria-selected":x===u,className:x===u?"active":"",onMouseEnter:()=>c(x),onMouseDown:y=>{y.preventDefault(),p(w)},children:["#",w]},w))]})]})}const TL=()=>`Test run ${new Date().toLocaleString("en-GB",{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}`;function PL(){var Zt;const e=ut(),n=Gn().state??null,{specs:r}=un(),i=Ie(()=>q.settings()),[l,a]=j.useState((n==null?void 0:n.name)??TL()),[o,u]=j.useState(()=>new Map(((n==null?void 0:n.selection)??[]).map(ee=>[Pi(ee),ee]))),[c,h]=j.useState(""),d=X0(c.trim(),250),[f,m]=j.useState(""),[p,g]=j.useState(new Set),[w,x]=j.useState("all"),[y,v]=j.useState(!1),[b,E]=j.useState(1),[k,L]=j.useState((n==null?void 0:n.retries)??null),[T,D]=j.useState(null),[N,P]=j.useState(!1),[A,z]=j.useState(null),U=T??((Zt=i.data)==null?void 0:Zt.settings.htmlReport)??!1,I=[...p].sort(),Q=y?[...o.keys()].sort():null,J=Pl([],50),H=JSON.stringify([d,f,I,w,y]),[X,S]=j.useState(H),ae=H!==X;ae&&(S(H),J.page!==1&&J.setPage(1));const O=ae?1:J.page,C=Ie(()=>q.searchTestCases({page:O,pageSize:J.pageSize,q:d,tags:I,spec:f,result:w,...Q?{selected:Q}:{}}),[O,J.pageSize,d,f,I.join("\0"),w,(Q==null?void 0:Q.join("\0"))??null]),F=C.data,Z=(F==null?void 0:F.items)??[],oe=(F==null?void 0:F.allTags)??[],B=(F==null?void 0:F.matchingRunnable)??[],he=B.length>0&&B.every(ee=>o.has(Pi(ee))),ze=[...o.values()],Ke=new Set(ze.map(ee=>ee.spec)).size,W=ee=>u(Ne=>{const et=new Map(Ne),Lr=Pi(ee);return et.has(Lr)?et.delete(Lr):et.set(Lr,ee),et}),fe=()=>u(ee=>{const Ne=new Map(ee);for(const et of B)he?Ne.delete(Pi(et)):Ne.set(Pi(et),et);return Ne}),Ze=ee=>g(Ne=>{const et=new Set(Ne);return et.has(ee)?et.delete(ee):et.add(ee),et}),Xt=async ee=>{if(ee.preventDefault(),!l.trim())return z("Give the test run a name.");if(!ze.length)return z("Pick at least one test case that has a Playwright test.");if(ze.length>Dp)return z(`A test run can have at most ${Dp} test cases.`);P(!0);try{const Ne=await q.createJob({type:"testrun",name:l.trim(),selection:ze,repeatEach:b,...k!==null?{retries:k}:{},htmlReport:U});e(`/runs/${Ne.id}`)}catch(Ne){z(Ne.message),P(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs",to:"/test-runs"},{label:"New test run"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"New test run"}),s.jsx("p",{className:"page-sub",children:"Filter and pick test cases. Only test cases that have a Playwright test can be run."})]})}),s.jsxs("form",{className:"tr-layout",onSubmit:Xt,children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"tr-filters",children:[s.jsx(EL,{query:c,onQuery:h,tags:p,allTags:oe,onToggleTag:Ze,onClearTags:()=>g(new Set)}),s.jsxs("select",{className:"select",value:f,onChange:ee=>m(ee.target.value),"aria-label":"Spec",children:[s.jsx("option",{value:"",children:"All specs"}),r.map(ee=>s.jsx("option",{value:ee.file,children:ee.file},ee.file))]}),s.jsxs("select",{className:"select",value:w,onChange:ee=>x(ee.target.value),"aria-label":"Last result",children:[s.jsx("option",{value:"all",children:"Any last result"}),s.jsx("option",{value:"passed",children:"Last passed"}),s.jsx("option",{value:"failed",children:"Last failed"}),s.jsx("option",{value:"none",children:"Never run"})]}),s.jsxs("label",{className:"row small",style:{gap:6},children:[s.jsx("input",{type:"checkbox",checked:y,onChange:ee=>v(ee.target.checked)})," Selected only"]})]}),s.jsxs("div",{className:"table-wrap",style:{border:0},children:[s.jsxs("table",{className:"tr-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"check",children:s.jsx("input",{type:"checkbox",checked:he,onChange:fe,disabled:!B.length,"aria-label":`Select all ${B.length} filtered test cases`,title:`All ${B.length} runnable test cases that match the filters (every page)`})}),s.jsx("th",{children:"Test case"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{children:"Last result"})]})}),s.jsx("tbody",{children:Z.map(ee=>s.jsxs("tr",{className:`${ee.runnable?"":"disabled"} ${o.has(ee.key)?"picked":""}`,onClick:()=>ee.runnable&&W(ee.ref),style:{cursor:ee.runnable?"pointer":"default"},children:[s.jsx("td",{className:"check",onClick:Ne=>Ne.stopPropagation(),children:s.jsx("input",{type:"checkbox",checked:o.has(ee.key),disabled:!ee.runnable,onChange:()=>W(ee.ref),"aria-label":`Select ${ee.tcId}`})}),s.jsxs("td",{children:[s.jsx("code",{children:ee.tcId})," ",ee.tcTitle,!ee.runnable&&s.jsx("div",{className:"muted small",children:"No Playwright test yet: generate it first"})]}),s.jsx("td",{className:"small",children:s.jsx(ye,{to:`/specs/${ee.ref.spec}`,onClick:Ne=>Ne.stopPropagation(),children:ee.ref.spec})}),s.jsx("td",{children:s.jsx("span",{className:"row",style:{gap:4,flexWrap:"wrap"},children:ee.tags.map(Ne=>s.jsx("button",{type:"button",className:`tag tag-btn ${p.has(Ne)?"on":""}`,title:p.has(Ne)?`Remove the "${Ne}" filter`:`Filter by "${Ne}"`,onClick:et=>{et.stopPropagation(),Ze(Ne)},children:Ne},Ne))})}),s.jsx("td",{children:ee.lastResult?s.jsx(ti,{status:ee.lastResult.status,title:Pt(ee.lastResult.at)}):s.jsx("span",{className:"muted small",children:"never"})})]},ee.key))})]}),s.jsx(Pe,{error:C.error}),F&&Z.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:F.totalCases?"No test case matches the filters.":"No test cases yet: add a spec first."}),!F&&!C.error&&s.jsx("p",{className:"muted",style:{padding:16},children:"Loading test cases…"}),F&&s.jsx(fs,{page:O,pageSize:J.pageSize,total:F.total,onPage:J.setPage,onPageSize:J.setPageSize,label:"test cases"})]})]}),s.jsx("div",{className:"tr-side",children:s.jsxs("div",{className:"card pad",style:{display:"grid",gap:12},children:[s.jsxs("label",{children:["Run name",s.jsx("input",{className:"input",value:l,maxLength:mb,onChange:ee=>a(ee.target.value)})]}),s.jsxs("label",{children:["Repeat each test",s.jsx("select",{className:"select",value:b,onChange:ee=>E(Number(ee.target.value)),children:[1,2,3,5,10].map(ee=>s.jsxs("option",{value:ee,children:[ee,"×"]},ee))})]}),s.jsxs("label",{children:["Retries on failure",s.jsxs("select",{className:"select",value:k??"",onChange:ee=>L(ee.target.value===""?null:Number(ee.target.value)),children:[s.jsx("option",{value:"",children:"Default (playwright.config.ts)"}),Array.from({length:pb+1},(ee,Ne)=>s.jsx("option",{value:Ne,children:Ne===0?"No retries":`${Ne} ${Ne===1?"retry":"retries"}`},Ne))]}),s.jsx("div",{className:"muted small",children:"A test that fails and then passes on a retry is reported as flaky."})]}),s.jsxs("div",{className:"row between",children:[s.jsxs("span",{style:{fontSize:13,fontWeight:600},children:["HTML report",s.jsx("div",{className:"muted small",style:{fontWeight:400},children:"Line report is always on"})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:U,onChange:ee=>D(ee.target.checked),"aria-label":"Also write the Playwright HTML report"}),s.jsx("span",{children:U?"On":"Off"})]})]}),s.jsxs("div",{className:"muted small",children:[s.jsx("b",{style:{color:"var(--text)"},children:ze.length})," test case",ze.length===1?"":"s"," selected from ",Ke," spec",Ke===1?"":"s",o.size>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("button",{type:"button",className:"link-btn",onClick:()=>u(new Map),children:"clear"})]})]}),s.jsx(Pe,{error:A}),s.jsxs("button",{type:"submit",className:"btn",disabled:N||!ze.length,children:[s.jsx(ft,{size:14})," ",N?"Starting…":"Create & run"]})]})})]})]})}const RL=T0([{element:s.jsx(Kb,{}),children:[{path:"/",element:s.jsx(FT,{})},{path:"/chat/:id?",element:s.jsx(JA,{})},{path:"/specs",element:s.jsx(KT,{})},{path:"/specs/from-requirement",element:s.jsx(QT,{})},{path:"/specs/:file",element:s.jsx(sP,{})},{path:"/mapping",element:s.jsx(OT,{})},{path:"/runs",element:s.jsx(qT,{})},{path:"/runs/:id",element:s.jsx(NT,{})},{path:"/agents",element:s.jsx(dP,{})},{path:"/agents/custom/new",element:s.jsx(Vm,{},"new")},{path:"/agents/custom/:id",element:s.jsx(Vm,{})},{path:"/agents/:agent",element:s.jsx(sL,{})},{path:"/agents/pipelines/new",element:s.jsx(Gm,{},"new")},{path:"/agents/pipelines/:id",element:s.jsx(Gm,{})},{path:"/usage",element:s.jsx(kL,{})},{path:"/test-runs",element:s.jsx(NL,{})},{path:"/test-runs/new",element:s.jsx(PL,{})},{path:"/project",element:s.jsx(UT,{})},{path:"/project/reset",element:s.jsx(HT,{})},{path:"/settings",element:s.jsx(uP,{})},{path:"*",element:s.jsx("p",{children:"Page not found."})}]}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}});"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>console.warn("Service worker registration failed",e))});oy(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(z0,{router:RL,future:{v7_startTransition:!0}})}));
418
+ `]},U))]}):!m&&s.jsx("p",{className:"muted",children:"Building preview…"})]}),o==="permissions"&&s.jsxs("div",{className:"pad",children:[s.jsxs("p",{className:"muted small",children:["Headless Claude Code with ",s.jsx("code",{children:"--permission-mode dontAsk"}),": anything outside the allow list is denied. Permissions are fixed by Agent Studio."]}),s.jsx("h4",{children:"Allowed"}),s.jsx("div",{className:"perm",children:d?d.allowedTools.map(z=>s.jsx("code",{children:z},z)):s.jsx(fA,{agent:e,onLoad:f})}),s.jsx("h4",{children:"Explicitly denied"}),s.jsx("div",{className:"perm",children:((d==null?void 0:d.disallowedTools)??lA).map(z=>s.jsx("code",{className:"deny",children:z},z))})]})]})]})}function hA({info:e,onSaved:t}){var d,f,m;const n=Me(()=>q.skills(),[e.agent]),[r,i]=j.useState(!1),[l,a]=j.useState(null),o=e.skills,u=new Set((d=n.data)==null?void 0:d.map(p=>p.name)),c=async p=>{i(!0);try{await q.saveAgentSkills(e.agent,p),a(null),t()}catch(g){a(g.message)}finally{i(!1)}},h=p=>{const g=o.includes(p.name);p.error&&!g||c(g?o.filter(w=>w!==p.name):[...o,p.name])};return s.jsxs("div",{className:"pad",style:{display:"grid",gap:12},children:[s.jsxs("p",{className:"muted small",style:{margin:0},children:["Select Claude Code skills from ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," (frontmatter ",s.jsx("code",{children:"name"})," + ",s.jsx("code",{children:"description"}),", then the skill's instructions). The skill content is not copied into the instructions: when the agent runs, Claude Code loads the selected skills itself with its Skill tool and applies them on top of the agent's role and persona. Claude Code's own skills (built-in, plugins such as superpowers) stay available too; nothing is blocked. The agent log shows every skill used (",s.jsx("code",{children:"[skill]"})," lines). Changes apply to jobs that start after saving."]}),s.jsx(Pe,{error:n.error??l}),e.skillsUnavailable.length>0&&s.jsxs("div",{className:"row",style:{gap:8},children:[s.jsxs("span",{className:"chip warn",children:["Skipped when jobs run: ",e.skillsUnavailable.join(", ")]}),s.jsx("span",{className:"muted small",children:"missing or invalid on disk"}),n.data&&e.skillsUnavailable.some(p=>!u.has(p))&&s.jsx("button",{type:"button",className:"link-btn",disabled:r,onClick:()=>void c(o.filter(p=>u.has(p))),children:"Remove missing"})]}),((f=n.data)==null?void 0:f.length)===0&&s.jsxs("p",{className:"muted",children:["No skills found. Create ",s.jsx("code",{children:".claude/skills/<name>/SKILL.md"})," in the project, then click ",s.jsx("b",{children:"Rescan folder"}),"."]}),s.jsx("div",{className:"skill-list",children:(m=n.data)==null?void 0:m.map(p=>{const g=o.includes(p.name);return s.jsxs("label",{className:`skill-item ${g?"on":""} ${p.error&&!g?"invalid":""}`,title:p.error??p.dir,children:[s.jsx("input",{type:"checkbox",checked:g,disabled:r||!!p.error&&!g,onChange:()=>h(p),"aria-label":`Attach skill ${p.name}`}),s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("b",{children:p.name}),g&&s.jsx(dt,{status:"stale",children:o.length>1?`attached #${o.indexOf(p.name)+1}`:"attached"}),p.error&&s.jsx("span",{className:"chip fail",children:"invalid"})]}),s.jsx("span",{className:"skill-desc muted small",children:p.error??p.description}),s.jsxs("span",{className:"skill-meta muted small",children:[s.jsxs("code",{children:[p.dir,"/SKILL.md"]}),s.jsxs("span",{children:[p.chars.toLocaleString()," characters"]}),p.files.length>0&&s.jsxs("span",{title:p.files.join(", "),children:["+",p.files.length," file",p.files.length===1?"":"s"]}),p.allowedTools.length>0&&s.jsxs("span",{className:"chip warn",title:"From the skill's frontmatter: Claude Code allows these tools while the skill is active, on top of the agent's permissions",children:["allowed-tools: ",p.allowedTools.join(" ")]})]})]},p.name)})}),s.jsxs("div",{className:"row between muted small",children:[s.jsxs("span",{children:[o.length," attached · see Full prompt preview for the result"]}),s.jsxs("button",{type:"button",className:"btn ghost sm",onClick:n.reload,disabled:r,children:[s.jsx(Rr,{size:12})," Rescan folder"]})]})]})}function fA({agent:e,onLoad:t}){return j.useEffect(()=>{q.previewAgentPrompt(e,{}).then(t).catch(()=>{})},[e,t]),s.jsx("span",{className:"muted small",children:"Loading…"})}let pA=0;const mj=()=>`b${Date.now().toString(36)}${(pA++).toString(36)}`;function gj(e,t=mj){return e.map(n=>n.kind==="agent"?{uid:t(),kind:"agent",agent:n.agent}:{uid:t(),kind:"loop",maxIterations:n.maxIterations,endsWhen:n.endsWhen??"first",steps:gj(n.steps.map(cs),t)})}const xj=e=>({kind:"loop",steps:e.steps.map(t=>t.kind==="agent"?t.agent:xj(t)),maxIterations:e.maxIterations,...e.endsWhen==="last"?{endsWhen:"last"}:{}});function yj(e){return e.map(t=>t.kind==="agent"?{kind:"agent",agent:t.agent}:xj(t))}const dd=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),vj=(e,t)=>e.length<=t.length&&e.every((n,r)=>n===t[r]);function Xh(e,t){let n=e,r;for(const i of t){if(r=n[i],!r)return;n=r.kind==="loop"?r.steps:[]}return r}function jj(e,t){if(t.length===0)return e;const n=Xh(e,t);return(n==null?void 0:n.kind)==="loop"?n.steps:null}const wj=e=>e.kind==="agent"?0:1+Math.max(0,...e.steps.map(wj));function gl(e,t,n){if(t.length===0)return n(e);const[r,...i]=t;return e.map((l,a)=>a===r&&l.kind==="loop"?{...l,steps:gl(l.steps,i,n)}:l)}const mA=(e,t)=>t.from==="block"?Xh(e,t.path)??null:null;function kj(e,t,n){const r=jj(e,n.parent);if(!r||n.index<0||n.index>r.length)return!1;let i;if(t.from==="palette")i=0;else if(t.from==="palette-loop")i=1;else{const a=mA(e,t);if(!a||vj(t.path,n.parent))return!1;i=wj(a)}return n.parent.length+i>no?!1:t.from==="block"&&dd(t.path.slice(0,-1),n.parent)||r.length<(n.parent.length===0?Sa:Na)}function hd(e,t,n,r=mj){if(!kj(e,t,n))return e;let i,l=e,a=n;if(t.from==="palette")i={uid:r(),kind:"agent",agent:t.agent};else if(t.from==="palette-loop")i={uid:r(),kind:"loop",steps:[],maxIterations:Sb,endsWhen:"first"};else{const o=t.path.slice(0,-1),u=t.path[t.path.length-1];if(dd(o,n.parent)&&(n.index===u||n.index===u+1))return e;if(i=Xh(e,t.path),l=gl(e,o,c=>c.filter((h,d)=>d!==u)),dd(o,n.parent))n.index>u&&(a={...n,index:n.index-1});else if(vj(o,n.parent)&&n.parent[o.length]>u){const c=[...n.parent];c[o.length]-=1,a={...n,parent:c}}}return gl(l,a.parent,o=>[...o.slice(0,a.index),i,...o.slice(a.index)])}function Qm(e,t,n){const r=t.slice(0,-1),i=t[t.length-1],l=jj(e,r),a=i+n;return!l||a<0||a>=l.length?e:hd(e,{from:"block",path:t},{parent:r,index:n<0?a:a+1})}function gA(e,t){const n=t[t.length-1];return gl(e,t.slice(0,-1),r=>r.filter((i,l)=>l!==n))}function qm(e,t,n){const r=t[t.length-1];return gl(e,t.slice(0,-1),i=>i.map((l,a)=>a===r&&l.kind==="loop"?{...l,...n}:l))}const xA=Object.keys(Se).filter(e=>e!=="custom"),Bu=(e,t,n,r="")=>JSON.stringify({name:e.trim(),description:t.trim(),workDir:r.trim(),steps:yj(n)});function Gm(){const{id:e}=li(),t=!e||e==="new",[n]=gh(),r=ut(),i=In(),l=Ar(),a=Me(()=>q.settings()),o=Me(()=>q.customAgents()).data??[],u=Me(()=>t?Promise.resolve(null):q.pipeline(e),[e]),[c,h]=j.useState(""),[d,f]=j.useState(""),[m,p]=j.useState(""),[g,w]=j.useState([]),[x,y]=j.useState(),[v,b]=j.useState(null),[E,k]=j.useState(!1),[R,T]=j.useState(null),[D,C]=j.useState(null),[L,A]=j.useState(!1),[z,U]=j.useState(!1),I=j.useRef(!1),Q=j.useMemo(()=>{var W;return Pb(((W=a.data)==null?void 0:W.settings.maxHealRounds)??2)},[a.data]),J=(W,fe,Ze=!0)=>{const Zt=gj(W.steps);h(W.name),f(W.description),p(W.workDir??""),w(Zt),y(fe),b(Ze?Bu(W.name,W.description,Zt,W.workDir??""):Bu("","",[],"")),k(!0)};j.useEffect(()=>{if(!t){u.data&&J(u.data,u.data.updatedAt);return}const W=n.get("from");if(W&&!a.data)return;const fe=Q.find(Ze=>Ze.id===W);fe?J({...fe,name:`${fe.name} (custom)`},void 0,!1):J({name:"",description:"",steps:[]},void 0)},[t,u.data,a.data]);const H=Bu(c,d,g,m),X=E&&v!==null&&H!==v,S=Tb({name:c,description:d,workDir:m,steps:yj(g)}),ae=S.ok?[]:S.errors,O=mh(({currentLocation:W,nextLocation:fe})=>X&&!I.current&&W.pathname!==fe.pathname);Th(O,{title:"Discard the unsaved pipeline changes?",message:"Your changes to this pipeline will be lost.",confirmLabel:"Discard",danger:!0});const N=async()=>{if(S.ok){A(!0);try{const W=t?await q.createPipeline(S.value):await q.savePipeline(e,S.value,x);C(null),J(W,W.updatedAt),U(!0),setTimeout(()=>U(!1),2e3),l.success(t?`Pipeline "${W.name}" created`:`Pipeline "${W.name}" saved`),t&&(I.current=!0,r(`/agents/pipelines/${W.id}`,{replace:!0}))}catch(W){C(W.message)}finally{A(!1)}}},F=async()=>{var Ze;if(t)return;const W=((Ze=u.data)==null?void 0:Ze.name)||c||e;if(await i({title:`Delete the pipeline "${W}"?`,message:"The pipeline is removed for everyone using this Agent Studio. This cannot be undone.",confirmLabel:"Delete pipeline",danger:!0})){A(!0);try{await q.deletePipeline(e),I.current=!0,l.success(`Pipeline "${W}" deleted`),r("/agents?tab=custom",{replace:!0})}catch(Zt){C(Zt.message),A(!1)}}},Z=(W,fe)=>{W.dataTransfer.effectAllowed=fe.from==="palette"||fe.from==="palette-loop"?"copy":"move",W.dataTransfer.setData("text/plain","qa-pipeline"),T(fe)},oe=()=>T(null),B=W=>{R&&w(fe=>hd(fe,R,W)),T(null)},he=W=>w(fe=>hd(fe,W,{parent:[],index:fe.length})),ze={blocks:g,drag:R,customAgents:o,setBlocks:w,startDrag:Z,endDrag:oe,drop:B},Ke=t?"New pipeline":c||"Pipeline";return!t&&u.error?s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:"Pipeline"}]}),s.jsx(Pe,{error:u.error}),s.jsx(ye,{to:"/agents",className:"btn ghost",children:"Back to Agents"})]}):s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Agents",to:"/agents"},{label:Ke}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:Ke}),s.jsxs("p",{className:"page-sub",children:["Drag agents from the palette into the pipeline, reorder them by dragging, and add a ",s.jsx("b",{children:"Loop"})," to repeat agents. Each loop runs its entries in order and ends when its first entry passes (check first) or when its last entry passes (work first, then check), or after its maximum number of iterations. Drop a loop inside another loop to nest it (up to ",no," levels); a nested loop in the check position (first, or last for loops that end when the last entry passes) ends the outer loop when it passes. Run it from the chat with ",s.jsx("code",{children:"/p:<name> <spec.md> [input]"})," or a prompt that names a spec or TC-ID (",s.jsx("code",{children:"/p:<name> check TC-LOGIN-001 on mobile"}),"); a pipeline with only custom agents or the Context Writer also runs from a prompt alone: ",s.jsx("code",{children:"/p:<name> <prompt>"}),"."]})]}),s.jsxs("span",{className:"row",children:[!t&&s.jsxs("button",{className:"btn danger",onClick:()=>void F(),disabled:L,children:[s.jsx(Lr,{size:14})," Delete"]}),s.jsxs("button",{className:"btn",onClick:()=>void N(),disabled:L||!E||!S.ok||!t&&!X,title:ae[0],children:[s.jsx(us,{size:14})," ",z?"Saved":t?"Create pipeline":"Save"]})]})]}),s.jsx(Pe,{error:D}),s.jsxs("div",{className:"card pl-meta",children:[s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{className:"input",value:c,maxLength:Hc,onChange:W=>h(W.target.value),placeholder:"e.g. Nightly regression"})]}),s.jsxs("label",{className:"pl-field",children:[s.jsx("span",{children:"Description"}),s.jsx("input",{className:"input",value:d,maxLength:Wc,onChange:W=>f(W.target.value),placeholder:"Optional"})]}),s.jsxs("label",{className:"pl-field wide",children:[s.jsx("span",{children:"Working directory"}),s.jsx("input",{className:"input",value:m,onChange:W=>p(W.target.value),placeholder:"Optional"}),s.jsx("span",{className:"muted small",children:"Custom agents run here (e.g. D:\\my-app). Empty: this QA repository."})]}),t&&s.jsxs("label",{className:"pl-field pl-from",children:[s.jsx("span",{children:"Start from"}),s.jsxs("select",{className:"input",value:n.get("from")??"",onChange:async W=>{const fe=W.target.value;if(g.length&&!await i({title:"Replace the current steps?",message:"The pipeline steps are replaced with the chosen starting point.",confirmLabel:"Replace",danger:!0}))return;r(fe?`/agents/pipelines/new?from=${fe}`:"/agents/pipelines/new",{replace:!0});const Ze=Q.find(Zt=>Zt.id===fe);J(Ze?{...Ze,name:`${Ze.name} (custom)`}:{name:"",description:"",steps:[]},void 0,!Ze)},children:[s.jsx("option",{value:"",children:"Blank pipeline"}),Q.map(W=>s.jsxs("option",{value:W.id,children:["Built-in: ",W.name]},W.id))]})]})]}),s.jsxs("div",{className:"pl-layout",children:[s.jsxs("aside",{className:"card pl-palette","aria-label":"Agent palette",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Palette"})}),s.jsx("p",{className:"muted small pl-hint",children:"Drag onto the pipeline, or press + to add at the end."}),s.jsxs("div",{className:"pl-tile pl-tile-loop",draggable:!0,onDragStart:W=>Z(W,{from:"palette-loop"}),onDragEnd:oe,children:[s.jsx("span",{className:"pl-loop-icon",children:s.jsx(is,{size:16})}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:"Loop"}),s.jsx("span",{className:"muted small",children:"Repeat agents up to a maximum count; loops can be nested"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":"Add a loop",onClick:()=>he({from:"palette-loop"}),children:s.jsx(Qt,{size:14})})]}),xA.map(W=>s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:fe=>Z(fe,{from:"palette",agent:W}),onDragEnd:oe,children:[s.jsx(Ot,{agent:W,size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:Se[W].label}),s.jsx("span",{className:"muted small",children:Se[W].llm?"LLM agent":"Playwright step"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${Se[W].label}`,onClick:()=>he({from:"palette",agent:W}),children:s.jsx(Qt,{size:14})})]},W)),o.map(W=>{const fe=Eh(W.id);return s.jsxs("div",{className:"pl-tile",draggable:!0,onDragStart:Ze=>Z(Ze,{from:"palette",agent:fe}),onDragEnd:oe,children:[s.jsx(Ot,{agent:"custom",size:28}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:W.name}),s.jsx("span",{className:"muted small",children:"Custom agent"})]}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Add ${W.name}`,onClick:()=>he({from:"palette",agent:fe}),children:s.jsx(Qt,{size:14})})]},W.id)}),o.length===0&&s.jsxs(ye,{to:"/agents/custom/new",className:"btn ghost sm",children:[s.jsx(Qt,{size:14})," New agent"]})]}),s.jsxs("div",{className:"card pl-canvas","aria-label":"Pipeline",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Pipeline"}),s.jsxs("span",{className:"muted small",children:[g.length," block",g.length===1?"":"s"]})]}),s.jsxs("div",{className:"pl-flow",children:[s.jsx("span",{className:"pl-terminal",children:"Start"}),g.map((W,fe)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:ze,target:{parent:[],index:fe}}),s.jsx(Nj,{tree:ze,block:W,path:[fe],siblings:g.length})]},W.uid)),s.jsx(co,{tree:ze,target:{parent:[],index:g.length},empty:g.length===0}),s.jsx("span",{className:"pl-terminal",children:"End"})]}),E&&ae.length>0&&(g.length>0||c)&&s.jsx("div",{className:"warn-box",role:"status",children:ae.join(`
419
+ `)})]})]})]})}const bj=e=>e.map(t=>t+1).join("."),Sj=(e,t)=>(e==null?void 0:e.from)==="block"&&e.path.length===t.length&&e.path.every((n,r)=>n===t[r]);function Nj({tree:e,block:t,path:n,siblings:r,parentEndsWhen:i}){var m;const{drag:l,customAgents:a,startDrag:o,endDrag:u}=e,c=n.length>1,h=n[n.length-1],d=c&&(i==="last"?h===r-1:h===0),f=p=>{p.stopPropagation(),o(p,{from:"block",path:n})};if(t.kind==="agent"){const p=Rl(t.agent,a);return s.jsxs("div",{className:`pl-block ${c?"inner":""} ${Sj(l,n)?"dragging":""}`,draggable:!0,onDragStart:f,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:bj(n)}),s.jsx(Ot,{agent:Hh(t.agent),size:c?26:30}),s.jsxs("span",{className:"pl-tile-text",children:[s.jsx("b",{children:p}),((m=a.find(g=>Eh(g.id)===t.agent))==null?void 0:m.review)==="human"&&s.jsx("span",{className:"hr-badge",children:"Human review"}),d?s.jsx("span",{className:"muted small",children:"Loop ends when this agent passes"}):!c&&s.jsx("span",{className:"muted small",children:Sl(t.agent)?"Custom agent":Se[t.agent].description})]}),s.jsx(Cj,{tree:e,path:n,count:r,label:p})]})}return s.jsx(yA,{tree:e,loop:t,path:n,siblings:r,first:d,onDragStart:f})}function yA({tree:e,loop:t,path:n,siblings:r,first:i,onDragStart:l}){const{drag:a,setBlocks:o,endDrag:u}=e,c=bj(n),h=`loop ${c}`;return s.jsxs("div",{className:`pl-loop ${n.length>1?"nested":""} ${Sj(a,n)?"dragging":""}`,"data-depth":n.length,children:[s.jsxs("div",{className:"pl-loop-head",draggable:!0,onDragStart:l,onDragEnd:u,children:[s.jsx("span",{className:"pl-num",children:c}),s.jsx("span",{className:"pl-loop-icon",children:s.jsx(is,{size:15})}),s.jsxs("span",{className:"pl-loop-title",children:[s.jsx("b",{children:n.length>1?"Nested loop":"Loop"}),i&&s.jsx("span",{className:"muted small",children:"Outer loop ends when this loop passes"})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Max iterations"}),s.jsx("input",{className:"input",type:"number",min:1,max:pl,step:1,value:t.maxIterations??"","aria-label":`Maximum iterations of ${h}`,onChange:d=>o(f=>qm(f,n,{maxIterations:d.target.value===""?null:Math.max(1,Math.min(pl,Math.round(Number(d.target.value))))}))})]}),s.jsxs("label",{className:"pl-max",children:[s.jsx("span",{className:"muted small",children:"Ends when"}),s.jsxs("select",{className:"input",value:t.endsWhen,"aria-label":`When ${h} ends`,onChange:d=>o(f=>qm(f,n,{endsWhen:d.target.value})),children:[s.jsx("option",{value:"first",children:"first entry passes"}),s.jsx("option",{value:"last",children:"last entry passes"})]})]}),s.jsx(Cj,{tree:e,path:n,count:r,label:h})]}),s.jsxs("div",{className:"pl-loop-body",children:[t.steps.map((d,f)=>s.jsxs("div",{className:"pl-item",children:[s.jsx(co,{tree:e,target:{parent:n,index:f},inner:!0}),s.jsx(Nj,{tree:e,block:d,path:[...n,f],siblings:t.steps.length,parentEndsWhen:t.endsWhen})]},d.uid)),s.jsx(co,{tree:e,target:{parent:n,index:t.steps.length},inner:!0,empty:t.steps.length===0}),s.jsxs("div",{className:"pl-loop-foot muted small",children:[s.jsx(is,{size:12})," repeats up to ",t.maxIterations??"?"," time",t.maxIterations===1?"":"s"]})]})]})}function co({tree:e,target:t,inner:n,empty:r}){const{blocks:i,drag:l,drop:a}=e,[o,u]=j.useState(!1),c=l!==null&&kj(i,l,t);return s.jsx("div",{className:`pl-gap ${n?"inner":""} ${r?"empty":""} ${c?"active":""} ${o&&c?"over":""}`,onDragOver:h=>{c&&(h.preventDefault(),h.stopPropagation(),h.dataTransfer.dropEffect=l.from==="palette"||l.from==="palette-loop"?"copy":"move",o||u(!0))},onDragLeave:()=>u(!1),onDrop:h=>{h.preventDefault(),h.stopPropagation(),u(!1),a(t)},children:r?s.jsx("span",{className:"muted small",children:n?"Drop agents or a loop here to repeat them":"Drag agents or a loop here"}):s.jsx("span",{className:"pl-arrow",children:"↓"})})}function Cj({tree:e,path:t,count:n,label:r}){const{setBlocks:i}=e,l=t[t.length-1];return s.jsxs("span",{className:"pl-actions",children:[s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} up`,disabled:l===0,onClick:()=>i(a=>Qm(a,t,-1)),children:"↑"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Move ${r} down`,disabled:l===n-1,onClick:()=>i(a=>Qm(a,t,1)),children:"↓"}),s.jsx("button",{className:"btn ghost sm icon","aria-label":`Remove ${r}`,onClick:()=>i(a=>gA(a,t)),children:s.jsx(wr,{size:13})})]})}const vA=[{id:"1",label:"24 h"},{id:"7",label:"7 days"},{id:"30",label:"30 days"},{id:"90",label:"90 days"}],ur=e=>e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,Rn=(e,t)=>e.trackedRuns?ln(t):"—";function jA(e){const t=new Map(e.byDay.map(i=>[i.day,i])),n=[],r=new Date;for(let i=Math.max(e.days,1)-1;i>=0;i--){const l=new Date(r.getTime()-i*864e5).toISOString().slice(0,10);n.push(t.get(l)??{day:l,runs:0,trackedRuns:0,costUsd:0,turns:0,inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0})}return n}function wA(e){if(e<=0)return 1;const t=10**Math.floor(Math.log10(e));return([1,2,2.5,5,10].find(n=>n*t>=e)??10)*t}const Ti=e=>new Date(`${e}T00:00:00`).toLocaleDateString("en-US",{month:"short",day:"numeric"});function kA({report:e}){const t=jA(e),n=wA(Math.max(...t.map(r=>r.costUsd)));return s.jsxs("div",{children:[s.jsxs("div",{className:"usage-chart",role:"img","aria-label":`Estimated cost per day over the last ${e.days} days`,children:[[.5,1].map(r=>s.jsx("div",{className:"usage-chart-gridline",style:{bottom:`${r*100}%`},children:s.jsx("span",{children:Gt(n*r)})},r)),t.map(r=>s.jsxs("div",{className:`bar-col ${r.costUsd?"":"zero"}`,tabIndex:0,"aria-label":`${Ti(r.day)}: ${Gt(r.costUsd)}, ${r.runs} runs`,children:[s.jsx("i",{style:{height:`${Math.max(r.costUsd/n*100,r.costUsd?2:0)}%`}}),s.jsxs("span",{className:"tip",children:[s.jsx("b",{children:Ti(r.day)})," · ",Gt(r.costUsd),s.jsx("br",{}),r.runs," run",r.runs===1?"":"s"," · ",ln(ur(r))," in / ",ln(r.outputTokens)," out"]})]},r.day))]}),s.jsxs("div",{className:"usage-axis",children:[s.jsx("span",{children:Ti(t[0].day)}),t.length>2&&s.jsx("span",{children:Ti(t[Math.floor(t.length/2)].day)}),s.jsx("span",{children:Ti(t[t.length-1].day)})]})]})}function ca({icon:e,label:t,value:n,sub:r}){return s.jsxs("div",{className:"stat",children:[s.jsxs("div",{className:"stat-head",children:[s.jsx("span",{children:t}),s.jsx("span",{className:"stat-icon",children:e})]}),s.jsx("div",{className:"stat-value",children:n}),r&&s.jsx("div",{className:"muted small",children:r})]})}function Hu({title:e,rows:t,name:n,total:r}){return s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:e})}),t.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{className:"num",children:"Runs"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"Share"})]})}),s.jsx("tbody",{children:t.map((i,l)=>s.jsxs("tr",{children:[s.jsx("td",{children:n(i)}),s.jsx("td",{className:"num",children:i.runs}),s.jsx("td",{className:"num",children:Rn(i,ur(i))}),s.jsx("td",{className:"num",children:Rn(i,i.outputTokens)}),s.jsx("td",{className:"num",children:Gt(i.costUsd)}),s.jsx("td",{children:s.jsx("div",{className:"share-bar",title:`${r?Math.round(i.costUsd/r*100):0}% of cost`,children:s.jsx("i",{style:{width:`${r?i.costUsd/r*100:0}%`}})})})]},l))})]})})]})}const Ej="qa-studio.usage.recentView";function bA(){try{return localStorage.getItem(Ej)==="jobs"?"jobs":"runs"}catch{return"runs"}}function SA({job:e}){return s.jsxs(s.Fragment,{children:[s.jsxs(ye,{to:`/runs/${e.jobId}`,children:["#",e.jobId," ",kr[e.jobType]??e.jobType]}),s.jsx("div",{className:"muted small",children:e.name??e.target})]})}function NA({jobs:e}){const[t,n]=j.useState(()=>new Set),r=l=>n(a=>{const o=new Set(a);return o.has(l)?o.delete(l):o.add(l),o}),i=e.length>0&&e.every(l=>t.has(l.jobId));return e.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat usage-jobs",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:s.jsx("button",{className:"btn ghost sm",onClick:()=>n(i?new Set:new Set(e.map(l=>l.jobId))),children:i?"Collapse all":"Expand all"})}),s.jsx("th",{children:"Agents"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:e.map(l=>{const a=t.has(l.jobId),o=[...new Set(l.agentRuns.map(u=>u.model).filter(Boolean))];return s.jsxs(j.Fragment,{children:[s.jsxs("tr",{className:"usage-job-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-job-cell",children:[s.jsx("button",{className:"usage-expand",onClick:()=>r(l.jobId),"aria-expanded":a,"aria-label":`${a?"Hide":"Show"} the LLM runs of job #${l.jobId}`,children:s.jsx(ti,{size:12,open:a})}),s.jsx("span",{children:s.jsx(SA,{job:l})})]})}),s.jsx("td",{children:s.jsxs("span",{className:"usage-agent-icons",title:l.agentRuns.map(u=>{var c;return((c=Se[u.agent])==null?void 0:c.label)??u.agent}).join(" → "),children:[l.agentRuns.slice(0,6).map(u=>s.jsx(Ot,{agent:u.agent,size:20},u.runId)),s.jsxs("span",{className:"muted small",children:[l.runs," run",l.runs===1?"":"s"]})]})}),s.jsx("td",{children:s.jsx(kn,{status:l.status})}),s.jsx("td",{children:o.length?o.map(u=>s.jsx("code",{children:u},u)):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:l.turns}),s.jsx("td",{className:"num",children:Rn(l,ur(l))}),s.jsx("td",{className:"num",children:Rn(l,l.outputTokens)}),s.jsx("td",{className:"num strong",children:Gt(l.costUsd)}),s.jsx("td",{className:"small",children:Pt(l.at)})]}),a&&l.agentRuns.map(u=>{var c;return s.jsxs("tr",{className:"usage-sub-row",children:[s.jsx("td",{children:s.jsxs("span",{className:"usage-sub-name",children:[s.jsx(Ot,{agent:u.agent,size:20})," ",((c=Se[u.agent])==null?void 0:c.label)??u.agent]})}),s.jsxs("td",{className:"muted small",children:["run #",u.runId]}),s.jsx("td",{children:s.jsx(kn,{status:u.status})}),s.jsx("td",{children:u.model?s.jsx("code",{children:u.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:u.turns}),s.jsx("td",{className:"num",children:Rn(u,ur(u))}),s.jsx("td",{className:"num",children:Rn(u,u.outputTokens)}),s.jsx("td",{className:"num",children:Gt(u.costUsd)}),s.jsx("td",{className:"small",children:Pt(u.at)})]},u.runId)})]},l.jobId)})})]})})}function CA(){const[e,t]=j.useState(bA),n=d=>{t(d);try{localStorage.setItem(Ej,d)}catch{}},[r,i]=j.useState("30"),{data:l,error:a,reload:o}=Me(()=>q.usage(Number(r)),[r]),u=l==null?void 0:l.totals,c=u&&ur(u)?Math.round(u.cacheReadTokens/ur(u)*100):0,h=u?u.runs-u.trackedRuns:0;return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Settings"},{label:"Claude usage"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Claude usage"}),s.jsxs("p",{className:"page-sub",children:["Tokens and estimated cost of the Claude Code agents run by Agent Studio (QA Explorer, QA Script Generator, QA Script Healer, QA Test Case Writer, Context Writer). The cost is Claude Code's API-price estimate. On a Claude subscription, check plan limits with ",s.jsx("code",{children:"/usage"})," in Claude Code."]})]}),s.jsxs("div",{className:"row",children:[s.jsx(bn,{value:r,onChange:i,items:vA}),s.jsx("button",{className:"btn ghost",onClick:o,title:"Refresh","aria-label":"Refresh",children:s.jsx(Rr,{size:15})})]})]}),s.jsx(Pe,{error:a}),l&&u&&s.jsxs(s.Fragment,{children:[h>0&&s.jsxs("div",{className:"warn-box",style:{marginBottom:14},children:[h," of ",u.runs," runs in this range were recorded before token tracking was added: they count toward cost and runs, but their tokens show as —."]}),s.jsxs("div",{className:"stats usage-stats",children:[s.jsx(ca,{icon:s.jsx(Dy,{size:16}),label:"Estimated cost",value:Gt(u.costUsd),sub:`${u.runs?Gt(u.costUsd/u.runs):"—"} per run`}),s.jsx(ca,{icon:s.jsx(Iy,{size:16}),label:"LLM agent runs",value:u.runs,sub:`${u.turns.toLocaleString()} turns`}),s.jsx(ca,{icon:s.jsx(ft,{size:16}),label:"Tokens in",value:Rn(u,ur(u)),sub:u.trackedRuns?`${c}% served from cache`:"No token data yet"}),s.jsx(ca,{icon:s.jsx(ft,{size:16}),label:"Tokens out",value:Rn(u,u.outputTokens),sub:u.trackedRuns?`${ln(u.inputTokens)} uncached input`:"No token data yet"})]}),s.jsxs("div",{className:"card pad",style:{marginBottom:14},children:[s.jsxs("div",{className:"row between",style:{marginBottom:18},children:[s.jsx("h3",{className:"card-title",children:"Estimated cost per day"}),s.jsxs("span",{className:"muted small",children:["Since ",new Date(l.since).toLocaleString("en-US",{hour12:!1})]})]}),s.jsx(kA,{report:l})]}),s.jsxs("div",{className:"overview-grid",style:{marginBottom:14},children:[s.jsx(Hu,{title:"By spec",rows:l.bySpec,total:u.costUsd,name:d=>d.target.endsWith(".md")?s.jsx(ye,{to:`/specs/${d.target}`,children:d.target}):d.target}),s.jsx(Hu,{title:"By agent",rows:l.byAgent,total:u.costUsd,name:d=>{var f;return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,whiteSpace:"nowrap"},children:[s.jsx(Ot,{agent:d.agent,size:22})," ",((f=Se[d.agent])==null?void 0:f.label)??d.agent]})}})]}),s.jsx("div",{style:{marginBottom:14},children:s.jsx(Hu,{title:"By model",rows:l.byModel,total:u.costUsd,name:d=>s.jsx("code",{children:d.model})})}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent LLM runs"}),s.jsx(bn,{value:e,onChange:n,items:[{id:"runs",label:"Runs"},{id:"jobs",label:"Group by job"}]})]}),e==="jobs"?s.jsx(NA,{jobs:l.recentJobs}):l.recent.length===0?s.jsx("p",{className:"muted pad",children:"No runs in this range. Usage is recorded for agent runs from this version of Agent Studio onward."}):s.jsx("div",{className:"table-wrap",children:s.jsxs("table",{className:"flat",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Job"}),s.jsx("th",{children:"Agent"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Model"}),s.jsx("th",{className:"num",children:"Turns"}),s.jsx("th",{className:"num",children:"Tokens in"}),s.jsx("th",{className:"num",children:"Tokens out"}),s.jsx("th",{className:"num",children:"Est. cost"}),s.jsx("th",{children:"When"})]})}),s.jsx("tbody",{children:l.recent.map(d=>{var f;return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsxs(ye,{to:`/runs/${d.jobId}`,children:["#",d.jobId," ",kr[d.jobType]]}),s.jsx("div",{className:"muted small",children:d.target})]}),s.jsx("td",{children:((f=Se[d.agent])==null?void 0:f.label)??d.agent}),s.jsx("td",{children:s.jsx(kn,{status:d.status})}),s.jsx("td",{children:d.model?s.jsx("code",{children:d.model}):s.jsx("span",{className:"muted",children:"—"})}),s.jsx("td",{className:"num",children:d.turns}),s.jsx("td",{className:"num",children:Rn(d,ur(d))}),s.jsx("td",{className:"num",children:Rn(d,d.outputTokens)}),s.jsx("td",{className:"num",children:Gt(d.costUsd)}),s.jsx("td",{className:"small",children:Pt(d.at)})]},d.runId)})})]})})]})]})]})}const Pi=e=>`${e.spec}#${e.tcId}`;function EA(e){return e.target==="all"?"All tests":e.args.tcId?"1 TC":"Whole spec"}function TA({counts:e}){const t=Object.values(e).reduce((r,i)=>r+i,0);if(!t)return s.jsx("span",{className:"muted small",children:"—"});const n=["passed","flaky","failed","skipped"];return s.jsxs("span",{className:"row",style:{gap:8},children:[s.jsx("span",{className:"tr-progress",role:"img","aria-label":n.filter(r=>e[r]).map(r=>`${e[r]} ${r}`).join(", "),children:n.map(r=>e[r]?s.jsx("i",{className:r,style:{width:`${e[r]/t*100}%`},title:`${e[r]} ${r}`},r):null)}),s.jsxs("span",{className:"small",children:[e.passed??0,"/",t]})]})}function PA(){const e=ut(),t=Pl(),{data:n,error:r,reload:i}=Me(()=>q.testRuns({page:t.page,pageSize:t.pageSize}),[t.page,t.pageSize]),l=(n==null?void 0:n.items)??[],a=l.some(o=>o.status==="queued"||o.status==="running");return j.useEffect(()=>{if(!a)return;const o=setInterval(i,2e3);return()=>clearInterval(o)},[a,i]),s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs"}]}),s.jsxs("div",{className:"page-head",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"Test runs"}),s.jsx("p",{className:"page-sub",children:"Pick test cases, name the run, execute it and review the results. Results use the line reporter; the Playwright HTML report is optional."})]}),s.jsxs(ye,{className:"btn",to:"/test-runs/new",children:[s.jsx(Qt,{size:15})," New test run"]})]}),s.jsx(Pe,{error:r}),s.jsxs("div",{className:"table-wrap",children:[s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Results"}),s.jsx("th",{className:"num",children:"Cases"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Duration"}),s.jsx("th",{children:"Report"})]})}),s.jsx("tbody",{children:l.map(o=>s.jsxs("tr",{onClick:()=>e(`/runs/${o.id}`),style:{cursor:"pointer"},children:[s.jsxs("td",{children:[s.jsx("div",{className:"strong",children:o.args.name??`Test run #${o.id}`}),s.jsxs("div",{className:"muted small",children:["#",o.id,o.args.repeatEach&&o.args.repeatEach>1?` · ${o.args.repeatEach}×`:"",o.args.retries!==void 0?` · retries ${o.args.retries}`:""]})]}),s.jsx("td",{children:s.jsx(kn,{status:o.status})}),s.jsx("td",{children:s.jsx(TA,{counts:o.counts})}),s.jsx("td",{className:"num",children:o.args.selection?o.caseCount:s.jsx("span",{className:"muted small",children:EA(o)})}),s.jsx("td",{className:"muted small",children:Pt(o.startedAt??o.createdAt)}),s.jsx("td",{className:"muted small",children:ds(o.startedAt,o.finishedAt)}),s.jsx("td",{onClick:u=>u.stopPropagation(),children:o.hasHtmlReport?s.jsxs("a",{className:"btn ghost",href:xh(o.id),target:"_blank",rel:"noreferrer",children:[s.jsx(bh,{size:13})," HTML"]}):s.jsx("span",{className:"muted small",children:"line only"})})]},o.id))})]}),n&&l.length===0&&s.jsxs("p",{className:"muted",style:{padding:16},children:["No test runs yet. ",s.jsx(ye,{to:"/test-runs/new",children:"Create the first one"}),"."]}),n&&s.jsx(ps,{page:t.page,pageSize:t.pageSize,total:n.total,onPage:t.setPage,onPageSize:t.setPageSize,label:"runs"})]})]})}const RA=8;function LA({query:e,onQuery:t,tags:n,allTags:r,onToggleTag:i,onClearTags:l}){const[a,o]=j.useState(!1),[u,c]=j.useState(0),h=j.useRef(null),d=e.trim().toLowerCase().replace(/^#/,""),f=r.filter(w=>!n.has(w)&&(!d||w.toLowerCase().includes(d))).sort((w,x)=>+!w.toLowerCase().startsWith(d)-+!x.toLowerCase().startsWith(d)).slice(0,RA),m=a&&f.length>0&&(d.length>0||n.size===0||e==="");j.useEffect(()=>c(0),[d]);const p=w=>{var x;i(w),t(""),c(0),(x=h.current)==null||x.focus()},g=w=>{var x;w.key==="ArrowDown"&&m?(w.preventDefault(),c(y=>(y+1)%f.length)):w.key==="ArrowUp"&&m?(w.preventDefault(),c(y=>(y-1+f.length)%f.length)):w.key==="Enter"?(w.preventDefault(),m&&d&&p(f[u])):w.key==="Escape"?e?t(""):(x=h.current)==null||x.blur():w.key==="Backspace"&&e===""&&n.size>0&&i([...n][n.size-1])};return s.jsxs("div",{className:"tag-search grow",onClick:()=>{var w;return(w=h.current)==null?void 0:w.focus()},children:[s.jsx(Ro,{size:15}),[...n].map(w=>s.jsxs("span",{className:"tag-token",children:["#",w,s.jsx("button",{type:"button","aria-label":`Remove tag filter ${w}`,onClick:x=>{x.stopPropagation(),i(w)},children:s.jsx(wr,{size:11})})]},w)),s.jsx("input",{ref:h,className:"tag-search-input",placeholder:n.size?"Add text or another tag…":"Search TC-ID, title, spec or tag…",value:e,onChange:w=>t(w.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:g,role:"combobox","aria-expanded":m,"aria-controls":"tag-suggestions","aria-activedescendant":m?`tag-opt-${u}`:void 0,"aria-label":"Search test cases or filter by tag"}),n.size>0&&s.jsx("button",{type:"button",className:"tag-search-clear",onClick:w=>{w.stopPropagation(),l()},title:"Clear tag filters","aria-label":"Clear tag filters",children:"Clear tags"}),m&&s.jsxs("ul",{id:"tag-suggestions",className:"tag-suggestions",role:"listbox","aria-label":"Tags",children:[s.jsx("li",{className:"tag-suggestions-head","aria-hidden":"true",children:"Filter by tag"}),f.map((w,x)=>s.jsxs("li",{id:`tag-opt-${x}`,role:"option","aria-selected":x===u,className:x===u?"active":"",onMouseEnter:()=>c(x),onMouseDown:y=>{y.preventDefault(),p(w)},children:["#",w]},w))]})]})}const AA=()=>`Test run ${new Date().toLocaleString("en-GB",{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}`;function IA(){var en;const e=ut(),n=Kn().state??null,{specs:r}=Xt(),i=Me(()=>q.settings()),[l,a]=j.useState((n==null?void 0:n.name)??AA()),[o,u]=j.useState(()=>new Map(((n==null?void 0:n.selection)??[]).map(ee=>[Pi(ee),ee]))),[c,h]=j.useState(""),d=Z0(c.trim(),250),[f,m]=j.useState(""),[p,g]=j.useState(new Set),[w,x]=j.useState("all"),[y,v]=j.useState(!1),[b,E]=j.useState(1),[k,R]=j.useState((n==null?void 0:n.retries)??null),[T,D]=j.useState(null),[C,L]=j.useState(!1),[A,z]=j.useState(null),U=T??((en=i.data)==null?void 0:en.settings.htmlReport)??!1,I=[...p].sort(),Q=y?[...o.keys()].sort():null,J=Pl([],50),H=JSON.stringify([d,f,I,w,y]),[X,S]=j.useState(H),ae=H!==X;ae&&(S(H),J.page!==1&&J.setPage(1));const O=ae?1:J.page,N=Me(()=>q.searchTestCases({page:O,pageSize:J.pageSize,q:d,tags:I,spec:f,result:w,...Q?{selected:Q}:{}}),[O,J.pageSize,d,f,I.join("\0"),w,(Q==null?void 0:Q.join("\0"))??null]),F=N.data,Z=(F==null?void 0:F.items)??[],oe=(F==null?void 0:F.allTags)??[],B=(F==null?void 0:F.matchingRunnable)??[],he=B.length>0&&B.every(ee=>o.has(Pi(ee))),ze=[...o.values()],Ke=new Set(ze.map(ee=>ee.spec)).size,W=ee=>u(Ne=>{const et=new Map(Ne),Dr=Pi(ee);return et.has(Dr)?et.delete(Dr):et.set(Dr,ee),et}),fe=()=>u(ee=>{const Ne=new Map(ee);for(const et of B)he?Ne.delete(Pi(et)):Ne.set(Pi(et),et);return Ne}),Ze=ee=>g(Ne=>{const et=new Set(Ne);return et.has(ee)?et.delete(ee):et.add(ee),et}),Zt=async ee=>{if(ee.preventDefault(),!l.trim())return z("Give the test run a name.");if(!ze.length)return z("Pick at least one test case that has a Playwright test.");if(ze.length>Dp)return z(`A test run can have at most ${Dp} test cases.`);L(!0);try{const Ne=await q.createJob({type:"testrun",name:l.trim(),selection:ze,repeatEach:b,...k!==null?{retries:k}:{},htmlReport:U});e(`/runs/${Ne.id}`)}catch(Ne){z(Ne.message),L(!1)}};return s.jsxs("section",{children:[s.jsx(ot,{items:[{label:"Testing"},{label:"Test runs",to:"/test-runs"},{label:"New test run"}]}),s.jsx("div",{className:"page-head",children:s.jsxs("div",{children:[s.jsx("h1",{className:"page-title",children:"New test run"}),s.jsx("p",{className:"page-sub",children:"Filter and pick test cases. Only test cases that have a Playwright test can be run."})]})}),s.jsxs("form",{className:"tr-layout",onSubmit:Zt,children:[s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"tr-filters",children:[s.jsx(LA,{query:c,onQuery:h,tags:p,allTags:oe,onToggleTag:Ze,onClearTags:()=>g(new Set)}),s.jsxs("select",{className:"select",value:f,onChange:ee=>m(ee.target.value),"aria-label":"Spec",children:[s.jsx("option",{value:"",children:"All specs"}),r.map(ee=>s.jsx("option",{value:ee.file,children:ee.file},ee.file))]}),s.jsxs("select",{className:"select",value:w,onChange:ee=>x(ee.target.value),"aria-label":"Last result",children:[s.jsx("option",{value:"all",children:"Any last result"}),s.jsx("option",{value:"passed",children:"Last passed"}),s.jsx("option",{value:"failed",children:"Last failed"}),s.jsx("option",{value:"none",children:"Never run"})]}),s.jsxs("label",{className:"row small",style:{gap:6},children:[s.jsx("input",{type:"checkbox",checked:y,onChange:ee=>v(ee.target.checked)})," Selected only"]})]}),s.jsxs("div",{className:"table-wrap",style:{border:0},children:[s.jsxs("table",{className:"tr-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"check",children:s.jsx("input",{type:"checkbox",checked:he,onChange:fe,disabled:!B.length,"aria-label":`Select all ${B.length} filtered test cases`,title:`All ${B.length} runnable test cases that match the filters (every page)`})}),s.jsx("th",{children:"Test case"}),s.jsx("th",{children:"Spec"}),s.jsx("th",{children:"Tags"}),s.jsx("th",{children:"Last result"})]})}),s.jsx("tbody",{children:Z.map(ee=>s.jsxs("tr",{className:`${ee.runnable?"":"disabled"} ${o.has(ee.key)?"picked":""}`,onClick:()=>ee.runnable&&W(ee.ref),style:{cursor:ee.runnable?"pointer":"default"},children:[s.jsx("td",{className:"check",onClick:Ne=>Ne.stopPropagation(),children:s.jsx("input",{type:"checkbox",checked:o.has(ee.key),disabled:!ee.runnable,onChange:()=>W(ee.ref),"aria-label":`Select ${ee.tcId}`})}),s.jsxs("td",{children:[s.jsx("code",{children:ee.tcId})," ",ee.tcTitle,!ee.runnable&&s.jsx("div",{className:"muted small",children:"No Playwright test yet: generate it first"})]}),s.jsx("td",{className:"small",children:s.jsx(ye,{to:`/specs/${ee.ref.spec}`,onClick:Ne=>Ne.stopPropagation(),children:ee.ref.spec})}),s.jsx("td",{children:s.jsx("span",{className:"row",style:{gap:4,flexWrap:"wrap"},children:ee.tags.map(Ne=>s.jsx("button",{type:"button",className:`tag tag-btn ${p.has(Ne)?"on":""}`,title:p.has(Ne)?`Remove the "${Ne}" filter`:`Filter by "${Ne}"`,onClick:et=>{et.stopPropagation(),Ze(Ne)},children:Ne},Ne))})}),s.jsx("td",{children:ee.lastResult?s.jsx(ni,{status:ee.lastResult.status,title:Pt(ee.lastResult.at)}):s.jsx("span",{className:"muted small",children:"never"})})]},ee.key))})]}),s.jsx(Pe,{error:N.error}),F&&Z.length===0&&s.jsx("p",{className:"muted",style:{padding:16},children:F.totalCases?"No test case matches the filters.":"No test cases yet: add a spec first."}),!F&&!N.error&&s.jsx("p",{className:"muted",style:{padding:16},children:"Loading test cases…"}),F&&s.jsx(ps,{page:O,pageSize:J.pageSize,total:F.total,onPage:J.setPage,onPageSize:J.setPageSize,label:"test cases"})]})]}),s.jsx("div",{className:"tr-side",children:s.jsxs("div",{className:"card pad",style:{display:"grid",gap:12},children:[s.jsxs("label",{children:["Run name",s.jsx("input",{className:"input",value:l,maxLength:gb,onChange:ee=>a(ee.target.value)})]}),s.jsxs("label",{children:["Repeat each test",s.jsx("select",{className:"select",value:b,onChange:ee=>E(Number(ee.target.value)),children:[1,2,3,5,10].map(ee=>s.jsxs("option",{value:ee,children:[ee,"×"]},ee))})]}),s.jsxs("label",{children:["Retries on failure",s.jsxs("select",{className:"select",value:k??"",onChange:ee=>R(ee.target.value===""?null:Number(ee.target.value)),children:[s.jsx("option",{value:"",children:"Default (playwright.config.ts)"}),Array.from({length:mb+1},(ee,Ne)=>s.jsx("option",{value:Ne,children:Ne===0?"No retries":`${Ne} ${Ne===1?"retry":"retries"}`},Ne))]}),s.jsx("div",{className:"muted small",children:"A test that fails and then passes on a retry is reported as flaky."})]}),s.jsxs("div",{className:"row between",children:[s.jsxs("span",{style:{fontSize:13,fontWeight:600},children:["HTML report",s.jsx("div",{className:"muted small",style:{fontWeight:400},children:"Line report is always on"})]}),s.jsxs("label",{className:"switch",children:[s.jsx("input",{type:"checkbox",checked:U,onChange:ee=>D(ee.target.checked),"aria-label":"Also write the Playwright HTML report"}),s.jsx("span",{children:U?"On":"Off"})]})]}),s.jsxs("div",{className:"muted small",children:[s.jsx("b",{style:{color:"var(--text)"},children:ze.length})," test case",ze.length===1?"":"s"," selected from ",Ke," spec",Ke===1?"":"s",o.size>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("button",{type:"button",className:"link-btn",onClick:()=>u(new Map),children:"clear"})]})]}),s.jsx(Pe,{error:A}),s.jsxs("button",{type:"submit",className:"btn",disabled:C||!ze.length,children:[s.jsx(ft,{size:14})," ",C?"Starting…":"Create & run"]})]})})]})]})}const DA=P0([{element:s.jsx(Xb,{}),children:[{path:"/",element:s.jsx(HT,{})},{path:"/chat/:id?",element:s.jsx(tA,{})},{path:"/specs",element:s.jsx(ZT,{})},{path:"/specs/from-requirement",element:s.jsx(YT,{})},{path:"/specs/:file",element:s.jsx(oP,{})},{path:"/mapping",element:s.jsx(BT,{})},{path:"/runs",element:s.jsx(JT,{})},{path:"/runs/:id",element:s.jsx(TT,{})},{path:"/agents",element:s.jsx(mP,{})},{path:"/agents/custom/new",element:s.jsx(Vm,{},"new")},{path:"/agents/custom/:id",element:s.jsx(Vm,{})},{path:"/agents/:agent",element:s.jsx(oA,{})},{path:"/agents/pipelines/new",element:s.jsx(Gm,{},"new")},{path:"/agents/pipelines/:id",element:s.jsx(Gm,{})},{path:"/usage",element:s.jsx(CA,{})},{path:"/test-runs",element:s.jsx(PA,{})},{path:"/test-runs/new",element:s.jsx(IA,{})},{path:"/project",element:s.jsx(VT,{})},{path:"/project/reset",element:s.jsx(qT,{})},{path:"/settings",element:s.jsx(fP,{})},{path:"*",element:s.jsx("p",{children:"Page not found."})}]}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}});"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>console.warn("Service worker registration failed",e))});oy(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(_0,{router:DA,future:{v7_startTransition:!0}})}));