@gavinc-cn/touchstone-dsh 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +21 -1
- package/README.zh.md +11 -1
- package/auth.py +0 -0
- package/board.py +775 -71
- package/builtin_assets.py +0 -0
- package/builtin_prompts/free_style/flow.md +0 -0
- package/builtin_prompts/free_style/load_test.md +0 -0
- package/builtin_prompts/free_style/templates/bug_report_template.md +0 -0
- package/builtin_prompts/free_style/templates/case_template.md +0 -0
- package/builtin_prompts/free_style/templates/index_template.md +0 -0
- package/builtin_prompts/free_style/templates/load_charts_template.md +0 -0
- package/builtin_prompts/free_style/templates/load_index_template.md +0 -0
- package/builtin_prompts/free_style/templates/load_plan_template.md +0 -0
- package/builtin_prompts/free_style/templates/load_scenario_template.md +0 -0
- package/builtin_prompts/free_style/templates/status_template.md +0 -0
- package/chat.py +590 -17
- package/db.py +62 -11
- package/dsh-plugin/cordis.patch.yml +7 -3
- package/dsh-plugin/install.sh +8 -5
- package/dsh-plugin/lib/agent-driver.js +710 -89
- package/dsh-plugin/lib/client.bundle.js +94 -9
- package/dsh-plugin/lib/index.js +242 -22
- package/dsh-plugin/scripts/build.mjs +0 -0
- package/dsh-plugin/scripts/prepack-check.mjs +0 -0
- package/dsh-plugin/scripts/select-bundle.mjs +0 -0
- package/dsh-plugin/src/client.js +94 -9
- package/dshdriver.py +74 -5
- package/dshevents.py +65 -3
- package/export_cases.py +0 -0
- package/extensions/dsh-autocommit/asset.json +0 -0
- package/extensions/dsh-autocommit/pkg/lib/index.mjs +0 -0
- package/extensions/dsh-autocommit/pkg/package.json +0 -0
- package/feishu.py +1197 -34
- package/feishu_conv.py +920 -0
- package/lib.py +0 -0
- package/lifecycle.py +0 -0
- package/loadcase.py +0 -0
- package/loadgen.py +0 -0
- package/localbus.py +0 -0
- package/migrate_p7b.py +0 -0
- package/package.json +1 -1
- package/platcompat.py +0 -0
- package/prompts.py +0 -0
- package/rag.py +0 -0
- package/requirements.txt +2 -1
- package/server.py +218 -26
- package/sessparse.py +150 -44
- package/touchstone.py +6 -3
- package/waitq.py +23 -0
- package/webui/dist-plugin/assets/index-JLwyZZxC.js +484 -0
- package/webui/dist-plugin/assets/index-tJ0TlvQ3.css +1 -0
- package/webui/dist-plugin/index.html +2 -2
- package/worktree.py +0 -0
- package/webui/dist-plugin/assets/index-B0WoP1Qy.css +0 -1
- package/webui/dist-plugin/assets/index-DtwKoi1T.js +0 -473
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
var Tm=e=>{throw TypeError(e)};var $m=(e,t,n)=>t.has(e)||Tm("Cannot "+n);var pn=(e,t,n)=>($m(e,t,"read from private field"),n?n.call(e):t.get(e)),Im=(e,t,n)=>t.has(e)?Tm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),vu=(e,t,n,s)=>($m(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);function Mj(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function dx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fx={exports:{}},Dc={},px={exports:{}},We={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Va=Symbol.for("react.element"),Tj=Symbol.for("react.portal"),$j=Symbol.for("react.fragment"),Ij=Symbol.for("react.strict_mode"),Aj=Symbol.for("react.profiler"),Oj=Symbol.for("react.provider"),Lj=Symbol.for("react.context"),zj=Symbol.for("react.forward_ref"),Dj=Symbol.for("react.suspense"),Fj=Symbol.for("react.memo"),Bj=Symbol.for("react.lazy"),Am=Symbol.iterator;function Uj(e){return e===null||typeof e!="object"?null:(e=Am&&e[Am]||e["@@iterator"],typeof e=="function"?e:null)}var mx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hx=Object.assign,gx={};function Fl(e,t,n){this.props=e,this.context=t,this.refs=gx,this.updater=n||mx}Fl.prototype.isReactComponent={};Fl.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")};Fl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xx(){}xx.prototype=Fl.prototype;function Wf(e,t,n){this.props=e,this.context=t,this.refs=gx,this.updater=n||mx}var qf=Wf.prototype=new xx;qf.constructor=Wf;hx(qf,Fl.prototype);qf.isPureReactComponent=!0;var Om=Array.isArray,vx=Object.prototype.hasOwnProperty,Gf={current:null},yx={key:!0,ref:!0,__self:!0,__source:!0};function wx(e,t,n){var s,o={},l=null,a=null;if(t!=null)for(s in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)vx.call(t,s)&&!yx.hasOwnProperty(s)&&(o[s]=t[s]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var c=Array(i),d=0;d<i;d++)c[d]=arguments[d+2];o.children=c}if(e&&e.defaultProps)for(s in i=e.defaultProps,i)o[s]===void 0&&(o[s]=i[s]);return{$$typeof:Va,type:e,key:l,ref:a,props:o,_owner:Gf.current}}function Hj(e,t){return{$$typeof:Va,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Kf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Va}function Vj(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Lm=/\/+/g;function yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vj(""+e.key):t.toString(36)}function Di(e,t,n,s,o){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 Va:case Tj:a=!0}}if(a)return a=e,o=o(a),e=s===""?"."+yu(a,0):s,Om(o)?(n="",e!=null&&(n=e.replace(Lm,"$&/")+"/"),Di(o,t,n,"",function(d){return d})):o!=null&&(Kf(o)&&(o=Hj(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Lm,"$&/")+"/")+e)),t.push(o)),1;if(a=0,s=s===""?".":s+":",Om(e))for(var i=0;i<e.length;i++){l=e[i];var c=s+yu(l,i);a+=Di(l,t,n,c,o)}else if(c=Uj(e),typeof c=="function")for(e=c.call(e),i=0;!(l=e.next()).done;)l=l.value,c=s+yu(l,i++),a+=Di(l,t,n,c,o);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 ni(e,t,n){if(e==null)return e;var s=[],o=0;return Di(e,s,"","",function(l){return t.call(n,l,o++)}),s}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 En={current:null},Fi={transition:null},qj={ReactCurrentDispatcher:En,ReactCurrentBatchConfig:Fi,ReactCurrentOwner:Gf};function jx(){throw Error("act(...) is not supported in production builds of React.")}We.Children={map:ni,forEach:function(e,t,n){ni(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ni(e,function(){t++}),t},toArray:function(e){return ni(e,function(t){return t})||[]},only:function(e){if(!Kf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};We.Component=Fl;We.Fragment=$j;We.Profiler=Aj;We.PureComponent=Wf;We.StrictMode=Ij;We.Suspense=Dj;We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qj;We.act=jx;We.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=hx({},e.props),o=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=Gf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(c in t)vx.call(t,c)&&!yx.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&i!==void 0?i[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){i=Array(c);for(var d=0;d<c;d++)i[d]=arguments[d+2];s.children=i}return{$$typeof:Va,type:e.type,key:o,ref:l,props:s,_owner:a}};We.createContext=function(e){return e={$$typeof:Lj,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Oj,_context:e},e.Consumer=e};We.createElement=wx;We.createFactory=function(e){var t=wx.bind(null,e);return t.type=e,t};We.createRef=function(){return{current:null}};We.forwardRef=function(e){return{$$typeof:zj,render:e}};We.isValidElement=Kf;We.lazy=function(e){return{$$typeof:Bj,_payload:{_status:-1,_result:e},_init:Wj}};We.memo=function(e,t){return{$$typeof:Fj,type:e,compare:t===void 0?null:t}};We.startTransition=function(e){var t=Fi.transition;Fi.transition={};try{e()}finally{Fi.transition=t}};We.unstable_act=jx;We.useCallback=function(e,t){return En.current.useCallback(e,t)};We.useContext=function(e){return En.current.useContext(e)};We.useDebugValue=function(){};We.useDeferredValue=function(e){return En.current.useDeferredValue(e)};We.useEffect=function(e,t){return En.current.useEffect(e,t)};We.useId=function(){return En.current.useId()};We.useImperativeHandle=function(e,t,n){return En.current.useImperativeHandle(e,t,n)};We.useInsertionEffect=function(e,t){return En.current.useInsertionEffect(e,t)};We.useLayoutEffect=function(e,t){return En.current.useLayoutEffect(e,t)};We.useMemo=function(e,t){return En.current.useMemo(e,t)};We.useReducer=function(e,t,n){return En.current.useReducer(e,t,n)};We.useRef=function(e){return En.current.useRef(e)};We.useState=function(e){return En.current.useState(e)};We.useSyncExternalStore=function(e,t,n){return En.current.useSyncExternalStore(e,t,n)};We.useTransition=function(){return En.current.useTransition()};We.version="18.3.1";px.exports=We;var u=px.exports;const bx=dx(u),Bo=Mj({__proto__:null,default:bx},[u]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Gj=u,Kj=Symbol.for("react.element"),Yj=Symbol.for("react.fragment"),Qj=Object.prototype.hasOwnProperty,Xj=Gj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Jj={key:!0,ref:!0,__self:!0,__source:!0};function _x(e,t,n){var s,o={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(s in t)Qj.call(t,s)&&!Jj.hasOwnProperty(s)&&(o[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)o[s]===void 0&&(o[s]=t[s]);return{$$typeof:Kj,type:e,key:l,ref:a,props:o,_owner:Xj.current}}Dc.Fragment=Yj;Dc.jsx=_x;Dc.jsxs=_x;fx.exports=Dc;var r=fx.exports,Sx={exports:{}},Xn={},kx={exports:{}},Nx={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(L,K){var F=L.length;L.push(K);e:for(;0<F;){var xe=F-1>>>1,X=L[xe];if(0<o(X,K))L[xe]=K,L[F]=X,F=xe;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var K=L[0],F=L.pop();if(F!==K){L[0]=F;e:for(var xe=0,X=L.length,Te=X>>>1;xe<Te;){var Pe=2*(xe+1)-1,Re=L[Pe],se=Pe+1,ve=L[se];if(0>o(Re,F))se<X&&0>o(ve,Re)?(L[xe]=ve,L[se]=F,xe=se):(L[xe]=Re,L[Pe]=F,xe=Pe);else if(se<X&&0>o(ve,F))L[xe]=ve,L[se]=F,xe=se;else break e}}return K}function o(L,K){var F=L.sortIndex-K.sortIndex;return F!==0?F:L.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,i=a.now();e.unstable_now=function(){return a.now()-i}}var c=[],d=[],f=1,m=null,p=3,h=!1,g=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(L){for(var K=n(d);K!==null;){if(K.callback===null)s(d);else if(K.startTime<=L)s(d),K.sortIndex=K.expirationTime,t(c,K);else break;K=n(d)}}function b(L){if(w=!1,y(L),!g)if(n(c)!==null)g=!0,te(S);else{var K=n(d);K!==null&&H(b,K.startTime-L)}}function S(L,K){g=!1,w&&(w=!1,v(C),C=-1),h=!0;var F=p;try{for(y(K),m=n(c);m!==null&&(!(m.expirationTime>K)||L&&!z());){var xe=m.callback;if(typeof xe=="function"){m.callback=null,p=m.priorityLevel;var X=xe(m.expirationTime<=K);K=e.unstable_now(),typeof X=="function"?m.callback=X:m===n(c)&&s(c),y(K)}else s(c);m=n(c)}if(m!==null)var Te=!0;else{var Pe=n(d);Pe!==null&&H(b,Pe.startTime-K),Te=!1}return Te}finally{m=null,p=F,h=!1}}var N=!1,k=null,C=-1,O=5,R=-1;function z(){return!(e.unstable_now()-R<O)}function V(){if(k!==null){var L=e.unstable_now();R=L;var K=!0;try{K=k(!0,L)}finally{K?q():(N=!1,k=null)}}else N=!1}var q;if(typeof x=="function")q=function(){x(V)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,G=I.port2;I.port1.onmessage=V,q=function(){G.postMessage(null)}}else q=function(){j(V,0)};function te(L){k=L,N||(N=!0,q())}function H(L,K){C=j(function(){L(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,te(S))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var F=p;p=K;try{return L()}finally{p=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,K){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=p;p=L;try{return K()}finally{p=F}},e.unstable_scheduleCallback=function(L,K,F){var xe=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?xe+F:xe):F=xe,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=F+X,L={id:f++,callback:K,priorityLevel:L,startTime:F,expirationTime:X,sortIndex:-1},F>xe?(L.sortIndex=F,t(d,L),n(c)===null&&L===n(d)&&(w?(v(C),C=-1):w=!0,H(b,F-xe))):(L.sortIndex=X,t(c,L),g||h||(g=!0,te(S))),L},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(L){var K=p;return function(){var F=p;p=K;try{return L.apply(this,arguments)}finally{p=F}}}})(Nx);kx.exports=Nx;var Zj=kx.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var e1=u,Qn=Zj;function ne(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 Cx=new Set,wa={};function Uo(e,t){Nl(e,t),Nl(e+"Capture",t)}function Nl(e,t){for(wa[e]=t,e=0;e<t.length;e++)Cx.add(t[e])}var fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gd=Object.prototype.hasOwnProperty,t1=/^[: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]*$/,zm={},Dm={};function n1(e){return gd.call(Dm,e)?!0:gd.call(zm,e)?!1:t1.test(e)?Dm[e]=!0:(zm[e]=!0,!1)}function s1(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function r1(e,t,n,s){if(t===null||typeof t>"u"||s1(e,t,n,s))return!0;if(s)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 Rn(e,t,n,s,o,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var un={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){un[e]=new Rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];un[t]=new Rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){un[e]=new Rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){un[e]=new Rn(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){un[e]=new Rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){un[e]=new Rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){un[e]=new Rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){un[e]=new Rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){un[e]=new Rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yf=/[\-:]([a-z])/g;function Qf(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(Yf,Qf);un[t]=new Rn(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(Yf,Qf);un[t]=new Rn(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(Yf,Qf);un[t]=new Rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){un[e]=new Rn(e,1,!1,e.toLowerCase(),null,!1,!1)});un.xlinkHref=new Rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){un[e]=new Rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xf(e,t,n,s){var o=un.hasOwnProperty(t)?un[t]:null;(o!==null?o.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(r1(t,n,o,s)&&(n=null),s||o===null?n1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,s=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var yr=e1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,si=Symbol.for("react.element"),sl=Symbol.for("react.portal"),rl=Symbol.for("react.fragment"),Jf=Symbol.for("react.strict_mode"),xd=Symbol.for("react.profiler"),Ex=Symbol.for("react.provider"),Rx=Symbol.for("react.context"),Zf=Symbol.for("react.forward_ref"),vd=Symbol.for("react.suspense"),yd=Symbol.for("react.suspense_list"),ep=Symbol.for("react.memo"),Tr=Symbol.for("react.lazy"),Px=Symbol.for("react.offscreen"),Fm=Symbol.iterator;function Yl(e){return e===null||typeof e!="object"?null:(e=Fm&&e[Fm]||e["@@iterator"],typeof e=="function"?e:null)}var St=Object.assign,wu;function la(e){if(wu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wu=t&&t[1]||""}return`
|
|
34
|
-
`+wu+e}var ju=!1;function bu(e,t){if(!e||ju)return"";ju=!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(d){var s=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){s=d}e.call(t.prototype)}else{try{throw Error()}catch(d){s=d}e()}}catch(d){if(d&&s&&typeof d.stack=="string"){for(var o=d.stack.split(`
|
|
35
|
-
`),l=s.stack.split(`
|
|
36
|
-
`),a=o.length-1,i=l.length-1;1<=a&&0<=i&&o[a]!==l[i];)i--;for(;1<=a&&0<=i;a--,i--)if(o[a]!==l[i]){if(a!==1||i!==1)do if(a--,i--,0>i||o[a]!==l[i]){var c=`
|
|
37
|
-
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=i);break}}}finally{ju=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?la(e):""}function o1(e){switch(e.tag){case 5:return la(e.type);case 16:return la("Lazy");case 13:return la("Suspense");case 19:return la("SuspenseList");case 0:case 2:case 15:return e=bu(e.type,!1),e;case 11:return e=bu(e.type.render,!1),e;case 1:return e=bu(e.type,!0),e;default:return""}}function wd(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 rl:return"Fragment";case sl:return"Portal";case xd:return"Profiler";case Jf:return"StrictMode";case vd:return"Suspense";case yd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Rx:return(e.displayName||"Context")+".Consumer";case Ex:return(e._context.displayName||"Context")+".Provider";case Zf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ep:return t=e.displayName||null,t!==null?t:wd(e.type)||"Memo";case Tr:t=e._payload,e=e._init;try{return wd(e(t))}catch{}}return null}function l1(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 wd(t);case 8:return t===Jf?"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 eo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Mx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function a1(e){var t=Mx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){s=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(a){s=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ri(e){e._valueTracker||(e._valueTracker=a1(e))}function Tx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Mx(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function rc(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 jd(e,t){var n=t.checked;return St({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bm(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=eo(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $x(e,t){t=t.checked,t!=null&&Xf(e,"checked",t,!1)}function bd(e,t){$x(e,t);var n=eo(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_d(e,t.type,n):t.hasOwnProperty("defaultValue")&&_d(e,t.type,eo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Um(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="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 _d(e,t,n){(t!=="number"||rc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var aa=Array.isArray;function gl(e,t,n,s){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&s&&(e[n].defaultSelected=!0)}else{for(n=""+eo(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Sd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return St({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Hm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ne(92));if(aa(n)){if(1<n.length)throw Error(ne(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:eo(n)}}function Ix(e,t){var n=eo(t.value),s=eo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Vm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ax(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 kd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ax(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var oi,Ox=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(oi=oi||document.createElement("div"),oi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=oi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ja(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var da={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},i1=["Webkit","ms","Moz","O"];Object.keys(da).forEach(function(e){i1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),da[t]=da[e]})});function Lx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||da.hasOwnProperty(e)&&da[e]?(""+t).trim():t+"px"}function zx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,o=Lx(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,o):e[n]=o}}var c1=St({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 Nd(e,t){if(t){if(c1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function Cd(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 Ed=null;function tp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rd=null,xl=null,vl=null;function Wm(e){if(e=Ga(e)){if(typeof Rd!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=Vc(t),Rd(e.stateNode,e.type,t))}}function Dx(e){xl?vl?vl.push(e):vl=[e]:xl=e}function Fx(){if(xl){var e=xl,t=vl;if(vl=xl=null,Wm(e),t)for(e=0;e<t.length;e++)Wm(t[e])}}function Bx(e,t){return e(t)}function Ux(){}var _u=!1;function Hx(e,t,n){if(_u)return e(t,n);_u=!0;try{return Bx(e,t,n)}finally{_u=!1,(xl!==null||vl!==null)&&(Ux(),Fx())}}function ba(e,t){var n=e.stateNode;if(n===null)return null;var s=Vc(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ne(231,t,typeof n));return n}var Pd=!1;if(fr)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{Pd=!1}function u1(e,t,n,s,o,l,a,i,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(f){this.onError(f)}}var fa=!1,oc=null,lc=!1,Md=null,d1={onError:function(e){fa=!0,oc=e}};function f1(e,t,n,s,o,l,a,i,c){fa=!1,oc=null,u1.apply(d1,arguments)}function p1(e,t,n,s,o,l,a,i,c){if(f1.apply(this,arguments),fa){if(fa){var d=oc;fa=!1,oc=null}else throw Error(ne(198));lc||(lc=!0,Md=d)}}function Ho(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 Vx(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 qm(e){if(Ho(e)!==e)throw Error(ne(188))}function m1(e){var t=e.alternate;if(!t){if(t=Ho(e),t===null)throw Error(ne(188));return t!==e?null:e}for(var n=e,s=t;;){var o=n.return;if(o===null)break;var l=o.alternate;if(l===null){if(s=o.return,s!==null){n=s;continue}break}if(o.child===l.child){for(l=o.child;l;){if(l===n)return qm(o),e;if(l===s)return qm(o),t;l=l.sibling}throw Error(ne(188))}if(n.return!==s.return)n=o,s=l;else{for(var a=!1,i=o.child;i;){if(i===n){a=!0,n=o,s=l;break}if(i===s){a=!0,s=o,n=l;break}i=i.sibling}if(!a){for(i=l.child;i;){if(i===n){a=!0,n=l,s=o;break}if(i===s){a=!0,s=l,n=o;break}i=i.sibling}if(!a)throw Error(ne(189))}}if(n.alternate!==s)throw Error(ne(190))}if(n.tag!==3)throw Error(ne(188));return n.stateNode.current===n?e:t}function Wx(e){return e=m1(e),e!==null?qx(e):null}function qx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=qx(e);if(t!==null)return t;e=e.sibling}return null}var Gx=Qn.unstable_scheduleCallback,Gm=Qn.unstable_cancelCallback,h1=Qn.unstable_shouldYield,g1=Qn.unstable_requestPaint,Ot=Qn.unstable_now,x1=Qn.unstable_getCurrentPriorityLevel,np=Qn.unstable_ImmediatePriority,Kx=Qn.unstable_UserBlockingPriority,ac=Qn.unstable_NormalPriority,v1=Qn.unstable_LowPriority,Yx=Qn.unstable_IdlePriority,Fc=null,qs=null;function y1(e){if(qs&&typeof qs.onCommitFiberRoot=="function")try{qs.onCommitFiberRoot(Fc,e,void 0,(e.current.flags&128)===128)}catch{}}var Ns=Math.clz32?Math.clz32:b1,w1=Math.log,j1=Math.LN2;function b1(e){return e>>>=0,e===0?32:31-(w1(e)/j1|0)|0}var li=64,ai=4194304;function ia(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 ic(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,o=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var i=a&~o;i!==0?s=ia(i):(l&=a,l!==0&&(s=ia(l)))}else a=n&~o,a!==0?s=ia(a):l!==0&&(s=ia(l));if(s===0)return 0;if(t!==0&&t!==s&&!(t&o)&&(o=s&-s,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-Ns(t),o=1<<n,s|=e[n],t&=~o;return s}function _1(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 S1(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-Ns(l),i=1<<a,c=o[a];c===-1?(!(i&n)||i&s)&&(o[a]=_1(i,t)):c<=t&&(e.expiredLanes|=i),l&=~i}}function Td(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Qx(){var e=li;return li<<=1,!(li&4194240)&&(li=64),e}function Su(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ns(t),e[t]=n}function k1(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 s=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Ns(n),l=1<<o;t[o]=0,s[o]=-1,e[o]=-1,n&=~l}}function sp(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ns(n),o=1<<s;o&t|e[s]&t&&(e[s]|=t),n&=~o}}var st=0;function Xx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Jx,rp,Zx,ev,tv,$d=!1,ii=[],Br=null,Ur=null,Hr=null,_a=new Map,Sa=new Map,Ir=[],N1="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 Km(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Ur=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":_a.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sa.delete(t.pointerId)}}function Xl(e,t,n,s,o,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:l,targetContainers:[o]},t!==null&&(t=Ga(t),t!==null&&rp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function C1(e,t,n,s,o){switch(t){case"focusin":return Br=Xl(Br,e,t,n,s,o),!0;case"dragenter":return Ur=Xl(Ur,e,t,n,s,o),!0;case"mouseover":return Hr=Xl(Hr,e,t,n,s,o),!0;case"pointerover":var l=o.pointerId;return _a.set(l,Xl(_a.get(l)||null,e,t,n,s,o)),!0;case"gotpointercapture":return l=o.pointerId,Sa.set(l,Xl(Sa.get(l)||null,e,t,n,s,o)),!0}return!1}function nv(e){var t=_o(e.target);if(t!==null){var n=Ho(t);if(n!==null){if(t=n.tag,t===13){if(t=Vx(n),t!==null){e.blockedOn=t,tv(e.priority,function(){Zx(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 Bi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Id(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);Ed=s,n.target.dispatchEvent(s),Ed=null}else return t=Ga(n),t!==null&&rp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ym(e,t,n){Bi(e)&&n.delete(t)}function E1(){$d=!1,Br!==null&&Bi(Br)&&(Br=null),Ur!==null&&Bi(Ur)&&(Ur=null),Hr!==null&&Bi(Hr)&&(Hr=null),_a.forEach(Ym),Sa.forEach(Ym)}function Jl(e,t){e.blockedOn===t&&(e.blockedOn=null,$d||($d=!0,Qn.unstable_scheduleCallback(Qn.unstable_NormalPriority,E1)))}function ka(e){function t(o){return Jl(o,e)}if(0<ii.length){Jl(ii[0],e);for(var n=1;n<ii.length;n++){var s=ii[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Br!==null&&Jl(Br,e),Ur!==null&&Jl(Ur,e),Hr!==null&&Jl(Hr,e),_a.forEach(t),Sa.forEach(t),n=0;n<Ir.length;n++)s=Ir[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Ir.length&&(n=Ir[0],n.blockedOn===null);)nv(n),n.blockedOn===null&&Ir.shift()}var yl=yr.ReactCurrentBatchConfig,cc=!0;function R1(e,t,n,s){var o=st,l=yl.transition;yl.transition=null;try{st=1,op(e,t,n,s)}finally{st=o,yl.transition=l}}function P1(e,t,n,s){var o=st,l=yl.transition;yl.transition=null;try{st=4,op(e,t,n,s)}finally{st=o,yl.transition=l}}function op(e,t,n,s){if(cc){var o=Id(e,t,n,s);if(o===null)Iu(e,t,s,uc,n),Km(e,s);else if(C1(o,e,t,n,s))s.stopPropagation();else if(Km(e,s),t&4&&-1<N1.indexOf(e)){for(;o!==null;){var l=Ga(o);if(l!==null&&Jx(l),l=Id(e,t,n,s),l===null&&Iu(e,t,s,uc,n),l===o)break;o=l}o!==null&&s.stopPropagation()}else Iu(e,t,s,null,n)}}var uc=null;function Id(e,t,n,s){if(uc=null,e=tp(s),e=_o(e),e!==null)if(t=Ho(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vx(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 uc=e,null}function sv(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(x1()){case np:return 1;case Kx:return 4;case ac:case v1:return 16;case Yx:return 536870912;default:return 16}default:return 16}}var Lr=null,lp=null,Ui=null;function rv(){if(Ui)return Ui;var e,t=lp,n=t.length,s,o="value"in Lr?Lr.value:Lr.textContent,l=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===o[l-s];s++);return Ui=o.slice(e,1<s?1-s:void 0)}function Hi(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 ci(){return!0}function Qm(){return!1}function Jn(e){function t(n,s,o,l,a){this._reactName=n,this._targetInst=o,this.type=s,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(n=e[i],this[i]=n?n(l):l[i]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?ci:Qm,this.isPropagationStopped=Qm,this}return St(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=ci)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ci)},persist:function(){},isPersistent:ci}),t}var Bl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ap=Jn(Bl),qa=St({},Bl,{view:0,detail:0}),M1=Jn(qa),ku,Nu,Zl,Bc=St({},qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ip,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!==Zl&&(Zl&&e.type==="mousemove"?(ku=e.screenX-Zl.screenX,Nu=e.screenY-Zl.screenY):Nu=ku=0,Zl=e),ku)},movementY:function(e){return"movementY"in e?e.movementY:Nu}}),Xm=Jn(Bc),T1=St({},Bc,{dataTransfer:0}),$1=Jn(T1),I1=St({},qa,{relatedTarget:0}),Cu=Jn(I1),A1=St({},Bl,{animationName:0,elapsedTime:0,pseudoElement:0}),O1=Jn(A1),L1=St({},Bl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),z1=Jn(L1),D1=St({},Bl,{data:0}),Jm=Jn(D1),F1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B1={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"},U1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function H1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=U1[e])?!!t[e]:!1}function ip(){return H1}var V1=St({},qa,{key:function(e){if(e.key){var t=F1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?B1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ip,charCode:function(e){return e.type==="keypress"?Hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),W1=Jn(V1),q1=St({},Bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zm=Jn(q1),G1=St({},qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ip}),K1=Jn(G1),Y1=St({},Bl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q1=Jn(Y1),X1=St({},Bc,{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}),J1=Jn(X1),Z1=[9,13,27,32],cp=fr&&"CompositionEvent"in window,pa=null;fr&&"documentMode"in document&&(pa=document.documentMode);var eb=fr&&"TextEvent"in window&&!pa,ov=fr&&(!cp||pa&&8<pa&&11>=pa),eh=" ",th=!1;function lv(e,t){switch(e){case"keyup":return Z1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function av(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ol=!1;function tb(e,t){switch(e){case"compositionend":return av(t);case"keypress":return t.which!==32?null:(th=!0,eh);case"textInput":return e=t.data,e===eh&&th?null:e;default:return null}}function nb(e,t){if(ol)return e==="compositionend"||!cp&&lv(e,t)?(e=rv(),Ui=lp=Lr=null,ol=!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 ov&&t.locale!=="ko"?null:t.data;default:return null}}var sb={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 nh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sb[e.type]:t==="textarea"}function iv(e,t,n,s){Dx(s),t=dc(t,"onChange"),0<t.length&&(n=new ap("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ma=null,Na=null;function rb(e){yv(e,0)}function Uc(e){var t=il(e);if(Tx(t))return e}function ob(e,t){if(e==="change")return t}var cv=!1;if(fr){var Eu;if(fr){var Ru="oninput"in document;if(!Ru){var sh=document.createElement("div");sh.setAttribute("oninput","return;"),Ru=typeof sh.oninput=="function"}Eu=Ru}else Eu=!1;cv=Eu&&(!document.documentMode||9<document.documentMode)}function rh(){ma&&(ma.detachEvent("onpropertychange",uv),Na=ma=null)}function uv(e){if(e.propertyName==="value"&&Uc(Na)){var t=[];iv(t,Na,e,tp(e)),Hx(rb,t)}}function lb(e,t,n){e==="focusin"?(rh(),ma=t,Na=n,ma.attachEvent("onpropertychange",uv)):e==="focusout"&&rh()}function ab(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Uc(Na)}function ib(e,t){if(e==="click")return Uc(t)}function cb(e,t){if(e==="input"||e==="change")return Uc(t)}function ub(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Es=typeof Object.is=="function"?Object.is:ub;function Ca(e,t){if(Es(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var o=n[s];if(!gd.call(t,o)||!Es(e[o],t[o]))return!1}return!0}function oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lh(e,t){var n=oh(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oh(n)}}function dv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fv(){for(var e=window,t=rc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=rc(e.document)}return t}function up(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 db(e){var t=fv(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dv(n.ownerDocument.documentElement,n)){if(s!==null&&up(n)){if(t=s.start,e=s.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 o=n.textContent.length,l=Math.min(s.start,o);s=s.end===void 0?l:Math.min(s.end,o),!e.extend&&l>s&&(o=s,s=l,l=o),o=lh(n,l);var a=lh(n,s);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>s?(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 fb=fr&&"documentMode"in document&&11>=document.documentMode,ll=null,Ad=null,ha=null,Od=!1;function ah(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Od||ll==null||ll!==rc(s)||(s=ll,"selectionStart"in s&&up(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ha&&Ca(ha,s)||(ha=s,s=dc(Ad,"onSelect"),0<s.length&&(t=new ap("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ll)))}function ui(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var al={animationend:ui("Animation","AnimationEnd"),animationiteration:ui("Animation","AnimationIteration"),animationstart:ui("Animation","AnimationStart"),transitionend:ui("Transition","TransitionEnd")},Pu={},pv={};fr&&(pv=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function Hc(e){if(Pu[e])return Pu[e];if(!al[e])return e;var t=al[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pv)return Pu[e]=t[n];return e}var mv=Hc("animationend"),hv=Hc("animationiteration"),gv=Hc("animationstart"),xv=Hc("transitionend"),vv=new Map,ih="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 ro(e,t){vv.set(e,t),Uo(t,[e])}for(var Mu=0;Mu<ih.length;Mu++){var Tu=ih[Mu],pb=Tu.toLowerCase(),mb=Tu[0].toUpperCase()+Tu.slice(1);ro(pb,"on"+mb)}ro(mv,"onAnimationEnd");ro(hv,"onAnimationIteration");ro(gv,"onAnimationStart");ro("dblclick","onDoubleClick");ro("focusin","onFocus");ro("focusout","onBlur");ro(xv,"onTransitionEnd");Nl("onMouseEnter",["mouseout","mouseover"]);Nl("onMouseLeave",["mouseout","mouseover"]);Nl("onPointerEnter",["pointerout","pointerover"]);Nl("onPointerLeave",["pointerout","pointerover"]);Uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Uo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ca="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(" "),hb=new Set("cancel close invalid load scroll toggle".split(" ").concat(ca));function ch(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,p1(s,t,void 0,e),e.currentTarget=null}function yv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],o=s.event;s=s.listeners;e:{var l=void 0;if(t)for(var a=s.length-1;0<=a;a--){var i=s[a],c=i.instance,d=i.currentTarget;if(i=i.listener,c!==l&&o.isPropagationStopped())break e;ch(o,i,d),l=c}else for(a=0;a<s.length;a++){if(i=s[a],c=i.instance,d=i.currentTarget,i=i.listener,c!==l&&o.isPropagationStopped())break e;ch(o,i,d),l=c}}}if(lc)throw e=Md,lc=!1,Md=null,e}function ht(e,t){var n=t[Bd];n===void 0&&(n=t[Bd]=new Set);var s=e+"__bubble";n.has(s)||(wv(t,e,2,!1),n.add(s))}function $u(e,t,n){var s=0;t&&(s|=4),wv(n,e,s,t)}var di="_reactListening"+Math.random().toString(36).slice(2);function Ea(e){if(!e[di]){e[di]=!0,Cx.forEach(function(n){n!=="selectionchange"&&(hb.has(n)||$u(n,!1,e),$u(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[di]||(t[di]=!0,$u("selectionchange",!1,t))}}function wv(e,t,n,s){switch(sv(t)){case 1:var o=R1;break;case 4:o=P1;break;default:o=op}n=o.bind(null,t,n,e),o=void 0,!Pd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Iu(e,t,n,s,o){var l=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var i=s.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;i!==null;){if(a=_o(i),a===null)return;if(c=a.tag,c===5||c===6){s=l=a;continue e}i=i.parentNode}}s=s.return}Hx(function(){var d=l,f=tp(n),m=[];e:{var p=vv.get(e);if(p!==void 0){var h=ap,g=e;switch(e){case"keypress":if(Hi(n)===0)break e;case"keydown":case"keyup":h=W1;break;case"focusin":g="focus",h=Cu;break;case"focusout":g="blur",h=Cu;break;case"beforeblur":case"afterblur":h=Cu;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":h=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=$1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=K1;break;case mv:case hv:case gv:h=O1;break;case xv:h=Q1;break;case"scroll":h=M1;break;case"wheel":h=J1;break;case"copy":case"cut":case"paste":h=z1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Zm}var w=(t&4)!==0,j=!w&&e==="scroll",v=w?p!==null?p+"Capture":null:p;w=[];for(var x=d,y;x!==null;){y=x;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,v!==null&&(b=ba(x,v),b!=null&&w.push(Ra(x,b,y)))),j)break;x=x.return}0<w.length&&(p=new h(p,g,null,n,f),m.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Ed&&(g=n.relatedTarget||n.fromElement)&&(_o(g)||g[pr]))break e;if((h||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=d,g=g?_o(g):null,g!==null&&(j=Ho(g),g!==j||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=d),h!==g)){if(w=Xm,b="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(w=Zm,b="onPointerLeave",v="onPointerEnter",x="pointer"),j=h==null?p:il(h),y=g==null?p:il(g),p=new w(b,x+"leave",h,n,f),p.target=j,p.relatedTarget=y,b=null,_o(f)===d&&(w=new w(v,x+"enter",g,n,f),w.target=y,w.relatedTarget=j,b=w),j=b,h&&g)t:{for(w=h,v=g,x=0,y=w;y;y=Xo(y))x++;for(y=0,b=v;b;b=Xo(b))y++;for(;0<x-y;)w=Xo(w),x--;for(;0<y-x;)v=Xo(v),y--;for(;x--;){if(w===v||v!==null&&w===v.alternate)break t;w=Xo(w),v=Xo(v)}w=null}else w=null;h!==null&&uh(m,p,h,w,!1),g!==null&&j!==null&&uh(m,j,g,w,!0)}}e:{if(p=d?il(d):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=ob;else if(nh(p))if(cv)S=cb;else{S=ab;var N=lb}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=ib);if(S&&(S=S(e,d))){iv(m,S,n,f);break e}N&&N(e,p,d),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&_d(p,"number",p.value)}switch(N=d?il(d):window,e){case"focusin":(nh(N)||N.contentEditable==="true")&&(ll=N,Ad=d,ha=null);break;case"focusout":ha=Ad=ll=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,ah(m,n,f);break;case"selectionchange":if(fb)break;case"keydown":case"keyup":ah(m,n,f)}var k;if(cp)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else ol?lv(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(ov&&n.locale!=="ko"&&(ol||C!=="onCompositionStart"?C==="onCompositionEnd"&&ol&&(k=rv()):(Lr=f,lp="value"in Lr?Lr.value:Lr.textContent,ol=!0)),N=dc(d,C),0<N.length&&(C=new Jm(C,e,null,n,f),m.push({event:C,listeners:N}),k?C.data=k:(k=av(n),k!==null&&(C.data=k)))),(k=eb?tb(e,n):nb(e,n))&&(d=dc(d,"onBeforeInput"),0<d.length&&(f=new Jm("onBeforeInput","beforeinput",null,n,f),m.push({event:f,listeners:d}),f.data=k))}yv(m,t)})}function Ra(e,t,n){return{instance:e,listener:t,currentTarget:n}}function dc(e,t){for(var n=t+"Capture",s=[];e!==null;){var o=e,l=o.stateNode;o.tag===5&&l!==null&&(o=l,l=ba(e,n),l!=null&&s.unshift(Ra(e,l,o)),l=ba(e,t),l!=null&&s.push(Ra(e,l,o))),e=e.return}return s}function Xo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function uh(e,t,n,s,o){for(var l=t._reactName,a=[];n!==null&&n!==s;){var i=n,c=i.alternate,d=i.stateNode;if(c!==null&&c===s)break;i.tag===5&&d!==null&&(i=d,o?(c=ba(n,l),c!=null&&a.unshift(Ra(n,c,i))):o||(c=ba(n,l),c!=null&&a.push(Ra(n,c,i)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var gb=/\r\n?/g,xb=/\u0000|\uFFFD/g;function dh(e){return(typeof e=="string"?e:""+e).replace(gb,`
|
|
38
|
-
`).replace(xb,"")}function fi(e,t,n){if(t=dh(t),dh(e)!==t&&n)throw Error(ne(425))}function fc(){}var Ld=null,zd=null;function Dd(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 Fd=typeof setTimeout=="function"?setTimeout:void 0,vb=typeof clearTimeout=="function"?clearTimeout:void 0,fh=typeof Promise=="function"?Promise:void 0,yb=typeof queueMicrotask=="function"?queueMicrotask:typeof fh<"u"?function(e){return fh.resolve(null).then(e).catch(wb)}:Fd;function wb(e){setTimeout(function(){throw e})}function Au(e,t){var n=t,s=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(s===0){e.removeChild(o),ka(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=o}while(n);ka(t)}function Vr(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 ph(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 Ul=Math.random().toString(36).slice(2),Hs="__reactFiber$"+Ul,Pa="__reactProps$"+Ul,pr="__reactContainer$"+Ul,Bd="__reactEvents$"+Ul,jb="__reactListeners$"+Ul,bb="__reactHandles$"+Ul;function _o(e){var t=e[Hs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pr]||n[Hs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ph(e);e!==null;){if(n=e[Hs])return n;e=ph(e)}return t}e=n,n=e.parentNode}return null}function Ga(e){return e=e[Hs]||e[pr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function il(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function Vc(e){return e[Pa]||null}var Ud=[],cl=-1;function oo(e){return{current:e}}function gt(e){0>cl||(e.current=Ud[cl],Ud[cl]=null,cl--)}function ut(e,t){cl++,Ud[cl]=e.current,e.current=t}var to={},yn=oo(to),On=oo(!1),Po=to;function Cl(e,t){var n=e.type.contextTypes;if(!n)return to;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ln(e){return e=e.childContextTypes,e!=null}function pc(){gt(On),gt(yn)}function mh(e,t,n){if(yn.current!==to)throw Error(ne(168));ut(yn,t),ut(On,n)}function jv(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var o in s)if(!(o in t))throw Error(ne(108,l1(e)||"Unknown",o));return St({},n,s)}function mc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||to,Po=yn.current,ut(yn,e),ut(On,On.current),!0}function hh(e,t,n){var s=e.stateNode;if(!s)throw Error(ne(169));n?(e=jv(e,t,Po),s.__reactInternalMemoizedMergedChildContext=e,gt(On),gt(yn),ut(yn,e)):gt(On),ut(On,n)}var sr=null,Wc=!1,Ou=!1;function bv(e){sr===null?sr=[e]:sr.push(e)}function _b(e){Wc=!0,bv(e)}function lo(){if(!Ou&&sr!==null){Ou=!0;var e=0,t=st;try{var n=sr;for(st=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}sr=null,Wc=!1}catch(o){throw sr!==null&&(sr=sr.slice(e+1)),Gx(np,lo),o}finally{st=t,Ou=!1}}return null}var ul=[],dl=0,hc=null,gc=0,ss=[],rs=0,Mo=null,rr=1,or="";function jo(e,t){ul[dl++]=gc,ul[dl++]=hc,hc=e,gc=t}function _v(e,t,n){ss[rs++]=rr,ss[rs++]=or,ss[rs++]=Mo,Mo=e;var s=rr;e=or;var o=32-Ns(s)-1;s&=~(1<<o),n+=1;var l=32-Ns(t)+o;if(30<l){var a=o-o%5;l=(s&(1<<a)-1).toString(32),s>>=a,o-=a,rr=1<<32-Ns(t)+o|n<<o|s,or=l+e}else rr=1<<l|n<<o|s,or=e}function dp(e){e.return!==null&&(jo(e,1),_v(e,1,0))}function fp(e){for(;e===hc;)hc=ul[--dl],ul[dl]=null,gc=ul[--dl],ul[dl]=null;for(;e===Mo;)Mo=ss[--rs],ss[rs]=null,or=ss[--rs],ss[rs]=null,rr=ss[--rs],ss[rs]=null}var Kn=null,qn=null,vt=!1,ks=null;function Sv(e,t){var n=ls(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 gh(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,Kn=e,qn=Vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Kn=e,qn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Mo!==null?{id:rr,overflow:or}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ls(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Kn=e,qn=null,!0):!1;default:return!1}}function Hd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vd(e){if(vt){var t=qn;if(t){var n=t;if(!gh(e,t)){if(Hd(e))throw Error(ne(418));t=Vr(n.nextSibling);var s=Kn;t&&gh(e,t)?Sv(s,n):(e.flags=e.flags&-4097|2,vt=!1,Kn=e)}}else{if(Hd(e))throw Error(ne(418));e.flags=e.flags&-4097|2,vt=!1,Kn=e}}}function xh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Kn=e}function pi(e){if(e!==Kn)return!1;if(!vt)return xh(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Dd(e.type,e.memoizedProps)),t&&(t=qn)){if(Hd(e))throw kv(),Error(ne(418));for(;t;)Sv(e,t),t=Vr(t.nextSibling)}if(xh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){qn=Vr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}qn=null}}else qn=Kn?Vr(e.stateNode.nextSibling):null;return!0}function kv(){for(var e=qn;e;)e=Vr(e.nextSibling)}function El(){qn=Kn=null,vt=!1}function pp(e){ks===null?ks=[e]:ks.push(e)}var Sb=yr.ReactCurrentBatchConfig;function ea(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(ne(309));var s=n.stateNode}if(!s)throw Error(ne(147,e));var o=s,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var i=o.refs;a===null?delete i[l]:i[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,e))}return e}function mi(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vh(e){var t=e._init;return t(e._payload)}function Nv(e){function t(v,x){if(e){var y=v.deletions;y===null?(v.deletions=[x],v.flags|=16):y.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function s(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=Kr(v,x),v.index=0,v.sibling=null,v}function l(v,x,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<x?(v.flags|=2,x):y):(v.flags|=2,x)):(v.flags|=1048576,x)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function i(v,x,y,b){return x===null||x.tag!==6?(x=Hu(y,v.mode,b),x.return=v,x):(x=o(x,y),x.return=v,x)}function c(v,x,y,b){var S=y.type;return S===rl?f(v,x,y.props.children,b,y.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Tr&&vh(S)===x.type)?(b=o(x,y.props),b.ref=ea(v,x,y),b.return=v,b):(b=Qi(y.type,y.key,y.props,null,v.mode,b),b.ref=ea(v,x,y),b.return=v,b)}function d(v,x,y,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation?(x=Vu(y,v.mode,b),x.return=v,x):(x=o(x,y.children||[]),x.return=v,x)}function f(v,x,y,b,S){return x===null||x.tag!==7?(x=Co(y,v.mode,b,S),x.return=v,x):(x=o(x,y),x.return=v,x)}function m(v,x,y){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Hu(""+x,v.mode,y),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case si:return y=Qi(x.type,x.key,x.props,null,v.mode,y),y.ref=ea(v,null,x),y.return=v,y;case sl:return x=Vu(x,v.mode,y),x.return=v,x;case Tr:var b=x._init;return m(v,b(x._payload),y)}if(aa(x)||Yl(x))return x=Co(x,v.mode,y,null),x.return=v,x;mi(v,x)}return null}function p(v,x,y,b){var S=x!==null?x.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:i(v,x,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case si:return y.key===S?c(v,x,y,b):null;case sl:return y.key===S?d(v,x,y,b):null;case Tr:return S=y._init,p(v,x,S(y._payload),b)}if(aa(y)||Yl(y))return S!==null?null:f(v,x,y,b,null);mi(v,y)}return null}function h(v,x,y,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(y)||null,i(x,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case si:return v=v.get(b.key===null?y:b.key)||null,c(x,v,b,S);case sl:return v=v.get(b.key===null?y:b.key)||null,d(x,v,b,S);case Tr:var N=b._init;return h(v,x,y,N(b._payload),S)}if(aa(b)||Yl(b))return v=v.get(y)||null,f(x,v,b,S,null);mi(x,b)}return null}function g(v,x,y,b){for(var S=null,N=null,k=x,C=x=0,O=null;k!==null&&C<y.length;C++){k.index>C?(O=k,k=null):O=k.sibling;var R=p(v,k,y[C],b);if(R===null){k===null&&(k=O);break}e&&k&&R.alternate===null&&t(v,k),x=l(R,x,C),N===null?S=R:N.sibling=R,N=R,k=O}if(C===y.length)return n(v,k),vt&&jo(v,C),S;if(k===null){for(;C<y.length;C++)k=m(v,y[C],b),k!==null&&(x=l(k,x,C),N===null?S=k:N.sibling=k,N=k);return vt&&jo(v,C),S}for(k=s(v,k);C<y.length;C++)O=h(k,v,C,y[C],b),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?C:O.key),x=l(O,x,C),N===null?S=O:N.sibling=O,N=O);return e&&k.forEach(function(z){return t(v,z)}),vt&&jo(v,C),S}function w(v,x,y,b){var S=Yl(y);if(typeof S!="function")throw Error(ne(150));if(y=S.call(y),y==null)throw Error(ne(151));for(var N=S=null,k=x,C=x=0,O=null,R=y.next();k!==null&&!R.done;C++,R=y.next()){k.index>C?(O=k,k=null):O=k.sibling;var z=p(v,k,R.value,b);if(z===null){k===null&&(k=O);break}e&&k&&z.alternate===null&&t(v,k),x=l(z,x,C),N===null?S=z:N.sibling=z,N=z,k=O}if(R.done)return n(v,k),vt&&jo(v,C),S;if(k===null){for(;!R.done;C++,R=y.next())R=m(v,R.value,b),R!==null&&(x=l(R,x,C),N===null?S=R:N.sibling=R,N=R);return vt&&jo(v,C),S}for(k=s(v,k);!R.done;C++,R=y.next())R=h(k,v,C,R.value,b),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?C:R.key),x=l(R,x,C),N===null?S=R:N.sibling=R,N=R);return e&&k.forEach(function(V){return t(v,V)}),vt&&jo(v,C),S}function j(v,x,y,b){if(typeof y=="object"&&y!==null&&y.type===rl&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case si:e:{for(var S=y.key,N=x;N!==null;){if(N.key===S){if(S=y.type,S===rl){if(N.tag===7){n(v,N.sibling),x=o(N,y.props.children),x.return=v,v=x;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Tr&&vh(S)===N.type){n(v,N.sibling),x=o(N,y.props),x.ref=ea(v,N,y),x.return=v,v=x;break e}n(v,N);break}else t(v,N);N=N.sibling}y.type===rl?(x=Co(y.props.children,v.mode,b,y.key),x.return=v,v=x):(b=Qi(y.type,y.key,y.props,null,v.mode,b),b.ref=ea(v,x,y),b.return=v,v=b)}return a(v);case sl:e:{for(N=y.key;x!==null;){if(x.key===N)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(v,x.sibling),x=o(x,y.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=Vu(y,v.mode,b),x.return=v,v=x}return a(v);case Tr:return N=y._init,j(v,x,N(y._payload),b)}if(aa(y))return g(v,x,y,b);if(Yl(y))return w(v,x,y,b);mi(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,y),x.return=v,v=x):(n(v,x),x=Hu(y,v.mode,b),x.return=v,v=x),a(v)):n(v,x)}return j}var Rl=Nv(!0),Cv=Nv(!1),xc=oo(null),vc=null,fl=null,mp=null;function hp(){mp=fl=vc=null}function gp(e){var t=xc.current;gt(xc),e._currentValue=t}function Wd(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function wl(e,t){vc=e,mp=fl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(An=!0),e.firstContext=null)}function us(e){var t=e._currentValue;if(mp!==e)if(e={context:e,memoizedValue:t,next:null},fl===null){if(vc===null)throw Error(ne(308));fl=e,vc.dependencies={lanes:0,firstContext:e}}else fl=fl.next=e;return t}var So=null;function xp(e){So===null?So=[e]:So.push(e)}function Ev(e,t,n,s){var o=t.interleaved;return o===null?(n.next=n,xp(t)):(n.next=o.next,o.next=n),t.interleaved=n,mr(e,s)}function mr(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 $r=!1;function vp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rv(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 ir(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wr(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,Je&2){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,mr(e,n)}return o=s.interleaved,o===null?(t.next=t,xp(s)):(t.next=o.next,o.next=t),s.interleaved=t,mr(e,n)}function Vi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,sp(e,n)}}function yh(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var o=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?o=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?o=l=t:l=l.next=t}else o=l=t;n={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:l,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yc(e,t,n,s){var o=e.updateQueue;$r=!1;var l=o.firstBaseUpdate,a=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var c=i,d=c.next;c.next=null,a===null?l=d:a.next=d,a=c;var f=e.alternate;f!==null&&(f=f.updateQueue,i=f.lastBaseUpdate,i!==a&&(i===null?f.firstBaseUpdate=d:i.next=d,f.lastBaseUpdate=c))}if(l!==null){var m=o.baseState;a=0,f=d=c=null,i=l;do{var p=i.lane,h=i.eventTime;if((s&p)===p){f!==null&&(f=f.next={eventTime:h,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var g=e,w=i;switch(p=t,h=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){m=g.call(h,m,p);break e}m=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,p=typeof g=="function"?g.call(h,m,p):g,p==null)break e;m=St({},m,p);break e;case 2:$r=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[i]:p.push(i))}else h={eventTime:h,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},f===null?(d=f=h,c=m):f=f.next=h,a|=p;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;p=i,i=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(f===null&&(c=m),o.baseState=c,o.firstBaseUpdate=d,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else l===null&&(o.shared.lanes=0);$o|=a,e.lanes=a,e.memoizedState=m}}function wh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],o=s.callback;if(o!==null){if(s.callback=null,s=n,typeof o!="function")throw Error(ne(191,o));o.call(s)}}}var Ka={},Gs=oo(Ka),Ma=oo(Ka),Ta=oo(Ka);function ko(e){if(e===Ka)throw Error(ne(174));return e}function yp(e,t){switch(ut(Ta,t),ut(Ma,e),ut(Gs,Ka),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kd(t,e)}gt(Gs),ut(Gs,t)}function Pl(){gt(Gs),gt(Ma),gt(Ta)}function Pv(e){ko(Ta.current);var t=ko(Gs.current),n=kd(t,e.type);t!==n&&(ut(Ma,e),ut(Gs,n))}function wp(e){Ma.current===e&&(gt(Gs),gt(Ma))}var bt=oo(0);function wc(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 Lu=[];function jp(){for(var e=0;e<Lu.length;e++)Lu[e]._workInProgressVersionPrimary=null;Lu.length=0}var Wi=yr.ReactCurrentDispatcher,zu=yr.ReactCurrentBatchConfig,To=0,_t=null,Kt=null,tn=null,jc=!1,ga=!1,$a=0,kb=0;function mn(){throw Error(ne(321))}function bp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Es(e[n],t[n]))return!1;return!0}function _p(e,t,n,s,o,l){if(To=l,_t=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wi.current=e===null||e.memoizedState===null?Rb:Pb,e=n(s,o),ga){l=0;do{if(ga=!1,$a=0,25<=l)throw Error(ne(301));l+=1,tn=Kt=null,t.updateQueue=null,Wi.current=Mb,e=n(s,o)}while(ga)}if(Wi.current=bc,t=Kt!==null&&Kt.next!==null,To=0,tn=Kt=_t=null,jc=!1,t)throw Error(ne(300));return e}function Sp(){var e=$a!==0;return $a=0,e}function Bs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?_t.memoizedState=tn=e:tn=tn.next=e,tn}function ds(){if(Kt===null){var e=_t.alternate;e=e!==null?e.memoizedState:null}else e=Kt.next;var t=tn===null?_t.memoizedState:tn.next;if(t!==null)tn=t,Kt=e;else{if(e===null)throw Error(ne(310));Kt=e,e={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},tn===null?_t.memoizedState=tn=e:tn=tn.next=e}return tn}function Ia(e,t){return typeof t=="function"?t(e):t}function Du(e){var t=ds(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var s=Kt,o=s.baseQueue,l=n.pending;if(l!==null){if(o!==null){var a=o.next;o.next=l.next,l.next=a}s.baseQueue=o=l,n.pending=null}if(o!==null){l=o.next,s=s.baseState;var i=a=null,c=null,d=l;do{var f=d.lane;if((To&f)===f)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),s=d.hasEagerState?d.eagerState:e(s,d.action);else{var m={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(i=c=m,a=s):c=c.next=m,_t.lanes|=f,$o|=f}d=d.next}while(d!==null&&d!==l);c===null?a=s:c.next=i,Es(s,t.memoizedState)||(An=!0),t.memoizedState=s,t.baseState=a,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){o=e;do l=o.lane,_t.lanes|=l,$o|=l,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fu(e){var t=ds(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var s=n.dispatch,o=n.pending,l=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do l=e(l,a.action),a=a.next;while(a!==o);Es(l,t.memoizedState)||(An=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,s]}function Mv(){}function Tv(e,t){var n=_t,s=ds(),o=t(),l=!Es(s.memoizedState,o);if(l&&(s.memoizedState=o,An=!0),s=s.queue,kp(Av.bind(null,n,s,e),[e]),s.getSnapshot!==t||l||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,Aa(9,Iv.bind(null,n,s,o,t),void 0,null),rn===null)throw Error(ne(349));To&30||$v(n,t,o)}return o}function $v(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Iv(e,t,n,s){t.value=n,t.getSnapshot=s,Ov(t)&&Lv(e)}function Av(e,t,n){return n(function(){Ov(t)&&Lv(e)})}function Ov(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Es(e,n)}catch{return!0}}function Lv(e){var t=mr(e,1);t!==null&&Cs(t,e,1,-1)}function jh(e){var t=Bs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:e},t.queue=e,e=e.dispatch=Eb.bind(null,_t,e),[t.memoizedState,e]}function Aa(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function zv(){return ds().memoizedState}function qi(e,t,n,s){var o=Bs();_t.flags|=e,o.memoizedState=Aa(1|t,n,void 0,s===void 0?null:s)}function qc(e,t,n,s){var o=ds();s=s===void 0?null:s;var l=void 0;if(Kt!==null){var a=Kt.memoizedState;if(l=a.destroy,s!==null&&bp(s,a.deps)){o.memoizedState=Aa(t,n,l,s);return}}_t.flags|=e,o.memoizedState=Aa(1|t,n,l,s)}function bh(e,t){return qi(8390656,8,e,t)}function kp(e,t){return qc(2048,8,e,t)}function Dv(e,t){return qc(4,2,e,t)}function Fv(e,t){return qc(4,4,e,t)}function Bv(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 Uv(e,t,n){return n=n!=null?n.concat([e]):null,qc(4,4,Bv.bind(null,t,e),n)}function Np(){}function Hv(e,t){var n=ds();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&bp(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Vv(e,t){var n=ds();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&bp(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Wv(e,t,n){return To&21?(Es(n,t)||(n=Qx(),_t.lanes|=n,$o|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,An=!0),e.memoizedState=n)}function Nb(e,t){var n=st;st=n!==0&&4>n?n:4,e(!0);var s=zu.transition;zu.transition={};try{e(!1),t()}finally{st=n,zu.transition=s}}function qv(){return ds().memoizedState}function Cb(e,t,n){var s=Gr(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Gv(e))Kv(t,n);else if(n=Ev(e,t,n,s),n!==null){var o=Cn();Cs(n,e,s,o),Yv(n,t,s)}}function Eb(e,t,n){var s=Gr(e),o={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gv(e))Kv(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,i=l(a,n);if(o.hasEagerState=!0,o.eagerState=i,Es(i,a)){var c=t.interleaved;c===null?(o.next=o,xp(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Ev(e,t,o,s),n!==null&&(o=Cn(),Cs(n,e,s,o),Yv(n,t,s))}}function Gv(e){var t=e.alternate;return e===_t||t!==null&&t===_t}function Kv(e,t){ga=jc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yv(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,sp(e,n)}}var bc={readContext:us,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useInsertionEffect:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useSyncExternalStore:mn,useId:mn,unstable_isNewReconciler:!1},Rb={readContext:us,useCallback:function(e,t){return Bs().memoizedState=[e,t===void 0?null:t],e},useContext:us,useEffect:bh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qi(4194308,4,Bv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qi(4194308,4,e,t)},useInsertionEffect:function(e,t){return qi(4,2,e,t)},useMemo:function(e,t){var n=Bs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Bs();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Cb.bind(null,_t,e),[s.memoizedState,e]},useRef:function(e){var t=Bs();return e={current:e},t.memoizedState=e},useState:jh,useDebugValue:Np,useDeferredValue:function(e){return Bs().memoizedState=e},useTransition:function(){var e=jh(!1),t=e[0];return e=Nb.bind(null,e[1]),Bs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=_t,o=Bs();if(vt){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),rn===null)throw Error(ne(349));To&30||$v(s,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,bh(Av.bind(null,s,l,e),[e]),s.flags|=2048,Aa(9,Iv.bind(null,s,l,n,t),void 0,null),n},useId:function(){var e=Bs(),t=rn.identifierPrefix;if(vt){var n=or,s=rr;n=(s&~(1<<32-Ns(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=$a++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=kb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Pb={readContext:us,useCallback:Hv,useContext:us,useEffect:kp,useImperativeHandle:Uv,useInsertionEffect:Dv,useLayoutEffect:Fv,useMemo:Vv,useReducer:Du,useRef:zv,useState:function(){return Du(Ia)},useDebugValue:Np,useDeferredValue:function(e){var t=ds();return Wv(t,Kt.memoizedState,e)},useTransition:function(){var e=Du(Ia)[0],t=ds().memoizedState;return[e,t]},useMutableSource:Mv,useSyncExternalStore:Tv,useId:qv,unstable_isNewReconciler:!1},Mb={readContext:us,useCallback:Hv,useContext:us,useEffect:kp,useImperativeHandle:Uv,useInsertionEffect:Dv,useLayoutEffect:Fv,useMemo:Vv,useReducer:Fu,useRef:zv,useState:function(){return Fu(Ia)},useDebugValue:Np,useDeferredValue:function(e){var t=ds();return Kt===null?t.memoizedState=e:Wv(t,Kt.memoizedState,e)},useTransition:function(){var e=Fu(Ia)[0],t=ds().memoizedState;return[e,t]},useMutableSource:Mv,useSyncExternalStore:Tv,useId:qv,unstable_isNewReconciler:!1};function _s(e,t){if(e&&e.defaultProps){t=St({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qd(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:St({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gc={isMounted:function(e){return(e=e._reactInternals)?Ho(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Cn(),o=Gr(e),l=ir(s,o);l.payload=t,n!=null&&(l.callback=n),t=Wr(e,l,o),t!==null&&(Cs(t,e,o,s),Vi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Cn(),o=Gr(e),l=ir(s,o);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Wr(e,l,o),t!==null&&(Cs(t,e,o,s),Vi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cn(),s=Gr(e),o=ir(n,s);o.tag=2,t!=null&&(o.callback=t),t=Wr(e,o,s),t!==null&&(Cs(t,e,s,n),Vi(t,e,s))}};function _h(e,t,n,s,o,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,l,a):t.prototype&&t.prototype.isPureReactComponent?!Ca(n,s)||!Ca(o,l):!0}function Qv(e,t,n){var s=!1,o=to,l=t.contextType;return typeof l=="object"&&l!==null?l=us(l):(o=Ln(t)?Po:yn.current,s=t.contextTypes,l=(s=s!=null)?Cl(e,o):to),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Gc,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=l),t}function Sh(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Gc.enqueueReplaceState(t,t.state,null)}function Gd(e,t,n,s){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},vp(e);var l=t.contextType;typeof l=="object"&&l!==null?o.context=us(l):(l=Ln(t)?Po:yn.current,o.context=Cl(e,l)),o.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(qd(e,t,l,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Gc.enqueueReplaceState(o,o.state,null),yc(e,n,o,s),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ml(e,t){try{var n="",s=t;do n+=o1(s),s=s.return;while(s);var o=n}catch(l){o=`
|
|
39
|
-
Error generating stack: `+l.message+`
|
|
40
|
-
`+l.stack}return{value:e,source:t,stack:o,digest:null}}function Bu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Kd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Tb=typeof WeakMap=="function"?WeakMap:Map;function Xv(e,t,n){n=ir(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Sc||(Sc=!0,rf=s),Kd(e,t)},n}function Jv(e,t,n){n=ir(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var o=t.value;n.payload=function(){return s(o)},n.callback=function(){Kd(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Kd(e,t),typeof s!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function kh(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Tb;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(n)||(o.add(n),e=qb.bind(null,e,t,n),t.then(e,e))}function Nh(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 Ch(e,t,n,s,o){return e.mode&1?(e.flags|=65536,e.lanes=o,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=ir(-1,1),t.tag=2,Wr(n,t,1))),n.lanes|=1),e)}var $b=yr.ReactCurrentOwner,An=!1;function Sn(e,t,n,s){t.child=e===null?Cv(t,null,n,s):Rl(t,e.child,n,s)}function Eh(e,t,n,s,o){n=n.render;var l=t.ref;return wl(t,o),s=_p(e,t,n,s,l,o),n=Sp(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hr(e,t,o)):(vt&&n&&dp(t),t.flags|=1,Sn(e,t,s,o),t.child)}function Rh(e,t,n,s,o){if(e===null){var l=n.type;return typeof l=="function"&&!Ip(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Zv(e,t,l,s,o)):(e=Qi(n.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&o)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:Ca,n(a,s)&&e.ref===t.ref)return hr(e,t,o)}return t.flags|=1,e=Kr(l,s),e.ref=t.ref,e.return=t,t.child=e}function Zv(e,t,n,s,o){if(e!==null){var l=e.memoizedProps;if(Ca(l,s)&&e.ref===t.ref)if(An=!1,t.pendingProps=s=l,(e.lanes&o)!==0)e.flags&131072&&(An=!0);else return t.lanes=e.lanes,hr(e,t,o)}return Yd(e,t,n,s,o)}function ey(e,t,n){var s=t.pendingProps,o=s.children,l=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(ml,Vn),Vn|=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,ut(ml,Vn),Vn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=l!==null?l.baseLanes:n,ut(ml,Vn),Vn|=s}else l!==null?(s=l.baseLanes|n,t.memoizedState=null):s=n,ut(ml,Vn),Vn|=s;return Sn(e,t,o,n),t.child}function ty(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Yd(e,t,n,s,o){var l=Ln(n)?Po:yn.current;return l=Cl(t,l),wl(t,o),n=_p(e,t,n,s,l,o),s=Sp(),e!==null&&!An?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,hr(e,t,o)):(vt&&s&&dp(t),t.flags|=1,Sn(e,t,n,o),t.child)}function Ph(e,t,n,s,o){if(Ln(n)){var l=!0;mc(t)}else l=!1;if(wl(t,o),t.stateNode===null)Gi(e,t),Qv(t,n,s),Gd(t,n,s,o),s=!0;else if(e===null){var a=t.stateNode,i=t.memoizedProps;a.props=i;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=us(d):(d=Ln(n)?Po:yn.current,d=Cl(t,d));var f=n.getDerivedStateFromProps,m=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";m||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==s||c!==d)&&Sh(t,a,s,d),$r=!1;var p=t.memoizedState;a.state=p,yc(t,s,a,o),c=t.memoizedState,i!==s||p!==c||On.current||$r?(typeof f=="function"&&(qd(t,n,f,s),c=t.memoizedState),(i=$r||_h(t,n,i,s,p,c,d))?(m||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=s,t.memoizedState=c),a.props=s,a.state=c,a.context=d,s=i):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,Rv(e,t),i=t.memoizedProps,d=t.type===t.elementType?i:_s(t.type,i),a.props=d,m=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=us(c):(c=Ln(n)?Po:yn.current,c=Cl(t,c));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(i!==m||p!==c)&&Sh(t,a,s,c),$r=!1,p=t.memoizedState,a.state=p,yc(t,s,a,o);var g=t.memoizedState;i!==m||p!==g||On.current||$r?(typeof h=="function"&&(qd(t,n,h,s),g=t.memoizedState),(d=$r||_h(t,n,d,s,p,g,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=g),a.props=s,a.state=g,a.context=c,s=d):(typeof a.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),s=!1)}return Qd(e,t,n,s,l,o)}function Qd(e,t,n,s,o,l){ty(e,t);var a=(t.flags&128)!==0;if(!s&&!a)return o&&hh(t,n,!1),hr(e,t,l);s=t.stateNode,$b.current=t;var i=a&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&a?(t.child=Rl(t,e.child,null,l),t.child=Rl(t,null,i,l)):Sn(e,t,i,l),t.memoizedState=s.state,o&&hh(t,n,!0),t.child}function ny(e){var t=e.stateNode;t.pendingContext?mh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&mh(e,t.context,!1),yp(e,t.containerInfo)}function Mh(e,t,n,s,o){return El(),pp(o),t.flags|=256,Sn(e,t,n,s),t.child}var Xd={dehydrated:null,treeContext:null,retryLane:0};function Jd(e){return{baseLanes:e,cachePool:null,transitions:null}}function sy(e,t,n){var s=t.pendingProps,o=bt.current,l=!1,a=(t.flags&128)!==0,i;if((i=a)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ut(bt,o&1),e===null)return Vd(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=s.children,e=s.fallback,l?(s=t.mode,l=t.child,a={mode:"hidden",children:a},!(s&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=Qc(a,s,0,null),e=Co(e,s,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Jd(n),t.memoizedState=Xd,e):Cp(t,a));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return Ib(e,t,a,s,i,o,n);if(l){l=s.fallback,a=t.mode,o=e.child,i=o.sibling;var c={mode:"hidden",children:s.children};return!(a&1)&&t.child!==o?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Kr(o,c),s.subtreeFlags=o.subtreeFlags&14680064),i!==null?l=Kr(i,l):(l=Co(l,a,n,null),l.flags|=2),l.return=t,s.return=t,s.sibling=l,t.child=s,s=l,l=t.child,a=e.child.memoizedState,a=a===null?Jd(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=Xd,s}return l=e.child,e=l.sibling,s=Kr(l,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Cp(e,t){return t=Qc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hi(e,t,n,s){return s!==null&&pp(s),Rl(t,e.child,null,n),e=Cp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ib(e,t,n,s,o,l,a){if(n)return t.flags&256?(t.flags&=-257,s=Bu(Error(ne(422))),hi(e,t,a,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=s.fallback,o=t.mode,s=Qc({mode:"visible",children:s.children},o,0,null),l=Co(l,o,a,null),l.flags|=2,s.return=t,l.return=t,s.sibling=l,t.child=s,t.mode&1&&Rl(t,e.child,null,a),t.child.memoizedState=Jd(a),t.memoizedState=Xd,l);if(!(t.mode&1))return hi(e,t,a,null);if(o.data==="$!"){if(s=o.nextSibling&&o.nextSibling.dataset,s)var i=s.dgst;return s=i,l=Error(ne(419)),s=Bu(l,s,void 0),hi(e,t,a,s)}if(i=(a&e.childLanes)!==0,An||i){if(s=rn,s!==null){switch(a&-a){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(s.suspendedLanes|a)?0:o,o!==0&&o!==l.retryLane&&(l.retryLane=o,mr(e,o),Cs(s,e,o,-1))}return $p(),s=Bu(Error(ne(421))),hi(e,t,a,s)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Gb.bind(null,e),o._reactRetry=t,null):(e=l.treeContext,qn=Vr(o.nextSibling),Kn=t,vt=!0,ks=null,e!==null&&(ss[rs++]=rr,ss[rs++]=or,ss[rs++]=Mo,rr=e.id,or=e.overflow,Mo=t),t=Cp(t,s.children),t.flags|=4096,t)}function Th(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Wd(e.return,t,n)}function Uu(e,t,n,s,o){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:o}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=s,l.tail=n,l.tailMode=o)}function ry(e,t,n){var s=t.pendingProps,o=s.revealOrder,l=s.tail;if(Sn(e,t,s.children,n),s=bt.current,s&2)s=s&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&&Th(e,n,t);else if(e.tag===19)Th(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}s&=1}if(ut(bt,s),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&wc(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Uu(t,!1,o,n,l);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&wc(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Uu(t,!0,n,null,l);break;case"together":Uu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function hr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$o|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,n=Kr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Kr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ab(e,t,n){switch(t.tag){case 3:ny(t),El();break;case 5:Pv(t);break;case 1:Ln(t.type)&&mc(t);break;case 4:yp(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,o=t.memoizedProps.value;ut(xc,s._currentValue),s._currentValue=o;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(ut(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?sy(e,t,n):(ut(bt,bt.current&1),e=hr(e,t,n),e!==null?e.sibling:null);ut(bt,bt.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return ry(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ut(bt,bt.current),s)break;return null;case 22:case 23:return t.lanes=0,ey(e,t,n)}return hr(e,t,n)}var oy,Zd,ly,ay;oy=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}};Zd=function(){};ly=function(e,t,n,s){var o=e.memoizedProps;if(o!==s){e=t.stateNode,ko(Gs.current);var l=null;switch(n){case"input":o=jd(e,o),s=jd(e,s),l=[];break;case"select":o=St({},o,{value:void 0}),s=St({},s,{value:void 0}),l=[];break;case"textarea":o=Sd(e,o),s=Sd(e,s),l=[];break;default:typeof o.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=fc)}Nd(n,s);var a;n=null;for(d in o)if(!s.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var i=o[d];for(a in i)i.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(wa.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in s){var c=s[d];if(i=o!=null?o[d]:void 0,s.hasOwnProperty(d)&&c!==i&&(c!=null||i!=null))if(d==="style")if(i){for(a in i)!i.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&i[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(l||(l=[]),l.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,i=i?i.__html:void 0,c!=null&&i!==c&&(l=l||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(wa.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ht("scroll",e),l||i===c||(l=[])):(l=l||[]).push(d,c))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}};ay=function(e,t,n,s){n!==s&&(t.flags|=4)};function ta(e,t){if(!vt)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function hn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags&14680064,s|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Ob(e,t,n){var s=t.pendingProps;switch(fp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(t),null;case 1:return Ln(t.type)&&pc(),hn(t),null;case 3:return s=t.stateNode,Pl(),gt(On),gt(yn),jp(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(pi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ks!==null&&(af(ks),ks=null))),Zd(e,t),hn(t),null;case 5:wp(t);var o=ko(Ta.current);if(n=t.type,e!==null&&t.stateNode!=null)ly(e,t,n,s,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(ne(166));return hn(t),null}if(e=ko(Gs.current),pi(t)){s=t.stateNode,n=t.type;var l=t.memoizedProps;switch(s[Hs]=t,s[Pa]=l,e=(t.mode&1)!==0,n){case"dialog":ht("cancel",s),ht("close",s);break;case"iframe":case"object":case"embed":ht("load",s);break;case"video":case"audio":for(o=0;o<ca.length;o++)ht(ca[o],s);break;case"source":ht("error",s);break;case"img":case"image":case"link":ht("error",s),ht("load",s);break;case"details":ht("toggle",s);break;case"input":Bm(s,l),ht("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!l.multiple},ht("invalid",s);break;case"textarea":Hm(s,l),ht("invalid",s)}Nd(n,l),o=null;for(var a in l)if(l.hasOwnProperty(a)){var i=l[a];a==="children"?typeof i=="string"?s.textContent!==i&&(l.suppressHydrationWarning!==!0&&fi(s.textContent,i,e),o=["children",i]):typeof i=="number"&&s.textContent!==""+i&&(l.suppressHydrationWarning!==!0&&fi(s.textContent,i,e),o=["children",""+i]):wa.hasOwnProperty(a)&&i!=null&&a==="onScroll"&&ht("scroll",s)}switch(n){case"input":ri(s),Um(s,l,!0);break;case"textarea":ri(s),Vm(s);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(s.onclick=fc)}s=o,t.updateQueue=s,s!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ax(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=a.createElement(n,{is:s.is}):(e=a.createElement(n),n==="select"&&(a=e,s.multiple?a.multiple=!0:s.size&&(a.size=s.size))):e=a.createElementNS(e,n),e[Hs]=t,e[Pa]=s,oy(e,t,!1,!1),t.stateNode=e;e:{switch(a=Cd(n,s),n){case"dialog":ht("cancel",e),ht("close",e),o=s;break;case"iframe":case"object":case"embed":ht("load",e),o=s;break;case"video":case"audio":for(o=0;o<ca.length;o++)ht(ca[o],e);o=s;break;case"source":ht("error",e),o=s;break;case"img":case"image":case"link":ht("error",e),ht("load",e),o=s;break;case"details":ht("toggle",e),o=s;break;case"input":Bm(e,s),o=jd(e,s),ht("invalid",e);break;case"option":o=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},o=St({},s,{value:void 0}),ht("invalid",e);break;case"textarea":Hm(e,s),o=Sd(e,s),ht("invalid",e);break;default:o=s}Nd(n,o),i=o;for(l in i)if(i.hasOwnProperty(l)){var c=i[l];l==="style"?zx(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Ox(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ja(e,c):typeof c=="number"&&ja(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(wa.hasOwnProperty(l)?c!=null&&l==="onScroll"&&ht("scroll",e):c!=null&&Xf(e,l,c,a))}switch(n){case"input":ri(e),Um(e,s,!1);break;case"textarea":ri(e),Vm(e);break;case"option":s.value!=null&&e.setAttribute("value",""+eo(s.value));break;case"select":e.multiple=!!s.multiple,l=s.value,l!=null?gl(e,!!s.multiple,l,!1):s.defaultValue!=null&&gl(e,!!s.multiple,s.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=fc)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return hn(t),null;case 6:if(e&&t.stateNode!=null)ay(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(ne(166));if(n=ko(Ta.current),ko(Gs.current),pi(t)){if(s=t.stateNode,n=t.memoizedProps,s[Hs]=t,(l=s.nodeValue!==n)&&(e=Kn,e!==null))switch(e.tag){case 3:fi(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fi(s.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Hs]=t,t.stateNode=s}return hn(t),null;case 13:if(gt(bt),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&qn!==null&&t.mode&1&&!(t.flags&128))kv(),El(),t.flags|=98560,l=!1;else if(l=pi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!l)throw Error(ne(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(ne(317));l[Hs]=t}else El(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hn(t),l=!1}else ks!==null&&(af(ks),ks=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||bt.current&1?Yt===0&&(Yt=3):$p())),t.updateQueue!==null&&(t.flags|=4),hn(t),null);case 4:return Pl(),Zd(e,t),e===null&&Ea(t.stateNode.containerInfo),hn(t),null;case 10:return gp(t.type._context),hn(t),null;case 17:return Ln(t.type)&&pc(),hn(t),null;case 19:if(gt(bt),l=t.memoizedState,l===null)return hn(t),null;if(s=(t.flags&128)!==0,a=l.rendering,a===null)if(s)ta(l,!1);else{if(Yt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=wc(e),a!==null){for(t.flags|=128,ta(l,!1),s=a.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)l=n,e=s,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 ut(bt,bt.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ot()>Tl&&(t.flags|=128,s=!0,ta(l,!1),t.lanes=4194304)}else{if(!s)if(e=wc(a),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ta(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!vt)return hn(t),null}else 2*Ot()-l.renderingStartTime>Tl&&n!==1073741824&&(t.flags|=128,s=!0,ta(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=Ot(),t.sibling=null,n=bt.current,ut(bt,s?n&1|2:n&1),t):(hn(t),null);case 22:case 23:return Tp(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Vn&1073741824&&(hn(t),t.subtreeFlags&6&&(t.flags|=8192)):hn(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function Lb(e,t){switch(fp(t),t.tag){case 1:return Ln(t.type)&&pc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pl(),gt(On),gt(yn),jp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wp(t),null;case 13:if(gt(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));El()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gt(bt),null;case 4:return Pl(),null;case 10:return gp(t.type._context),null;case 22:case 23:return Tp(),null;case 24:return null;default:return null}}var gi=!1,xn=!1,zb=typeof WeakSet=="function"?WeakSet:Set,je=null;function pl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Ct(e,t,s)}else n.current=null}function ef(e,t,n){try{n()}catch(s){Ct(e,t,s)}}var $h=!1;function Db(e,t){if(Ld=cc,e=fv(),up(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var o=s.anchorOffset,l=s.focusNode;s=s.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,i=-1,c=-1,d=0,f=0,m=e,p=null;t:for(;;){for(var h;m!==n||o!==0&&m.nodeType!==3||(i=a+o),m!==l||s!==0&&m.nodeType!==3||(c=a+s),m.nodeType===3&&(a+=m.nodeValue.length),(h=m.firstChild)!==null;)p=m,m=h;for(;;){if(m===e)break t;if(p===n&&++d===o&&(i=a),p===l&&++f===s&&(c=a),(h=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=h}n=i===-1||c===-1?null:{start:i,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},cc=!1,je=t;je!==null;)if(t=je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,je=e;else for(;je!==null;){t=je;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,j=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?w:_s(t.type,w),j);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(b){Ct(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,je=e;break}je=t.return}return g=$h,$h=!1,g}function xa(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var o=s=s.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&ef(t,n,l)}o=o.next}while(o!==s)}}function Kc(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 s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function tf(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 iy(e){var t=e.alternate;t!==null&&(e.alternate=null,iy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Hs],delete t[Pa],delete t[Bd],delete t[jb],delete t[bb])),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 cy(e){return e.tag===5||e.tag===3||e.tag===4}function Ih(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cy(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 nf(e,t,n){var s=e.tag;if(s===5||s===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=fc));else if(s!==4&&(e=e.child,e!==null))for(nf(e,t,n),e=e.sibling;e!==null;)nf(e,t,n),e=e.sibling}function sf(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(sf(e,t,n),e=e.sibling;e!==null;)sf(e,t,n),e=e.sibling}var an=null,Ss=!1;function Er(e,t,n){for(n=n.child;n!==null;)uy(e,t,n),n=n.sibling}function uy(e,t,n){if(qs&&typeof qs.onCommitFiberUnmount=="function")try{qs.onCommitFiberUnmount(Fc,n)}catch{}switch(n.tag){case 5:xn||pl(n,t);case 6:var s=an,o=Ss;an=null,Er(e,t,n),an=s,Ss=o,an!==null&&(Ss?(e=an,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):an.removeChild(n.stateNode));break;case 18:an!==null&&(Ss?(e=an,n=n.stateNode,e.nodeType===8?Au(e.parentNode,n):e.nodeType===1&&Au(e,n),ka(e)):Au(an,n.stateNode));break;case 4:s=an,o=Ss,an=n.stateNode.containerInfo,Ss=!0,Er(e,t,n),an=s,Ss=o;break;case 0:case 11:case 14:case 15:if(!xn&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){o=s=s.next;do{var l=o,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&ef(n,t,a),o=o.next}while(o!==s)}Er(e,t,n);break;case 1:if(!xn&&(pl(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(i){Ct(n,t,i)}Er(e,t,n);break;case 21:Er(e,t,n);break;case 22:n.mode&1?(xn=(s=xn)||n.memoizedState!==null,Er(e,t,n),xn=s):Er(e,t,n);break;default:Er(e,t,n)}}function Ah(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zb),t.forEach(function(s){var o=Kb.bind(null,e,s);n.has(s)||(n.add(s),s.then(o,o))})}}function js(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];try{var l=e,a=t,i=a;e:for(;i!==null;){switch(i.tag){case 5:an=i.stateNode,Ss=!1;break e;case 3:an=i.stateNode.containerInfo,Ss=!0;break e;case 4:an=i.stateNode.containerInfo,Ss=!0;break e}i=i.return}if(an===null)throw Error(ne(160));uy(l,a,o),an=null,Ss=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Ct(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dy(t,e),t=t.sibling}function dy(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(js(t,e),As(e),s&4){try{xa(3,e,e.return),Kc(3,e)}catch(w){Ct(e,e.return,w)}try{xa(5,e,e.return)}catch(w){Ct(e,e.return,w)}}break;case 1:js(t,e),As(e),s&512&&n!==null&&pl(n,n.return);break;case 5:if(js(t,e),As(e),s&512&&n!==null&&pl(n,n.return),e.flags&32){var o=e.stateNode;try{ja(o,"")}catch(w){Ct(e,e.return,w)}}if(s&4&&(o=e.stateNode,o!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,i=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{i==="input"&&l.type==="radio"&&l.name!=null&&$x(o,l),Cd(i,a);var d=Cd(i,l);for(a=0;a<c.length;a+=2){var f=c[a],m=c[a+1];f==="style"?zx(o,m):f==="dangerouslySetInnerHTML"?Ox(o,m):f==="children"?ja(o,m):Xf(o,f,m,d)}switch(i){case"input":bd(o,l);break;case"textarea":Ix(o,l);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!l.multiple;var h=l.value;h!=null?gl(o,!!l.multiple,h,!1):p!==!!l.multiple&&(l.defaultValue!=null?gl(o,!!l.multiple,l.defaultValue,!0):gl(o,!!l.multiple,l.multiple?[]:"",!1))}o[Pa]=l}catch(w){Ct(e,e.return,w)}}break;case 6:if(js(t,e),As(e),s&4){if(e.stateNode===null)throw Error(ne(162));o=e.stateNode,l=e.memoizedProps;try{o.nodeValue=l}catch(w){Ct(e,e.return,w)}}break;case 3:if(js(t,e),As(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ka(t.containerInfo)}catch(w){Ct(e,e.return,w)}break;case 4:js(t,e),As(e);break;case 13:js(t,e),As(e),o=e.child,o.flags&8192&&(l=o.memoizedState!==null,o.stateNode.isHidden=l,!l||o.alternate!==null&&o.alternate.memoizedState!==null||(Pp=Ot())),s&4&&Ah(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(xn=(d=xn)||f,js(t,e),xn=d):js(t,e),As(e),s&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&e.mode&1)for(je=e,f=e.child;f!==null;){for(m=je=f;je!==null;){switch(p=je,h=p.child,p.tag){case 0:case 11:case 14:case 15:xa(4,p,p.return);break;case 1:pl(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){s=p,n=p.return;try{t=s,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(w){Ct(s,n,w)}}break;case 5:pl(p,p.return);break;case 22:if(p.memoizedState!==null){Lh(m);continue}}h!==null?(h.return=p,je=h):Lh(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{o=m.stateNode,d?(l=o.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(i=m.stateNode,c=m.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,i.style.display=Lx("display",a))}catch(w){Ct(e,e.return,w)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(w){Ct(e,e.return,w)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:js(t,e),As(e),s&4&&Ah(e);break;case 21:break;default:js(t,e),As(e)}}function As(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cy(n)){var s=n;break e}n=n.return}throw Error(ne(160))}switch(s.tag){case 5:var o=s.stateNode;s.flags&32&&(ja(o,""),s.flags&=-33);var l=Ih(e);sf(e,l,o);break;case 3:case 4:var a=s.stateNode.containerInfo,i=Ih(e);nf(e,i,a);break;default:throw Error(ne(161))}}catch(c){Ct(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fb(e,t,n){je=e,fy(e)}function fy(e,t,n){for(var s=(e.mode&1)!==0;je!==null;){var o=je,l=o.child;if(o.tag===22&&s){var a=o.memoizedState!==null||gi;if(!a){var i=o.alternate,c=i!==null&&i.memoizedState!==null||xn;i=gi;var d=xn;if(gi=a,(xn=c)&&!d)for(je=o;je!==null;)a=je,c=a.child,a.tag===22&&a.memoizedState!==null?zh(o):c!==null?(c.return=a,je=c):zh(o);for(;l!==null;)je=l,fy(l),l=l.sibling;je=o,gi=i,xn=d}Oh(e)}else o.subtreeFlags&8772&&l!==null?(l.return=o,je=l):Oh(e)}}function Oh(e){for(;je!==null;){var t=je;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xn||Kc(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!xn)if(n===null)s.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_s(t.type,n.memoizedProps);s.componentDidUpdate(o,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&wh(t,l,s);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}wh(t,a,n)}break;case 5:var i=t.stateNode;if(n===null&&t.flags&4){n=i;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&ka(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}xn||t.flags&512&&tf(t)}catch(p){Ct(t,t.return,p)}}if(t===e){je=null;break}if(n=t.sibling,n!==null){n.return=t.return,je=n;break}je=t.return}}function Lh(e){for(;je!==null;){var t=je;if(t===e){je=null;break}var n=t.sibling;if(n!==null){n.return=t.return,je=n;break}je=t.return}}function zh(e){for(;je!==null;){var t=je;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Kc(4,t)}catch(c){Ct(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var o=t.return;try{s.componentDidMount()}catch(c){Ct(t,o,c)}}var l=t.return;try{tf(t)}catch(c){Ct(t,l,c)}break;case 5:var a=t.return;try{tf(t)}catch(c){Ct(t,a,c)}}}catch(c){Ct(t,t.return,c)}if(t===e){je=null;break}var i=t.sibling;if(i!==null){i.return=t.return,je=i;break}je=t.return}}var Bb=Math.ceil,_c=yr.ReactCurrentDispatcher,Ep=yr.ReactCurrentOwner,is=yr.ReactCurrentBatchConfig,Je=0,rn=null,Ft=null,cn=0,Vn=0,ml=oo(0),Yt=0,Oa=null,$o=0,Yc=0,Rp=0,va=null,In=null,Pp=0,Tl=1/0,tr=null,Sc=!1,rf=null,qr=null,xi=!1,zr=null,kc=0,ya=0,of=null,Ki=-1,Yi=0;function Cn(){return Je&6?Ot():Ki!==-1?Ki:Ki=Ot()}function Gr(e){return e.mode&1?Je&2&&cn!==0?cn&-cn:Sb.transition!==null?(Yi===0&&(Yi=Qx()),Yi):(e=st,e!==0||(e=window.event,e=e===void 0?16:sv(e.type)),e):1}function Cs(e,t,n,s){if(50<ya)throw ya=0,of=null,Error(ne(185));Wa(e,n,s),(!(Je&2)||e!==rn)&&(e===rn&&(!(Je&2)&&(Yc|=n),Yt===4&&Ar(e,cn)),zn(e,s),n===1&&Je===0&&!(t.mode&1)&&(Tl=Ot()+500,Wc&&lo()))}function zn(e,t){var n=e.callbackNode;S1(e,t);var s=ic(e,e===rn?cn:0);if(s===0)n!==null&&Gm(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Gm(n),t===1)e.tag===0?_b(Dh.bind(null,e)):bv(Dh.bind(null,e)),yb(function(){!(Je&6)&&lo()}),n=null;else{switch(Xx(s)){case 1:n=np;break;case 4:n=Kx;break;case 16:n=ac;break;case 536870912:n=Yx;break;default:n=ac}n=wy(n,py.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function py(e,t){if(Ki=-1,Yi=0,Je&6)throw Error(ne(327));var n=e.callbackNode;if(jl()&&e.callbackNode!==n)return null;var s=ic(e,e===rn?cn:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Nc(e,s);else{t=s;var o=Je;Je|=2;var l=hy();(rn!==e||cn!==t)&&(tr=null,Tl=Ot()+500,No(e,t));do try{Vb();break}catch(i){my(e,i)}while(!0);hp(),_c.current=l,Je=o,Ft!==null?t=0:(rn=null,cn=0,t=Yt)}if(t!==0){if(t===2&&(o=Td(e),o!==0&&(s=o,t=lf(e,o))),t===1)throw n=Oa,No(e,0),Ar(e,s),zn(e,Ot()),n;if(t===6)Ar(e,s);else{if(o=e.current.alternate,!(s&30)&&!Ub(o)&&(t=Nc(e,s),t===2&&(l=Td(e),l!==0&&(s=l,t=lf(e,l))),t===1))throw n=Oa,No(e,0),Ar(e,s),zn(e,Ot()),n;switch(e.finishedWork=o,e.finishedLanes=s,t){case 0:case 1:throw Error(ne(345));case 2:bo(e,In,tr);break;case 3:if(Ar(e,s),(s&130023424)===s&&(t=Pp+500-Ot(),10<t)){if(ic(e,0)!==0)break;if(o=e.suspendedLanes,(o&s)!==s){Cn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Fd(bo.bind(null,e,In,tr),t);break}bo(e,In,tr);break;case 4:if(Ar(e,s),(s&4194240)===s)break;for(t=e.eventTimes,o=-1;0<s;){var a=31-Ns(s);l=1<<a,a=t[a],a>o&&(o=a),s&=~l}if(s=o,s=Ot()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Bb(s/1960))-s,10<s){e.timeoutHandle=Fd(bo.bind(null,e,In,tr),s);break}bo(e,In,tr);break;case 5:bo(e,In,tr);break;default:throw Error(ne(329))}}}return zn(e,Ot()),e.callbackNode===n?py.bind(null,e):null}function lf(e,t){var n=va;return e.current.memoizedState.isDehydrated&&(No(e,t).flags|=256),e=Nc(e,t),e!==2&&(t=In,In=n,t!==null&&af(t)),e}function af(e){In===null?In=e:In.push.apply(In,e)}function Ub(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var o=n[s],l=o.getSnapshot;o=o.value;try{if(!Es(l(),o))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 Ar(e,t){for(t&=~Rp,t&=~Yc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ns(t),s=1<<n;e[n]=-1,t&=~s}}function Dh(e){if(Je&6)throw Error(ne(327));jl();var t=ic(e,0);if(!(t&1))return zn(e,Ot()),null;var n=Nc(e,t);if(e.tag!==0&&n===2){var s=Td(e);s!==0&&(t=s,n=lf(e,s))}if(n===1)throw n=Oa,No(e,0),Ar(e,t),zn(e,Ot()),n;if(n===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bo(e,In,tr),zn(e,Ot()),null}function Mp(e,t){var n=Je;Je|=1;try{return e(t)}finally{Je=n,Je===0&&(Tl=Ot()+500,Wc&&lo())}}function Io(e){zr!==null&&zr.tag===0&&!(Je&6)&&jl();var t=Je;Je|=1;var n=is.transition,s=st;try{if(is.transition=null,st=1,e)return e()}finally{st=s,is.transition=n,Je=t,!(Je&6)&&lo()}}function Tp(){Vn=ml.current,gt(ml)}function No(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vb(n)),Ft!==null)for(n=Ft.return;n!==null;){var s=n;switch(fp(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&pc();break;case 3:Pl(),gt(On),gt(yn),jp();break;case 5:wp(s);break;case 4:Pl();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:gp(s.type._context);break;case 22:case 23:Tp()}n=n.return}if(rn=e,Ft=e=Kr(e.current,null),cn=Vn=t,Yt=0,Oa=null,Rp=Yc=$o=0,In=va=null,So!==null){for(t=0;t<So.length;t++)if(n=So[t],s=n.interleaved,s!==null){n.interleaved=null;var o=s.next,l=n.pending;if(l!==null){var a=l.next;l.next=o,s.next=a}n.pending=s}So=null}return e}function my(e,t){do{var n=Ft;try{if(hp(),Wi.current=bc,jc){for(var s=_t.memoizedState;s!==null;){var o=s.queue;o!==null&&(o.pending=null),s=s.next}jc=!1}if(To=0,tn=Kt=_t=null,ga=!1,$a=0,Ep.current=null,n===null||n.return===null){Yt=1,Oa=t,Ft=null;break}e:{var l=e,a=n.return,i=n,c=t;if(t=cn,i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,f=i,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=Nh(a);if(h!==null){h.flags&=-257,Ch(h,a,i,l,t),h.mode&1&&kh(l,d,t),t=h,c=d;var g=t.updateQueue;if(g===null){var w=new Set;w.add(c),t.updateQueue=w}else g.add(c);break e}else{if(!(t&1)){kh(l,d,t),$p();break e}c=Error(ne(426))}}else if(vt&&i.mode&1){var j=Nh(a);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Ch(j,a,i,l,t),pp(Ml(c,i));break e}}l=c=Ml(c,i),Yt!==4&&(Yt=2),va===null?va=[l]:va.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=Xv(l,c,t);yh(l,v);break e;case 1:i=c;var x=l.type,y=l.stateNode;if(!(l.flags&128)&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(qr===null||!qr.has(y)))){l.flags|=65536,t&=-t,l.lanes|=t;var b=Jv(l,i,t);yh(l,b);break e}}l=l.return}while(l!==null)}xy(n)}catch(S){t=S,Ft===n&&n!==null&&(Ft=n=n.return);continue}break}while(!0)}function hy(){var e=_c.current;return _c.current=bc,e===null?bc:e}function $p(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),rn===null||!($o&268435455)&&!(Yc&268435455)||Ar(rn,cn)}function Nc(e,t){var n=Je;Je|=2;var s=hy();(rn!==e||cn!==t)&&(tr=null,No(e,t));do try{Hb();break}catch(o){my(e,o)}while(!0);if(hp(),Je=n,_c.current=s,Ft!==null)throw Error(ne(261));return rn=null,cn=0,Yt}function Hb(){for(;Ft!==null;)gy(Ft)}function Vb(){for(;Ft!==null&&!h1();)gy(Ft)}function gy(e){var t=yy(e.alternate,e,Vn);e.memoizedProps=e.pendingProps,t===null?xy(e):Ft=t,Ep.current=null}function xy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Lb(n,t),n!==null){n.flags&=32767,Ft=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Yt=6,Ft=null;return}}else if(n=Ob(n,t,Vn),n!==null){Ft=n;return}if(t=t.sibling,t!==null){Ft=t;return}Ft=t=e}while(t!==null);Yt===0&&(Yt=5)}function bo(e,t,n){var s=st,o=is.transition;try{is.transition=null,st=1,Wb(e,t,n,s)}finally{is.transition=o,st=s}return null}function Wb(e,t,n,s){do jl();while(zr!==null);if(Je&6)throw Error(ne(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(k1(e,l),e===rn&&(Ft=rn=null,cn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||xi||(xi=!0,wy(ac,function(){return jl(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=is.transition,is.transition=null;var a=st;st=1;var i=Je;Je|=4,Ep.current=null,Db(e,n),dy(n,e),db(zd),cc=!!Ld,zd=Ld=null,e.current=n,Fb(n),g1(),Je=i,st=a,is.transition=l}else e.current=n;if(xi&&(xi=!1,zr=e,kc=o),l=e.pendingLanes,l===0&&(qr=null),y1(n.stateNode),zn(e,Ot()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],s(o.value,{componentStack:o.stack,digest:o.digest});if(Sc)throw Sc=!1,e=rf,rf=null,e;return kc&1&&e.tag!==0&&jl(),l=e.pendingLanes,l&1?e===of?ya++:(ya=0,of=e):ya=0,lo(),null}function jl(){if(zr!==null){var e=Xx(kc),t=is.transition,n=st;try{if(is.transition=null,st=16>e?16:e,zr===null)var s=!1;else{if(e=zr,zr=null,kc=0,Je&6)throw Error(ne(331));var o=Je;for(Je|=4,je=e.current;je!==null;){var l=je,a=l.child;if(je.flags&16){var i=l.deletions;if(i!==null){for(var c=0;c<i.length;c++){var d=i[c];for(je=d;je!==null;){var f=je;switch(f.tag){case 0:case 11:case 15:xa(8,f,l)}var m=f.child;if(m!==null)m.return=f,je=m;else for(;je!==null;){f=je;var p=f.sibling,h=f.return;if(iy(f),f===d){je=null;break}if(p!==null){p.return=h,je=p;break}je=h}}}var g=l.alternate;if(g!==null){var w=g.child;if(w!==null){g.child=null;do{var j=w.sibling;w.sibling=null,w=j}while(w!==null)}}je=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,je=a;else e:for(;je!==null;){if(l=je,l.flags&2048)switch(l.tag){case 0:case 11:case 15:xa(9,l,l.return)}var v=l.sibling;if(v!==null){v.return=l.return,je=v;break e}je=l.return}}var x=e.current;for(je=x;je!==null;){a=je;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,je=y;else e:for(a=x;je!==null;){if(i=je,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:Kc(9,i)}}catch(S){Ct(i,i.return,S)}if(i===a){je=null;break e}var b=i.sibling;if(b!==null){b.return=i.return,je=b;break e}je=i.return}}if(Je=o,lo(),qs&&typeof qs.onPostCommitFiberRoot=="function")try{qs.onPostCommitFiberRoot(Fc,e)}catch{}s=!0}return s}finally{st=n,is.transition=t}}return!1}function Fh(e,t,n){t=Ml(n,t),t=Xv(e,t,1),e=Wr(e,t,1),t=Cn(),e!==null&&(Wa(e,1,t),zn(e,t))}function Ct(e,t,n){if(e.tag===3)Fh(e,e,n);else for(;t!==null;){if(t.tag===3){Fh(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(qr===null||!qr.has(s))){e=Ml(n,e),e=Jv(t,e,1),t=Wr(t,e,1),e=Cn(),t!==null&&(Wa(t,1,e),zn(t,e));break}}t=t.return}}function qb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Cn(),e.pingedLanes|=e.suspendedLanes&n,rn===e&&(cn&n)===n&&(Yt===4||Yt===3&&(cn&130023424)===cn&&500>Ot()-Pp?No(e,0):Rp|=n),zn(e,t)}function vy(e,t){t===0&&(e.mode&1?(t=ai,ai<<=1,!(ai&130023424)&&(ai=4194304)):t=1);var n=Cn();e=mr(e,t),e!==null&&(Wa(e,t,n),zn(e,n))}function Gb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vy(e,n)}function Kb(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(ne(314))}s!==null&&s.delete(t),vy(e,n)}var yy;yy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||On.current)An=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return An=!1,Ab(e,t,n);An=!!(e.flags&131072)}else An=!1,vt&&t.flags&1048576&&_v(t,gc,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Gi(e,t),e=t.pendingProps;var o=Cl(t,yn.current);wl(t,n),o=_p(null,t,s,e,o,n);var l=Sp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ln(s)?(l=!0,mc(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vp(t),o.updater=Gc,t.stateNode=o,o._reactInternals=t,Gd(t,s,e,n),t=Qd(null,t,s,!0,l,n)):(t.tag=0,vt&&l&&dp(t),Sn(null,t,o,n),t=t.child),t;case 16:s=t.elementType;e:{switch(Gi(e,t),e=t.pendingProps,o=s._init,s=o(s._payload),t.type=s,o=t.tag=Qb(s),e=_s(s,e),o){case 0:t=Yd(null,t,s,e,n);break e;case 1:t=Ph(null,t,s,e,n);break e;case 11:t=Eh(null,t,s,e,n);break e;case 14:t=Rh(null,t,s,_s(s.type,e),n);break e}throw Error(ne(306,s,""))}return t;case 0:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Yd(e,t,s,o,n);case 1:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Ph(e,t,s,o,n);case 3:e:{if(ny(t),e===null)throw Error(ne(387));s=t.pendingProps,l=t.memoizedState,o=l.element,Rv(e,t),yc(t,s,null,n);var a=t.memoizedState;if(s=a.element,l.isDehydrated)if(l={element:s,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=Ml(Error(ne(423)),t),t=Mh(e,t,s,n,o);break e}else if(s!==o){o=Ml(Error(ne(424)),t),t=Mh(e,t,s,n,o);break e}else for(qn=Vr(t.stateNode.containerInfo.firstChild),Kn=t,vt=!0,ks=null,n=Cv(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(El(),s===o){t=hr(e,t,n);break e}Sn(e,t,s,n)}t=t.child}return t;case 5:return Pv(t),e===null&&Vd(t),s=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,a=o.children,Dd(s,o)?a=null:l!==null&&Dd(s,l)&&(t.flags|=32),ty(e,t),Sn(e,t,a,n),t.child;case 6:return e===null&&Vd(t),null;case 13:return sy(e,t,n);case 4:return yp(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Rl(t,null,s,n):Sn(e,t,s,n),t.child;case 11:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Eh(e,t,s,o,n);case 7:return Sn(e,t,t.pendingProps,n),t.child;case 8:return Sn(e,t,t.pendingProps.children,n),t.child;case 12:return Sn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,o=t.pendingProps,l=t.memoizedProps,a=o.value,ut(xc,s._currentValue),s._currentValue=a,l!==null)if(Es(l.value,a)){if(l.children===o.children&&!On.current){t=hr(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var i=l.dependencies;if(i!==null){a=l.child;for(var c=i.firstContext;c!==null;){if(c.context===s){if(l.tag===1){c=ir(-1,n&-n),c.tag=2;var d=l.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?c.next=c:(c.next=f.next,f.next=c),d.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Wd(l.return,n,t),i.lanes|=n;break}c=c.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(ne(341));a.lanes|=n,i=a.alternate,i!==null&&(i.lanes|=n),Wd(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}Sn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps.children,wl(t,n),o=us(o),s=s(o),t.flags|=1,Sn(e,t,s,n),t.child;case 14:return s=t.type,o=_s(s,t.pendingProps),o=_s(s.type,o),Rh(e,t,s,o,n);case 15:return Zv(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,o=t.pendingProps,o=t.elementType===s?o:_s(s,o),Gi(e,t),t.tag=1,Ln(s)?(e=!0,mc(t)):e=!1,wl(t,n),Qv(t,s,o),Gd(t,s,o,n),Qd(null,t,s,!0,e,n);case 19:return ry(e,t,n);case 22:return ey(e,t,n)}throw Error(ne(156,t.tag))};function wy(e,t){return Gx(e,t)}function Yb(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ls(e,t,n,s){return new Yb(e,t,n,s)}function Ip(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qb(e){if(typeof e=="function")return Ip(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zf)return 11;if(e===ep)return 14}return 2}function Kr(e,t){var n=e.alternate;return n===null?(n=ls(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 Qi(e,t,n,s,o,l){var a=2;if(s=e,typeof e=="function")Ip(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case rl:return Co(n.children,o,l,t);case Jf:a=8,o|=8;break;case xd:return e=ls(12,n,t,o|2),e.elementType=xd,e.lanes=l,e;case vd:return e=ls(13,n,t,o),e.elementType=vd,e.lanes=l,e;case yd:return e=ls(19,n,t,o),e.elementType=yd,e.lanes=l,e;case Px:return Qc(n,o,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ex:a=10;break e;case Rx:a=9;break e;case Zf:a=11;break e;case ep:a=14;break e;case Tr:a=16,s=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=ls(a,n,t,o),t.elementType=e,t.type=s,t.lanes=l,t}function Co(e,t,n,s){return e=ls(7,e,s,t),e.lanes=n,e}function Qc(e,t,n,s){return e=ls(22,e,s,t),e.elementType=Px,e.lanes=n,e.stateNode={isHidden:!1},e}function Hu(e,t,n){return e=ls(6,e,null,t),e.lanes=n,e}function Vu(e,t,n){return t=ls(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xb(e,t,n,s,o){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=Su(0),this.expirationTimes=Su(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Su(0),this.identifierPrefix=s,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ap(e,t,n,s,o,l,a,i,c){return e=new Xb(e,t,n,i,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=ls(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vp(l),e}function Jb(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sl,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function jy(e){if(!e)return to;e=e._reactInternals;e:{if(Ho(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ln(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var n=e.type;if(Ln(n))return jv(e,n,t)}return t}function by(e,t,n,s,o,l,a,i,c){return e=Ap(n,s,!0,e,o,l,a,i,c),e.context=jy(null),n=e.current,s=Cn(),o=Gr(n),l=ir(s,o),l.callback=t??null,Wr(n,l,o),e.current.lanes=o,Wa(e,o,s),zn(e,s),e}function Xc(e,t,n,s){var o=t.current,l=Cn(),a=Gr(o);return n=jy(n),t.context===null?t.context=n:t.pendingContext=n,t=ir(l,a),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Wr(o,t,a),e!==null&&(Cs(e,o,a,l),Vi(e,o,a)),a}function Cc(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 Bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Op(e,t){Bh(e,t),(e=e.alternate)&&Bh(e,t)}function Zb(){return null}var _y=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lp(e){this._internalRoot=e}Jc.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));Xc(e,t,null,null)};Jc.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Io(function(){Xc(null,e,null,null)}),t[pr]=null}};function Jc(e){this._internalRoot=e}Jc.prototype.unstable_scheduleHydration=function(e){if(e){var t=ev();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ir.length&&t!==0&&t<Ir[n].priority;n++);Ir.splice(n,0,e),n===0&&nv(e)}};function zp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uh(){}function e_(e,t,n,s,o){if(o){if(typeof s=="function"){var l=s;s=function(){var d=Cc(a);l.call(d)}}var a=by(t,s,e,0,null,!1,!1,"",Uh);return e._reactRootContainer=a,e[pr]=a.current,Ea(e.nodeType===8?e.parentNode:e),Io(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof s=="function"){var i=s;s=function(){var d=Cc(c);i.call(d)}}var c=Ap(e,0,!1,null,null,!1,!1,"",Uh);return e._reactRootContainer=c,e[pr]=c.current,Ea(e.nodeType===8?e.parentNode:e),Io(function(){Xc(t,c,n,s)}),c}function eu(e,t,n,s,o){var l=n._reactRootContainer;if(l){var a=l;if(typeof o=="function"){var i=o;o=function(){var c=Cc(a);i.call(c)}}Xc(t,a,e,o)}else a=e_(n,t,e,o,s);return Cc(a)}Jx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ia(t.pendingLanes);n!==0&&(sp(t,n|1),zn(t,Ot()),!(Je&6)&&(Tl=Ot()+500,lo()))}break;case 13:Io(function(){var s=mr(e,1);if(s!==null){var o=Cn();Cs(s,e,1,o)}}),Op(e,1)}};rp=function(e){if(e.tag===13){var t=mr(e,134217728);if(t!==null){var n=Cn();Cs(t,e,134217728,n)}Op(e,134217728)}};Zx=function(e){if(e.tag===13){var t=Gr(e),n=mr(e,t);if(n!==null){var s=Cn();Cs(n,e,t,s)}Op(e,t)}};ev=function(){return st};tv=function(e,t){var n=st;try{return st=e,t()}finally{st=n}};Rd=function(e,t,n){switch(t){case"input":if(bd(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 s=n[t];if(s!==e&&s.form===e.form){var o=Vc(s);if(!o)throw Error(ne(90));Tx(s),bd(s,o)}}}break;case"textarea":Ix(e,n);break;case"select":t=n.value,t!=null&&gl(e,!!n.multiple,t,!1)}};Bx=Mp;Ux=Io;var t_={usingClientEntryPoint:!1,Events:[Ga,il,Vc,Dx,Fx,Mp]},na={findFiberByHostInstance:_o,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n_={bundleType:na.bundleType,version:na.version,rendererPackageName:na.rendererPackageName,rendererConfig:na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Wx(e),e===null?null:e.stateNode},findFiberByHostInstance:na.findFiberByHostInstance||Zb,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 vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vi.isDisabled&&vi.supportsFiber)try{Fc=vi.inject(n_),qs=vi}catch{}}Xn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t_;Xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zp(t))throw Error(ne(200));return Jb(e,t,null,n)};Xn.createRoot=function(e,t){if(!zp(e))throw Error(ne(299));var n=!1,s="",o=_y;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ap(e,1,!1,null,null,n,!1,s,o),e[pr]=t.current,Ea(e.nodeType===8?e.parentNode:e),new Lp(t)};Xn.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(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=Wx(t),e=e===null?null:e.stateNode,e};Xn.flushSync=function(e){return Io(e)};Xn.hydrate=function(e,t,n){if(!Zc(t))throw Error(ne(200));return eu(null,e,t,!0,n)};Xn.hydrateRoot=function(e,t,n){if(!zp(e))throw Error(ne(405));var s=n!=null&&n.hydratedSources||null,o=!1,l="",a=_y;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=by(t,null,e,1,n??null,o,!1,l,a),e[pr]=t.current,Ea(e),s)for(e=0;e<s.length;e++)n=s[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Jc(t)};Xn.render=function(e,t,n){if(!Zc(t))throw Error(ne(200));return eu(null,e,t,!1,n)};Xn.unmountComponentAtNode=function(e){if(!Zc(e))throw Error(ne(40));return e._reactRootContainer?(Io(function(){eu(null,null,e,!1,function(){e._reactRootContainer=null,e[pr]=null})}),!0):!1};Xn.unstable_batchedUpdates=Mp;Xn.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!Zc(n))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return eu(e,t,n,!1,s)};Xn.version="18.3.1-next-f1338f8080-20240426";function Sy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sy)}catch(e){console.error(e)}}Sy(),Sx.exports=Xn;var Vo=Sx.exports,ky,Hh=Vo;ky=Hh.createRoot,Hh.hydrateRoot;/**
|
|
41
|
-
* @remix-run/router v1.23.4
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},La.apply(null,arguments)}var Dr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Dr||(Dr={}));const Vh="popstate";function s_(e){e===void 0&&(e={});function t(s,o){let{pathname:l,search:a,hash:i}=s.location;return cf("",{pathname:l,search:a,hash:i},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){return typeof o=="string"?o:Cy(o)}return o_(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ny(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function r_(){return Math.random().toString(36).substr(2,8)}function Wh(e,t){return{usr:e.state,key:e.key,idx:t}}function cf(e,t,n,s){return n===void 0&&(n=null),La({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Hl(t):t,{state:n,key:t&&t.key||s||r_()})}function Cy(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Hl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function o_(e,t,n,s){s===void 0&&(s={});let{window:o=document.defaultView,v5Compat:l=!1}=s,a=o.history,i=Dr.Pop,c=null,d=f();d==null&&(d=0,a.replaceState(La({},a.state,{idx:d}),""));function f(){return(a.state||{idx:null}).idx}function m(){i=Dr.Pop;let j=f(),v=j==null?null:j-d;d=j,c&&c({action:i,location:w.location,delta:v})}function p(j,v){i=Dr.Push;let x=cf(w.location,j,v);d=f()+1;let y=Wh(x,d),b=w.createHref(x);try{a.pushState(y,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(b)}l&&c&&c({action:i,location:w.location,delta:1})}function h(j,v){i=Dr.Replace;let x=cf(w.location,j,v);d=f();let y=Wh(x,d),b=w.createHref(x);a.replaceState(y,"",b),l&&c&&c({action:i,location:w.location,delta:0})}function g(j){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof j=="string"?j:Cy(j);return x=x.replace(/ $/,"%20"),Vt(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let w={get action(){return i},get location(){return e(o,a)},listen(j){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Vh,m),c=j,()=>{o.removeEventListener(Vh,m),c=null}},createHref(j){return t(o,j)},createURL:g,encodeLocation(j){let v=g(j);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(j){return a.go(j)}};return w}var qh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(qh||(qh={}));function l_(e,t,n){return n===void 0&&(n="/"),a_(e,t,n)}function a_(e,t,n,s){let o=typeof t=="string"?Hl(t):t,l=Py(o.pathname||"/",n);if(l==null)return null;let a=Ey(e);i_(a);let i=null,c=w_(l);for(let d=0;i==null&&d<a.length;++d)i=x_(a[d],c);return i}function Ey(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let o=(l,a,i)=>{let c={relativePath:i===void 0?l.path||"":i,caseSensitive:l.caseSensitive===!0,childrenIndex:a,route:l};c.relativePath.startsWith("/")&&(Vt(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let d=Eo([s,c.relativePath]),f=n.concat(c);l.children&&l.children.length>0&&(Vt(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Ey(l.children,t,f,d)),!(l.path==null&&!l.index)&&t.push({path:d,score:h_(d,l.index),routesMeta:f})};return e.forEach((l,a)=>{var i;if(l.path===""||!((i=l.path)!=null&&i.includes("?")))o(l,a);else for(let c of Ry(l.path))o(l,a,c)}),t}function Ry(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let a=Ry(s.join("/")),i=[];return i.push(...a.map(c=>c===""?l:[l,c].join("/"))),o&&i.push(...a),i.map(c=>e.startsWith("/")&&c===""?"/":c)}function i_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:g_(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const c_=/^:[\w-]+$/,u_=3,d_=2,f_=1,p_=10,m_=-2,Gh=e=>e==="*";function h_(e,t){let n=e.split("/"),s=n.length;return n.some(Gh)&&(s+=m_),t&&(s+=d_),n.filter(o=>!Gh(o)).reduce((o,l)=>o+(c_.test(l)?u_:l===""?f_:p_),s)}function g_(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function x_(e,t,n){let{routesMeta:s}=e,o={},l="/",a=[];for(let i=0;i<s.length;++i){let c=s[i],d=i===s.length-1,f=l==="/"?t:t.slice(l.length)||"/",m=v_({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},f),p=c.route;if(!m)return null;Object.assign(o,m.params),a.push({params:o,pathname:Eo([l,m.pathname]),pathnameBase:__(Eo([l,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(l=Eo([l,m.pathnameBase]))}return a}function v_(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=y_(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],a=l.replace(/(.)\/+$/,"$1"),i=o.slice(1);return{params:s.reduce((d,f,m)=>{let{paramName:p,isOptional:h}=f;if(p==="*"){let w=i[m]||"";a=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const g=i[m];return h&&!g?d[p]=void 0:d[p]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function y_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ny(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,i,c)=>(s.push({paramName:i,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function w_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ny(!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 Py(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}function j_(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:o=""}=typeof e=="string"?Hl(e):e,l;return n?(n=$y(n),n.startsWith("/")?l=Kh(n.substring(1),"/"):l=Kh(n,t)):l=t,{pathname:l,search:S_(s),hash:k_(o)}}function Kh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Wu(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. 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 b_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function My(e,t){let n=b_(e);return t?n.map((s,o)=>o===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function Ty(e,t,n,s){s===void 0&&(s=!1);let o;typeof e=="string"?o=Hl(e):(o=La({},e),Vt(!o.pathname||!o.pathname.includes("?"),Wu("?","pathname","search",o)),Vt(!o.pathname||!o.pathname.includes("#"),Wu("#","pathname","hash",o)),Vt(!o.search||!o.search.includes("#"),Wu("#","search","hash",o)));let l=e===""||o.pathname==="",a=l?"/":o.pathname,i;if(a==null)i=n;else{let m=t.length-1;if(!s&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),m-=1;o.pathname=p.join("/")}i=m>=0?t[m]:"/"}let c=j_(o,i),d=a&&a!=="/"&&a.endsWith("/"),f=(l||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||f)&&(c.pathname+="/"),c}const $y=e=>e.replace(/\/\/+/g,"/"),Eo=e=>$y(e.join("/")),__=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),S_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,k_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function N_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Iy=["post","put","patch","delete"];new Set(Iy);const C_=["get",...Iy];new Set(C_);/**
|
|
50
|
-
* React Router v6.30.6
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function za(){return za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},za.apply(null,arguments)}const Dp=u.createContext(null),E_=u.createContext(null),Ya=u.createContext(null),tu=u.createContext(null),ao=u.createContext({outlet:null,matches:[],isDataRoute:!1}),Ay=u.createContext(null);function Qa(){return u.useContext(tu)!=null}function Xa(){return Qa()||Vt(!1),u.useContext(tu).location}function Oy(e){u.useContext(Ya).static||u.useLayoutEffect(e)}function Vl(){let{isDataRoute:e}=u.useContext(ao);return e?U_():R_()}function R_(){Qa()||Vt(!1);let e=u.useContext(Dp),{basename:t,future:n,navigator:s}=u.useContext(Ya),{matches:o}=u.useContext(ao),{pathname:l}=Xa(),a=JSON.stringify(My(o,n.v7_relativeSplatPath)),i=u.useRef(!1);return Oy(()=>{i.current=!0}),u.useCallback(function(d,f){if(f===void 0&&(f={}),!i.current)return;if(typeof d=="number"){s.go(d);return}let m=Ty(d,JSON.parse(a),l,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Eo([t,m.pathname])),(f.replace?s.replace:s.push)(m,f.state,f)},[t,s,a,l,e])}function P_(){let{matches:e}=u.useContext(ao),t=e[e.length-1];return t?t.params:{}}function M_(e,t){return T_(e,t)}function T_(e,t,n,s){Qa()||Vt(!1);let{navigator:o}=u.useContext(Ya),{matches:l}=u.useContext(ao),a=l[l.length-1],i=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Xa(),f;if(t){var m;let j=typeof t=="string"?Hl(t):t;c==="/"||(m=j.pathname)!=null&&m.startsWith(c)||Vt(!1),f=j}else f=d;let p=f.pathname||"/",h=p;if(c!=="/"){let j=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(j.length).join("/")}let g=l_(e,{pathname:h}),w=L_(g&&g.map(j=>Object.assign({},j,{params:Object.assign({},i,j.params),pathname:Eo([c,o.encodeLocation?o.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:Eo([c,o.encodeLocation?o.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),l,n,s);return t&&w?u.createElement(tu.Provider,{value:{location:za({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Dr.Pop}},w):w}function $_(){let e=B_(),t=N_(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:o},n):null,null)}const I_=u.createElement($_,null);class A_ extends u.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?u.createElement(ao.Provider,{value:this.props.routeContext},u.createElement(Ay.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function O_(e){let{routeContext:t,match:n,children:s}=e,o=u.useContext(Dp);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),u.createElement(ao.Provider,{value:t},s)}function L_(e,t,n,s){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var l;if(!n)return null;if(n.errors)e=n.matches;else if((l=s)!=null&&l.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=(o=n)==null?void 0:o.errors;if(i!=null){let f=a.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);f>=0||Vt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,d=-1;if(n&&s&&s.v7_partialHydration)for(let f=0;f<a.length;f++){let m=a[f];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=f),m.route.id){let{loaderData:p,errors:h}=n,g=m.route.loader&&p[m.route.id]===void 0&&(!h||h[m.route.id]===void 0);if(m.route.lazy||g){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((f,m,p)=>{let h,g=!1,w=null,j=null;n&&(h=i&&m.route.id?i[m.route.id]:void 0,w=m.route.errorElement||I_,c&&(d<0&&p===0?(H_("route-fallback"),g=!0,j=null):d===p&&(g=!0,j=m.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,p+1)),x=()=>{let y;return h?y=w:g?y=j:m.route.Component?y=u.createElement(m.route.Component,null):m.route.element?y=m.route.element:y=f,u.createElement(O_,{match:m,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:y})};return n&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?u.createElement(A_,{location:n.location,revalidation:n.revalidation,component:w,error:h,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var Ly=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ly||{}),zy=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}(zy||{});function z_(e){let t=u.useContext(Dp);return t||Vt(!1),t}function D_(e){let t=u.useContext(E_);return t||Vt(!1),t}function F_(e){let t=u.useContext(ao);return t||Vt(!1),t}function Dy(e){let t=F_(),n=t.matches[t.matches.length-1];return n.route.id||Vt(!1),n.route.id}function B_(){var e;let t=u.useContext(Ay),n=D_(),s=Dy();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function U_(){let{router:e}=z_(Ly.UseNavigateStable),t=Dy(zy.UseNavigateStable),n=u.useRef(!1);return Oy(()=>{n.current=!0}),u.useCallback(function(o,l){l===void 0&&(l={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,za({fromRouteId:t},l)))},[e,t])}const Yh={};function H_(e,t,n){Yh[e]||(Yh[e]=!0)}function V_(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function $l(e){let{to:t,replace:n,state:s,relative:o}=e;Qa()||Vt(!1);let{future:l,static:a}=u.useContext(Ya),{matches:i}=u.useContext(ao),{pathname:c}=Xa(),d=Vl(),f=Ty(t,My(i,l.v7_relativeSplatPath),c,o==="path"),m=JSON.stringify(f);return u.useEffect(()=>d(JSON.parse(m),{replace:n,state:s,relative:o}),[d,m,o,n,s]),null}function Ds(e){Vt(!1)}function W_(e){let{basename:t="/",children:n=null,location:s,navigationType:o=Dr.Pop,navigator:l,static:a=!1,future:i}=e;Qa()&&Vt(!1);let c=t.replace(/^\/*/,"/"),d=u.useMemo(()=>({basename:c,navigator:l,static:a,future:za({v7_relativeSplatPath:!1},i)}),[c,i,l,a]);typeof s=="string"&&(s=Hl(s));let{pathname:f="/",search:m="",hash:p="",state:h=null,key:g="default"}=s,w=u.useMemo(()=>{let j=Py(f,c);return j==null?null:{location:{pathname:j,search:m,hash:p,state:h,key:g},navigationType:o}},[c,f,m,p,h,g,o]);return w==null?null:u.createElement(Ya.Provider,{value:d},u.createElement(tu.Provider,{children:n,value:w}))}function q_(e){let{children:t,location:n}=e;return M_(uf(t),n)}new Promise(()=>{});function uf(e,t){t===void 0&&(t=[]);let n=[];return u.Children.forEach(e,(s,o)=>{if(!u.isValidElement(s))return;let l=[...t,o];if(s.type===u.Fragment){n.push.apply(n,uf(s.props.children,l));return}s.type!==Ds&&Vt(!1),!s.props.index||!s.props.children||Vt(!1);let a={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(a.children=uf(s.props.children,l)),n.push(a)}),n}/**
|
|
59
|
-
* React Router DOM v6.30.6
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function df(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 s=e[n];return t.concat(Array.isArray(s)?s.map(o=>[n,o]):[[n,s]])},[]))}function G_(e,t){let n=df(e);return t&&t.forEach((s,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}const K_="6";try{window.__reactRouterVersion=K_}catch{}const Y_="startTransition",Qh=Bo[Y_];function Q_(e){let{basename:t,children:n,future:s,window:o}=e,l=u.useRef();l.current==null&&(l.current=s_({window:o,v5Compat:!0}));let a=l.current,[i,c]=u.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},f=u.useCallback(m=>{d&&Qh?Qh(()=>c(m)):c(m)},[c,d]);return u.useLayoutEffect(()=>a.listen(f),[a,f]),u.useEffect(()=>V_(s),[s]),u.createElement(W_,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:a,future:s})}var Xh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Xh||(Xh={}));var Jh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jh||(Jh={}));function X_(e){let t=u.useRef(df(e)),n=u.useRef(!1),s=Xa(),o=u.useMemo(()=>G_(s.search,n.current?null:t.current),[s.search]),l=Vl(),a=u.useCallback((i,c)=>{const d=df(typeof i=="function"?i(o):i);n.current=!0,l("?"+d,c)},[l,o]);return[o,a]}const J_={},Zh=e=>{let t;const n=new Set,s=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const h=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(g=>g(t,h))}},o=()=>t,c={setState:s,getState:o,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(J_?"plugin":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,o,c);return c},Z_=e=>e?Zh(e):Zh;var Fy={exports:{}},By={},Uy={exports:{}},Hy={};/**
|
|
68
|
-
* @license React
|
|
69
|
-
* use-sync-external-store-shim.production.js
|
|
70
|
-
*
|
|
71
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the MIT license found in the
|
|
74
|
-
* LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/var Il=u;function eS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tS=typeof Object.is=="function"?Object.is:eS,nS=Il.useState,sS=Il.useEffect,rS=Il.useLayoutEffect,oS=Il.useDebugValue;function lS(e,t){var n=t(),s=nS({inst:{value:n,getSnapshot:t}}),o=s[0].inst,l=s[1];return rS(function(){o.value=n,o.getSnapshot=t,qu(o)&&l({inst:o})},[e,n,t]),sS(function(){return qu(o)&&l({inst:o}),e(function(){qu(o)&&l({inst:o})})},[e]),oS(n),n}function qu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tS(e,n)}catch{return!0}}function aS(e,t){return t()}var iS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aS:lS;Hy.useSyncExternalStore=Il.useSyncExternalStore!==void 0?Il.useSyncExternalStore:iS;Uy.exports=Hy;var cS=Uy.exports;/**
|
|
76
|
-
* @license React
|
|
77
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
78
|
-
*
|
|
79
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the MIT license found in the
|
|
82
|
-
* LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/var nu=u,uS=cS;function dS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fS=typeof Object.is=="function"?Object.is:dS,pS=uS.useSyncExternalStore,mS=nu.useRef,hS=nu.useEffect,gS=nu.useMemo,xS=nu.useDebugValue;By.useSyncExternalStoreWithSelector=function(e,t,n,s,o){var l=mS(null);if(l.current===null){var a={hasValue:!1,value:null};l.current=a}else a=l.current;l=gS(function(){function c(h){if(!d){if(d=!0,f=h,h=s(h),o!==void 0&&a.hasValue){var g=a.value;if(o(g,h))return m=g}return m=h}if(g=m,fS(f,h))return g;var w=s(h);return o!==void 0&&o(g,w)?(f=h,g):(f=h,m=w)}var d=!1,f,m,p=n===void 0?null:n;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,n,s,o]);var i=pS(e,l[0],l[1]);return hS(function(){a.hasValue=!0,a.value=i},[i]),xS(i),i};Fy.exports=By;var vS=Fy.exports;const yS=dx(vS),Vy={},{useDebugValue:wS}=bx,{useSyncExternalStoreWithSelector:jS}=yS;let eg=!1;const bS=e=>e;function _S(e,t=bS,n){(Vy?"plugin":void 0)!=="production"&&n&&!eg&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),eg=!0);const s=jS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return wS(s),s}const tg=e=>{(Vy?"plugin":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Z_(e):e,n=(s,o)=>_S(t,s,o);return Object.assign(n,t),n},Fp=e=>e?tg(e):tg,as="/touchstone/".replace(/\/+$/,"");async function yi(e,t,n){const s={method:e,credentials:"same-origin",headers:{}};n!==void 0&&(s.headers["Content-Type"]="application/json",s.body=JSON.stringify(n));const o=await fetch(as+t,s);if(o.status===401)throw window.location.pathname!==as+"/login"&&!window.__ts_redirecting&&(window.__ts_redirecting=!0,window.location.href=as+"/login"),new Error("unauthorized");let l=null;const a=await o.text();if(a)try{l=JSON.parse(a)}catch{l=a}if(!o.ok){const i=l&&(l.error||l.message)||`HTTP ${o.status}`;throw new Error(i)}return l}const ee={get:e=>yi("GET",e),post:(e,t)=>yi("POST",e,t),patch:(e,t)=>yi("PATCH",e,t),del:(e,t)=>yi("DELETE",e,t)},bl={me:()=>ee.get("/api/auth/me"),login:(e,t)=>ee.post("/api/auth/login",{username:e,password:t}),register:(e,t)=>ee.post("/api/auth/register",{username:e,password:t}),logout:()=>ee.post("/api/auth/logout"),changePassword:(e,t)=>ee.post("/api/auth/change_password",{old_password:e,new_password:t})},Us={feishuGet:()=>ee.get("/api/me/feishu"),feishuBindcode:()=>ee.post("/api/me/feishu-bindcode"),feishuUnbind:()=>ee.del("/api/me/feishu"),feishuCfgGet:()=>ee.get("/api/me/feishu-cfg"),feishuCfgSet:e=>ee.patch("/api/me/feishu-cfg",e),feishuOutbox:()=>ee.get("/api/me/feishu/outbox"),feishuSlashGet:()=>ee.get("/api/me/feishu/slash-commands"),feishuSlashSet:e=>ee.post("/api/me/feishu/slash-commands",{action:e})},Mt={list:()=>ee.get("/api/projects"),get:e=>ee.get(`/api/projects/${e}`),create:e=>ee.post("/api/projects",e),update:(e,t)=>ee.patch(`/api/projects/${e}`,t),remove:(e,t)=>ee.del(`/api/projects/${e}`,t),archive:e=>ee.post(`/api/projects/${e}/archive`),unarchive:e=>ee.post(`/api/projects/${e}/unarchive`),fsBrowse:e=>ee.get(`/api/fs/browse?path=${encodeURIComponent(e||"")}`),fsMkdir:(e,t)=>ee.post("/api/fs/mkdir",{path:e,name:t}),dupCheck:e=>{const t=new URLSearchParams(e).toString();return ee.get(`/api/projects/dup_check?${t}`)},agents:()=>ee.get("/api/agents/scan"),agentModels:e=>ee.get(`/api/agents/models?agent_path=${encodeURIComponent(e||"")}`),agentSkills:(e,t)=>ee.get(`/api/agents/skills?agent_path=${encodeURIComponent(e||"")}&project_dir=${encodeURIComponent(t||"")}`),feishuHookGet:e=>ee.get(`/api/projects/${e}/feishu-hook`),feishuHookSet:(e,t)=>ee.patch(`/api/projects/${e}/feishu-hook`,t),filePreview:(e,t)=>ee.get(`/api/projects/${e}/file?path=${encodeURIComponent(t)}`),fileRawUrl:(e,t)=>`${as}/api/projects/${e}/file?path=${encodeURIComponent(t)}&raw=1`},hl={get:e=>ee.get(`/api/prefs?project_id=${e||0}`),set:(e,t,n)=>ee.post("/api/prefs",{project_id:e||0,key:t,value:n})},Be={list:e=>ee.get(`/api/projects/${e}/tasks`),create:(e,t)=>ee.post(`/api/projects/${e}/tasks`,t),get:e=>ee.get(`/api/tasks/${e}`),update:(e,t)=>ee.patch(`/api/tasks/${e}`,t),stop:e=>ee.post(`/api/tasks/${e}/stop`),restart:e=>ee.post(`/api/tasks/${e}/restart`),continue:(e,t)=>ee.post(`/api/tasks/${e}/continue`,t),remove:e=>ee.del(`/api/tasks/${e}`),rounds:e=>ee.get(`/api/tasks/${e}/rounds`),dialogue:e=>ee.get(`/api/tasks/${e}/dialogue`),log:(e,t,n=300)=>ee.get(`/api/tasks/${e}/log?round=${t}&tail=${n}`),loadCase:e=>ee.get(`/api/tasks/${e}/load/case`),loadCaseMeta:e=>ee.get(`/api/tasks/${e}/load/case?meta=1`),loadRuns:e=>ee.get(`/api/tasks/${e}/load/runs`),loadRerun:e=>ee.post(`/api/tasks/${e}/load/rerun`),loadDiagnose:e=>ee.post(`/api/tasks/${e}/load/diagnose`),loadMetrics:(e,t=0,n=2e4,s="")=>ee.get(`/api/tasks/${e}/load/metrics?after=${t}&limit=${n}`+(s?`&run=${encodeURIComponent(s)}`:"")),loadReport:(e,t="")=>ee.get(`/api/tasks/${e}/load_report${t?`?run=${encodeURIComponent(t)}`:""}`),loadStream:(e,t="")=>new EventSource(`${as}/api/tasks/${e}/load/stream${t?`?run=${encodeURIComponent(t)}`:""}`),loadCustomHtmlUrl:e=>`${as}/api/tasks/${e}/load/custom_html`,sessionMessages:(e,t="main",n=0)=>ee.get(`/api/tasks/${e}/session/messages?agent=${encodeURIComponent(t)}&after=${n}`),sessionStream:(e,t="main")=>new EventSource(`${as}/api/tasks/${e}/session/stream?agent=${encodeURIComponent(t)}`),sessionChat:(e,t,n=!1)=>ee.post(`/api/tasks/${e}/session/chat`,{message:t,inject:n}),sessionChatInject:(e,t)=>ee.post(`/api/tasks/${e}/session/chat/inject`,{msg_id:t}),sessionRewind:(e,t)=>ee.post(`/api/tasks/${e}/session/rewind`,{mid:t}),answerInteraction:(e,t)=>ee.post(`/api/tasks/${e}/session/interaction/answer`,t),sessionChatStop:e=>ee.post(`/api/tasks/${e}/session/chat/stop`),sessionProfile:(e,t)=>ee.post(`/api/tasks/${e}/session/profile`,t),sessionMediaUrl:(e,t,n)=>`${as}/api/tasks/${e}/session/media/${encodeURIComponent(n)}?agent=${encodeURIComponent(t)}`},ff={list:e=>ee.get(`/api/projects/${e}/bugs`),get:(e,t)=>ee.get(`/api/projects/${e}/bugs/${encodeURIComponent(t)}`),reject:(e,t,n)=>ee.post(`/api/projects/${e}/bugs/${encodeURIComponent(t)}/reject`,{reason:n})},Fr={users:()=>ee.get("/api/admin/users"),createUser:e=>ee.post("/api/admin/users",e),updateUser:(e,t)=>ee.patch(`/api/admin/users/${e}`,t),deleteUser:e=>ee.del(`/api/admin/users/${e}`),ragGet:()=>ee.get("/api/admin/rag"),ragSet:e=>ee.patch("/api/admin/rag",e),ragTest:e=>ee.post("/api/admin/rag/test",e)},Gu={list:(e,t)=>{const n=e==="project"?"project":"user";return ee.get(`/api/builtin-assets?target=${n}`+(n==="project"&&t?`&project_id=${t}`:""))},install:(e,t,n)=>ee.post(`/api/builtin-assets/${e}/install`,{target:t,project_id:n??null}),uninstall:(e,t,n)=>ee.post(`/api/builtin-assets/${e}/uninstall`,{target:t,project_id:n??null})},ng={state:e=>ee.get(`/api/state?project=${e}`),stream:e=>new EventSource(`${as}/api/stream?project=${e}`)},Ce={get:e=>ee.get(`/api/projects/${e}/board`),createCard:(e,t)=>ee.post(`/api/projects/${e}/board/cards`,t),updateCard:(e,t,n)=>ee.patch(`/api/projects/${e}/board/cards/${t}`,n),removeCard:(e,t)=>ee.del(`/api/projects/${e}/board/cards/${t}`),moveCard:(e,t,n,s,o=null,l=!1)=>ee.post(`/api/projects/${e}/board/cards/${t}/move`,{column:n,block_text:s,before_id:o,merge_ack:!!l}),startCard:(e,t,n,s,o)=>ee.post(`/api/projects/${e}/board/cards/${t}/start`,{opinion:n,force:!!s,worktree:!!o}),worktreePreview:(e,t)=>ee.get(`/api/projects/${e}/board/cards/${t}/worktree`),mergeWorktree:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/worktree/merge`,{}),removeWorktree:(e,t)=>ee.del(`/api/projects/${e}/board/cards/${t}/worktree`),stopCard:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/stop`),markViewed:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/viewed`),addComment:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/comments`,{text:n}),sendComment:(e,t,n,s=!1,o=!1)=>ee.post(`/api/projects/${e}/board/cards/${t}/comments/${n}/send`,{inject:s,raw:o}),removeComment:(e,t,n)=>ee.del(`/api/projects/${e}/board/cards/${t}/comments/${n}`),listSessions:e=>ee.get(`/api/projects/${e}/board/sessions`),compact:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/compact`,n?{sid:n}:{}),forkCompact:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/fork-compact`,n?{sid:n}:{}),forkSession:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/fork`,n?{sid:n}:{}),answerInteraction:(e,t,n)=>ee.post(`/api/projects/${e}/board/cards/${t}/interaction/answer`,n),deliverAnswer:(e,t)=>ee.post(`/api/projects/${e}/board/cards/${t}/answer/deliver`),injectSessionMsg:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/inject`,{msg_id:n}),rewindSession:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/rewind`,{mid:n}),updateSettings:(e,t)=>ee.patch(`/api/projects/${e}/board/settings`,t),jiraTest:(e,t)=>ee.post(`/api/projects/${e}/board/jira/test`,t),jiraImport:e=>ee.post(`/api/projects/${e}/board/jira/import`),sessionMessages:(e,t,n=0,s="main")=>ee.get(`/api/projects/${e}/board/session/messages?sid=${encodeURIComponent(t)}&after=${n}&agent=${encodeURIComponent(s)}`),sessionMediaUrl:(e,t,n,s)=>`${as}/api/projects/${e}/board/session/media/${encodeURIComponent(s)}?sid=${encodeURIComponent(t)}&agent=${encodeURIComponent(n)}`,reorderCard:(e,t,n)=>ee.post(`/api/projects/${e}/board/reorder`,{card_id:t,before_id:n}),trashList:e=>ee.get(`/api/projects/${e}/board/trash`),restoreCard:(e,t)=>ee.post(`/api/projects/${e}/board/trash/${t}/restore`),purgeCard:(e,t)=>ee.del(`/api/projects/${e}/board/trash/${t}`),emptyTrash:e=>ee.post(`/api/projects/${e}/board/trash/empty`),setSessionProfile:(e,t,n)=>ee.post(`/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/profile`,n),uploadMedia:(e,t)=>ee.post(`/api/projects/${e}/board/media`,t),stream:e=>new EventSource(`${as}/api/projects/${e}/board/stream`),sessionStream:(e,t)=>new EventSource(`${as}/api/projects/${e}/board/sessions/${encodeURIComponent(t)}/stream`)},Yn=Fp((e,t)=>({username:"",isAdmin:!1,mustChangePassword:!1,loaded:!1,load:async()=>{try{const n=await bl.me();e({username:n.username,isAdmin:!!n.is_admin,mustChangePassword:!!n.must_change_password,loaded:!0})}catch{e({username:"",mustChangePassword:!1,loaded:!0})}},login:async(n,s)=>{await bl.login(n,s),await t().load()},logout:async()=>{try{await bl.logout()}catch{}e({username:"",isAdmin:!1,mustChangePassword:!1})}}));function su({size:e=22}){return r.jsxs("svg",{className:"ts-logo",width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"tsLogoG",x1:"0",y1:"1",x2:"1",y2:"0",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--logo-1)"}}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--logo-2)"}})]})}),r.jsx("path",{fill:"url(#tsLogoG)",fillRule:"evenodd",d:`M8.6 3H15.4A5.6 5.6 0 0 1 21 8.6V15.4A5.6 5.6 0 0 1 15.4 21H8.6A5.6 5.6 0 0 1 3 15.4V8.6A5.6 5.6 0 0 1 8.6 3Z
|
|
84
|
-
M7.6 6.6H16.4V9.8H13.6V17.8H10.4V9.8H7.6Z`})]})}var SS=Object.defineProperty,Bp=(e,t)=>SS(e,"name",{value:t,configurable:!0});function pf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Bp(pf,"setRef");function Wy(...e){return t=>{let n=!1;const s=e.map(o=>{const l=pf(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():pf(e[o],null)}}}}Bp(Wy,"composeRefs");function yt(...e){return u.useCallback(Wy(...e),e)}Bp(yt,"useComposedRefs");var kS=Object.defineProperty,Ps=(e,t)=>kS(e,"name",{value:t,configurable:!0});function gr(e){const t=u.forwardRef((n,s)=>{let{children:o,...l}=n,a=null,i=!1;const c=[];mf(o)&&typeof wi=="function"&&(o=wi(o._payload)),u.Children.forEach(o,p=>{var h;if(Yy(p)){i=!0;const g=p;let w="child"in g.props?g.props.child:g.props.children;mf(w)&&typeof wi=="function"&&(w=wi(w._payload)),a=ES(g,w),c.push((h=a==null?void 0:a.props)==null?void 0:h.children)}else c.push(p)}),a?a=u.cloneElement(a,void 0,c):!i&&u.Children.count(o)===1&&u.isValidElement(o)&&(a=o);const d=a?Ky(a):void 0,f=yt(s,d);if(!a){if(o||o===0)throw new Error(i?MS(e):PS(e));return o}const m=Gy(l,a.props??{});return a.type!==u.Fragment&&(m.ref=s?f:d),u.cloneElement(a,m)});return t.displayName=`${e}.Slot`,t}Ps(gr,"createSlot");var NS=gr("Slot"),qy=Symbol.for("radix.slottable");function CS(e){const t=Ps(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=qy,t}Ps(CS,"createSlottable");var ES=Ps((e,t)=>{if("child"in e.props){const n=e.props.child;return u.isValidElement(n)?u.cloneElement(n,void 0,e.props.children(n.props.children)):null}return u.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function Gy(e,t){const n={...t};for(const s in t){const o=e[s],l=t[s];/^on[A-Z]/.test(s)?o&&l?n[s]=(...i)=>{const c=l(...i);return o(...i),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...l}:s==="className"&&(n[s]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}Ps(Gy,"mergeProps");function Ky(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ps(Ky,"getElementRef");function Yy(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qy}Ps(Yy,"isSlottable");var RS=Symbol.for("react.lazy");function mf(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RS&&"_payload"in e&&Qy(e._payload)}Ps(mf,"isLazyComponent");function Qy(e){return typeof e=="object"&&e!==null&&"then"in e}Ps(Qy,"isPromiseLike");var PS=Ps(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),MS=Ps(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),wi=Bo[" use ".trim().toString()];function Xy(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Xy(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Jy(){for(var e,t,n=0,s="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Xy(e))&&(s&&(s+=" "),s+=t);return s}const sg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rg=Jy,Zy=(e,t)=>n=>{var s;if((t==null?void 0:t.variants)==null)return rg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,a=Object.keys(o).map(d=>{const f=n==null?void 0:n[d],m=l==null?void 0:l[d];if(f===null)return null;const p=sg(f)||sg(m);return o[d][p]}),i=n&&Object.entries(n).reduce((d,f)=>{let[m,p]=f;return p===void 0||(d[m]=p),d},{}),c=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((d,f)=>{let{class:m,className:p,...h}=f;return Object.entries(h).every(g=>{let[w,j]=g;return Array.isArray(j)?j.includes({...l,...i}[w]):{...l,...i}[w]===j})?[...d,m,p]:d},[]);return rg(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},TS=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},$S=(e,t)=>({classGroupId:e,validator:t}),e0=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ec="-",og=[],IS="arbitrary..",AS=e=>{const t=LS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return OS(a);const i=a.split(Ec),c=i[0]===""&&i.length>1?1:0;return t0(i,c,t)},getConflictingClassGroupIds:(a,i)=>{if(i){const c=s[a],d=n[a];return c?d?TS(d,c):c:d||og}return n[a]||og}}},t0=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const d=t0(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const i=t===0?e.join(Ec):e.slice(t).join(Ec),c=a.length;for(let d=0;d<c;d++){const f=a[d];if(f.validator(i))return f.classGroupId}},OS=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?IS+s:void 0})(),LS=e=>{const{theme:t,classGroups:n}=e;return zS(n,t)},zS=(e,t)=>{const n=e0();for(const s in e){const o=e[s];Up(o,n,s,t)}return n},Up=(e,t,n,s)=>{const o=e.length;for(let l=0;l<o;l++){const a=e[l];DS(a,t,n,s)}},DS=(e,t,n,s)=>{if(typeof e=="string"){FS(e,t,n);return}if(typeof e=="function"){BS(e,t,n,s);return}US(e,t,n,s)},FS=(e,t,n)=>{const s=e===""?t:n0(t,e);s.classGroupId=n},BS=(e,t,n,s)=>{if(HS(e)){Up(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push($S(n,e))},US=(e,t,n,s)=>{const o=Object.entries(e),l=o.length;for(let a=0;a<l;a++){const[i,c]=o[a];Up(c,n0(t,i),n,s)}},n0=(e,t)=>{let n=e;const s=t.split(Ec),o=s.length;for(let l=0;l<o;l++){const a=s[l];let i=n.nextPart.get(a);i||(i=e0(),n.nextPart.set(a,i)),n=i}return n},HS=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const o=(l,a)=>{n[l]=a,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=s[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},hf="!",lg=":",WS=[],ag=(e,t,n,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:o}),qS=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=o=>{const l=[];let a=0,i=0,c=0,d;const f=o.length;for(let w=0;w<f;w++){const j=o[w];if(a===0&&i===0){if(j===lg){l.push(o.slice(c,w)),c=w+1;continue}if(j==="/"){d=w;continue}}j==="["?a++:j==="]"?a--:j==="("?i++:j===")"&&i--}const m=l.length===0?o:o.slice(c);let p=m,h=!1;m.endsWith(hf)?(p=m.slice(0,-1),h=!0):m.startsWith(hf)&&(p=m.slice(1),h=!0);const g=d&&d>c?d-c:void 0;return ag(l,h,p,g)};if(t){const o=t+lg,l=s;s=a=>a.startsWith(o)?l(a.slice(o.length)):ag(WS,!1,a,void 0,!0)}if(n){const o=s;s=l=>n({className:l,parseClassName:o})}return s},GS=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],i=a[0]==="[",c=t.has(a);i||c?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(a)):o.push(a)}return o.length>0&&(o.sort(),s.push(...o)),s}},KS=e=>({cache:VS(e.cacheSize),parseClassName:qS(e),sortModifiers:GS(e),postfixLookupClassGroupIds:YS(e),...AS(e)}),YS=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let s=0;s<n.length;s++)t[n[s]]=!0;return t},QS=/\s+/,XS=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:a}=t,i=[],c=e.trim().split(QS);let d="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:p,modifiers:h,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:j}=n(m);if(p){d=m+(d.length>0?" "+d:d);continue}let v=!!j,x;if(v){const k=w.substring(0,j);x=s(k);const C=x&&a[x]?s(w):void 0;C&&C!==x&&(x=C,v=!1)}else x=s(w);if(!x){if(!v){d=m+(d.length>0?" "+d:d);continue}if(x=s(w),!x){d=m+(d.length>0?" "+d:d);continue}v=!1}const y=h.length===0?"":h.length===1?h[0]:l(h).join(":"),b=g?y+hf:y,S=b+x;if(i.indexOf(S)>-1)continue;i.push(S);const N=o(x,v);for(let k=0;k<N.length;++k){const C=N[k];i.push(b+C)}d=m+(d.length>0?" "+d:d)}return d},JS=(...e)=>{let t=0,n,s,o="";for(;t<e.length;)(n=e[t++])&&(s=s0(n))&&(o&&(o+=" "),o+=s);return o},s0=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=s0(e[s]))&&(n&&(n+=" "),n+=t);return n},ZS=(e,...t)=>{let n,s,o,l;const a=c=>{const d=t.reduce((f,m)=>m(f),e());return n=KS(d),s=n.cache.get,o=n.cache.set,l=i,i(c)},i=c=>{const d=s(c);if(d)return d;const f=XS(c,n);return o(c,f),f};return l=a,(...c)=>l(JS(...c))},ek=[],Gt=e=>{const t=n=>n[e]||ek;return t.isThemeGetter=!0,t},r0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,o0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tk=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ok=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rr=e=>tk.test(e),Ue=e=>!!e&&!Number.isNaN(Number(e)),Os=e=>!!e&&Number.isInteger(Number(e)),Ku=e=>e.endsWith("%")&&Ue(e.slice(0,-1)),er=e=>nk.test(e),l0=()=>!0,ak=e=>sk.test(e)&&!rk.test(e),Hp=()=>!1,ik=e=>ok.test(e),ck=e=>lk.test(e),uk=e=>!ye(e)&&!we(e),dk=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),fk=e=>io(e,c0,Hp),ye=e=>r0.test(e),xo=e=>io(e,u0,ak),ig=e=>io(e,wk,Ue),pk=e=>io(e,f0,l0),mk=e=>io(e,d0,Hp),cg=e=>io(e,a0,Hp),hk=e=>io(e,i0,ck),ji=e=>io(e,p0,ik),we=e=>o0.test(e),sa=e=>Wo(e,u0),gk=e=>Wo(e,d0),ug=e=>Wo(e,a0),xk=e=>Wo(e,c0),vk=e=>Wo(e,i0),bi=e=>Wo(e,p0,!0),yk=e=>Wo(e,f0,!0),io=(e,t,n)=>{const s=r0.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},Wo=(e,t,n=!1)=>{const s=o0.exec(e);return s?s[1]?t(s[1]):n:!1},a0=e=>e==="position"||e==="percentage",i0=e=>e==="image"||e==="url",c0=e=>e==="length"||e==="size"||e==="bg-size",u0=e=>e==="length",wk=e=>e==="number",d0=e=>e==="family-name",f0=e=>e==="number"||e==="weight",p0=e=>e==="shadow",jk=()=>{const e=Gt("color"),t=Gt("font"),n=Gt("text"),s=Gt("font-weight"),o=Gt("tracking"),l=Gt("leading"),a=Gt("breakpoint"),i=Gt("container"),c=Gt("spacing"),d=Gt("radius"),f=Gt("shadow"),m=Gt("inset-shadow"),p=Gt("text-shadow"),h=Gt("drop-shadow"),g=Gt("blur"),w=Gt("perspective"),j=Gt("aspect"),v=Gt("ease"),x=Gt("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),we,ye],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],C=()=>[we,ye,c],O=()=>[Rr,"full","auto",...C()],R=()=>[Os,"none","subgrid",we,ye],z=()=>["auto",{span:["full",Os,we,ye]},Os,we,ye],V=()=>[Os,"auto",we,ye],q=()=>["auto","min","max","fr",we,ye],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...C()],H=()=>[Rr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],L=()=>[Rr,"screen","full","dvw","lvw","svw","min","max","fit",...C()],K=()=>[Rr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],F=()=>[e,we,ye],xe=()=>[...b(),ug,cg,{position:[we,ye]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",xk,fk,{size:[we,ye]}],Pe=()=>[Ku,sa,xo],Re=()=>["","none","full",d,we,ye],se=()=>["",Ue,sa,xo],ve=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ue,Ku,ug,cg],he=()=>["","none",g,we,ye],pe=()=>["none",Ue,we,ye],E=()=>["none",Ue,we,ye],Y=()=>[Ue,we,ye],A=()=>[Rr,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[er],breakpoint:[er],color:[l0],container:[er],"drop-shadow":[er],ease:["in","out","in-out"],font:[uk],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[er],shadow:[er],spacing:["px",Ue],text:[er],"text-shadow":[er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rr,ye,we,j]}],container:["container"],"container-type":[{"@container":["","normal","size",we,ye]}],"container-named":[dk],columns:[{columns:[Ue,ye,we,i]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Os,"auto",we,ye]}],basis:[{basis:[Rr,"full","auto",i,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ue,Rr,"auto","initial","none",ye]}],grow:[{grow:["",Ue,we,ye]}],shrink:[{shrink:["",Ue,we,ye]}],order:[{order:[Os,"first","last","none",we,ye]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[i,"screen",...H()]}],"min-w":[{"min-w":[i,"screen","none",...H()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,sa,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,yk,pk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ku,ye]}],"font-family":[{font:[gk,mk,t]}],"font-features":[{"font-features":[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,we,ye]}],"line-clamp":[{"line-clamp":[Ue,"none",we,ig]}],leading:[{leading:[l,...C()]}],"list-image":[{"list-image":["none",we,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ue,"from-font","auto",we,xo]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Ue,"auto",we,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[Os,we,ye]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:xe()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Os,we,ye],radial:["",we,ye],conic:[Os,we,ye]},vk,hk]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:Pe()}],"gradient-via-pos":[{via:Pe()}],"gradient-to-pos":[{to:Pe()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Re()}],"rounded-s":[{"rounded-s":Re()}],"rounded-e":[{"rounded-e":Re()}],"rounded-t":[{"rounded-t":Re()}],"rounded-r":[{"rounded-r":Re()}],"rounded-b":[{"rounded-b":Re()}],"rounded-l":[{"rounded-l":Re()}],"rounded-ss":[{"rounded-ss":Re()}],"rounded-se":[{"rounded-se":Re()}],"rounded-ee":[{"rounded-ee":Re()}],"rounded-es":[{"rounded-es":Re()}],"rounded-tl":[{"rounded-tl":Re()}],"rounded-tr":[{"rounded-tr":Re()}],"rounded-br":[{"rounded-br":Re()}],"rounded-bl":[{"rounded-bl":Re()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ue,we,ye]}],"outline-w":[{outline:["",Ue,sa,xo]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",f,bi,ji]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",m,bi,ji]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Ue,xo]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",p,bi,ji]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Ue,we,ye]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ue]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[we,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Ue]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:xe()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,ye]}],filter:[{filter:["","none",we,ye]}],blur:[{blur:he()}],brightness:[{brightness:[Ue,we,ye]}],contrast:[{contrast:[Ue,we,ye]}],"drop-shadow":[{"drop-shadow":["","none",h,bi,ji]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",Ue,we,ye]}],"hue-rotate":[{"hue-rotate":[Ue,we,ye]}],invert:[{invert:["",Ue,we,ye]}],saturate:[{saturate:[Ue,we,ye]}],sepia:[{sepia:["",Ue,we,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",we,ye]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Ue,we,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Ue,we,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ue,we,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ue,we,ye]}],"backdrop-invert":[{"backdrop-invert":["",Ue,we,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Ue,we,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Ue,we,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Ue,we,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ue,"initial",we,ye]}],ease:[{ease:["linear","initial",v,we,ye]}],delay:[{delay:[Ue,we,ye]}],animate:[{animate:["none",x,we,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,we,ye]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:E()}],"scale-x":[{"scale-x":E()}],"scale-y":[{"scale-y":E()}],"scale-z":[{"scale-z":E()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[we,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:A()}],"translate-x":[{"translate-x":A()}],"translate-y":[{"translate-y":A()}],"translate-z":[{"translate-z":A()}],"translate-none":["translate-none"],zoom:[{zoom:[Os,we,ye]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,ye]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[Ue,sa,xo,ig]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},bk=ZS(jk);function He(...e){return bk(Jy(e))}const _k=Zy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function D({className:e,variant:t,size:n,asChild:s=!1,...o}){const l=s?NS:"button";return r.jsx(l,{"data-slot":"button",className:He(_k({variant:t,size:n,className:e})),...o})}function Ie({className:e,type:t,...n}){return r.jsx("input",{type:t,"data-slot":"input",className:He("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",e),...n})}var Sk=Object.defineProperty,kk=(e,t)=>Sk(e,"name",{value:t,configurable:!0}),Nk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ot=Nk.reduce((e,t)=>{const n=gr(`Primitive.${t}`),s=u.forwardRef((o,l)=>{const{asChild:a,...i}=o,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(c,{...i,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function m0(e,t){e&&Vo.flushSync(()=>e.dispatchEvent(t))}kk(m0,"dispatchDiscreteCustomEvent");var Ck=Object.defineProperty,Ek=(e,t)=>Ck(e,"name",{value:t,configurable:!0}),Rk=u.forwardRef(Ek(function(t,n){return r.jsx(ot.label,{...t,ref:n,onMouseDown:s=>{var l;s.target.closest("button, input, select, textarea")||((l=t.onMouseDown)==null||l.call(t,s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}})},"Label")),Pk=Rk;const et=u.forwardRef(({className:e,...t},n)=>r.jsx(Pk,{ref:n,"data-slot":"label",className:He("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t}));et.displayName="Label";function Dn({className:e,...t}){return r.jsx("div",{"data-slot":"card",className:He("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function fs({className:e,...t}){return r.jsx("div",{"data-slot":"card-header",className:He("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ps({className:e,...t}){return r.jsx("div",{"data-slot":"card-title",className:He("leading-none font-semibold",e),...t})}function h0({className:e,...t}){return r.jsx("div",{"data-slot":"card-description",className:He("text-muted-foreground text-sm",e),...t})}function Fn({className:e,...t}){return r.jsx("div",{"data-slot":"card-content",className:He("px-6",e),...t})}function g0({className:e,...t}){return r.jsx("div",{"data-slot":"card-footer",className:He("flex items-center px-6",e),...t})}/**
|
|
85
|
-
* @license lucide-react v1.35.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const x0=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
90
|
-
* @license lucide-react v1.35.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const Mk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
95
|
-
* @license lucide-react v1.35.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const Tk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
100
|
-
* @license lucide-react v1.35.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const dg=e=>{const t=Tk(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
105
|
-
* @license lucide-react v1.35.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/var Yu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
110
|
-
* @license lucide-react v1.35.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const $k=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ik=u.createContext({}),Ak=()=>u.useContext(Ik),Ok=u.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:o="",children:l,iconNode:a,...i},c)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:m=!1,color:p="currentColor",className:h=""}=Ak()??{},g=s??m?Number(n??f)*24/Number(t??d):n??f;return u.createElement("svg",{ref:c,...Yu,width:t??d??Yu.width,height:t??d??Yu.height,stroke:e??p,strokeWidth:g,className:x0("lucide",h,o),...!l&&!$k(i)&&{"aria-hidden":"true"},...i},[...a.map(([w,j])=>u.createElement(w,j)),...Array.isArray(l)?l:[l]])});/**
|
|
115
|
-
* @license lucide-react v1.35.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const Ee=(e,t)=>{const n=u.forwardRef(({className:s,...o},l)=>u.createElement(Ok,{ref:l,iconNode:t,className:x0(`lucide-${Mk(dg(e))}`,`lucide-${e}`,s),...o}));return n.displayName=dg(e),n};/**
|
|
120
|
-
* @license lucide-react v1.35.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Lk=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],Qu=Ee("archive-restore",Lk);/**
|
|
125
|
-
* @license lucide-react v1.35.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const zk=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Xu=Ee("archive",zk);/**
|
|
130
|
-
* @license lucide-react v1.35.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const Dk=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Fk=Ee("arrow-down-to-line",Dk);/**
|
|
135
|
-
* @license lucide-react v1.35.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const Bk=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Vp=Ee("arrow-left",Bk);/**
|
|
140
|
-
* @license lucide-react v1.35.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const Uk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Hk=Ee("arrow-right",Uk);/**
|
|
145
|
-
* @license lucide-react v1.35.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const Vk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Wk=Ee("arrow-up",Vk);/**
|
|
150
|
-
* @license lucide-react v1.35.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const qk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Gk=Ee("ban",qk);/**
|
|
155
|
-
* @license lucide-react v1.35.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const Kk=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Yk=Ee("bell",Kk);/**
|
|
160
|
-
* @license lucide-react v1.35.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const Qk=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],v0=Ee("boxes",Qk);/**
|
|
165
|
-
* @license lucide-react v1.35.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const Xk=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],y0=Ee("brain",Xk);/**
|
|
170
|
-
* @license lucide-react v1.35.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const Jk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Al=Ee("check",Jk);/**
|
|
175
|
-
* @license lucide-react v1.35.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const Zk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ol=Ee("chevron-down",Zk);/**
|
|
180
|
-
* @license lucide-react v1.35.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const eN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Rc=Ee("chevron-up",eN);/**
|
|
185
|
-
* @license lucide-react v1.35.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const tN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],nN=Ee("circle-x",tN);/**
|
|
190
|
-
* @license lucide-react v1.35.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const sN=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],rN=Ee("command",sN);/**
|
|
195
|
-
* @license lucide-react v1.35.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const oN=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],lN=Ee("copy-plus",oN);/**
|
|
200
|
-
* @license lucide-react v1.35.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const aN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Wp=Ee("copy",aN);/**
|
|
205
|
-
* @license lucide-react v1.35.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const iN=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],cN=Ee("download",iN);/**
|
|
210
|
-
* @license lucide-react v1.35.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const uN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],qp=Ee("external-link",uN);/**
|
|
215
|
-
* @license lucide-react v1.35.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const dN=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],fg=Ee("eye-off",dN);/**
|
|
220
|
-
* @license lucide-react v1.35.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const fN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],pN=Ee("file-exclamation-point",fN);/**
|
|
225
|
-
* @license lucide-react v1.35.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const mN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],w0=Ee("file-text",mN);/**
|
|
230
|
-
* @license lucide-react v1.35.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const hN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],pg=Ee("folder-open",hN);/**
|
|
235
|
-
* @license lucide-react v1.35.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const gN=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],xN=Ee("folder-plus",gN);/**
|
|
240
|
-
* @license lucide-react v1.35.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const vN=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],yN=Ee("git-fork",vN);/**
|
|
245
|
-
* @license lucide-react v1.35.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const wN=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Gp=Ee("key-round",wN);/**
|
|
250
|
-
* @license lucide-react v1.35.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const jN=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],j0=Ee("link-2",jN);/**
|
|
255
|
-
* @license lucide-react v1.35.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const bN=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_N=Ee("list",bN);/**
|
|
260
|
-
* @license lucide-react v1.35.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const SN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],b0=Ee("loader-circle",SN);/**
|
|
265
|
-
* @license lucide-react v1.35.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const kN=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Kp=Ee("log-out",kN);/**
|
|
270
|
-
* @license lucide-react v1.35.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const NN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],CN=Ee("maximize-2",NN);/**
|
|
275
|
-
* @license lucide-react v1.35.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const EN=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],RN=Ee("menu",EN);/**
|
|
280
|
-
* @license lucide-react v1.35.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const PN=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],MN=Ee("message-square",PN);/**
|
|
285
|
-
* @license lucide-react v1.35.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const TN=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],$N=Ee("messages-square",TN);/**
|
|
290
|
-
* @license lucide-react v1.35.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const IN=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],_0=Ee("palette",IN);/**
|
|
295
|
-
* @license lucide-react v1.35.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const AN=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Yp=Ee("pencil",AN);/**
|
|
300
|
-
* @license lucide-react v1.35.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const ON=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],gf=Ee("play",ON);/**
|
|
305
|
-
* @license lucide-react v1.35.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const LN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],zN=Ee("plug-zap",LN);/**
|
|
310
|
-
* @license lucide-react v1.35.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const DN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ja=Ee("plus",DN);/**
|
|
315
|
-
* @license lucide-react v1.35.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const FN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Da=Ee("refresh-cw",FN);/**
|
|
320
|
-
* @license lucide-react v1.35.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const BN=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xf=Ee("rotate-ccw",BN);/**
|
|
325
|
-
* @license lucide-react v1.35.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const UN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],HN=Ee("save",UN);/**
|
|
330
|
-
* @license lucide-react v1.35.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const VN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],vf=Ee("send",VN);/**
|
|
335
|
-
* @license lucide-react v1.35.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const WN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],S0=Ee("settings",WN);/**
|
|
340
|
-
* @license lucide-react v1.35.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const qN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]],GN=Ee("shield-user",qN);/**
|
|
345
|
-
* @license lucide-react v1.35.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const KN=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],YN=Ee("shrink",KN);/**
|
|
350
|
-
* @license lucide-react v1.35.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const QN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Qp=Ee("square",QN);/**
|
|
355
|
-
* @license lucide-react v1.35.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const XN=[["path",{d:"M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"1ystz2"}],["path",{d:"M3 4v16",key:"1ph11n"}]],JN=Ee("step-forward",XN);/**
|
|
360
|
-
* @license lucide-react v1.35.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const ZN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ks=Ee("trash-2",ZN);/**
|
|
365
|
-
* @license lucide-react v1.35.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const eC=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],k0=Ee("triangle-alert",eC);/**
|
|
370
|
-
* @license lucide-react v1.35.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const tC=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Pc=Ee("undo-2",tC);/**
|
|
375
|
-
* @license lucide-react v1.35.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const nC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sC=Ee("users",nC);/**
|
|
380
|
-
* @license lucide-react v1.35.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const rC=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],oC=Ee("webhook",rC);/**
|
|
385
|
-
* @license lucide-react v1.35.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const lC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],N0=Ee("wrench",lC);/**
|
|
390
|
-
* @license lucide-react v1.35.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const aC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ao=Ee("x",aC);/**
|
|
395
|
-
* @license lucide-react v1.35.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const iC=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],mg=Ee("zap",iC);function cC(){const e=Vl(),t=Yn(),[n,s]=u.useState("login"),[o,l]=u.useState(""),[a,i]=u.useState(""),[c,d]=u.useState(""),[f,m]=u.useState(""),[p,h]=u.useState(""),[g,w]=u.useState(""),[j,v]=u.useState(!1);function x(){s(n==="login"?"reg":"login"),w("")}async function y(){if(j)return;w("");const b=n==="reg";if(b&&f!==p){w("两次输入的密码不一致");return}v(!0);try{b?(await bl.register(c,f),await t.load()):await t.login(o,a),e("/app")}catch(S){w(S.message||(b?"注册失败":"登录失败"))}finally{v(!1)}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(Dn,{className:"w-[360px] shadow-xl",children:[r.jsxs(fs,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(su,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsx(ps,{className:"font-serif text-lg",children:n==="login"?"Touchstone":"注册用户"}),r.jsx(h0,{className:"mt-1",children:"Free-style testing · Execution & monitoring"})]})]}),r.jsxs(Fn,{className:"flex flex-col gap-4",children:[n==="login"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"login-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{id:"login-username",value:o,onChange:b=>l(b.target.value.trim()),autoComplete:"username",placeholder:"请输入用户名",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"login-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{id:"login-password",value:a,onChange:b=>i(b.target.value),type:"password",autoComplete:"current-password",placeholder:"请输入密码",onKeyUp:b=>{b.key==="Enter"&&y()}})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"reg-username",className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{id:"reg-username",value:c,onChange:b=>d(b.target.value.trim()),autoComplete:"username",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"reg-password",className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{id:"reg-password",value:f,onChange:b=>m(b.target.value),type:"password",autoComplete:"new-password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"reg-password2",className:"text-xs text-muted-foreground",children:"确认密码"}),r.jsx(Ie,{id:"reg-password2",value:p,onChange:b=>h(b.target.value),type:"password",autoComplete:"new-password",onKeyUp:b=>{b.key==="Enter"&&y()}})]})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:g}),r.jsxs(D,{size:"lg",className:"w-full",disabled:j,onClick:y,children:[j&&r.jsx(b0,{className:"size-4 animate-spin"}),n==="login"?"登 录":"注 册"]})]}),r.jsxs(g0,{className:"flex-col items-center gap-3 pt-0",children:[r.jsx("button",{type:"button",className:"text-sm text-primary underline-offset-4 hover:underline",onClick:x,children:n==="login"?"没有账号?注册新用户":"已有账号?返回登录"}),n==="login"&&r.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入账号密码登录;登录后可在右上角修改密码"})]})]})})}const $n=Fp((e,t)=>({projects:[],currentProject:null,tasks:[],bugs:[],loading:{projects:!1,tasks:!1,bugs:!1},loadProjects:async()=>{e(n=>({loading:{...n.loading,projects:!0}}));try{e({projects:await Mt.list()})}finally{e(n=>({loading:{...n.loading,projects:!1}}))}},selectProject:async n=>{const s=t().projects.find(o=>o.id===n)||null;e({currentProject:s}),s&&await Promise.all([t().loadTasks(),t().loadBugs()])},refreshProject:async()=>{const n=t().currentProject;if(!n)return;const s=await Mt.get(n.id);e(o=>({currentProject:s,projects:o.projects.map(l=>l.id===s.id?s:l)}))},loadTasks:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,tasks:!0}}));try{e({tasks:await Be.list(n.id)})}finally{e(s=>({loading:{...s.loading,tasks:!1}}))}}},loadBugs:async()=>{const n=t().currentProject;if(n){e(s=>({loading:{...s.loading,bugs:!0}}));try{e({bugs:await ff.list(n.id)})}finally{e(s=>({loading:{...s.loading,bugs:!1}}))}}},createProject:async n=>{const s=await Mt.create(n);return await t().loadProjects(),s},updateProject:async(n,s)=>{await Mt.update(n,s),await t().refreshProject(),await t().loadProjects()},deleteProject:async(n,s)=>{var o;await Mt.remove(n,s),((o=t().currentProject)==null?void 0:o.id)===n&&e({currentProject:null}),await t().loadProjects()},archiveProject:async(n,s)=>{var o;await Mt[s?"archive":"unarchive"](n),await t().loadProjects(),((o=t().currentProject)==null?void 0:o.id)===n&&await t().refreshProject()}}));let vo=null,hg=null;function M(e,t=2500){vo||(vo=document.createElement("div"),vo.className="ts-toast",document.body.appendChild(vo)),vo.textContent=e,vo.classList.add("show"),clearTimeout(hg),hg=setTimeout(()=>vo.classList.remove("show"),t)}const Xi=400,Ji=240,Tn=8,uC={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",nw:"nwse-resize",se:"nwse-resize",sw:"nesw-resize"};function dC(e,t){if(!e)return null;try{const n=JSON.parse(localStorage.getItem(e));if(n&&+n.w>=Xi&&(!t||+n.h>=Ji))return t?{w:+n.w,h:+n.h}:{w:+n.w}}catch{}return null}function lr(e,t=!0){const[n,s]=u.useState(()=>dC(e,t)),o=u.useRef(null),l=u.useRef(null),a=u.useCallback(h=>{const g=o.current;if(!g)return;const w=h.clientX-g.sx,j=h.clientY-g.sy;let v=g.left,x=g.top,y=g.w,b=g.h;if(g.dir==="mv"){const k=window.innerWidth,C=window.innerHeight;v=Math.max(Tn,Math.min(g.left+w,k-Tn-y)),x=Math.max(Tn,Math.min(g.top+j,C-Tn-b)),s({left:v,top:x,w:y,h:b});return}g.dir.includes("e")&&(y=g.w+w),g.dir.includes("s")&&(b=g.h+j),g.dir.includes("w")&&(y=g.w-w,v=g.left+w),g.dir.includes("n")&&(b=g.h-j,x=g.top+j);const S=window.innerWidth,N=window.innerHeight;y<Xi&&(g.dir.includes("w")&&(v-=Xi-y),y=Xi),b<Ji&&(g.dir.includes("n")&&(x-=Ji-b),b=Ji),v<Tn&&(g.dir.includes("w")&&(y-=Tn-v),v=Tn),x<Tn&&(g.dir.includes("n")&&(b-=Tn-x),x=Tn),v+y>S-Tn&&(y=S-Tn-v),x+b>N-Tn&&(b=N-Tn-x),s({left:v,top:x,w:y,h:b})},[]),i=u.useCallback(()=>{l.current&&(window.removeEventListener("mousemove",l.current),window.removeEventListener("mouseup",i),l.current=null),document.body.style.cursor="",e&&s(h=>{if(h)try{localStorage.setItem(e,JSON.stringify(t?{w:h.w,h:h.h}:{w:h.w}))}catch{}return h})},[e,t]),c=u.useCallback((h,g)=>{const w=h.currentTarget.closest(".modal");if(!w)return;w.style.animation="none",w.style.transition="none";const j=w.getBoundingClientRect();o.current={dir:g,sx:h.clientX,sy:h.clientY,left:j.left,top:j.top,w:j.width,h:j.height},s({left:j.left,top:j.top,w:j.width,h:j.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor=uC[g]||"default"},[a,i]),d=u.useCallback(h=>{if(h.button!==0)return;const g=h.currentTarget.closest(".modal");if(!g)return;g.style.animation="none",g.style.transition="none";const w=g.getBoundingClientRect();o.current={dir:"mv",sx:h.clientX,sy:h.clientY,left:w.left,top:w.top,w:w.width,h:w.height},s({left:w.left,top:w.top,w:w.width,h:w.height}),l.current=a,window.addEventListener("mousemove",a),window.addEventListener("mouseup",i),document.body.style.cursor="move",h.preventDefault()},[a,i]),f=u.useCallback(()=>{if(e)try{localStorage.removeItem(e)}catch{}s(null)},[e]),m=!!n,p=n?n.left!=null?{left:n.left+"px",top:n.top+"px",width:n.w+"px",height:n.h+"px",transform:"none"}:n.h?{left:`calc(50% - ${n.w/2}px)`,top:`calc(50% - ${n.h/2}px)`,width:n.w+"px",height:n.h+"px"}:{left:`calc(50% - ${n.w/2}px)`,width:n.w+"px"}:{};return{rzOn:m,rzStyle:p,rzStart:c,rzDragStart:d,rzReset:f}}const fC=/[^\s\u0000\u0001<>",。、;:!?()〔〕【】「」『』《》〈〉…—~·“”‘’]+/g,pC=/^[([{`'*“「『【(〔〈《]+/,mC=/(?::\d+(?::\d+)?|[)\]}`'*.,;:!?。,、;:!?…’”」』)】〕〉》])+$/,hC=/[()[\]{}*?=,!#$%^|`]/,gC=/^[^/\\\s]*\.[A-Za-z][A-Za-z0-9]{0,9}$/,xC=new Set(["md","markdown","txt","rst","json","jsonl","ndjson","yaml","yml","toml","ini","cfg","conf","env","log","csv","tsv","xml","html","htm","css","scss","less","js","jsx","mjs","cjs","ts","tsx","vue","svelte","py","sh","bash","zsh","bat","cmd","ps1","sql","go","rs","java","kt","rb","php","c","h","cc","cpp","hpp","cs","swift","lua","pl","r","jl","lock","patch","diff","ipynb","pdf","zip","tar","gz","tgz","7z","png","jpg","jpeg","gif","webp","svg","ico","bmp","mp4","mov","mp3","xlsx","xls","docx","doc","pptx","ppt","db","sqlite","wasm","map"]);function vC(e){return e.slice(e.lastIndexOf(".")+1).toLowerCase()}function yC(e,t){if(!e||e.indexOf("://")>=0||hC.test(e))return!1;const n=e.split(/[/\\]/).pop();return gC.test(n)?/[/\\]/.test(e)||/^[A-Za-z]:/.test(e)?!0:t&&xC.has(vC(n)):!1}function wC(e){return`<a class="md-path" data-path="${e}" title="点击预览:${e}">${e}</a>`}function gg(e,t){const n=!!(t&&t.bare);return String(e??"").replace(fC,s=>{const o=(s.match(pC)||[""])[0],l=s.slice(o.length),a=(l.match(mC)||[""])[0],i=l.slice(0,l.length-a.length);return yC(i,n)?o+wC(i)+a:s})}const _i=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function xg(e){const t=String(e||"").trim();return/^(\/|https?:\/\/|mailto:|tel:|data:image\/)/i.test(t)?t:""}function Pr(e,t){const n=!!(t&&t.pathLinks);let s=_i(e);const o=[],l=[];return s=s.replace(/`([^`]+)`/g,(a,i)=>(o.push(i),"\0"+(o.length-1)+"\0")),n&&(s=s.replace(/!?\[[^\]]*\]\([^)\s]+(?:\s+"[^"]*")?\)/g,a=>(l.push(a),""+(l.length-1)+""))),s=s.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),n&&(s=gg(s)),l.length&&(s=s.replace(/\u0001(\d+)\u0001/g,(a,i)=>l[+i])),s=s.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=xg(c);return d?`<img class="md-img" src="${d}" alt="${_i(i)}" loading="lazy">`:_i(a)}),s=s.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,(a,i,c)=>{const d=xg(c);return d?`<a href="${d}" target="_blank" rel="noreferrer">${i}</a>`:_i(a)}),s=s.replace(/\u0000(\d+)\u0000/g,(a,i)=>"<code>"+(n?gg(o[+i],{bare:!0}):o[+i])+"</code>"),s}const vg=e=>String(e).trim().replace(/^\||\|$/g,"").split("|").map(t=>t.trim());function Oo(e,t){const n=t||{},s=String(e||"").split(`
|
|
400
|
-
`);let o="",l=0;for(;l<s.length;){const a=s[l];if(/^```/.test(a)){const c=[];for(l++;l<s.length&&!/^```/.test(s[l]);)c.push(s[l]),l++;l++,o+="<pre><code>"+c.map(d=>Pr(d)).join(`
|
|
401
|
-
`)+"</code></pre>";continue}if(/^\|/.test(a)&&l+1<s.length&&/^\|[\s:|-]+\|$/.test(s[l+1])){const c=vg(a);l+=2;const d=[];for(;l<s.length&&/^\|/.test(s[l]);)d.push(vg(s[l])),l++;o+="<table><thead><tr>"+c.map(f=>"<th>"+Pr(f,n)+"</th>").join("")+"</tr></thead><tbody>"+d.map(f=>"<tr>"+f.map(m=>"<td>"+Pr(m,n)+"</td>").join("")+"</tr>").join("")+"</tbody></table>";continue}const i=a.match(/^(#{1,4})\s+(.*)$/);if(i){o+="<h"+i[1].length+">"+Pr(i[2],n)+"</h"+i[1].length+">",l++;continue}if(/^\s*(?:---|\*\*\*)\s*$/.test(a)){o+="<hr>",l++;continue}if(/^\s*[-*]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*[-*]\s+/.test(s[l]);)c.push(Pr(s[l].replace(/^\s*[-*]\s+/,""),n)),l++;o+="<ul>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ul>";continue}if(/^\s*\d{1,2}[.)]\s+/.test(a)){const c=[];for(;l<s.length&&/^\s*\d{1,2}[.)]\s+/.test(s[l]);)c.push(Pr(s[l].replace(/^\s*\d{1,2}[.)]\s+/,""),n)),l++;o+="<ol>"+c.map(d=>"<li>"+d+"</li>").join("")+"</ol>";continue}if(/^\s*>\s?/.test(a)){const c=[];for(;l<s.length&&/^\s*>\s?/.test(s[l]);)c.push(s[l].replace(/^\s*>\s?/,"")),l++;o+="<blockquote>"+c.map(d=>"<p>"+Pr(d,n)+"</p>").join("")+"</blockquote>";continue}if(a.trim()===""){l++;continue}o+="<p>"+Pr(a,n)+"</p>",l++}return o}function ns(e){return e||"—"}const cr={queued:"排队中",running:"运行中",done:"已完成",stopped:"已停止",failed:"失败",interrupted:"中断"};function ar({start:e,reset:t}){const n=["n","s","e","w","ne","nw","se","sw"];return r.jsx(r.Fragment,{children:n.map(s=>r.jsx("i",{className:"rz rz-"+s,onMouseDown:o=>e(o,s),onDoubleClick:t,title:"拖动调整大小,双击复位"},s))})}const yf={idle:"",queued_serial:"排队中",answer_pending:"已作答·待送达",interaction_pending:"等待作答",server_queued:"服务端排队中",foreign_busy:"等外部会话",starting:"启动中",running:"会话运行中"},C0={running:"run",starting:"run",interaction_pending:"queued",queued_serial:"queued",answer_pending:"queued",server_queued:"server",foreign_busy:"foreign"},jC={run:"bug-status run",queued:"bug-status retest",server:"bug-status retest",foreign:"bug-status retest"},bC={run:"sess-qstate run",queued:"sess-qstate queued",server:"sess-qstate server",foreign:"sess-qstate foreign"};function E0(e,t="board"){const n=C0[e];return n?(t==="sess"?bC:jC)[n]:t==="sess"?"sess-qstate":"bug-status pending"}function _C(e,t={}){const{found:n=!0,board:s=!1,canQueue:o=!1,chatRunning:l=!1,projectBusy:a=!1}=t;if(!n)return"会话不可用";if(e==="foreign_busy")return s?"外部会话运行中:Enter 排队,空闲后自动投递":"外部会话运行中:Enter 排队,空闲后自动发送";if(e==="interaction_pending")return s?"agent 等待你作答:回答上方提问,或 Enter 排队继续对话":"agent 等待你作答:回答上方提问";const i=!!C0[e]||a;return i&&o?s?"会话运行中:Enter 排队,排队行「立即注入」可插入当前轮":"任务运行中:Enter 排队,排队行「立即注入」可插入当前轮":i?s?"项目忙:Enter 排队,空闲后自动投递":"项目忙:Enter 排队,空闲后自动发送":l?"对话进行中:Enter 排队,等当前轮结束发送":"向该会话继续发消息…(Enter 发送,Shift+Enter 换行)"}const SC=/([!]?\[[^\]]*\]\()([^)\s]+)(\))/g,R0="m\\d{13}_[0-9a-f]{10}\\.[A-Za-z0-9]{1,10}",kC=new RegExp("^\\/.*\\/board_media\\/("+R0+")$"),NC=new RegExp("^\\/api\\/projects\\/\\d+\\/board\\/media\\/("+R0+")$"),P0="/touchstone/".replace(/\/+$/,"");function Xp(e,t=P0){const n=typeof e=="string"?e:"";return NC.test(n)?t+n:n}function wf(e,t,n=P0){return!e||!t?e||"":String(e).replace(SC,(s,o,l,a)=>{const i=kC.exec(l);if(i)return o+n+"/api/projects/"+t+"/board/media/"+i[1]+a;const c=Xp(l,n);return c===l?s:o+c+a})}const yg=4;async function Jp(e){try{if(!(e.type||"").startsWith("image/"))return!1;const t=new Uint8Array(await e.slice(0,24).arrayBuffer());if(t.length<24||[137,80,78,71,13,10,26,10].some((l,a)=>t[a]!==l))return!1;const s=t[16]<<24|t[17]<<16|t[18]<<8|t[19],o=t[20]<<24|t[21]<<16|t[22]<<8|t[23];return s<=yg&&o<=yg}catch{return!1}}var CC=Object.defineProperty,EC=(e,t)=>CC(e,"name",{value:t,configurable:!0});function jf(e,[t,n]){return Math.min(n,Math.max(t,e))}EC(jf,"clamp");var RC=Object.defineProperty,Wl=(e,t)=>RC(e,"name",{value:t,configurable:!0}),M0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ye(e,t,{checkForDefaultPrevented:n=!0}={}){return Wl(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Wl(Ye,"composeEventHandlers");function PC(e){var t;if(!M0)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Wl(PC,"getOwnerWindow");function bf(e){if(!M0)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Wl(bf,"getOwnerDocument");function T0(e,t=!1){const{activeElement:n}=bf(e);if(!(n!=null&&n.nodeName))return null;if($0(n)&&n.contentDocument)return T0(n.contentDocument.body,t);if(t){const s=n.getAttribute("aria-activedescendant");if(s){const o=bf(n).getElementById(s);if(o)return o}}return n}Wl(T0,"getActiveElement");function $0(e){return e.tagName==="IFRAME"}Wl($0,"isFrame");var MC=Object.defineProperty,os=(e,t)=>MC(e,"name",{value:t,configurable:!0});function TC(e,t){const n=u.createContext(t);n.displayName=e+"Context";const s=os(l=>{const{children:a,...i}=l,c=u.useMemo(()=>i,Object.values(i));return r.jsx(n.Provider,{value:c,children:a})},"Provider");s.displayName=e+"Provider";function o(l,a={}){const{optional:i=!1}=a,c=u.useContext(n);if(c)return c;if(t!==void 0)return t;if(!i)throw new Error(`\`${l}\` must be used within \`${e}\``)}return os(o,"useContext"),[s,o]}os(TC,"createContext");function co(e,t=[]){let n=[];function s(l,a){const i=u.createContext(a);i.displayName=l+"Context";const c=n.length;n=[...n,a];const d=os(m=>{var v;const{scope:p,children:h,...g}=m,w=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useMemo(()=>g,Object.values(g));return r.jsx(w.Provider,{value:j,children:h})},"Provider");d.displayName=l+"Provider";function f(m,p,h={}){var v;const{optional:g=!1}=h,w=((v=p==null?void 0:p[e])==null?void 0:v[c])||i,j=u.useContext(w);if(j)return j;if(a!==void 0)return a;if(!g)throw new Error(`\`${m}\` must be used within \`${l}\``)}return os(f,"useContext"),[d,f]}os(s,"createContext");const o=os(()=>{const l=n.map(a=>u.createContext(a));return os(function(i){const c=(i==null?void 0:i[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:c}}),[i,c])},"useScope")},"createScope");return o.scopeName=e,[s,I0(o,...t)]}os(co,"createContextScope");function I0(...e){const t=e[0];if(e.length===1)return t;const n=os(()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return os(function(l){const a=s.reduce((i,{useScope:c,scopeName:d})=>{const m=c(l)[`__scope${d}`];return{...i,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}os(I0,"composeContextScopes");var $C=Object.defineProperty,sn=(e,t)=>$C(e,"name",{value:t,configurable:!0});function Zp(e){const t=e+"CollectionProvider",[n,s]=co(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=sn(w=>{const{scope:j,children:v}=w,x=u.useRef(null),y=u.useRef(new Map).current;return r.jsx(o,{scope:j,itemMap:y,collectionRef:x,children:v})},"CollectionProvider");a.displayName=t;const i=e+"CollectionSlot",c=gr(i),d=u.forwardRef((w,j)=>{const{scope:v,children:x}=w,y=l(i,v),b=yt(j,y.collectionRef);return r.jsx(c,{ref:b,children:x})});d.displayName=i;const f=e+"CollectionItemSlot",m="data-radix-collection-item",p=gr(f),h=u.forwardRef((w,j)=>{const{scope:v,children:x,...y}=w,b=u.useRef(null),S=yt(j,b),N=l(f,v);return u.useEffect(()=>(N.itemMap.set(b,{ref:b,...y}),()=>void N.itemMap.delete(b))),r.jsx(p,{[m]:"",ref:S,children:x})});h.displayName=f;function g(w){const j=l(e+"CollectionConsumer",w);return u.useCallback(()=>{const x=j.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${m}]`));return Array.from(j.itemMap.values()).sort((N,k)=>y.indexOf(N.ref.current)-y.indexOf(k.ref.current))},[j.collectionRef,j.itemMap])}return sn(g,"useCollection"),[{Provider:a,Slot:d,ItemSlot:h},g,s]}sn(Zp,"createCollection");var wg=new WeakMap,zt,Wn,Ju=(Wn=class extends Map{constructor(n){super(n);Im(this,zt);vu(this,zt,[...super.keys()]),wg.set(this,!0)}set(n,s){return wg.get(this)&&(this.has(n)?pn(this,zt)[pn(this,zt).indexOf(n)]=n:pn(this,zt).push(n)),super.set(n,s),this}insert(n,s,o){const l=this.has(s),a=pn(this,zt).length,i=em(n);let c=i>=0?i:a+i;const d=c<0||c>=a?-1:c;if(d===this.size||l&&d===this.size-1||d===-1)return this.set(s,o),this;const f=this.size+(l?0:1);i<0&&c++;const m=[...pn(this,zt)];let p,h=!1;for(let g=c;g<f;g++)if(c===g){let w=m[g];m[g]===s&&(w=m[g+1]),l&&this.delete(s),p=this.get(w),this.set(s,o)}else{!h&&m[g-1]===s&&(h=!0);const w=m[h?g:g-1],j=p;p=this.get(w),this.delete(w),this.set(w,j)}return this}with(n,s,o){const l=new Wn(this);return l.insert(n,s,o),l}before(n){const s=pn(this,zt).indexOf(n)-1;if(!(s<0))return this.entryAt(s)}setBefore(n,s,o){const l=pn(this,zt).indexOf(n);return l===-1?this:this.insert(l,s,o)}after(n){let s=pn(this,zt).indexOf(n);if(s=s===-1||s===this.size-1?-1:s+1,s!==-1)return this.entryAt(s)}setAfter(n,s,o){const l=pn(this,zt).indexOf(n);return l===-1?this:this.insert(l+1,s,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return vu(this,zt,[]),super.clear()}delete(n){const s=super.delete(n);return s&&pn(this,zt).splice(pn(this,zt).indexOf(n),1),s}deleteAt(n){const s=this.keyAt(n);return s!==void 0?this.delete(s):!1}at(n){const s=Zi(pn(this,zt),n);if(s!==void 0)return this.get(s)}entryAt(n){const s=Zi(pn(this,zt),n);if(s!==void 0)return[s,this.get(s)]}indexOf(n){return pn(this,zt).indexOf(n)}keyAt(n){return Zi(pn(this,zt),n)}from(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.at(l)}keyFrom(n,s){const o=this.indexOf(n);if(o===-1)return;let l=o+s;return l<0&&(l=0),l>=this.size&&(l=this.size-1),this.keyAt(l)}find(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return l;o++}}findIndex(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return o;o++}return-1}filter(n,s){const o=[];let l=0;for(const a of this)Reflect.apply(n,s,[a,l,this])&&o.push(a),l++;return new Wn(o)}map(n,s){const o=[];let l=0;for(const a of this)o.push([a[0],Reflect.apply(n,s,[a,l,this])]),l++;return new Wn(o)}reduce(...n){const[s,o]=n;let l=0,a=o??this.at(0);for(const i of this)l===0&&n.length===1?a=i:a=Reflect.apply(s,this,[a,i,l,this]),l++;return a}reduceRight(...n){const[s,o]=n;let l=o??this.at(-1);for(let a=this.size-1;a>=0;a--){const i=this.at(a);a===this.size-1&&n.length===1?l=i:l=Reflect.apply(s,this,[l,i,a,this])}return l}toSorted(n){const s=[...this.entries()].sort(n);return new Wn(s)}toReversed(){const n=new Wn;for(let s=this.size-1;s>=0;s--){const o=this.keyAt(s),l=this.get(o);n.set(o,l)}return n}toSpliced(...n){const s=[...this.entries()];return s.splice(...n),new Wn(s)}slice(n,s){const o=new Wn;let l=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),s!==void 0&&s>0&&(l=s-1);for(let a=n;a<=l;a++){const i=this.keyAt(a),c=this.get(i);o.set(i,c)}return o}every(n,s){let o=0;for(const l of this){if(!Reflect.apply(n,s,[l,o,this]))return!1;o++}return!0}some(n,s){let o=0;for(const l of this){if(Reflect.apply(n,s,[l,o,this]))return!0;o++}return!1}},zt=new WeakMap,sn(Wn,"OrderedDict"),Wn);function Zi(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=A0(e,t);return n===-1?void 0:e[n]}sn(Zi,"at");function A0(e,t){const n=e.length,s=em(t),o=s>=0?s:n+s;return o<0||o>=n?-1:o}sn(A0,"toSafeIndex");function em(e){return e!==e||e===0?0:Math.trunc(e)}sn(em,"toSafeInteger");function IC(e){const t=e+"CollectionProvider",[n,s]=co(t),[o,l]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Ju,setItemMap:sn(()=>{},"setItemMap")}),a=sn(({state:y,...b})=>y?r.jsx(c,{...b,state:y}):r.jsx(i,{...b}),"CollectionProvider");a.displayName=t;const i=sn(y=>{const b=j();return r.jsx(c,{...y,state:b})},"CollectionInit");i.displayName=t+"Init";const c=sn(y=>{const{scope:b,children:S,state:N}=y,k=u.useRef(null),[C,O]=u.useState(null),R=yt(k,O),[z,V]=N;return u.useEffect(()=>{if(!C)return;const q=z0(()=>{});return q.observe(C,{childList:!0,subtree:!0}),()=>{q.disconnect()}},[C]),r.jsx(o,{scope:b,itemMap:z,setItemMap:V,collectionRef:R,collectionRefObject:k,collectionElement:C,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const d=e+"CollectionSlot",f=gr(d),m=u.forwardRef((y,b)=>{const{scope:S,children:N}=y,k=l(d,S),C=yt(b,k.collectionRef);return r.jsx(f,{ref:C,children:N})});m.displayName=d;const p=e+"CollectionItemSlot",h="data-radix-collection-item",g=gr(p),w=u.forwardRef((y,b)=>{const{scope:S,children:N,...k}=y,C=u.useRef(null),[O,R]=u.useState(null),z=yt(b,C,R),V=l(p,S),{setItemMap:q}=V,I=u.useRef(k);O0(I.current,k)||(I.current=k);const G=I.current;return u.useEffect(()=>{const te=G;return q(H=>O?H.has(O)?H.set(O,{...te,element:O}).toSorted(_f):(H.set(O,{...te,element:O}),H.toSorted(_f)):H),()=>{q(H=>!O||!H.has(O)?H:(H.delete(O),new Ju(H)))}},[O,G,q]),r.jsx(g,{[h]:"",ref:z,children:N})});w.displayName=p;function j(){return u.useState(new Ju)}sn(j,"useInitCollection");function v(y){const{itemMap:b}=l(e+"CollectionConsumer",y);return b}return sn(v,"useCollection"),[{Provider:a,Slot:m,ItemSlot:w},{createCollectionScope:s,useCollection:v,useInitCollection:j}]}sn(IC,"createCollection");function O0(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}sn(O0,"shallowEqual");function L0(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}sn(L0,"isElementPreceding");function _f(e,t){return!e[1].element||!t[1].element?0:L0(e[1].element,t[1].element)?-1:1}sn(_f,"sortByDocumentPosition");function z0(e){return new MutationObserver(n=>{for(const s of n)if(s.type==="childList"){e();return}})}sn(z0,"getChildListObserver");var AC=Object.defineProperty,OC=(e,t)=>AC(e,"name",{value:t,configurable:!0}),LC=u.createContext(void 0);function ru(e){const t=u.useContext(LC);return e||t||"ltr"}OC(ru,"useDirection");var zC=Object.defineProperty,DC=(e,t)=>zC(e,"name",{value:t,configurable:!0});function Rs(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}DC(Rs,"useCallbackRef");var FC=Object.defineProperty,nn=(e,t)=>FC(e,"name",{value:t,configurable:!0}),Sf="dismissableLayer.update",BC="dismissableLayer.pointerDownOutside",UC="dismissableLayer.focusOutside",jg,D0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),F0=u.forwardRef(nn(function(t,n){const{disableOutsidePointerEvents:s=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:c,onDismiss:d,...f}=t,m=u.useContext(D0),[p,h]=u.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=u.useState({}),j=yt(n,h),v=Array.from(m.layers),[x]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),y=x?v.indexOf(x):-1,b=p?v.indexOf(p):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,N=b>=y,k=u.useRef(!1),C=U0(V=>{a==null||a(V),c==null||c(V),V.defaultPrevented||d==null||d()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:u.useCallback(V=>{if(!(V instanceof Node))return!1;const q=[...m.branches].some(I=>I.contains(V));return N&&!q},[m.branches,N])}),O=H0(V=>{if(o&&k.current)return;const q=V.target;[...m.branches].some(G=>G.contains(q))||(i==null||i(V),c==null||c(V),V.defaultPrevented||d==null||d())},g),R=p?b===v.length-1:!1,z=Rs(V=>{V.key==="Escape"&&(l==null||l(V),!V.defaultPrevented&&d&&(V.preventDefault(),d()))});return u.useEffect(()=>{if(R)return g.addEventListener("keydown",z,{capture:!0}),()=>g.removeEventListener("keydown",z,{capture:!0})},[g,R,z]),u.useEffect(()=>{if(p)return s&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(jg=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),kf(),()=>{s&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=jg))}},[p,g,s,m]),u.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),kf())},[p,m]),u.useEffect(()=>{const V=nn(()=>w({}),"handleUpdate");return document.addEventListener(Sf,V),()=>document.removeEventListener(Sf,V)},[]),r.jsx(ot.div,{...f,ref:j,style:{pointerEvents:S?N?"auto":"none":void 0,...t.style},onFocusCapture:Ye(t.onFocusCapture,O.onFocusCapture),onBlurCapture:Ye(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ye(t.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function B0(){const e=u.useContext(D0),[t,n]=u.useState(null);return u.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}nn(B0,"useDismissableLayerSurface");var HC=nn(()=>!0,"IS_TRUE");function U0(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:s=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:a=HC}=t,i=Rs(e),c=u.useRef(!1),d=u.useRef(!1),f=u.useRef(new Map),m=u.useRef(()=>{});return u.useEffect(()=>{function p(){d.current=!1,o.current=!1,f.current.clear()}nn(p,"resetOutsideInteraction");function h(){return Array.from(f.current.values()).some(Boolean)}nn(h,"isOutsideInteractionIntercepted");function g(y){if(!d.current)return;const b=y.target;b instanceof Node&&[...l].some(N=>N.contains(b))||f.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{d.current&&m.current()},0)}nn(g,"handleInteractionCapture");function w(y){d.current&&f.current.set(y.type,!1)}nn(w,"handleInteractionBubble");const j=nn(y=>{if(y.target&&!c.current){let b=function(){n.removeEventListener("click",m.current);const N=h();p(),N||tm(BC,i,S,{discrete:!0})};if(nn(b,"handleAndDispatchPointerDownOutsideEvent"),!a(y.target)){n.removeEventListener("click",m.current),p(),c.current=!1;return}const S={originalEvent:y};d.current=!0,o.current=s&&y.button===0,f.current.clear(),!s||y.button!==0?b():(n.removeEventListener("click",m.current),m.current=b,n.addEventListener("click",m.current,{once:!0}))}else n.removeEventListener("click",m.current),p();c.current=!1},"handlePointerDown"),v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of v)n.addEventListener(y,g,!0),n.addEventListener(y,w);const x=window.setTimeout(()=>{n.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(x),n.removeEventListener("pointerdown",j),n.removeEventListener("click",m.current);for(const y of v)n.removeEventListener(y,g,!0),n.removeEventListener(y,w)}},[n,i,s,o,l,a]),{onPointerDownCapture:nn(()=>c.current=!0,"onPointerDownCapture")}}nn(U0,"usePointerDownOutside");function H0(e,t=globalThis==null?void 0:globalThis.document){const n=Rs(e),s=u.useRef(!1);return u.useEffect(()=>{const o=nn(l=>{l.target&&!s.current&&tm(UC,n,{originalEvent:l},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:nn(()=>s.current=!0,"onFocusCapture"),onBlurCapture:nn(()=>s.current=!1,"onBlurCapture")}}nn(H0,"useFocusOutside");function kf(){const e=new CustomEvent(Sf);document.dispatchEvent(e)}nn(kf,"dispatchUpdate");function tm(e,t,n,{discrete:s}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),s?m0(o,l):o.dispatchEvent(l)}nn(tm,"handleAndDispatchCustomEvent");var VC=Object.defineProperty,nm=(e,t)=>VC(e,"name",{value:t,configurable:!0}),Si=0,Ls=null;function WC(e){return ou(),e.children}nm(WC,"FocusGuards");function ou(){u.useEffect(()=>{Ls||(Ls={start:Nf(),end:Nf()});const{start:e,end:t}=Ls;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Si++,()=>{Si===1&&(Ls==null||Ls.start.remove(),Ls==null||Ls.end.remove(),Ls=null),Si=Math.max(0,Si-1)}},[])}nm(ou,"useFocusGuards");function Nf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}nm(Nf,"createFocusGuard");var qC=Object.defineProperty,Nn=(e,t)=>qC(e,"name",{value:t,configurable:!0}),Zu="focusScope.autoFocusOnMount",ed="focusScope.autoFocusOnUnmount",bg={bubbles:!1,cancelable:!0},V0=u.forwardRef(Nn(function(t,n){const{loop:s=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:a,...i}=t,[c,d]=u.useState(null),f=Rs(l),m=Rs(a),p=u.useRef(null),h=yt(n,d),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(o){let j=function(b){if(g.paused||!c)return;const S=b.target;c.contains(S)?p.current=S:nr(p.current,{select:!0})},v=function(b){if(g.paused||!c)return;const S=b.relatedTarget;S!==null&&(c.contains(S)||nr(p.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&nr(c)};Nn(j,"handleFocusIn"),Nn(v,"handleFocusOut"),Nn(x,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",v);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",v),y.disconnect()}}},[o,c,g.paused]),u.useEffect(()=>{if(c){_g.add(g);const j=document.activeElement;if(!c.contains(j)){const x=new CustomEvent(Zu,bg);c.addEventListener(Zu,f),c.dispatchEvent(x),x.defaultPrevented||(W0(Q0(sm(c)),{select:!0}),document.activeElement===j&&nr(c))}return()=>{c.removeEventListener(Zu,f),setTimeout(()=>{const x=new CustomEvent(ed,bg);c.addEventListener(ed,m),c.dispatchEvent(x),x.defaultPrevented||nr(j??document.body,{select:!0}),c.removeEventListener(ed,m),_g.remove(g)},0)}}},[c,f,m,g]);const w=u.useCallback(j=>{if(!s&&!o||g.paused)return;const v=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,x=document.activeElement;if(v&&x){const y=j.currentTarget,[b,S]=q0(y);b&&S?!j.shiftKey&&x===S?(j.preventDefault(),s&&nr(b,{select:!0})):j.shiftKey&&x===b&&(j.preventDefault(),s&&nr(S,{select:!0})):x===y&&j.preventDefault()}},[s,o,g.paused]);return r.jsx(ot.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})},"FocusScope"));function W0(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(nr(s,{select:t}),document.activeElement!==n)return}Nn(W0,"focusFirst");function q0(e){const t=sm(e),n=Cf(t,e),s=Cf(t.reverse(),e);return[n,s]}Nn(q0,"getTabbableEdges");function sm(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Nn(s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}Nn(sm,"getTabbableCandidates");function Cf(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const s of e)if(!(n?!s.checkVisibility({checkVisibilityCSS:!0}):G0(s,{upTo:t})))return s}Nn(Cf,"findVisible");function G0(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}Nn(G0,"isHidden");function K0(e){return e instanceof HTMLInputElement&&"select"in e}Nn(K0,"isSelectableInput");function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&K0(e)&&t&&e.select()}}Nn(nr,"focus");var _g=Y0();function Y0(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ef(e,t),e.unshift(t)},remove(t){var n;e=Ef(e,t),(n=e[0])==null||n.resume()}}}Nn(Y0,"createFocusScopesStack");function Ef(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}Nn(Ef,"arrayRemove");function Q0(e){return e.filter(t=>t.tagName!=="A")}Nn(Q0,"removeLinks");var Lt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},GC=Object.defineProperty,KC=(e,t)=>GC(e,"name",{value:t,configurable:!0}),YC=Bo[" useId ".trim().toString()]||(()=>{}),QC=0;function Yr(e){const[t,n]=u.useState(YC());return Lt(()=>{e||n(s=>s??String(QC++))},[e]),e||(t?`radix-${t}`:"")}KC(Yr,"useId");const XC=["top","right","bottom","left"],no=Math.min,ur=Math.max,Mc=Math.round,ki=Math.floor,dr=e=>({x:e,y:e}),JC={left:"right",right:"left",bottom:"top",top:"bottom"};function X0(e,t,n){return ur(e,no(t,n))}function xr(e,t){return typeof e=="function"?e(t):e}function so(e){return e.split("-")[0]}function ql(e){return e.split("-")[1]}function rm(e){return e==="x"?"y":"x"}function om(e){return e==="y"?"height":"width"}function Ws(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function lm(e){return rm(Ws(e))}function ZC(e,t,n){n===void 0&&(n=!1);const s=ql(e),o=lm(e),l=om(o);let a=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=Tc(a)),[a,Tc(a)]}function e2(e){const t=Tc(e);return[Rf(e),t,Rf(t)]}function Rf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Sg=["left","right"],kg=["right","left"],t2=["top","bottom"],n2=["bottom","top"];function s2(e,t,n){switch(e){case"top":case"bottom":return n?t?kg:Sg:t?Sg:kg;case"left":case"right":return t?t2:n2;default:return[]}}function r2(e,t,n,s){const o=ql(e);let l=s2(so(e),n==="start",s);return o&&(l=l.map(a=>a+"-"+o),t&&(l=l.concat(l.map(Rf)))),l}function Tc(e){const t=so(e);return JC[t]+e.slice(t.length)}function o2(e){var t,n,s,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(o=e.left)!=null?o:0}}function J0(e){return typeof e!="number"?o2(e):{top:e,right:e,bottom:e,left:e}}function $c(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function Ng(e,t,n){let{reference:s,floating:o}=e;const l=Ws(t),a=lm(t),i=om(a),c=so(t),d=l==="y",f=s.x+s.width/2-o.width/2,m=s.y+s.height/2-o.height/2,p=s[i]/2-o[i]/2;let h;switch(c){case"top":h={x:f,y:s.y-o.height};break;case"bottom":h={x:f,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:m};break;case"left":h={x:s.x-o.width,y:m};break;default:h={x:s.x,y:s.y}}const g=ql(t);return g&&(h[a]+=p*(g==="end"?1:-1)*(n&&d?-1:1)),h}async function l2(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:l,rects:a,elements:i,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:p=!1,padding:h=0}=xr(t,e),g=J0(h),j=i[p?m==="floating"?"reference":"floating":m],v=$c(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(i.floating)),boundary:d,rootBoundary:f,strategy:c})),x=m==="floating"?{x:s,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),b=await(l.isElement==null?void 0:l.isElement(y))&&await(l.getScale==null?void 0:l.getScale(y))||{x:1,y:1},S=$c(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:y,strategy:c}):x);return{top:(v.top-S.top+g.top)/b.y,bottom:(S.bottom-v.bottom+g.bottom)/b.y,left:(v.left-S.left+g.left)/b.x,right:(S.right-v.right+g.right)/b.x}}const a2=50,i2=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:l2},c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:m}=Ng(d,s,c),p=s,h=0;const g={};for(let w=0;w<l.length;w++){const j=l[w];if(!j)continue;const{name:v,fn:x}=j,{x:y,y:b,data:S,reset:N}=await x({x:f,y:m,initialPlacement:s,placement:p,strategy:o,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=y??f,m=b??m,g[v]={...g[v],...S},N&&h<a2&&(h++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:f,y:m}=Ng(d,p,c)),w=-1)}return{x:f,y:m,placement:p,strategy:o,middlewareData:g}},c2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:l,platform:a,elements:i,middlewareData:c}=t,{element:d,padding:f=0}=xr(e,t)||{};if(d==null)return{};const m=J0(f),p={x:n,y:s},h=lm(o),g=om(h),w=await a.getDimensions(d),j=h==="y",v=j?"top":"left",x=j?"bottom":"right",y=j?"clientHeight":"clientWidth",b=l.reference[g]+l.reference[h]-p[h]-l.floating[g],S=p[h]-l.reference[h],N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let k=N?N[y]:0;(!k||!await(a.isElement==null?void 0:a.isElement(N)))&&(k=i.floating[y]||l.floating[g]);const C=b/2-S/2,O=k/2-w[g]/2-1,R=no(m[v],O),z=no(m[x],O),V=k-w[g]-z,q=k/2-w[g]/2+C,I=X0(R,q,V),G=!c.arrow&&ql(o)!=null&&q!==I&&l.reference[g]/2-(q<R?R:z)-w[g]/2<0,te=G?q<R?q-R:q-V:0;return{[h]:p[h]+te,data:{[h]:I,centerOffset:q-I-te,...G&&{alignmentOffset:te}},reset:G}}}),u2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:l,rects:a,initialPlacement:i,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...j}=xr(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const v=so(o),x=Ws(i),y=so(i)===i,b=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=p||(y||!w?[Tc(i)]:e2(i)),N=g!=="none";!p&&N&&S.push(...r2(i,w,g,b));const k=[i,...S],C=await c.detectOverflow(t,j),O=[];let R=((s=l.flip)==null?void 0:s.overflows)||[];if(f&&O.push(C[v]),m){const I=ZC(o,a,b);O.push(C[I[0]],C[I[1]])}if(R=[...R,{placement:o,overflows:O}],!O.every(I=>I<=0)){var z,V;const I=(((z=l.flip)==null?void 0:z.index)||0)+1,G=k[I];if(G&&(!(m==="alignment"?x!==Ws(G):!1)||R.every(L=>Ws(L.placement)===x?L.overflows[0]>0:!0)))return{data:{index:I,overflows:R},reset:{placement:G}};let te=(V=R.filter(H=>H.overflows[0]<=0).sort((H,L)=>H.overflows[1]-L.overflows[1])[0])==null?void 0:V.placement;if(!te)switch(h){case"bestFit":{var q;const H=(q=R.filter(L=>{if(N){const K=Ws(L.placement);return K===x||K==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(K=>K>0).reduce((K,F)=>K+F,0)]).sort((L,K)=>L[1]-K[1])[0])==null?void 0:q[0];H&&(te=H);break}case"initialPlacement":te=i;break}if(o!==te)return{reset:{placement:te}}}return{}}}};function Cg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Eg(e){return XC.some(t=>e[t]>=0)}const d2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:o="referenceHidden",...l}=xr(e,t);switch(o){case"referenceHidden":{const a=await s.detectOverflow(t,{...l,elementContext:"reference"}),i=Cg(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Eg(i)}}}case"escaped":{const a=await s.detectOverflow(t,{...l,altBoundary:!0}),i=Cg(a,n.floating);return{data:{escapedOffsets:i,escaped:Eg(i)}}}default:return{}}}}},Z0=new Set(["left","top"]);async function f2(e,t){const{placement:n,platform:s,elements:o}=e,l=await(s.isRTL==null?void 0:s.isRTL(o.floating)),a=so(n),i=ql(n),c=Ws(n)==="y",d=Z0.has(a)?-1:1,f=l&&c?-1:1,m=xr(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof g=="number"&&(h=i==="end"?g*-1:g),c?{x:h*f,y:p*d}:{x:p*d,y:h*f}}const p2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:l,placement:a,middlewareData:i}=t,c=await f2(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(s=i.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:l+c.y,data:{...c,placement:a}}}}},m2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o,platform:l}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:c={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...d}=xr(e,t),f={x:n,y:s},m=await l.detectOverflow(t,d),p=Ws(o),h=rm(p);let g=f[h],w=f[p];const j=(x,y)=>X0(y+m[x==="y"?"top":"left"],y,y-m[x==="y"?"bottom":"right"]);a&&(g=j(h,g)),i&&(w=j(p,w));const v=c.fn({...t,[h]:g,[p]:w});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[h]:a,[p]:i}}}}}},h2=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,s;const{x:o,y:l,placement:a,rects:i,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=xr(e,t),p={x:o,y:l},h=Ws(a),g=rm(h);let w=p[g],j=p[h];const v=xr(d,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(s=v.crossAxis)!=null?s:0};if(f){const S=g==="y"?"height":"width",N=i.reference[g]-i.floating[S]+x.mainAxis,k=i.reference[g]+i.reference[S]-x.mainAxis;w<N?w=N:w>k&&(w=k)}if(m){var y,b;const S=g==="y"?"width":"height",N=Z0.has(so(a)),k=i.reference[h]-i.floating[S]+(N&&((y=c.offset)==null?void 0:y[h])||0)+(N?0:x.crossAxis),C=i.reference[h]+i.reference[S]+(N?0:((b=c.offset)==null?void 0:b[h])||0)-(N?x.crossAxis:0);j<k?j=k:j>C&&(j=C)}return{[g]:w,[h]:j}}}},g2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:s,platform:o,elements:l}=t,{apply:a=()=>{},...i}=xr(e,t),c=await o.detectOverflow(t,i),d=so(n),f=ql(n),m=Ws(n)==="y",{width:p,height:h}=s.floating;let g,w;d==="top"||d==="bottom"?(g=d,w=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=d,g=f==="end"?"top":"bottom");const j=h-c.top-c.bottom,v=p-c.left-c.right,x=no(h-c[g],j),y=no(p-c[w],v),b=t.middlewareData.shift,S=!b;let N=x,k=y;b!=null&&b.enabled.x&&(k=v),b!=null&&b.enabled.y&&(N=j),S&&!f&&(m?k=p-2*ur(c.left,c.right):N=h-2*ur(c.top,c.bottom)),await a({...t,availableWidth:k,availableHeight:N});const C=await o.getDimensions(l.floating);return p!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}};function lu(){return typeof window<"u"}function Gl(e){return ew(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(ew(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ew(e){return lu()?e instanceof Node||e instanceof Bn(e).Node:!1}function Ys(e){return lu()?e instanceof Element||e instanceof Bn(e).Element:!1}function uo(e){return lu()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function Rg(e){return!lu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}function au(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Qs(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&o!=="inline"&&o!=="contents"}function x2(e){return/^(table|td|th)$/.test(Gl(e))}function iu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const v2=/transform|translate|scale|rotate|perspective|filter/,y2=/paint|layout|strict|content/,yo=e=>!!e&&e!=="none";let td;function am(e){const t=Ys(e)?Qs(e):e;return yo(t.transform)||yo(t.translate)||yo(t.scale)||yo(t.rotate)||yo(t.perspective)||!im()&&(yo(t.backdropFilter)||yo(t.filter))||v2.test(t.willChange||"")||y2.test(t.contain||"")}function w2(e){let t=Lo(e);for(;uo(t)&&!Fa(t);){if(am(t))return t;if(iu(t))return null;t=Lo(t)}return null}function im(){return td==null&&(td=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),td}function Fa(e){return/^(html|body|#document)$/.test(Gl(e))}function Qs(e){return Bn(e).getComputedStyle(e)}function cu(e){return Ys(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lo(e){if(Gl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rg(e)&&e.host||wr(e);return Rg(t)?t.host:t}function tw(e){const t=Lo(e);return Fa(t)?(e.ownerDocument||e).body:uo(t)&&au(t)?t:tw(t)}function Ba(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=tw(e),l=o===((s=e.ownerDocument)==null?void 0:s.body),a=Bn(o);if(l){const i=Pf(a);return t.concat(a,a.visualViewport||[],au(o)?o:[],i&&n?Ba(i):[])}else return t.concat(o,Ba(o,[],n))}function Pf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nw(e){const t=Qs(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=uo(e),l=o?e.offsetWidth:n,a=o?e.offsetHeight:s,i=Mc(n)!==l||Mc(s)!==a;return i&&(n=l,s=a),{width:n,height:s,$:i}}function cm(e){return Ys(e)?e:e.contextElement}function _l(e){const t=cm(e);if(!uo(t))return dr(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:l}=nw(t);let a=(l?Mc(n.width):n.width)/s,i=(l?Mc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const j2=dr(0);function sw(e){const t=Bn(e);return!im()||!t.visualViewport?j2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function b2(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bn(e)}function zo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=cm(e);let a=dr(1);t&&(s?Ys(s)&&(a=_l(s)):a=_l(e));const i=b2(l,n,s)?sw(l):dr(0);let c=(o.left+i.x)/a.x,d=(o.top+i.y)/a.y,f=o.width/a.x,m=o.height/a.y;if(l&&s){const p=Bn(l),h=Ys(s)?Bn(s):s;let g=p,w=Pf(g);for(;w&&h!==g;){const j=_l(w),v=w.getBoundingClientRect(),x=Qs(w),y=v.left+(w.clientLeft+parseFloat(x.paddingLeft))*j.x,b=v.top+(w.clientTop+parseFloat(x.paddingTop))*j.y;c*=j.x,d*=j.y,f*=j.x,m*=j.y,c+=y,d+=b,g=Bn(w),w=Pf(g)}}return $c({width:f,height:m,x:c,y:d})}function uu(e,t){const n=cu(e).scrollLeft;return t?t.left+n:zo(wr(e)).left+n}function rw(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-uu(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function _2(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const l=o==="fixed",a=wr(s),i=t?iu(t.floating):!1;if(s===a||i&&l)return n;let c={scrollLeft:0,scrollTop:0},d=dr(1);const f=dr(0),m=uo(s);if((m||!l)&&((Gl(s)!=="body"||au(a))&&(c=cu(s)),m)){const h=zo(s);d=_l(s),f.x=h.x+s.clientLeft,f.y=h.y+s.clientTop}const p=a&&!m&&!l?rw(a,c):dr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+p.x,y:n.y*d.y-c.scrollTop*d.y+f.y+p.y}}function S2(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function k2(e){const t=cu(e),n=e.ownerDocument.body,s=ur(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=ur(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let l=-t.scrollLeft+uu(e);const a=-t.scrollTop;return Qs(n).direction==="rtl"&&(l+=ur(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:l,y:a}}const N2=25;function C2(e,t,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",o=Bn(e),l=wr(e),a=o.visualViewport;let i=l.clientWidth,c=l.clientHeight,d=0,f=0;if(a){const p=!im()||t==="fixed";s?p||(d=-a.offsetLeft,f=-a.offsetTop):(i=a.width,c=a.height,p&&(d=a.offsetLeft,f=a.offsetTop))}if(uu(l)<=0){const p=l.ownerDocument,h=p.body,g=getComputedStyle(h),w=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(l.clientWidth-h.clientWidth-w),v=getComputedStyle(l).scrollbarGutter==="stable both-edges"?j/2:j;v<=N2&&(i-=v)}return{width:i,height:c,x:d,y:f}}function E2(e,t){const n=zo(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,l=_l(e),a=e.clientWidth*l.x,i=e.clientHeight*l.y,c=o*l.x,d=s*l.y;return{width:a,height:i,x:c,y:d}}function Pg(e,t,n){let s;if(t==="viewport"||t==="layoutViewport")s=C2(e,n,t);else if(t==="document")s=k2(wr(e));else if(Ys(t))s=E2(t,n);else{const o=sw(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $c(s)}function R2(e,t){const n=t.get(e);if(n)return n;let s=Ba(e,[],!1).filter(i=>Ys(i)&&Gl(i)!=="body"),o=null;const l=Qs(e).position==="fixed";let a=l?Lo(e):e;for(;Ys(a)&&!Fa(a);){const i=Qs(a),c=am(a),d=o?o.position:l?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&i.position==="static")?s=s.filter(m=>m!==a):o=i,a=Lo(a)}return t.set(e,s),s}function P2(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const a=[...n==="clippingAncestors"?iu(t)?[]:R2(t,this._c):[].concat(n),s],i=Pg(t,a[0],o);let c=i.top,d=i.right,f=i.bottom,m=i.left;for(let p=1;p<a.length;p++){const h=Pg(t,a[p],o);c=ur(h.top,c),d=no(h.right,d),f=no(h.bottom,f),m=ur(h.left,m)}return{width:d-m,height:f-c,x:m,y:c}}function M2(e){const{width:t,height:n}=nw(e);return{width:t,height:n}}function T2(e,t,n){const s=uo(t),o=wr(t),l=n==="fixed",a=zo(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const c=dr(0);if((s||!l)&&((Gl(t)!=="body"||au(o))&&(i=cu(t)),s)){const p=zo(t,!0,l,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}!s&&o&&(c.x=uu(o));const d=o&&!s&&!l?rw(o,i):dr(0),f=a.left+i.scrollLeft-c.x-d.x,m=a.top+i.scrollTop-c.y-d.y;return{x:f,y:m,width:a.width,height:a.height}}function nd(e){return Qs(e).position==="static"}function Mg(e,t){if(!uo(e)||Qs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return wr(e)===n&&(n=n.ownerDocument.body),n}function ow(e,t){const n=Bn(e);if(iu(e))return n;if(!uo(e)){let o=Lo(e);for(;o&&!Fa(o);){if(Ys(o)&&!nd(o))return o;o=Lo(o)}return n}let s=Mg(e,t);for(;s&&x2(s)&&nd(s);)s=Mg(s,t);return s&&Fa(s)&&nd(s)&&!am(s)?n:s||w2(e)||n}const $2=async function(e){const t=this.getOffsetParent||ow,n=this.getDimensions,s=await n(e.floating);return{reference:T2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function I2(e){return Qs(e).direction==="rtl"}const A2={convertOffsetParentRelativeRectToViewportRelativeRect:_2,getDocumentElement:wr,getClippingRect:P2,getOffsetParent:ow,getElementRects:$2,getClientRects:S2,getDimensions:M2,getScale:_l,isElement:Ys,isRTL:I2};function lw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function O2(e,t,n){let s=null,o;const l=wr(e);function a(){var f;clearTimeout(o),(f=s)==null||f.disconnect(),s=null}function i(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),a();const p=e.getBoundingClientRect(),{left:h,top:g,width:w,height:j}=p;if(f||t(),!w||!j)return;const v=ki(g),x=ki(l.clientWidth-(h+w)),y=ki(l.clientHeight-(g+j)),b=ki(h),N={rootMargin:-v+"px "+-x+"px "+-y+"px "+-b+"px",threshold:ur(0,no(1,m))||1};let k=!0;function C(O){const R=O[0].intersectionRatio;if(!lw(p,e.getBoundingClientRect()))return i();if(R!==m){if(!k)return i();R?i(!1,R):o=setTimeout(()=>{i(!1,1e-7)},1e3)}k=!1}try{s=new IntersectionObserver(C,{...N,root:l.ownerDocument})}catch{s=new IntersectionObserver(C,N)}s.observe(e)}const c=Bn(e),d=()=>i(n);return c.addEventListener("resize",d),i(!0),()=>{c.removeEventListener("resize",d),a()}}function L2(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=cm(e),f=o||l?[...d?Ba(d):[],...t?Ba(t):[]]:[];f.forEach(v=>{o&&v.addEventListener("scroll",n),l&&v.addEventListener("resize",n)});const m=d&&i?O2(d,n,l):null;let p=-1,h=null;a&&(h=new ResizeObserver(v=>{let[x]=v;x&&x.target===d&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),d&&!c&&h.observe(d),t&&h.observe(t));let g,w=c?zo(e):null;c&&j();function j(){const v=zo(e);w&&!lw(w,v)&&n(),w=v,g=requestAnimationFrame(j)}return n(),()=>{var v;f.forEach(x=>{o&&x.removeEventListener("scroll",n),l&&x.removeEventListener("resize",n)}),m==null||m(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const z2=p2,D2=m2,F2=u2,B2=g2,U2=d2,Tg=c2,H2=h2,V2=(e,t,n)=>{const s=new Map,o=n??{},l={...A2,...o.platform,_c:s};return i2(e,t,{...o,platform:l})};var W2=typeof document<"u",q2=function(){},ec=W2?u.useLayoutEffect:q2;function Ic(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Ic(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const l=o[s];if(!(l==="_owner"&&e.$$typeof)&&!Ic(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function aw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $g(e,t){const n=aw(e);return Math.round(t*n)/n}function sd(e){const t=u.useRef(e);return ec(()=>{t.current=e}),t}function G2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:l,floating:a}={},transform:i=!0,whileElementsMounted:c,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(s);Ic(p,s)||h(s);const[g,w]=u.useState(null),[j,v]=u.useState(null),x=u.useCallback(L=>{L!==N.current&&(N.current=L,w(L))},[]),y=u.useCallback(L=>{L!==k.current&&(k.current=L,v(L))},[]),b=l||g,S=a||j,N=u.useRef(null),k=u.useRef(null),C=u.useRef(f),O=c!=null,R=sd(c),z=sd(o),V=sd(d),q=u.useCallback(()=>{if(!N.current||!k.current)return;const L={placement:t,strategy:n,middleware:p};z.current&&(L.platform=z.current),V2(N.current,k.current,L).then(K=>{const F={...K,isPositioned:V.current!==!1};I.current&&!Ic(C.current,F)&&(C.current=F,Vo.flushSync(()=>{m(F)}))})},[p,t,n,z,V]);ec(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[d]);const I=u.useRef(!1);ec(()=>(I.current=!0,()=>{I.current=!1}),[]),ec(()=>{if(b&&(N.current=b),S&&(k.current=S),b&&S){if(R.current)return R.current(b,S,q);q()}},[b,S,q,R,O]);const G=u.useMemo(()=>({reference:N,floating:k,setReference:x,setFloating:y}),[x,y]),te=u.useMemo(()=>({reference:b,floating:S}),[b,S]),H=u.useMemo(()=>{const L={position:n,left:0,top:0};if(!te.floating)return L;const K=$g(te.floating,f.x),F=$g(te.floating,f.y);return i?{...L,transform:"translate("+K+"px, "+F+"px)",...aw(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:F}},[n,i,te.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:q,refs:G,elements:te,floatingStyles:H}),[f,q,G,te,H])}const K2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Tg({element:s.current,padding:o}).fn(n):{}:s?Tg({element:s,padding:o}).fn(n):{}}}},Y2=(e,t)=>{const n=z2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q2=(e,t)=>{const n=D2(e);return{name:n.name,fn:n.fn,options:[e,t]}},X2=(e,t)=>({fn:H2(e).fn,options:[e,t]}),J2=(e,t)=>{const n=F2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Z2=(e,t)=>{const n=B2(e);return{name:n.name,fn:n.fn,options:[e,t]}},eE=(e,t)=>{const n=U2(e);return{name:n.name,fn:n.fn,options:[e,t]}},tE=(e,t)=>{const n=K2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var nE=Object.defineProperty,sE=(e,t)=>nE(e,"name",{value:t,configurable:!0});function iw(e){const[t,n]=u.useState(void 0);return Lt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,i;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}sE(iw,"useSize");var rE=Object.defineProperty,Qr=(e,t)=>rE(e,"name",{value:t,configurable:!0}),cw="Popper",[uw,dw]=co(cw),[oE,fw]=uw(cw),lE=Qr(e=>{const{__scopePopper:t,children:n}=e,[s,o]=u.useState(null),[l,a]=u.useState(void 0);return r.jsx(oE,{scope:t,anchor:s,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})},"Popper"),aE="PopperAnchor",iE=u.forwardRef(Qr(function(t,n){const{__scopePopper:s,virtualRef:o,...l}=t,a=fw(aE,s),i=u.useRef(null),c=a.onAnchorChange,d=u.useCallback(w=>{i.current=w,w&&c(w)},[c]),f=yt(n,d),m=u.useRef(null);u.useEffect(()=>{if(!o)return;const w=m.current;m.current=o.current,w!==m.current&&c(m.current)});const p=a.placementState&&du(a.placementState),h=p==null?void 0:p[0],g=p==null?void 0:p[1];return o?null:r.jsx(ot.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...l,ref:f})},"PopperAnchor")),pw="PopperContent",[cE,x$]=uw(pw),uE=u.forwardRef(Qr(function(t,n){var ue,he,pe,E,Y,A,oe;const{__scopePopper:s,side:o="bottom",sideOffset:l=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:w,...j}=t,v=fw(pw,s),[x,y]=u.useState(null),b=yt(n,y),[S,N]=u.useState(null),k=iw(S),C=(k==null?void 0:k.width)??0,O=(k==null?void 0:k.height)??0,R=o+(a!=="center"?"-"+a:""),z=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},V=Array.isArray(f)?f:[f],q=V.length>0,I={padding:z,boundary:V.filter(mw),altBoundary:q},{refs:G,floatingStyles:te,placement:H,isPositioned:L,middlewareData:K}=G2({strategy:"fixed",placement:R,whileElementsMounted:Qr((...le)=>L2(...le,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Y2({mainAxis:l+O,alignmentAxis:i}),d&&Q2({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?X2():void 0,...I}),d&&J2({...I}),Z2({...I,apply:Qr(({elements:le,rects:Ne,availableWidth:Ge,availableHeight:dt})=>{const{width:Ze,height:ft}=Ne.reference,kt=le.floating.style;kt.setProperty("--radix-popper-available-width",`${Ge}px`),kt.setProperty("--radix-popper-available-height",`${dt}px`),kt.setProperty("--radix-popper-anchor-width",`${Ze}px`),kt.setProperty("--radix-popper-anchor-height",`${ft}px`)},"apply")}),S&&tE({element:S,padding:c}),dE({arrowWidth:C,arrowHeight:O}),h&&eE({strategy:"referenceHidden",...I,boundary:q?I.boundary:void 0})]}),F=v.setPlacementState;Lt(()=>(F(H),()=>{F(void 0)}),[H,F]);const[xe,X]=du(H),Te=Rs(w);Lt(()=>{L&&(Te==null||Te())},[L,Te]);const Pe=(ue=K.arrow)==null?void 0:ue.x,Re=(he=K.arrow)==null?void 0:he.y,se=((pe=K.arrow)==null?void 0:pe.centerOffset)!==0,[ve,ie]=u.useState();return Lt(()=>{x&&ie(window.getComputedStyle(x).zIndex)},[x]),r.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:L?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(E=K.transformOrigin)==null?void 0:E.x,(Y=K.transformOrigin)==null?void 0:Y.y].join(" "),...((A=K.hide)==null?void 0:A.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(cE,{scope:s,placedSide:xe,placedAlign:X,onArrowChange:N,arrowX:Pe,arrowY:Re,shouldHideArrow:se,children:r.jsx(ot.div,{"data-side":xe,"data-align":X,...j,ref:b,style:{...j.style,animation:L?(oe=j.style)==null?void 0:oe.animation:"none"}})})})},"PopperContent"));function mw(e){return e!==null}Qr(mw,"isNotNull");var dE=Qr(e=>({name:"transformOrigin",options:e,fn(t){var j,v,x;const{placement:n,rects:s,middlewareData:o}=t,a=((j=o.arrow)==null?void 0:j.centerOffset)!==0,i=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,f]=du(n),m={start:"0%",center:"50%",end:"100%"}[f],p=(((v=o.arrow)==null?void 0:v.x)??0)+i/2,h=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let g="",w="";return d==="bottom"?(g=a?m:`${p}px`,w=`${-c}px`):d==="top"?(g=a?m:`${p}px`,w=`${s.floating.height+c}px`):d==="right"?(g=`${-c}px`,w=a?m:`${h}px`):d==="left"&&(g=`${s.floating.width+c}px`,w=a?m:`${h}px`),{data:{x:g,y:w}}}}),"transformOrigin");function du(e){const[t,n="center"]=e.split("-");return[t,n]}Qr(du,"getSideAndAlignFromPlacement");var fE=lE,pE=iE,mE=uE,hE=Object.defineProperty,gE=(e,t)=>hE(e,"name",{value:t,configurable:!0}),hw=u.forwardRef(gE(function(t,n){var c;const{container:s,...o}=t,[l,a]=u.useState(!1);Lt(()=>a(!0),[]);const i=s||l&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?Vo.createPortal(r.jsx(ot.div,{...o,ref:n}),i):null},"Portal")),xE=Object.defineProperty,vr=(e,t)=>xE(e,"name",{value:t,configurable:!0});function gw(e,t){return u.useReducer((n,s)=>t[n][s]??n,e)}vr(gw,"useStateMachine");var Za=vr(e=>{const{present:t,children:n}=e,s=xw(t),o=typeof n=="function"?n({present:s.isPresent}):u.Children.only(n),l=vw(s.ref,yw(o));return typeof n=="function"||s.isPresent?u.cloneElement(o,{ref:l}):null},"Presence");function xw(e){const[t,n]=u.useState(),s=u.useRef(null),o=u.useRef(e),l=u.useRef("none"),a=u.useRef(void 0),i=e?"mounted":"unmounted",[c,d]=gw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{c==="mounted"?(l.current=a.current??nl(s.current),a.current=void 0):l.current="none"},[c]),Lt(()=>{const f=s.current,m=o.current;if(m!==e){const h=l.current,g=nl(f);e?(a.current=g,d("MOUNT")):g==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(m&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Lt(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,p=vr(g=>{const j=nl(s.current).includes(CSS.escape(g.animationName));if(g.target===t&&j&&(d("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},"handleAnimationEnd"),h=vr(g=>{g.target===t&&(l.current=nl(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u.useCallback(f=>{if(f){const m=getComputedStyle(f);s.current=m,a.current=nl(m)}else s.current=null;n(f)},[])}}vr(xw,"usePresence");function Mf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}vr(Mf,"setRef");function vw(...e){const t=u.useRef(e);return t.current=e,u.useCallback(n=>{const s=t.current;let o=!1;const l=s.map(a=>{const i=Mf(a,n);return!o&&typeof i=="function"&&(o=!0),i});if(o)return()=>{for(let a=0;a<l.length;a++){const i=l[a];typeof i=="function"?i():Mf(s[a],null)}}},[])}vr(vw,"useStableComposedRefs");function nl(e){return(e==null?void 0:e.animationName)||"none"}vr(nl,"getAnimationName");function yw(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}vr(yw,"getElementRef");var vE=Object.defineProperty,yE=(e,t)=>vE(e,"name",{value:t,configurable:!0}),Ig=Bo[" useEffectEvent ".trim().toString()],Ag=Bo[" useInsertionEffect ".trim().toString()];function ww(e){if(typeof Ig=="function")return Ig(e);const t=u.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ag=="function"?Ag(()=>{t.current=e}):Lt(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}yE(ww,"useEffectEvent");var wE=Object.defineProperty,ei=(e,t)=>wE(e,"name",{value:t,configurable:!0}),jE=Bo[" useInsertionEffect ".trim().toString()]||Lt;function Ll({prop:e,defaultProp:t,onChange:n=ei(()=>{},"onChange"),caller:s}){const[o,l,a]=jw({defaultProp:t,onChange:n}),i=e!==void 0,c=i?e:o,d=u.useCallback(f=>{var m;if(i){const p=bw(f)?f(e):f;p!==e&&((m=a.current)==null||m.call(a,p))}else l(f)},[i,e,l,a]);return[c,d]}ei(Ll,"useControllableState");function jw({defaultProp:e,onChange:t}){const[n,s]=u.useState(e),o=u.useRef(n),l=u.useRef(t);return jE(()=>{l.current=t},[t]),u.useEffect(()=>{var a;o.current!==n&&((a=l.current)==null||a.call(l,n),o.current=n)},[n,o]),[n,s,l]}ei(jw,"useUncontrolledState");function bw(e){return typeof e=="function"}ei(bw,"isFunction");var Og=Symbol("RADIX:SYNC_STATE");function bE(e,t,n,s){const{prop:o,defaultProp:l,onChange:a,caller:i}=t,c=o!==void 0,d=ww(a),f=[{...n,state:l}];s&&f.push(s);const[m,p]=u.useReducer((j,v)=>{if(v.type===Og)return{...j,state:v.state};const x=e(j,v);return c&&!Object.is(x.state,j.state)&&d(x.state),x},...f),h=m.state,g=u.useRef(h);u.useEffect(()=>{g.current!==h&&(g.current=h,c||d(h))},[h,g,c]);const w=u.useMemo(()=>o!==void 0?{...m,state:o}:m,[m,o]);return u.useEffect(()=>{c&&!Object.is(o,m.state)&&p({type:Og,state:o})},[o,m.state,c]),[w,p]}ei(bE,"useControllableStateReducer");var _E=Object.defineProperty,SE=(e,t)=>_E(e,"name",{value:t,configurable:!0});function _w(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}SE(_w,"usePrevious");var kE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jo=new WeakMap,Ni=new WeakMap,Ci={},rd=0,Sw=function(e){return e&&(e.host||Sw(e.parentNode))},CE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Sw(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},EE=function(e,t,n,s){var o=CE(t,Array.isArray(e)?e:[e]);Ci[n]||(Ci[n]=new WeakMap);var l=Ci[n],a=[],i=new Set,c=new Set(o),d=function(m){!m||i.has(m)||(i.add(m),d(m.parentNode))};o.forEach(d);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(p){if(i.has(p))f(p);else try{var h=p.getAttribute(s),g=h!==null&&h!=="false",w=(Jo.get(p)||0)+1,j=(l.get(p)||0)+1;Jo.set(p,w),l.set(p,j),a.push(p),w===1&&g&&Ni.set(p,!0),j===1&&p.setAttribute(n,"true"),g||p.setAttribute(s,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),i.clear(),rd++,function(){a.forEach(function(m){var p=Jo.get(m)-1,h=l.get(m)-1;Jo.set(m,p),l.set(m,h),p||(Ni.has(m)||m.removeAttribute(s),Ni.delete(m)),h||m.removeAttribute(n)}),rd--,rd||(Jo=new WeakMap,Jo=new WeakMap,Ni=new WeakMap,Ci={})}},kw=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=NE(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),EE(s,o,n,"aria-hidden")):function(){return null}},Vs=function(){return Vs=Object.assign||function(t){for(var n,s=1,o=arguments.length;s<o;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Vs.apply(this,arguments)};function Nw(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(n[s[o]]=e[s[o]]);return n}function RE(e,t,n){if(n||arguments.length===2)for(var s=0,o=t.length,l;s<o;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var tc="right-scroll-bar-position",nc="width-before-scroll-bar",PE="with-scroll-bars-hidden",ME="--removed-body-scroll-bar-size";function od(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TE(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var o=n.value;o!==s&&(n.value=s,n.callback(s,o))}}}})[0];return n.callback=t,n.facade}var $E=typeof window<"u"?u.useLayoutEffect:u.useEffect,Lg=new WeakMap;function IE(e,t){var n=TE(null,function(s){return e.forEach(function(o){return od(o,s)})});return $E(function(){var s=Lg.get(n);if(s){var o=new Set(s),l=new Set(e),a=n.current;o.forEach(function(i){l.has(i)||od(i,null)}),l.forEach(function(i){o.has(i)||od(i,a)})}Lg.set(n,e)},[e]),n}function AE(e){return e}function OE(e,t){t===void 0&&(t=AE);var n=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var a=t(l,s);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(l){for(s=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(i){return l(i)},filter:function(){return n}}},assignMedium:function(l){s=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(l),a=n}var c=function(){var f=a;a=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){a.push(f),d()},filter:function(f){return a=a.filter(f),n}}}};return o}function LE(e){e===void 0&&(e={});var t=OE(null);return t.options=Vs({async:!0,ssr:!1},e),t}var Cw=function(e){var t=e.sideCar,n=Nw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return u.createElement(s,Vs({},n))};Cw.isSideCarExport=!0;function zE(e,t){return e.useMedium(t),Cw}var Ew=LE(),ld=function(){},fu=u.forwardRef(function(e,t){var n=u.useRef(null),s=u.useState({onScrollCapture:ld,onWheelCapture:ld,onTouchMoveCapture:ld}),o=s[0],l=s[1],a=e.forwardProps,i=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,m=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,w=e.inert,j=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,y=e.gapMode,b=Nw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,N=IE([n,t]),k=Vs(Vs({},b),o);return u.createElement(u.Fragment,null,f&&u.createElement(S,{sideCar:Ew,removeScrollBar:d,shards:m,noRelative:h,noIsolation:g,inert:w,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:y}),a?u.cloneElement(u.Children.only(i),Vs(Vs({},k),{ref:N})):u.createElement(x,Vs({},k,{className:c,ref:N}),i))});fu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fu.classNames={fullWidth:nc,zeroRight:tc};var DE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DE();return t&&e.setAttribute("nonce",t),e}function BE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HE=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FE())&&(BE(t,n),UE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},VE=function(){var e=HE();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Rw=function(){var e=VE(),t=function(n){var s=n.styles,o=n.dynamic;return e(s,o),null};return t},WE={left:0,top:0,right:0,gap:0},ad=function(e){return parseInt(e||"",10)||0},qE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ad(n),ad(s),ad(o)]},GE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return WE;var t=qE(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},KE=Rw(),Sl="data-scroll-locked",YE=function(e,t,n,s){var o=e.left,l=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
402
|
-
.`.concat(PE,` {
|
|
403
|
-
overflow: hidden `).concat(s,`;
|
|
404
|
-
padding-right: `).concat(i,"px ").concat(s,`;
|
|
405
|
-
}
|
|
406
|
-
body[`).concat(Sl,`] {
|
|
407
|
-
overflow: hidden `).concat(s,`;
|
|
408
|
-
overscroll-behavior: contain;
|
|
409
|
-
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
410
|
-
padding-left: `.concat(o,`px;
|
|
411
|
-
padding-top: `).concat(l,`px;
|
|
412
|
-
padding-right: `).concat(a,`px;
|
|
413
|
-
margin-left:0;
|
|
414
|
-
margin-top:0;
|
|
415
|
-
margin-right: `).concat(i,"px ").concat(s,`;
|
|
416
|
-
`),n==="padding"&&"padding-right: ".concat(i,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.`).concat(tc,` {
|
|
420
|
-
right: `).concat(i,"px ").concat(s,`;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.`).concat(nc,` {
|
|
424
|
-
margin-right: `).concat(i,"px ").concat(s,`;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.`).concat(tc," .").concat(tc,` {
|
|
428
|
-
right: 0 `).concat(s,`;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.`).concat(nc," .").concat(nc,` {
|
|
432
|
-
margin-right: 0 `).concat(s,`;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
body[`).concat(Sl,`] {
|
|
436
|
-
`).concat(ME,": ").concat(i,`px;
|
|
437
|
-
}
|
|
438
|
-
`)},zg=function(){var e=parseInt(document.body.getAttribute(Sl)||"0",10);return isFinite(e)?e:0},QE=function(){u.useEffect(function(){return document.body.setAttribute(Sl,(zg()+1).toString()),function(){var e=zg()-1;e<=0?document.body.removeAttribute(Sl):document.body.setAttribute(Sl,e.toString())}},[])},XE=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;QE();var l=u.useMemo(function(){return GE(o)},[o]);return u.createElement(KE,{styles:YE(l,!t,o,n?"":"!important")})},Tf=!1;if(typeof window<"u")try{var Ei=Object.defineProperty({},"passive",{get:function(){return Tf=!0,!0}});window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{Tf=!1}var Zo=Tf?{passive:!1}:!1,JE=function(e){return e.tagName==="TEXTAREA"},Pw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!JE(e)&&n[t]==="visible")},ZE=function(e){return Pw(e,"overflowY")},eR=function(e){return Pw(e,"overflowX")},Dg=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Mw(e,s);if(o){var l=Tw(e,s),a=l[1],i=l[2];if(a>i)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},tR=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},nR=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Mw=function(e,t){return e==="v"?ZE(t):eR(t)},Tw=function(e,t){return e==="v"?tR(t):nR(t)},sR=function(e,t){return e==="h"&&t==="rtl"?-1:1},rR=function(e,t,n,s,o){var l=sR(e,window.getComputedStyle(t).direction),a=l*s,i=n.target,c=t.contains(i),d=!1,f=a>0,m=0,p=0;do{if(!i)break;var h=Tw(e,i),g=h[0],w=h[1],j=h[2],v=w-j-l*g;(g||v)&&Mw(e,i)&&(m+=v,p+=g);var x=i.parentNode;i=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&i!==document.body||c&&(t.contains(i)||t===i));return(f&&Math.abs(m)<1||!f&&Math.abs(p)<1)&&(d=!0),d},Ri=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fg=function(e){return[e.deltaX,e.deltaY]},Bg=function(e){return e&&"current"in e?e.current:e},oR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lR=function(e){return`
|
|
439
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
440
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
441
|
-
`)},aR=0,el=[];function iR(e){var t=u.useRef([]),n=u.useRef([0,0]),s=u.useRef(),o=u.useState(aR++)[0],l=u.useState(Rw)[0],a=u.useRef(e);u.useEffect(function(){a.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=RE([e.lockRef.current],(e.shards||[]).map(Bg),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=u.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var v=Ri(w),x=n.current,y="deltaX"in w?w.deltaX:x[0]-v[0],b="deltaY"in w?w.deltaY:x[1]-v[1],S,N=w.target,k=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in w&&k==="h"&&N.type==="range")return!1;var C=window.getSelection(),O=C&&C.anchorNode,R=O?O===N||O.contains(N):!1;if(R)return!1;var z=Dg(k,N);if(!z)return!0;if(z?S=k:(S=k==="v"?"h":"v",z=Dg(k,N)),!z)return!1;if(!s.current&&"changedTouches"in w&&(y||b)&&(s.current=S),!S)return!0;var V=s.current||S;return rR(V,j,w,V==="h"?y:b)},[]),c=u.useCallback(function(w){var j=w;if(!(!el.length||el[el.length-1]!==l)){var v="deltaY"in j?Fg(j):Ri(j),x=t.current.filter(function(S){return S.name===j.type&&(S.target===j.target||j.target===S.shadowParent)&&oR(S.delta,v)})[0];if(x&&x.should){j.cancelable&&j.preventDefault();return}if(!x){var y=(a.current.shards||[]).map(Bg).filter(Boolean).filter(function(S){return S.contains(j.target)}),b=y.length>0?i(j,y[0]):!a.current.noIsolation;b&&j.cancelable&&j.preventDefault()}}},[]),d=u.useCallback(function(w,j,v,x){var y={name:w,delta:j,target:v,should:x,shadowParent:cR(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),f=u.useCallback(function(w){n.current=Ri(w),s.current=void 0},[]),m=u.useCallback(function(w){d(w.type,Fg(w),w.target,i(w,e.lockRef.current))},[]),p=u.useCallback(function(w){d(w.type,Ri(w),w.target,i(w,e.lockRef.current))},[]);u.useEffect(function(){return el.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Zo),document.addEventListener("touchmove",c,Zo),document.addEventListener("touchstart",f,Zo),function(){el=el.filter(function(w){return w!==l}),document.removeEventListener("wheel",c,Zo),document.removeEventListener("touchmove",c,Zo),document.removeEventListener("touchstart",f,Zo)}},[]);var h=e.removeScrollBar,g=e.inert;return u.createElement(u.Fragment,null,g?u.createElement(l,{styles:lR(o)}):null,h?u.createElement(XE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function cR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const uR=zE(Ew,iR);var um=u.forwardRef(function(e,t){return u.createElement(fu,Vs({},e,{ref:t,sideCar:uR}))});um.classNames=fu.classNames;var dR=Object.defineProperty,Ke=(e,t)=>dR(e,"name",{value:t,configurable:!0}),fR=[" ","Enter","ArrowUp","ArrowDown"],pR=[" ","Enter"],zl="Select",[pu,mu,mR]=Zp(zl),[qo,v$]=co(zl,[mR,dw]),dm=dw(),[hR,fo]=qo(zl),[gR,xR]=qo(zl);function $w(e){const{__scopeSelect:t,children:n,open:s,defaultOpen:o,onOpenChange:l,value:a,defaultValue:i,onValueChange:c,dir:d,name:f,autoComplete:m,disabled:p,required:h,form:g,internal_do_not_use_render:w}=e,j=dm(t),[v,x]=u.useState(null),[y,b]=u.useState(null),[S,N]=u.useState(!1),k=ru(d),[C,O]=Ll({prop:s,defaultProp:o??!1,onChange:l,caller:zl}),[R,z]=Ll({prop:a,defaultProp:i,onChange:c,caller:zl}),V=u.useRef(null),q=u.useRef(R);u.useEffect(()=>{const X=g?v==null?void 0:v.ownerDocument.getElementById(g):v==null?void 0:v.form;if(X instanceof HTMLFormElement){const Te=Ke(()=>z(q.current),"reset");return X.addEventListener("reset",Te),()=>X.removeEventListener("reset",Te)}},[g,v,z]);const I=v?!!g||!!v.closest("form"):!0,[G,te]=u.useState(new Set),H=Yr(),L=Array.from(G).map(X=>X.props.value).join(";"),K=u.useCallback(X=>{te(Te=>new Set(Te).add(X))},[]),F=u.useCallback(X=>{te(Te=>{const Pe=new Set(Te);return Pe.delete(X),Pe})},[]),xe={required:h,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:H,value:R,onValueChange:z,open:C,onOpenChange:O,dir:k,triggerPointerDownPosRef:V,disabled:p,name:f,autoComplete:m,form:g,nativeOptions:G,nativeSelectKey:L,isFormControl:I};return r.jsx(fE,{...j,children:r.jsx(hR,{scope:t,...xe,children:r.jsx(pu.Provider,{scope:t,children:r.jsx(gR,{scope:t,onNativeOptionAdd:K,onNativeOptionRemove:F,children:Lw(w)?w(xe):n})})})})}Ke($w,"SelectProvider");var vR=Ke(e=>{const{__scopeSelect:t,children:n,...s}=e;return r.jsx($w,{__scopeSelect:t,...s,internal_do_not_use_render:({isFormControl:o})=>r.jsxs(r.Fragment,{children:[n,o?r.jsx(KR,{__scopeSelect:t}):null]})})},"Select"),yR="SelectTrigger",wR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,disabled:o=!1,...l}=t,a=dm(s),i=fo(yR,s),c=i.disabled||o,d=yt(n,i.onTriggerChange),f=mu(s),m=u.useRef("touch"),[p,h,g]=pm(j=>{const v=f().filter(b=>!b.disabled),x=v.find(b=>b.value===i.value),y=mm(v,j,x);y!==void 0&&i.onValueChange(y.value)}),w=Ke(j=>{c||(i.onOpenChange(!0),g()),j&&(i.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return r.jsx(pE,{asChild:!0,...a,children:r.jsx(ot.button,{type:"button",role:"combobox","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ti(i.value)?"":void 0,...l,ref:d,onClick:Ye(l.onClick,j=>{j.currentTarget.focus(),m.current!=="mouse"&&w(j)}),onPointerDown:Ye(l.onPointerDown,j=>{m.current=j.pointerType;const v=j.target;v.hasPointerCapture(j.pointerId)&&v.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(w(j),j.preventDefault())}),onKeyDown:Ye(l.onKeyDown,j=>{const v=p.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&h(j.key),!(v&&j.key===" ")&&fR.includes(j.key)&&(w(),j.preventDefault())})})})},"SelectTrigger")),jR="SelectValue",bR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,className:o,style:l,children:a,placeholder:i="",...c}=t,d=fo(jR,s),{onValueNodeHasChildrenChange:f}=d,m=a!==void 0,p=yt(n,d.onValueNodeChange);Lt(()=>{f(m)},[f,m]);const h=ti(d.value);return r.jsx(ot.span,{...c,asChild:h?!1:c.asChild,ref:p,style:{pointerEvents:"none"},children:r.jsx(u.Fragment,{children:h?i:a},h?"placeholder":"value")})},"SelectValue")),_R=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,children:o,...l}=t;return r.jsx(ot.span,{"aria-hidden":!0,...l,ref:n,children:o||"▼"})},"SelectIcon")),SR="SelectPortal",[kR,NR]=qo(SR,{forceMount:void 0}),CR=Ke(e=>{const{__scopeSelect:t,forceMount:n,...s}=e;return r.jsx(kR,{scope:e.__scopeSelect,forceMount:n,children:r.jsx(hw,{asChild:!0,...s})})},"SelectPortal"),Do="SelectContent",ER=u.forwardRef(Ke(function(t,n){const s=NR(Do,t.__scopeSelect),{forceMount:o=s.forceMount,...l}=t,a=fo(Do,t.__scopeSelect),[i,c]=u.useState();return Lt(()=>{c(new DocumentFragment)},[]),r.jsx(Za,{present:o||a.open,children:({present:d})=>d?r.jsx(MR,{...l,ref:n}):r.jsx(RR,{...l,fragment:i})})},"SelectContent")),RR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,children:o,fragment:l}=t;return l?Vo.createPortal(r.jsx(Iw,{scope:s,children:r.jsx(pu.Slot,{scope:s,children:r.jsx("div",{ref:n,children:o})})}),l):null},"SelectContentFragment")),bs=10,[Iw,Go]=qo(Do),PR=gr("SelectContent.RemoveScroll"),MR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s}=t,{position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:w,hideWhenDetached:j,avoidCollisions:v,...x}=t,y=fo(Do,s),[b,S]=u.useState(null),[N,k]=u.useState(null),C=yt(n,S),[O,R]=u.useState(null),[z,V]=u.useState(null),q=mu(s),[I,G]=u.useState(!1),te=u.useRef(!1);u.useEffect(()=>{if(b)return kw(b)},[b]),ou();const H=u.useCallback(ie=>{const[ue,...he]=q().map(Y=>Y.ref.current),[pe]=he.slice(-1),E=document.activeElement;for(const Y of ie)if(Y===E||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===ue&&N&&(N.scrollTop=0),Y===pe&&N&&(N.scrollTop=N.scrollHeight),Y==null||Y.focus(),document.activeElement!==E))return},[q,N]),L=u.useCallback(()=>H([O,b]),[H,O,b]);u.useEffect(()=>{I&&L()},[I,L]);const{onOpenChange:K,triggerPointerDownPosRef:F}=y;u.useEffect(()=>{if(b){let ie={x:0,y:0};const ue=Ke(pe=>{var E,Y;ie={x:Math.abs(Math.round(pe.pageX)-(((E=F.current)==null?void 0:E.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((Y=F.current)==null?void 0:Y.y)??0))}},"handlePointerMove"),he=Ke(pe=>{ie.x<=10&&ie.y<=10?pe.preventDefault():pe.composedPath().includes(b)||K(!1),document.removeEventListener("pointermove",ue),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",he,{capture:!0})}}},[b,K,F]),u.useEffect(()=>{const ie=Ke(()=>K(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[K]);const[xe,X]=pm(ie=>{const ue=q().filter(E=>!E.disabled),he=ue.find(E=>E.ref.current===document.activeElement),pe=mm(ue,ie,he);pe&&setTimeout(()=>{var E;return(E=pe.ref.current)==null?void 0:E.focus()})}),Te=u.useCallback((ie,ue,he)=>{const pe=!te.current&&!he;(y.value!==void 0&&y.value===ue||pe)&&(R(ie),pe&&(te.current=!0))},[y.value]),Pe=u.useCallback(()=>b==null?void 0:b.focus(),[b]),Re=u.useCallback((ie,ue,he)=>{const pe=!te.current&&!he;(y.value!==void 0&&y.value===ue||pe)&&V(ie)},[y.value]),se=o==="popper"?Ug:TR,ve=se===Ug?{side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:h,collisionPadding:g,sticky:w,hideWhenDetached:j,avoidCollisions:v}:{};return r.jsx(Iw,{scope:s,content:b,viewport:N,onViewportChange:k,itemRefCallback:Te,selectedItem:O,onItemLeave:Pe,itemTextRefCallback:Re,focusSelectedItem:L,selectedItemText:z,position:o,isPositioned:I,searchRef:xe,children:r.jsx(um,{as:PR,allowPinchZoom:!0,children:r.jsx(V0,{asChild:!0,trapped:y.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Ye(l,ie=>{var ue;(ue=y.trigger)==null||ue.focus({preventScroll:!0}),ie.preventDefault()}),children:r.jsx(F0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:r.jsx(se,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:ie=>ie.preventDefault(),...x,...ve,onPlaced:()=>G(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ye(x.onKeyDown,ie=>{const ue=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ue&&ie.key.length===1&&X(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let pe=q().filter(E=>!E.disabled).map(E=>E.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const E=ie.target,Y=pe.indexOf(E);pe=pe.slice(Y+1)}setTimeout(()=>H(pe)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),TR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,onPlaced:o,...l}=t,a=fo(Do,s),i=Go(Do,s),[c,d]=u.useState(null),[f,m]=u.useState(null),p=yt(n,m),h=mu(s),g=u.useRef(!1),w=u.useRef(!0),{viewport:j,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=i,b=u.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&f&&j&&v&&x){const C=a.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),R=a.valueNode.getBoundingClientRect(),z=x.getBoundingClientRect();if(a.dir!=="rtl"){const E=z.left-O.left,Y=R.left-E,A=C.left-Y,oe=C.width+A,le=Math.max(oe,O.width),Ne=window.innerWidth-bs,Ge=jf(Y,[bs,Math.max(bs,Ne-le)]);c.style.minWidth=oe+"px",c.style.left=Ge+"px"}else{const E=O.right-z.right,Y=window.innerWidth-R.right-E,A=window.innerWidth-C.right-Y,oe=C.width+A,le=Math.max(oe,O.width),Ne=window.innerWidth-bs,Ge=jf(Y,[bs,Math.max(bs,Ne-le)]);c.style.minWidth=oe+"px",c.style.right=Ge+"px"}const V=h(),q=window.innerHeight-bs*2,I=j.scrollHeight,G=window.getComputedStyle(f),te=parseInt(G.borderTopWidth,10),H=parseInt(G.paddingTop,10),L=parseInt(G.borderBottomWidth,10),K=parseInt(G.paddingBottom,10),F=te+H+I+K+L,xe=Math.min(v.offsetHeight*5,F),X=window.getComputedStyle(j),Te=parseInt(X.paddingTop,10),Pe=parseInt(X.paddingBottom,10),Re=C.top+C.height/2-bs,se=q-Re,ve=v.offsetHeight/2,ie=v.offsetTop+ve,ue=te+H+ie,he=F-ue;if(ue<=Re){const E=V.length>0&&v===V[V.length-1].ref.current;c.style.bottom="0px";const Y=f.clientHeight-j.offsetTop-j.offsetHeight,A=Math.max(se,ve+(E?Pe:0)+Y+L),oe=ue+A;c.style.height=oe+"px"}else{const E=V.length>0&&v===V[0].ref.current;c.style.top="0px";const A=Math.max(Re,te+j.offsetTop+(E?Te:0)+ve)+he;c.style.height=A+"px",j.scrollTop=ue-Re+j.offsetTop}c.style.margin=`${bs}px 0`,c.style.minHeight=xe+"px",c.style.maxHeight=q+"px",o==null||o(),requestAnimationFrame(()=>g.current=!0)}},[h,a.trigger,a.valueNode,c,f,j,v,x,a.dir,o]);Lt(()=>b(),[b]);const[S,N]=u.useState();Lt(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const k=u.useCallback(C=>{C&&w.current===!0&&(b(),y==null||y(),w.current=!1)},[b,y]);return r.jsx($R,{scope:s,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:r.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:r.jsx(ot.div,{...l,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})},"SelectItemAlignedPosition")),Ug=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,align:o="start",collisionPadding:l=bs,...a}=t,i=dm(s);return r.jsx(mE,{...i,...a,ref:n,align:o,collisionPadding:l,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[$R,fm]=qo(Do,{}),Hg="SelectViewport",IR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,nonce:o,...l}=t,a=Go(Hg,s),i=fm(Hg,s),c=yt(n,a.onViewportChange),d=u.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),r.jsx(pu.Slot,{scope:s,children:r.jsx(ot.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ye(l.onScroll,f=>{const m=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&p){const g=Math.abs(d.current-m.scrollTop);if(g>0){const w=window.innerHeight-bs*2,j=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),x=Math.max(j,v);if(x<w){const y=x+g,b=Math.min(w,y),S=y-b;p.style.height=b+"px",p.style.bottom==="0px"&&(m.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})},"SelectViewport")),AR="SelectGroup",[y$,OR]=qo(AR),LR="SelectLabel",zR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,...o}=t,l=OR(LR,s);return r.jsx(ot.div,{id:l.id,...o,ref:n})},"SelectLabel")),$f="SelectItem",[DR,Aw]=qo($f),FR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,value:o,disabled:l=!1,textValue:a,...i}=t,c=fo($f,s),d=Go($f,s),f=c.value===o,[m,p]=u.useState(a??""),[h,g]=u.useState(!1),w=Rs(b=>{var S;return(S=d.itemRefCallback)==null?void 0:S.call(d,b,o,l)}),j=yt(n,w),v=Yr(),x=u.useRef("touch"),y=Ke(()=>{l||(c.onValueChange(o),c.onOpenChange(!1))},"handleSelect");return r.jsx(DR,{scope:s,value:o,disabled:l,textId:v,isSelected:f,onItemTextChange:u.useCallback(b=>{p(S=>S||((b==null?void 0:b.textContent)??"").trim())},[]),children:r.jsx(pu.ItemSlot,{scope:s,value:o,disabled:l,textValue:m,children:r.jsx(ot.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":f&&h,"data-state":f?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...i,ref:j,onFocus:Ye(i.onFocus,()=>g(!0)),onBlur:Ye(i.onBlur,()=>g(!1)),onClick:Ye(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:Ye(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:Ye(i.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:Ye(i.onPointerMove,b=>{var S;x.current=b.pointerType,l?(S=d.onItemLeave)==null||S.call(d):x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ye(i.onPointerLeave,b=>{var S;b.currentTarget===document.activeElement&&((S=d.onItemLeave)==null||S.call(d))}),onKeyDown:Ye(i.onKeyDown,b=>{var N;l||b.target!==b.currentTarget||((N=d.searchRef)==null?void 0:N.current)!==""&&b.key===" "||(pR.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})},"SelectItem")),Pi="SelectItemText",BR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,className:o,style:l,...a}=t,i=fo(Pi,s),c=Go(Pi,s),d=Aw(Pi,s),f=xR(Pi,s),[m,p]=u.useState(null),h=Rs(y=>{var b;return(b=c.itemTextRefCallback)==null?void 0:b.call(c,y,d.value,d.disabled)}),g=yt(n,p,d.onItemTextChange,h),w=m==null?void 0:m.textContent,j=u.useMemo(()=>r.jsx("option",{value:d.value,disabled:d.disabled,children:w},d.value),[d.disabled,d.value,w]),{onNativeOptionAdd:v,onNativeOptionRemove:x}=f;return Lt(()=>(v(j),()=>x(j)),[v,x,j]),r.jsxs(r.Fragment,{children:[r.jsx(ot.span,{id:d.textId,...a,ref:g}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren&&!ti(i.value)?Vo.createPortal(a.children,i.valueNode):null]})},"SelectItemText")),UR="SelectItemIndicator",HR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,...o}=t;return Aw(UR,s).isSelected?r.jsx(ot.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),Vg="SelectScrollUpButton",VR=u.forwardRef(Ke(function(t,n){const s=Go(Vg,t.__scopeSelect),o=fm(Vg,t.__scopeSelect),[l,a]=u.useState(!1),i=yt(n,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollTop>0;a(f)};Ke(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(Ow,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),Wg="SelectScrollDownButton",WR=u.forwardRef(Ke(function(t,n){const s=Go(Wg,t.__scopeSelect),o=fm(Wg,t.__scopeSelect),[l,a]=u.useState(!1),i=yt(n,o.onScrollButtonChange);return Lt(()=>{if(s.viewport&&s.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)<f;a(m)};Ke(c,"handleScroll");const d=s.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[s.viewport,s.isPositioned]),l?r.jsx(Ow,{...t,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=s;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),Ow=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,onAutoScroll:o,...l}=t,a=Go("SelectScrollButton",s),i=u.useRef(null),c=mu(s),d=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>d(),[d]),Lt(()=>{var m;const f=c().find(p=>p.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[c]),r.jsx(ot.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Ye(l.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:Ye(l.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:Ye(l.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),qR=u.forwardRef(Ke(function(t,n){const{__scopeSelect:s,...o}=t;return r.jsx(ot.div,{"aria-hidden":!0,...o,ref:n})},"SelectSeparator")),GR="SelectBubbleInput",KR=u.forwardRef(Ke(function({__scopeSelect:t,...n},s){const o=fo(GR,t),{value:l,onValueChange:a,required:i,disabled:c,name:d,autoComplete:f,form:m}=o,{nativeOptions:p,nativeSelectKey:h}=o,g=u.useRef(null),w=yt(s,g),j=l??"",v=_w(j),x=Array.from(p).some(y=>(y.props.value??"")==="");return u.useEffect(()=>{const y=g.current;if(!y)return;const b=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(b,"value").set;if(v!==j&&N){const k=new Event("change",{bubbles:!0});N.call(y,j),y.dispatchEvent(k)}},[v,j]),r.jsxs(ot.select,{"aria-hidden":!0,required:i,tabIndex:-1,name:d,autoComplete:f,disabled:c,form:m,onChange:y=>a(y.target.value),...n,style:{...kE,...n.style},ref:w,defaultValue:j,children:[ti(l)&&!x?r.jsx("option",{value:""}):null,Array.from(p)]},h)},"SelectBubbleInput"));function Lw(e){return typeof e=="function"}Ke(Lw,"isFunction");function ti(e){return e===""||e===void 0}Ke(ti,"shouldShowPlaceholder");function pm(e){const t=Rs(e),n=u.useRef(""),s=u.useRef(0),o=u.useCallback(a=>{const i=n.current+a;t(i),Ke(function c(d){n.current=d,window.clearTimeout(s.current),d!==""&&(s.current=window.setTimeout(()=>c(""),1e3))},"updateSearch")(i)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,l]}Ke(pm,"useTypeaheadSearch");function mm(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=zw(e,Math.max(l,0));o.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}Ke(mm,"findNextItem");function zw(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Ke(zw,"wrapArray");const At=vR,Et=u.forwardRef((e,t)=>r.jsx(bR,{ref:t,"data-slot":"select-value",...e}));Et.displayName="SelectValue";const Rt=u.forwardRef(({className:e,size:t="default",children:n,...s},o)=>r.jsxs(wR,{ref:o,"data-slot":"select-trigger","data-size":t,className:He("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:truncate [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[n,r.jsx(_R,{asChild:!0,children:r.jsx(Ol,{className:"size-4 opacity-50"})})]}));Rt.displayName="SelectTrigger";const Pt=u.forwardRef(({className:e,children:t,position:n="popper",...s},o)=>r.jsx(CR,{children:r.jsxs(ER,{ref:o,"data-slot":"select-content",className:He("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx(Dw,{}),r.jsx(IR,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),r.jsx(Fw,{})]})}));Pt.displayName="SelectContent";const YR=u.forwardRef(({className:e,...t},n)=>r.jsx(zR,{ref:n,"data-slot":"select-label",className:He("text-muted-foreground px-2 py-1.5 text-xs",e),...t}));YR.displayName="SelectLabel";const Ae=u.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(FR,{ref:s,"data-slot":"select-item",className:He("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r.jsx(HR,{children:r.jsx(Al,{className:"size-4"})})}),r.jsx(BR,{children:t})]}));Ae.displayName="SelectItem";const QR=u.forwardRef(({className:e,...t},n)=>r.jsx(qR,{ref:n,"data-slot":"select-separator",className:He("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t}));QR.displayName="SelectSeparator";const Dw=u.forwardRef(({className:e,...t},n)=>r.jsx(VR,{ref:n,"data-slot":"select-scroll-up-button",className:He("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Rc,{className:"size-4"})}));Dw.displayName="SelectScrollUpButton";const Fw=u.forwardRef(({className:e,...t},n)=>r.jsx(WR,{ref:n,"data-slot":"select-scroll-down-button",className:He("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(Ol,{className:"size-4"})}));Fw.displayName="SelectScrollDownButton";function Bw({open:e,query:t,items:n,onSelect:s,onClose:o,onDisabled:l}){const[a,i]=u.useState(0),c=u.useRef(null),d=(n||[]).filter(p=>p.dis||!t||(p.key||"").toLowerCase().includes(t.toLowerCase())),f=d.filter(p=>!p.dis);u.useEffect(()=>{const p=d.findIndex(h=>!h.dis);i(p>=0?p:0)},[t,e]),u.useEffect(()=>{c.current&&c.current.scrollIntoView({block:"nearest"})},[a,d]);function m(p,h){var g;if(!f.length)return p;for(let w=1;w<=d.length;w++){const j=(p+h*w+d.length)%d.length;if(!((g=d[j])!=null&&g.dis))return j}return p}return u.useEffect(()=>{if(!e)return;function p(h){if(!h.isComposing){if(h.key==="Escape"){h.preventDefault(),h.stopPropagation(),o();return}if(f.length){if(h.key==="ArrowDown")h.preventDefault(),h.stopPropagation(),i(g=>m(g,1));else if(h.key==="ArrowUp")h.preventDefault(),h.stopPropagation(),i(g=>m(g,-1));else if(h.key==="Enter"){h.preventDefault(),h.stopPropagation();const g=d[a];if(!g)return;g.dis?l==null||l(g):s(g)}}}}return window.addEventListener("keydown",p,!0),()=>window.removeEventListener("keydown",p,!0)},[e,d,f,a,s,o,l]),e?r.jsx("div",{className:"sess-slashmenu",children:d.length===0?r.jsx("div",{className:"sess-slash-empty",children:"无匹配项"}):d.map((p,h)=>r.jsxs("button",{type:"button",ref:h===a?c:void 0,className:"sess-slash-item"+(h===a?" on":"")+(p.dis?" dis":""),onMouseEnter:()=>i(h),onClick:()=>{p.dis?l==null||l(p):s(p)},children:[r.jsx("span",{className:"sess-slash-key",children:p.key||p.label}),r.jsx("span",{className:"sess-slash-desc",children:p.desc}),p.type==="cmd"&&r.jsx("span",{className:"sess-slash-tag",children:"命令"}),p.type==="skill"&&r.jsx("span",{className:"sess-slash-tag",children:"skill"})]},p.key))}):null}const Ac=[{value:"manual",label:"逐条确认",desc:"每个工具操作都需要你手动确认"},{value:"yolo",label:"自动通过",desc:"自动批准工具操作,但遇到关键问题仍会询问"},{value:"auto",label:"完全自主",desc:"完全自主运行,智能体自己做决定,不再询问"}];function Mi(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function XR({value:e,onChange:t,atts:n,onRemoveAtt:s,uploading:o,inputLocked:l,caps:a,meta:i,onSend:c,onStop:d,chatRunning:f,taskRunning:m,queuedN:p,board:h,sending:g,permMode:w,modelSel:j,modelOpts:v,onSetModel:x,onSetPermission:y,effortSel:b,effortOpts:S,onSetEffort:N,queueRows:k,injecting:C,onInject:O,answerPending:R,deliveringAnswer:z,onDeliverAnswer:V,slashOpen:q,slashQuery:I,slashItems:G,onSlashSelect:te,onSlashClose:H,onSlashDisabled:L,onPasteFiles:K,onDropFiles:F,onUploadFiles:xe,taRef:X}){const Te=u.useRef(null),Pe=h&&!!(a!=null&&a.profile),Re=h&&!!(a!=null&&a.permission),se=!!(a!=null&&a.profile)&&!!((S==null?void 0:S.options)||[]).length,ve=Ac.find(de=>de.value===w)||null,ie=ve?ve.label:"权限",ue=b||(i==null?void 0:i.sessionEffort)||"",he=((S==null?void 0:S.options)||[]).find(de=>de.value===ue)||null,pe=S!=null&&S.defaultEffort?((S.options||[]).find(de=>de.value===S.defaultEffort)||{}).label||S.defaultEffort:"",E=(he==null?void 0:he.label)||(pe?`默认(${pe})`:"默认"),Y=j||(i==null?void 0:i.sessionModel)||(v==null?void 0:v.default)||"默认模型",A=Y==="默认模型"?"__default__":Y,oe=i==null?void 0:i.ctx,le=oe&&+oe.max>0?Math.min(100,Math.max(0,Math.round(+oe.used/+oe.max*100))):0,Ne=2*Math.PI*7,Ge=(n||[]).filter(de=>e.includes(de.md)),dt=(i==null?void 0:i.queue_state)||"",Ze=!!(i!=null&&i.project_busy),kt=!!dt&&dt!=="idle"||Ze||f||(p||0)>0,on=_C(dt,{found:!!(i!=null&&i.found),board:!!h,canQueue:!!a.queue,chatRunning:f,projectBusy:Ze}),wn=(p||0)>0||f&&(h||!(a.queue&&m));return r.jsxs("div",{className:"sess-composer",children:[R&&r.jsx("div",{className:"sess-queue",children:r.jsxs("div",{className:"sess-queue-row",title:"答案已提交,等项目空闲送达",children:[r.jsx("span",{className:"sess-queue-tag on",children:"待送达"}),r.jsx("span",{className:"sess-queue-text",children:"已作答,等待送达(项目忙,空闲后自动送达)"}),r.jsxs(D,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:z,title:"立即送达:不等项目空闲,立即把答案交给等待中的会话",onClick:V,children:[r.jsx(mg,{className:"h-3 w-3"})," 立即送达"]})]})}),k.length>0&&r.jsx("div",{className:"sess-queue",children:k.map(de=>{const Q=a.steer&&de.msgId&&de.state!=="running";return r.jsxs("div",{className:"sess-queue-row",title:de.text,children:[r.jsx("span",{className:"sess-queue-tag"+(de.state==="server"?" on":""),children:de.state==="server"?"服务端排队":de.state==="running"?"发送中":"排队中"}),r.jsxs("span",{className:"sess-queue-text",children:[de.text.slice(0,60),de.text.length>60?"…":""]}),Q&&r.jsxs(D,{size:"sm",variant:"outline",className:"sess-queue-btn",disabled:C===de.key,title:"立即注入:不等队列,直接投递到会话当前上下文",onClick:()=>O(de),children:[r.jsx(mg,{className:"h-3 w-3"})," 立即注入"]})]},de.key)})}),Ge.length>0&&r.jsx("div",{className:"sess-attachrow",children:Ge.map((de,Q)=>r.jsxs("span",{className:"sess-chip",title:de.name,children:[(de.mime||"").startsWith("image/")&&de.url?r.jsx("img",{src:de.url,alt:de.name}):r.jsx(w0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:de.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>s(de.md),children:r.jsx(Ao,{className:"h-3 w-3"})})]},de.md+Q))}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(Bw,{open:q,query:I,items:G,onSelect:te,onClose:H,onDisabled:L}),r.jsx("textarea",{ref:X,className:"sess-ta",rows:1,value:e,onChange:de=>t(de.target.value),onKeyDown:de=>{de.key==="Enter"&&!de.shiftKey&&!de.nativeEvent.isComposing&&(de.preventDefault(),c())},onPaste:K,onDrop:F,placeholder:on,disabled:l})]}),r.jsxs("div",{className:"sess-bottombar",children:[r.jsx("input",{ref:Te,type:"file",multiple:!0,className:"hidden",onChange:de=>{xe(de.target.files),de.target.value=""}}),r.jsx(D,{variant:"ghost",size:"icon",className:"sess-attach",title:"添加附件(粘贴/拖入亦可)",disabled:o||l,onClick:()=>{var de;return(de=Te.current)==null?void 0:de.click()},children:r.jsx(Ja,{className:"h-4 w-4"})}),Re?r.jsxs(At,{value:w||void 0,onValueChange:y,disabled:!w,children:[r.jsx(Rt,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:ve?`权限:${ve.label}(${ve.desc})`:"权限模式读取中…",children:r.jsx(Et,{className:"sess-ctl-value",placeholder:"权限",children:ie})}),r.jsx(Pt,{children:Ac.map(de=>r.jsx(Ae,{value:de.value,title:de.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:de.label}),r.jsx("span",{className:"sess-perm-desc",children:de.desc})]})},de.value))})]}):r.jsx("span",{className:"sess-chip",title:"权限模式(会话级)",children:ie}),Pe?r.jsxs(At,{value:A,onValueChange:x,children:[r.jsx(Rt,{size:"sm",className:"h-8 max-w-[180px] px-2 text-xs gap-1",title:"切换会话模型(即时生效)",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[A==="__default__"&&r.jsx(Ae,{value:"__default__",disabled:!0,children:"默认模型"}),A!=="__default__"&&!((v==null?void 0:v.models)||[]).some(de=>de.name===A)&&r.jsx(Ae,{value:A,children:A}),((v==null?void 0:v.models)||[]).map(de=>r.jsx(Ae,{value:de.name,children:de.display_name||de.name},de.name))]})]}):r.jsx("span",{className:"sess-chip",title:"当前会话模型",children:(i==null?void 0:i.sessionModel)||"默认模型"}),se?r.jsxs(At,{value:ue||"__default__",onValueChange:N,children:[r.jsx(Rt,{size:"sm",className:"h-8 max-w-[130px] px-2 text-xs gap-1",title:"切换会话思考等级(即时生效)",children:r.jsx(Et,{className:"sess-ctl-value",placeholder:"思考等级",children:E})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__default__",disabled:!0,children:pe?`默认(${pe})`:"默认"}),ue&&!he&&r.jsx(Ae,{value:ue,children:ue}),((S==null?void 0:S.options)||[]).map(de=>r.jsx(Ae,{value:de.value,title:de.title,children:de.label},de.value))]})]}):r.jsx("span",{className:"sess-chip",title:"思考等级(会话级)",children:E}),r.jsxs("svg",{className:"sess-ring",viewBox:"0 0 18 18",width:"18",height:"18",title:oe?`上下文 ${Mi(oe.used)} / ${Mi(oe.max)}(${le}%)`:"暂无上下文用量数据",children:[r.jsx("title",{children:oe?`上下文 ${Mi(oe.used)} / ${Mi(oe.max)}(${le}%)`:"暂无上下文用量数据"}),r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--border)",strokeWidth:"2"}),le>0&&r.jsx("circle",{cx:"9",cy:"9",r:"7",fill:"none",stroke:"var(--run)",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${le/100*Ne} ${Ne}`,transform:"rotate(-90 9 9)"}),r.jsx("text",{x:"9",y:"9",dominantBaseline:"central",textAnchor:"middle",children:le})]}),r.jsx("span",{style:{flex:1}}),wn&&r.jsxs(D,{variant:"outline",size:"sm",onClick:d,children:[r.jsx(Qp,{})," ",(p||0)>0&&!f?"取消排队":"停止"]}),r.jsxs(D,{size:"sm",onClick:c,disabled:!e.trim()||g||l,children:[r.jsx(vf,{})," ",kt?"排队":"发送"]})]})]})}const id=["off","minimal","low","medium","high","xhigh","max"];function If(e){return e||""}function JR(e,t){const n=(t||"").trim();return n&&(e.find(s=>s.name===n)||e.find(s=>s.name.endsWith("/"+n)))||null}function qg(e){return(e&&e.efforts||[]).map(t=>t.id).filter(Boolean)}function Uw(e,t){const n=e&&e.models||[],s=JR(n,t);let o=qg(s);if(!o.length){const i=[];for(const c of n)for(const d of qg(c))i.includes(d)||i.push(d);o=i}const l=o.length>0;return l||(o=id.slice()),{options:id.filter(i=>o.includes(i)).concat(o.filter(i=>!id.includes(i))).map(i=>({value:i,label:If(i),title:`思考等级 ${i}`})),defaultEffort:s&&s.default_effort||"",fromCatalog:l}}function ZR(e,t=""){return e?If(e):t?`默认(${If(t)})`:"默认"}var eP=Object.defineProperty,ms=(e,t)=>eP(e,"name",{value:t,configurable:!0}),hm="Dialog",[Hw,w$]=co(hm),[tP,Xs]=Hw(hm),nP=ms(e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:o,onOpenChange:l,modal:a=!0}=e,i=u.useRef(null),c=u.useRef(null),[d,f]=Ll({prop:s,defaultProp:o??!1,onChange:l,caller:hm}),[m,p]=u.useState(0),[h,g]=u.useState(0);return r.jsx(tP,{scope:t,triggerRef:i,contentRef:c,contentId:Yr(),titleId:Yr(),descriptionId:Yr(),titlePresent:m>0,descriptionPresent:h>0,setTitleCount:p,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(w=>!w),[f]),modal:a,children:n})},"Dialog"),Vw="DialogPortal",[sP,Ww]=Hw(Vw,{forceMount:void 0}),rP=ms(e=>{const{__scopeDialog:t,forceMount:n,children:s,container:o}=e,l=Xs(Vw,t);return r.jsx(sP,{scope:t,forceMount:n,children:u.Children.map(s,a=>r.jsx(Za,{present:n||l.open,children:r.jsx(hw,{asChild:!0,container:o,children:a})}))})},"DialogPortal"),Af="DialogOverlay",oP=u.forwardRef(ms(function(t,n){const s=Ww(Af,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Xs(Af,t.__scopeDialog);return a.modal?r.jsx(Za,{present:o||a.open,children:r.jsx(aP,{...l,ref:n})}):null},"DialogOverlay")),lP=gr("DialogOverlay.RemoveScroll"),aP=u.forwardRef(ms(function(t,n){const{__scopeDialog:s,...o}=t,l=Xs(Af,s),a=B0(),i=yt(n,a);return r.jsx(um,{as:lP,allowPinchZoom:!0,shards:[l.contentRef],children:r.jsx(ot.div,{"data-state":gm(l.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Ua="DialogContent",iP=u.forwardRef(ms(function(t,n){const s=Ww(Ua,t.__scopeDialog),{forceMount:o=s.forceMount,...l}=t,a=Xs(Ua,t.__scopeDialog);return r.jsx(Za,{present:o||a.open,children:a.modal?r.jsx(cP,{...l,ref:n}):r.jsx(uP,{...l,ref:n})})},"DialogContent")),cP=u.forwardRef(ms(function(t,n){const s=Xs(Ua,t.__scopeDialog),o=u.useRef(null),l=yt(n,s.contentRef,o);return u.useEffect(()=>{const a=o.current;if(a)return kw(a)},[]),r.jsx(qw,{...t,ref:l,trapFocus:s.open,disableOutsidePointerEvents:s.open,onCloseAutoFocus:Ye(t.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=s.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Ye(t.onPointerDownOutside,a=>{const i=a.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&a.preventDefault()}),onFocusOutside:Ye(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),uP=u.forwardRef(ms(function(t,n){const s=Xs(Ua,t.__scopeDialog),o=u.useRef(!1),l=u.useRef(!1);return r.jsx(qw,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,c;(i=t.onCloseAutoFocus)==null||i.call(t,a),a.defaultPrevented||(o.current||(c=s.triggerRef.current)==null||c.focus(),a.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:a=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const i=a.target;((f=s.triggerRef.current)==null?void 0:f.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&l.current&&a.preventDefault()}})},"DialogContentNonModal")),qw=u.forwardRef(ms(function(t,n){const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,...i}=t,c=Xs(Ua,s);return ou(),r.jsx(r.Fragment,{children:r.jsx(V0,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:a,children:r.jsx(F0,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":gm(c.open),...i,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),dP="DialogTitle",fP=u.forwardRef(ms(function(t,n){const{__scopeDialog:s,...o}=t,l=Xs(dP,s),{setTitleCount:a}=l;return Lt(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ot.h2,{id:l.titleId,...o,ref:n})},"DialogTitle")),pP="DialogDescription",mP=u.forwardRef(ms(function(t,n){const{__scopeDialog:s,...o}=t,l=Xs(pP,s),{setDescriptionCount:a}=l;return Lt(()=>(a(i=>i+1),()=>a(i=>i-1)),[a]),r.jsx(ot.p,{id:l.descriptionId,...o,ref:n})},"DialogDescription")),hP="DialogClose",gP=u.forwardRef(ms(function(t,n){const{__scopeDialog:s,...o}=t,l=Xs(hP,s);return r.jsx(ot.button,{type:"button",...o,ref:n,onClick:Ye(t.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function gm(e){return e?"open":"closed"}ms(gm,"getState");const Qt=nP,xP=rP,Gw=u.forwardRef(({className:e,...t},n)=>r.jsx(oP,{ref:n,"data-slot":"dialog-overlay",className:He("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));Gw.displayName="DialogOverlay";const Bt=u.forwardRef(({className:e,children:t,showCloseButton:n=!0,...s},o)=>r.jsxs(xP,{"data-slot":"dialog-portal",children:[r.jsx(Gw,{}),r.jsxs(iP,{ref:o,"data-slot":"dialog-content",className:He("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed z-50 grid w-full max-w-[calc(100%-2rem)] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...s,children:[t,n&&r.jsxs(gP,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[r.jsx(Ao,{}),r.jsx("span",{className:"sr-only",children:"关闭"})]})]})]}));Bt.displayName="DialogContent";const Ut=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-header",className:He("flex flex-col gap-2 text-center sm:text-left",e),...t}));Ut.displayName="DialogHeader";const vn=u.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,"data-slot":"dialog-footer",className:He("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t}));vn.displayName="DialogFooter";const Ht=u.forwardRef(({className:e,...t},n)=>r.jsx(fP,{ref:n,"data-slot":"dialog-title",className:He("text-lg leading-none font-semibold",e),...t}));Ht.displayName="DialogTitle";const vP=u.forwardRef(({className:e,...t},n)=>r.jsx(mP,{ref:n,"data-slot":"dialog-description",className:He("text-muted-foreground text-sm",e),...t}));vP.displayName="DialogDescription";const yP=/\.(md|markdown)$/i;function Gg(e){const t=+e||0;return t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/1024/1024).toFixed(1)+" MB"}function wP(e){const t=new Date((+e||0)*1e3);return isNaN(t.getTime())?"":t.toLocaleString()}function jP({pid:e,path:t,onClose:n}){const[s,o]=u.useState([t]),l=s[s.length-1],[a,i]=u.useState({loading:!0});u.useEffect(()=>{let p=!0;return i({loading:!0}),Mt.filePreview(e,l).then(h=>{p&&i({data:h})}).catch(h=>{p&&i({error:h.message||"读取失败"})}),()=>{p=!1}},[e,l]);const c=u.useCallback(p=>{const h=p.target&&p.target.closest?p.target.closest("a.md-path"):null,g=h&&h.getAttribute("data-path");g&&(p.preventDefault(),o(w=>w[w.length-1]===g?w:[...w,g]))},[]),d=a.data,f=Mt.fileRawUrl(e,l),m=u.useCallback(()=>{var h;const p=d&&d.path||l;(h=navigator.clipboard)==null||h.writeText(p).then(()=>M("已复制路径"),()=>M("复制失败,请手动选择"))},[d,l]);return r.jsx(Qt,{open:!0,onOpenChange:p=>{p||n()},children:r.jsxs(Bt,{className:"modal fv-modal w-[66vw] h-[78vh] sm:max-w-none flex flex-col gap-2 p-4 overflow-hidden",showCloseButton:!1,children:[r.jsxs(Ut,{className:"text-left fv-head",children:[r.jsxs("div",{className:"fv-titlebar",children:[s.length>1&&r.jsx("button",{type:"button",className:"fv-act",title:"返回上一个文件",onClick:()=>o(p=>p.slice(0,-1)),children:r.jsx(Vp,{className:"fv-act-i"})}),r.jsx(Ht,{className:"fv-title",title:d&&d.path||l,children:d&&d.rel||l}),r.jsx("button",{type:"button",className:"fv-act",title:"复制完整路径",onClick:m,children:r.jsx(Wp,{className:"fv-act-i"})}),r.jsx("a",{className:"fv-act",href:f,target:"_blank",rel:"noreferrer",title:"在新标签页打开原文(文本按纯文本展示;二进制下载)",children:r.jsx(qp,{className:"fv-act-i"})}),r.jsx("button",{type:"button",className:"fv-act",title:"关闭(Esc)",onClick:n,children:r.jsx(Ao,{className:"fv-act-i"})})]}),d&&r.jsxs("div",{className:"fv-meta",children:[Gg(d.size)," · ",wP(d.mtime),d.root==="work"?" · 工作目录":" · 项目目录",d.truncated?" · 仅显示前 256KB":""]})]}),r.jsx("div",{className:"fv-body",children:a.loading?r.jsx("div",{className:"fv-hint",children:"读取中…"}):a.error?r.jsxs("div",{className:"fv-hint err",children:[r.jsx(k0,{className:"fv-hint-i"}),r.jsx("span",{children:a.error})]}):d.binary?r.jsxs("div",{className:"fv-hint",children:[r.jsx(pN,{className:"fv-hint-i"}),r.jsxs("span",{children:["二进制文件(",Gg(d.size),"),无法预览。",r.jsx("a",{className:"md-path",href:f,target:"_blank",rel:"noreferrer",children:"下载"})]})]}):yP.test(l)?r.jsx("div",{className:"md-body",onClick:c,dangerouslySetInnerHTML:{__html:Oo(d.text,{pathLinks:!0})}}):r.jsx("pre",{className:"fv-pre",children:d.text})})]})})}function Kw({open:e,info:t,busy:n,disabledReason:s,onHandoff:o,onPass:l,onClose:a}){const i=t||{},c=Number(i.dirty_count||0);return r.jsx(Qt,{open:!!e,onOpenChange:d=>!d&&a&&a(),children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{children:r.jsx(Ht,{children:"通过前:worktree 改动还没回流主分支"})}),r.jsxs("p",{className:"hint",children:["该卡片在独立 worktree 中开发,改动在分支 ",r.jsx("span",{className:"font-mono",children:i.branch||"—"})," 上, 主分支 ",r.jsx("span",{className:"font-mono",children:i.target||"—"})," 还不知道这些改动。"]}),r.jsxs("p",{className:"hint",children:["待合并提交:",r.jsx("b",{children:i.ahead||0})," 个",i.behind?r.jsxs(r.Fragment,{children:["(主分支领先 ",i.behind," 个提交,需先同步)"]}):null]}),c>0&&r.jsxs("p",{className:"hint",children:["工作树有 ",c," 处未提交改动,交给 agent 时会先提交它们。"]}),r.jsx("p",{className:"hint",children:"「交给 agent 合并」= 平台把合并指令发给卡片主会话并让卡片回开发队列排队: agent 先同步主分支最新代码,再尽量快进(不能快进才生成合并提交)回流,冲突由它解决; 干完这轮卡片自动回「待审核」,那时再点「通过」即完成。"}),i.path&&r.jsxs("p",{className:"hint break-all",children:["工作树:",r.jsx("span",{className:"font-mono",children:i.path})]}),s&&r.jsx("p",{className:"hint",children:s}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",disabled:n,onClick:a,children:"取消"}),r.jsx(D,{variant:"outline",disabled:n,onClick:l,children:"仅通过(不合并)"}),r.jsx(D,{disabled:n||!!s,title:s||void 0,onClick:o,children:n?"提交中…":"交给 agent 合并"})]})]})})}function Yw(e,t){const s=e.slice(0,t).match(/(?:^|\s)(\/[^\s]*)$/);return s?{start:t-s[1].length,text:s[1]}:null}const bP="touchstone:host-probe",_P="touchstone:host-caps",SP="touchstone:open-session";let Ha=null,Kg=!1;const Of=new Set;function kP(){return Ha}function NP(e){return Of.add(e),()=>{Of.delete(e)}}function CP(e){Ha=e;for(const t of[...Of])try{t(Ha)}catch{}}function Qw(){return typeof window<"u"&&!!window.parent&&window.parent!==window}function Xw(e){if(!Ha||!Ha.openSession||!e||!Qw())return!1;try{return window.parent.postMessage({type:SP,sid:String(e)},window.location.origin),!0}catch{return!1}}function EP(){if(!(Kg||typeof window>"u")&&(Kg=!0,window.addEventListener("message",e=>{if(e.origin!==window.location.origin)return;const t=e.data||{};t.type===_P&&CP(t.caps||{})}),!!Qw()))try{window.parent.postMessage({type:bP},window.location.origin)}catch{}}function Jw(){return u.useSyncExternalStore(NP,kP,()=>null)}function kl(e){const t=+e||0;return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":String(t)}function Lf(e){const t=+e||0;return t<1e3?"":t<6e4?(t/1e3).toFixed(1)+"s":Math.floor(t/6e4)+"分"+Math.round(t%6e4/1e3)+"s"}function RP(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e||""}}const PP={family:"该智能体暂不支持会话查看",no_session:"会话尚未生成(任务首轮执行后才有会话)",missing:"未找到会话文件(可能已被清理)"},MP=10,Yg=56,Qg=10,ra=60,TP=240,$P=60;function cd(e,t){let n=0,s=e.length-2;if(s<0||t<=0)return 0;for(;n<s;){const o=n+s+1>>1;e[o]<=t?n=o:s=o-1}return n}const IP=u.memo(function({e:t,taskId:n,agent:s,pid:o,boardPid:l,boardSid:a,flash:i,rwState:c,copied:d,onCopy:f,onRewind:m,onOpenPath:p}){const h=u.useCallback(w=>{const j=w.target&&w.target.closest?w.target.closest("a.md-path"):null,v=j&&j.getAttribute("data-path");!v||!p||(w.preventDefault(),p(v))},[p]),g=(()=>{if(t.kind==="user"){const w=wf(t.text,o),j=!!(t.text||"").trim();return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sess-msg user",children:r.jsxs("div",{className:"bubble",children:[w&&r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Oo(w)}}),(t.images||[]).map((v,x)=>{const y=v.media?n?Be.sessionMediaUrl(n,s,v.media):l&&a?Ce.sessionMediaUrl(l,a,s,v.media):"":"";return y?r.jsx("a",{href:y,target:"_blank",rel:"noreferrer",children:r.jsx("img",{className:"sess-img",src:y,alt:"图片",onError:b=>{b.currentTarget.closest("a").replaceWith("[图片]")}})},x):r.jsx("span",{className:"sess-img-ph",children:"[图片]"},x)})]})}),(c||j)&&r.jsxs("div",{className:"sess-actrow",children:[c&&r.jsx("button",{type:"button",className:"sess-act rw"+(c==="on"?"":" off"),disabled:c!=="on",title:c==="busy"?"会话运行中或有排队消息,稍后再试":c==="running"?"回退中…":"回退到该提问之前(撤销该提问及其后对话,不回退文件改动)",onClick:()=>m(t),children:r.jsx(Pc,{className:"sess-act-i"})}),j&&r.jsx("button",{type:"button",className:"sess-act cp",title:d?"已复制":"复制该提问",onClick:()=>f(t),children:d?r.jsx(Al,{className:"sess-act-i"}):r.jsx(Wp,{className:"sess-act-i"})})]})]})}if(t.kind==="assistant")return r.jsx("div",{className:"sess-msg assistant",children:r.jsx("div",{className:"md-body",onClick:h,dangerouslySetInnerHTML:{__html:Oo(t.text,{pathLinks:!0})}})});if(t.kind==="think")return t.text?r.jsxs("details",{className:"sess-msg think",children:[r.jsx("summary",{children:"思考过程"}),r.jsx("div",{className:"think-text",children:t.text})]}):null;if(t.kind==="tool_call")return r.jsxs("details",{className:"sess-msg tool",children:[r.jsxs("summary",{children:[r.jsx(N0,{className:"inline h-3 w-3"})," ",t.name||"工具调用"]}),r.jsx("pre",{children:RP(t.args)})]});if(t.kind==="tool_result")return r.jsxs("details",{className:"sess-msg tool result"+(t.is_error?" err":""),children:[r.jsxs("summary",{children:[t.is_error?"错误":"结果",t.name?` · ${t.name}`:"","(",String(t.text||"").trim().length," 字符",t.truncated?" · 已截断":"",")"]}),r.jsx("pre",{children:String(t.text||"").trim()})]});if(t.kind==="usage"){const w=[];return t.input&&w.push("↑"+kl(t.input)),t.output&&w.push("↓"+kl(t.output)),t.cache_read&&w.push("缓存 "+kl(t.cache_read)),t.duration_ms&&Lf(t.duration_ms)&&w.push(Lf(t.duration_ms)),w.length?r.jsx("div",{className:"sess-usage",children:w.join(" · ")}):null}if(t.kind==="divider")return r.jsx("div",{className:"sess-divider",children:t.text});if(t.kind==="error"){const w=[t.text,t.code?`[${t.code}]`:"",t.retryable?"可重试":""].filter(Boolean).join(" · ");return r.jsx("div",{className:"sess-msg error",children:r.jsxs("div",{className:"sess-errbox",children:[r.jsx(k0,{className:"sess-errbox-i"}),r.jsxs("div",{children:[r.jsx("div",{className:"sess-errbox-t",children:"模型请求失败,本轮对话已中断"}),w&&r.jsx("div",{className:"sess-errbox-d",children:w})]})]})})}return null})();return g?r.jsx("div",{className:"sess-entry"+(i?" flash":""),"data-seq":t.seq,children:g}):null}),AP=u.memo(function({entries:t,metaNull:n,found:s,reason:o,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flashSeq:f,chatRunning:m,exitCode:p,boxRef:h,atBottomRef:g,onScroll:w,jumpSeq:j,onJumpHandled:v,rwEnabled:x,rwBusy:y,rewindingMid:b,copiedSeq:S,onCopy:N,onRewind:k,onSwitchSession:C,onOpenPath:O}){const R=t.length,z=u.useRef(new Map),V=u.useRef(new Set),q=u.useRef(null),[I,G]=u.useState(0),[te,H]=u.useState(null),L=u.useRef(!0),K=u.useRef(0),F=u.useRef(null),xe=u.useRef(null),X=u.useMemo(()=>{const se=new Float64Array(R+1),ve=z.current;let ie=0;for(const he of ve.values())ie+=he;const ue=ve.size?ie/ve.size:Yg;for(let he=0;he<R;he++)se[he+1]=se[he]+(ve.get(t[he].seq)||ue);return se},[t,R,I]),[Te,Pe]=te??[Math.max(0,R-ra),R],Re=u.useCallback(()=>{const se=h.current;se&&(w(),L.current=se.scrollHeight-se.scrollTop-se.clientHeight<$P,!K.current&&(K.current=requestAnimationFrame(()=>{K.current=0;const ve=h.current;ve&&H(ie=>{const[ue,he]=ie??[Math.max(0,R-ra),R];if(L.current)return he===R?ie:[Math.max(0,R-ra),R];const pe=Math.max(0,cd(X,ve.scrollTop)-Qg),E=Math.min(R,cd(X,ve.scrollTop+ve.clientHeight)+1+Qg);return pe===ue&&E===he?ie:[pe,Math.max(pe+1,E)]})})))},[h,w,R,X]);return u.useEffect(()=>()=>cancelAnimationFrame(K.current),[]),u.useLayoutEffect(()=>{if(!R){z.current.size&&(z.current=new Map),xe.current=null,H(null);return}H(se=>{const[ve,ie]=se??[Math.max(0,R-ra),R];return g.current?[R-ve>TP?Math.max(0,R-ra):Math.min(ve,R-1),R]:[Math.min(ve,R-1),Math.min(ie,R)]})},[R,g]),u.useEffect(()=>{if(j==null)return;const se=t.findIndex(ve=>ve.seq===j);if(se<0){v(j);return}L.current=!1,F.current=j,H([Math.max(0,se-5),Math.min(R,se+25)])},[j,t,R,v]),u.useEffect(()=>{if(typeof ResizeObserver>"u")return;const se=new ResizeObserver(()=>G(ve=>ve+1));return q.current=se,h.current&&se.observe(h.current),()=>{se.disconnect(),q.current=null,V.current=new Set}},[h]),u.useLayoutEffect(()=>{const se=h.current;if(!se)return;const ve=z.current;let ie=!1,ue=0;const he=cd(X,se.scrollTop),pe=se.querySelectorAll(".sess-entry[data-seq]");for(let le=0;le<pe.length;le++){const Ne=pe[le],Ge=+Ne.dataset.seq,dt=Ne.offsetHeight+MP,Ze=ve.get(Ge);Ze!==dt&&(ve.set(Ge,dt),ie=!0,Te+le<he&&(ue+=dt-(Ze??Yg)))}ue&&!L.current&&(se.scrollTop+=ue);const E=xe.current,Y=!E||se.scrollHeight!==E.sh||se.clientHeight<E.ch;xe.current={sh:se.scrollHeight,ch:se.clientHeight},L.current&&g.current&&Y&&(se.scrollTop=se.scrollHeight);const A=q.current;if(A){const le=new Set;for(let Ne=0;Ne<pe.length;Ne++){const Ge=pe[Ne];le.add(Ge),V.current.has(Ge)||(A.observe(Ge),V.current.add(Ge))}for(const Ne of V.current)le.has(Ne)||(A.unobserve(Ne),V.current.delete(Ne))}const oe=F.current;if(oe!=null){const le=se.querySelector(`[data-seq="${oe}"]`);le&&(le.scrollIntoView({block:"start"}),F.current=null,v(oe))}ie&&G(le=>le+1)}),r.jsxs("div",{className:"sess-body scroll",ref:h,onScroll:Re,children:[n?r.jsx("div",{className:"sess-empty",children:"加载中…"}):s?R?r.jsxs(r.Fragment,{children:[Te>0&&r.jsx("div",{className:"sess-pad",style:{height:X[Te]}}),t.slice(Te,Pe).map(se=>{const ve=!x||!se.mid?"":b===se.mid?"running":y?"busy":"on";return r.jsx(IP,{e:se,taskId:l,agent:a,pid:i,boardPid:c,boardSid:d,flash:f===se.seq,rwState:ve,copied:S===se.seq,onCopy:N,onRewind:k,onOpenPath:O},se.seq)}),Pe<R&&r.jsx("div",{className:"sess-pad",style:{height:X[R]-X[Pe]}})]}):r.jsx("div",{className:"sess-empty",children:"会话暂无内容"}):r.jsx("div",{className:"sess-empty",children:PP[o]||"会话不可用"}),m&&r.jsxs("div",{className:"sess-running",children:[r.jsx("span",{className:"sess-pulse"}),"工作中…"]}),!m&&p!=null&&p!==0&&r.jsxs("div",{className:"sess-chaterr",children:[r.jsx(nN,{className:"inline h-3 w-3"})," 对话进程异常结束(exit=",p,")"]})]})}),OP=u.memo(function({withQBar:t,qbarOpen:n,questions:s,flashSeq:o,onJump:l}){return!t||!n?null:r.jsxs("aside",{className:"sess-qbar",children:[r.jsxs("div",{className:"sess-qbar-t",children:["提问索引 ",r.jsx("span",{className:"sess-qbar-n",children:s.length})]}),r.jsxs("div",{className:"sess-qbar-list",children:[s.length===0&&r.jsx("div",{className:"sess-qbar-empty",children:"暂无提问"}),s.map((a,i)=>r.jsxs("button",{type:"button",className:"sess-qitem"+(o===a.seq?" on":""),onClick:()=>l(a.seq),title:a.text,children:[r.jsx("span",{className:"sess-qitem-i",children:i+1}),r.jsxs("span",{className:"sess-qitem-t",children:[a.text.replace(/\s+/g," ").slice(0,60),a.text.length>60?"…":""]})]},a.seq))]})]})}),LP=u.memo(function({data:t,answer:n}){const[s,o]=u.useState({}),[l,a]=u.useState(!1),[i,c]=u.useState(0),[d,f]=u.useState(!1),m=t==null?void 0:t.qid,p=t==null?void 0:t.approval_id;if(u.useEffect(()=>{o({}),c(0),f(!1)},[m,p]),!(t!=null&&t.pending))return null;const h=t.questions&&t.questions.length?t.questions:[{id:t.wire||"q_0",question:t.question,header:t.header,body:t.body,options:t.options||[],multi_select:t.multi_select,allow_other:t.allow_other,other_label:t.other_label,other_description:t.other_description}],g=h.length>1,w=I=>s[I]||{sel:[],other:"",useOther:!1},j=(I,G)=>o(te=>({...te,[I]:{...te[I]||{sel:[],other:"",useOther:!1},...G}}));async function v(I){a(!0);try{await n(I)}finally{a(!1)}}function x(I,G){const te=w(I.id);I.multi_select?j(I.id,{sel:te.sel.includes(G)?te.sel.filter(H=>H!==G):[...te.sel,G]}):j(I.id,{sel:[G],useOther:!1})}function y(I){j(I.id,I.multi_select?{useOther:!0}:{useOther:!0,sel:[]})}function b(I,G){j(I.id,I.multi_select?{other:G,useOther:!0}:{other:G,useOther:!0,sel:[]})}function S(I){const G=w(I.id),te=(G.other||"").trim();return I.multi_select?G.sel.length&&te?{wire:I.id,kind:"multi_with_other",option_ids:G.sel,text:te}:G.sel.length?{wire:I.id,kind:"multi",option_ids:G.sel}:te?{wire:I.id,kind:"other",text:te}:null:G.sel.length?{wire:I.id,kind:"single",option_id:G.sel[0]}:te?{wire:I.id,kind:"other",text:te}:null}const N=h.map(S),k=!l&&N.every(Boolean);function C(){if(k)return v({qid:m,answers:N})}const O=N.filter(Boolean).length,R=Math.min(Math.max(i,0),h.length-1),z=h[R],V=w(z.id),q=z.options||[];return t.kind==="approval"?d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx(Rc,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🛡 agent 请求审批:",t.action||t.tool||"工具调用"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Ol,{className:"h-3.5 w-3.5"})})]}),t.input&&r.jsx("pre",{className:"sess-interaction-pre",children:t.input}),r.jsxs("div",{className:"sess-interaction-opts",children:[r.jsx(D,{size:"sm",disabled:l,onClick:()=>v({approval_id:p,decision:"approved"}),children:"批准"}),r.jsx(D,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"approved",scope:"session"}),children:"本会话内批准"}),r.jsx(D,{size:"sm",variant:"outline",disabled:l,onClick:()=>v({approval_id:p,decision:"rejected"}),children:"拒绝"})]})]}):d?r.jsxs("button",{type:"button",className:"sess-interaction-bar",title:"展开",onClick:()=>f(!1),children:[r.jsxs("span",{className:"sess-interaction-bar-t",children:["🤔 agent 等待你的回答",g?` · 已答 ${O}/${h.length}`:""]}),r.jsx(Rc,{className:"h-3.5 w-3.5"})]}):r.jsxs("div",{className:"sess-interaction",children:[r.jsxs("div",{className:"sess-interaction-head",children:[r.jsxs("div",{className:"sess-interaction-q",children:["🤔 ",g?`问题 ${R+1}/${h.length}`:"agent 等待你的回答",z.header?`(${z.header})`:"",":",z.question||"(详情见会话记录)"]}),r.jsx("button",{type:"button",className:"sess-interaction-min",title:"最小化",onClick:()=>f(!0),children:r.jsx(Ol,{className:"h-3.5 w-3.5"})})]}),z.body&&r.jsx("div",{className:"sess-interaction-body",children:z.body}),t.answerable&&r.jsxs("div",{className:"sess-interaction-list",children:[q.map((I,G)=>r.jsxs("label",{className:"sess-iopt"+(V.sel.includes(I.id)?" on":""),children:[r.jsx("input",{type:z.multi_select?"checkbox":"radio",checked:V.sel.includes(I.id),disabled:l,onChange:()=>x(z,I.id)}),r.jsx("span",{className:"sess-iopt-key",children:G+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:I.label}),I.description&&r.jsx("span",{className:"sess-iopt-desc",children:I.description})]})]},I.id)),z.allow_other&&r.jsxs("label",{className:"sess-iopt"+(V.useOther?" on":""),children:[r.jsx("input",{type:z.multi_select?"checkbox":"radio",checked:V.useOther,disabled:l,onChange:()=>y(z)}),r.jsx("span",{className:"sess-iopt-key",children:q.length+1}),r.jsxs("span",{className:"sess-iopt-text",children:[r.jsx("span",{className:"sess-iopt-label",children:z.other_label||"其他…"}),z.other_description&&r.jsx("span",{className:"sess-iopt-desc",children:z.other_description}),r.jsx("input",{className:"sess-iopt-input",type:"text",value:V.other,placeholder:z.other_label||"其他…",disabled:l,onFocus:()=>y(z),onChange:I=>b(z,I.target.value)})]})]})]}),(t.answerable||g)&&r.jsxs("div",{className:"sess-interaction-foot",children:[g?r.jsxs("div",{className:"sess-inav",children:[r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:R===0,onClick:()=>c(R-1),children:"‹ 上一题"}),h.map((I,G)=>r.jsx("button",{type:"button",className:"sess-inav-dot"+(G===R?" on":"")+(N[G]?" done":""),title:`第 ${G+1} 题${N[G]?"(已答)":"(未答)"}`,onClick:()=>c(G),children:G+1},I.id)),r.jsx("button",{type:"button",className:"sess-inav-btn",disabled:R===h.length-1,onClick:()=>c(R+1),children:"下一题 ›"})]}):r.jsx("span",{className:"sess-interaction-hint",children:z.multi_select?"可多选,选好后点「提交」":"选择后点「提交」"}),t.answerable&&r.jsx(D,{size:"sm",disabled:!k,title:!l&&!k?"还有题目未作答":void 0,onClick:C,children:"提交"})]})]})});function zf({task:e,board:t,withQBar:n=!0,onUnitState:s,onCardColumn:o,onPassed:l}){var Sr,$s,kr,Nr,ws,Zs;const a=e==null?void 0:e.id,i=t==null?void 0:t.sid,c=t==null?void 0:t.projectId,d=t==null?void 0:t.cid,[f,m]=u.useState(null),[p,h]=u.useState([]),[g,w]=u.useState({running:!1}),[j,v]=u.useState("main"),[x,y]=u.useState(!1),[b,S]=u.useState(""),[N,k]=u.useState(!1),[C,O]=u.useState(""),[R,z]=u.useState(""),[V,q]=u.useState(!1),[I,G]=u.useState(null),[te,H]=u.useState(!1),[L,K]=u.useState(!1),[F,xe]=u.useState(null),[X,Te]=u.useState(""),Pe=u.useRef(null),[Re,se]=u.useState(!1),[ve,ie]=u.useState([]),[ue,he]=u.useState([]),[pe,E]=u.useState(null),[Y,A]=u.useState(null),[oe,le]=u.useState({models:[],default:""}),[Ne,Ge]=u.useState(null),dt=$n($=>$.projects),[Ze,ft]=u.useState(-1),[kt,on]=u.useState(!1),[wn,de]=u.useState([]),[Q,Ve]=u.useState(!0),[Xt,Un]=u.useState(null),[Wt,ln]=u.useState(null),at=u.useRef(null),Ms=u.useRef(null),hs=u.useRef(!0),Tt=u.useRef(-1),P=u.useRef(""),B=u.useRef(""),J=u.useRef(null),ae=u.useRef(null),ce=u.useRef(null),fe=u.useRef(null),Oe=u.useRef([1,0]),qe=!!t&&!!(f!=null&&f.running),Qe=["running","queued"].includes(e==null?void 0:e.status)||qe,Xe=!!(g!=null&&g.running),wt=(f==null?void 0:f.capabilities)||{},jn=Jw(),Jt=i||(f==null?void 0:f.session_id)||"",tt=!(f!=null&&f.found),$t=(g==null?void 0:g.queued)||0,dn=((Sr=f==null?void 0:f.unit_state)==null?void 0:Sr.state)||"",qt=(f==null?void 0:f.queue_state)||"",nt=(($s=f==null?void 0:f.unit_state)==null?void 0:$s.pos)||0,It=((kr=f==null?void 0:f.unit_state)==null?void 0:kr.total)||0,Pn=u.useMemo(()=>qt?{kind:qt,pos:nt,total:It}:null,[qt,nt,It]);u.useEffect(()=>{s&&s(Pn)},[Pn,s]);const Zn=t&&(f==null?void 0:f.card_column)||"";u.useEffect(()=>{o&&o(Zn)},[Zn,o]);const jr=!!(t&&(f==null?void 0:f.queue_state)==="answer_pending"),gs=!!wt.rewind,Ts=Qe||Xe||dn==="running"||$t>0||(((Nr=f==null?void 0:f.queue)==null?void 0:Nr.length)||0)>0||N;u.useEffect(()=>()=>clearTimeout(Pe.current),[]);const fn=t?t.projectId:e==null?void 0:e.project_id,it=dt.find($=>$.id===fn);u.useEffect(()=>{if(!(it!=null&&it.agent_path)||!fn)return;let $=!1;return de(Z=>Z.filter(_e=>_e.type!=="skill")),Mt.agentSkills(it.agent_path,it.project_dir||it.work_dir||"").then(Z=>{if($)return;const _e=Array.isArray(Z)?Z:(Z==null?void 0:Z.skills)||[];de(me=>[...me.filter($e=>$e.type!=="skill"),..._e.map($e=>({key:$e.name||$e.id,label:$e.name||$e.id,desc:($e.description||$e.summary||"").slice(0,40),type:"skill"}))])}).catch(()=>{}),()=>{$=!0}},[it==null?void 0:it.agent_path,fn]);const po=[{key:"/stop",desc:"停止当前对话",type:"cmd",on:()=>!!wt.chat,run:mt},{key:"/compact",desc:"压缩会话历史",type:"cmd",on:()=>!!t&&!!wt.compact,run:async()=>{await Ce.compact(c,d,i)}},{key:"/new",desc:"创建新会话",type:"cmd",dis:!0},{key:"/clear",desc:"清空并新建会话",type:"cmd",dis:!0},{key:"/plan",desc:"切换计划模式 开/关",type:"cmd",dis:!0},{key:"/swarm",desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行",type:"cmd",dis:!0},{key:"/goal",desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel",type:"cmd",dis:!0},{key:"/btw",desc:"侧边聊天:/btw <问题> 向 fork 的侧边聊天提问",type:"cmd",dis:!0},{key:"/undo",desc:"撤销上一条消息",type:"cmd",dis:!0}],Yo=po.filter($=>$.dis||$.on()),Hn=u.useMemo(()=>Yw(b,Ze>=0?Ze:b.length),[b,Ze]),es=Hn!=null&&!kt,xs=Hn?Hn.text.slice(1):"";u.useEffect(()=>{if(!a||t)return;let $=!1;m(null),h([]),w({running:!1}),he([]),y(!1),Tt.current=-1,P.current="";function Z($e){$e.addEventListener("meta",De=>{if($)return;const xt=JSON.parse(De.data);if(xt.session_id&&P.current&&xt.session_id!==P.current&&(Tt.current=-1,h([])),xt.session_id&&(P.current=xt.session_id),xt.found&&xt.total<Tt.current+1){me();return}m(xt)}),$e.addEventListener("entries",De=>{if($)return;const xt=JSON.parse(De.data);if(xt.total<Tt.current+1){me();return}const jt=(xt.entries||[]).filter(en=>en.seq>Tt.current);jt.length&&(Tt.current=jt[jt.length-1].seq,h(en=>[...en,...jt]),he(en=>en.filter(Cr=>!jt.some(Is=>Is.kind==="user"&&(Is.text||"").includes(Cr.text.slice(0,50))))))}),$e.addEventListener("chat",De=>{$||w(JSON.parse(De.data))}),$e.onopen=()=>{$||y(!0)},$e.onerror=()=>{$||y(!1)}}function _e(){const $e=Be.sessionStream(a,j);J.current=$e,Z($e)}function me(){Tt.current=-1,h([]),J.current&&(J.current.close(),J.current=null),_e()}return _e(),()=>{$=!0,J.current&&(J.current.close(),J.current=null)}},[a,j]),u.useEffect(()=>{if(!i)return;let $=!1;m(null),h([]),w({running:!1}),he([]),y(!1),Tt.current=-1;let Z=null,_e=setInterval($e,2e3);const me=()=>{ce.current||(ce.current=setTimeout(()=>{ce.current=null,$e()},150))};ae.current=De=>{if(!(!De||Z)){clearInterval(_e),_e=setInterval($e,6e4);try{Z=Ce.sessionStream(c,i),Z.addEventListener("hello",me),Z.addEventListener("refresh",me)}catch{Z=null}}};async function $e(){try{const De=await Ce.sessionMessages(c,i,Tt.current+1,j);if($)return;if(De.found&&De.total<Tt.current+1){Tt.current=-1,h([]);return}const xt=(De.entries||[]).filter(jt=>jt.seq>Tt.current);xt.length&&(Tt.current=xt[xt.length-1].seq,h(jt=>[...jt,...xt]),he(jt=>jt.filter(en=>!xt.some(Cr=>Cr.kind==="user"&&(Cr.text||"").includes(en.text.slice(0,50)))))),m(jt=>({found:De.found,reason:De.reason,agents:De.agents,agent:De.agent,total:De.total,totals:De.totals,session_id:i,capabilities:De.capabilities,running:De.running,interaction:De.interaction,family:De.family,ctx:De.ctx,permission:De.permission,sessionModel:De.sessionModel,sessionEffort:De.sessionEffort,unit_state:De.unit_state,queue_state:De.queue_state,project_busy:De.project_busy,card_column:De.card_column,answer_pending:De.answer_pending,card_worktree:De.card_worktree,queue:De.queue==null?jt==null?void 0:jt.queue:De.queue})),w(De.chat||{running:!1}),y(!0)}catch{$||y(!1)}}return $e(),()=>{$=!0,ae.current=null,clearInterval(_e),ce.current&&(clearTimeout(ce.current),ce.current=null);try{Z==null||Z.close()}catch{}}},[i,c,j]),u.useEffect(()=>{var $,Z;(Z=ae.current)==null||Z.call(ae,!!(($=f==null?void 0:f.capabilities)!=null&&$.events))},[(ws=f==null?void 0:f.capabilities)==null?void 0:ws.events,i]),u.useEffect(()=>{B.current=i},[i]);const br=u.useRef(new Set);u.useEffect(()=>{const $=((g==null?void 0:g.msgs)||[]).filter(Z=>Z.state==="error");if($.length)for(const Z of $)br.current.has(Z.id)||(br.current.add(Z.id),M(`消息发送失败:${Z.error||"未知原因"}`),Z.id&&he(_e=>_e.filter(me=>me.id!==Z.id)))},[g]),u.useEffect(()=>{if(E(null),A(null),Ge(null),!i)return;let $=!1;return it!=null&&it.agent_path?Mt.agentModels(it.agent_path).then(Z=>{$||le(Z||{models:[],default:""})}).catch(()=>{$||le({models:[],default:""})}):le({models:[],default:""}),()=>{$=!0}},[i,it==null?void 0:it.agent_path]),u.useEffect(()=>{(f==null?void 0:f.permission)!=null&&E(f.permission),f!=null&&f.sessionModel&&A(f.sessionModel),f!=null&&f.sessionEffort&&Ge(f.sessionEffort)},[f==null?void 0:f.permission,f==null?void 0:f.sessionModel,f==null?void 0:f.sessionEffort]);const mo=u.useMemo(()=>Uw(oe,Y||(f==null?void 0:f.sessionModel)||(oe==null?void 0:oe.default)||""),[oe,Y,f==null?void 0:f.sessionModel]),ho=u.useCallback(()=>{const $=Ms.current;hs.current=$?$.scrollHeight-$.scrollTop-$.clientHeight<60:!0},[]),Js=u.useMemo(()=>{const $=[],Z=[],_e=me=>Z.some($e=>$e&&me&&$e.slice(0,40)===me.slice(0,40));for(const me of(f==null?void 0:f.queue)||[])me!=null&&me.text&&($.push({key:"k"+me.id,text:me.text,msgId:"",state:"server"}),Z.push(me.text));for(const me of(g==null?void 0:g.msgs)||[])me.state==="error"||!me.text||_e(me.text)||($.push({key:"m"+me.id,text:me.text,msgId:me.id,state:me.state}),Z.push(me.text));for(const me of ue)!me.text||_e(me.text)||($.push({key:"p"+(me.id||me.ts),text:me.text,msgId:me.id||"",state:"pending"}),Z.push(me.text));return $},[f==null?void 0:f.queue,g,ue]),T=u.useMemo(()=>p.filter($=>$.kind==="user"&&($.text||"").trim()).map($=>({seq:$.seq,text:$.text.trim()})),[p]),U=u.useCallback($=>ln($),[]),be=u.useCallback($=>{ln(null),Un($),clearTimeout(at.current),at.current=setTimeout(()=>Un(null),1600)},[]);function ge(){const $=fe.current;if(!$)return;const Z=$.value.split(`
|
|
442
|
-
`).length,_e=$.value.length,[me,$e]=Oe.current;Z===me&&Math.abs(_e-$e)<40||(Oe.current=[Z,_e],$.style.height="auto",$.style.height=Math.min($.scrollHeight,320)+"px")}async function Le($){const Z=Array.from($||[]);if(!Z.length||Re)return;const _e=t?t.projectId:e==null?void 0:e.project_id;if(_e)for(const me of Z){if(me.size>10*1024*1024){M(`附件过大(>10MB):${me.name}`);continue}if(await Jp(me)){M(`已跳过占位图(极小尺寸):${me.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}se(!0);try{const $e=await new Promise((en,Cr)=>{const Is=new FileReader;Is.onload=()=>en(String(Is.result||"").split(",")[1]||""),Is.onerror=()=>Cr(new Error("文件读取失败")),Is.readAsDataURL(me)}),De=await Ce.uploadMedia(_e,{name:me.name,mime:me.type||"application/octet-stream",data:$e}),xt=(me.type||"").startsWith("image/")?``:`[${me.name}](${De.abs||De.url})`;ie(en=>[...en,{md:xt,url:Xp(De.url),abs:De.abs,name:me.name,mime:me.type}]);const jt=fe.current;if(jt&&document.activeElement===jt&&jt.selectionStart!=null){const en=jt.selectionStart,Cr=jt.selectionEnd;S(Is=>Is.slice(0,en)+xt+Is.slice(Cr)),requestAnimationFrame(()=>{jt.selectionStart=jt.selectionEnd=en+xt.length,ft(en+xt.length)})}else S(en=>(en?en+`
|
|
443
|
-
`:"")+xt+`
|
|
444
|
-
`),ft(-1);ge(),M(`已添加附件:${me.name}`)}catch($e){M($e.message||"附件上传失败")}finally{se(!1)}}}function Se($){var me;const _e=Array.from(((me=$.clipboardData)==null?void 0:me.items)||[]).filter($e=>$e.kind==="file").map($e=>$e.getAsFile()).filter(Boolean);_e.length&&($.preventDefault(),Le(_e))}function Nt($){var _e;const Z=Array.from(((_e=$.dataTransfer)==null?void 0:_e.files)||[]);Z.length&&($.preventDefault(),Le(Z))}async function pt(){const $=b.trim();if(!(!$||N||tt)){if(/^\/[\w-]+$/.test($)){const Z=po.find(_e=>_e.key===$);if(Z){if(Z.dis||!(Z.on&&Z.on())){M(`当前环境不支持 ${$}`);return}S(""),ft(0),requestAnimationFrame(ge);try{if(await Z.run()===!1)return;M(`已执行 ${$}`)}catch(_e){M(_e.message||`指令执行失败:${$}`)}return}}k(!0);try{if(t){const Z=await Ce.addComment(c,d,$),_e=await Ce.sendComment(c,d,Z.id,!1,!0);_e!=null&&_e.queued&&he(me=>[...me,{text:$,ts:Date.now(),id:_e.msg_id||""}])}else{const Z=await Be.sessionChat(a,$);Z!=null&&Z.queued&&he(_e=>[..._e,{text:$,ts:Date.now(),id:Z.msg_id||""}])}S(""),hs.current=!0,requestAnimationFrame(ge)}catch(Z){M(Z.message)}finally{k(!1)}}}async function mt(){try{if(t){const $=await Ce.stopCard(c,d);if($&&$.stopped===!1)return M("该会话未在运行或无法停止"),!1}else await Be.sessionChatStop(a);return he([]),!0}catch($){return M($.message),!1}}async function W($){if(!$||$===pe)return;const Z=i;try{if(await Ce.setSessionProfile(c,Z,{permission_mode:$}),Z!==B.current)return;E($),M(`权限已切换:${(Ac.find(_e=>_e.value===$)||{}).label||$}`)}catch(_e){Z===B.current&&M(_e.message)}}async function lt($){const Z=i;try{if(await Ce.setSessionProfile(c,Z,{model:$}),Z!==B.current)return;A($),M(`模型已切换:${$}`)}catch(_e){Z===B.current&&M(_e.message)}}async function bn($){if(!$||$==="__default__"||$===Ne)return;const Z=i;try{if(t?await Ce.setSessionProfile(c,Z,{reasoning_effort:$}):await Be.sessionProfile(a,{reasoning_effort:$}),Z&&Z!==B.current)return;Ge($),M(`思考等级已切换:${ZR($)}`)}catch(_e){(!Z||Z===B.current)&&M(_e.message)}}async function Mn($){try{const Z=t?await Ce.answerInteraction(c,d,$):await Be.answerInteraction(a,$);M(Z&&Z.queued?"已提交答案:项目忙,等待空闲后自动送达":"已回答")}catch(Z){M(Z.message)}}async function vs($){if($!=null&&$.msgId){z($.key);try{t?await Ce.injectSessionMsg(c,i,$.msgId):await Be.sessionChatInject(a,$.msgId),M("已注入当前上下文"),he(Z=>Z.filter(_e=>_e.id!==$.msgId))}catch(Z){M(Z.message)}finally{z("")}}}async function Qo(){K(!0);try{await Ce.deliverAnswer(c,d),M("已送达答案")}catch($){M($.message)}finally{K(!1)}}async function ys(){q(!0);try{if(t&&(f!=null&&f.card_worktree)){let $=null;try{$=await Ce.worktreePreview(c,d)}catch{$=null}if($&&$.merge&&$.merge.ahead>0){G($.merge);return}}await Ce.moveCard(c,d,"done"),M("已通过,卡片移入「已完成」"),l&&l()}catch($){M($.message)}finally{q(!1)}}async function go(){H(!0);try{await Ce.mergeWorktree(c,d),G(null),M("已交给 agent 合并:卡片回到开发队列排队,完成后自动回「待审核」")}catch($){M($.message)}finally{H(!1)}}async function _n(){G(null),q(!0);try{await Ce.moveCard(c,d,"done",void 0,null,!0),M("已通过,卡片移入「已完成」"),l&&l()}catch($){M($.message)}finally{q(!1)}}const ts=u.useCallback($=>O($||""),[]);function _($){var me;const Z=($==null?void 0:$.text)||"";if(!Z.trim())return;const _e=(me=navigator.clipboard)==null?void 0:me.writeText(Z);_e&&_e.catch&&_e.catch(()=>M("复制失败:浏览器未授予剪贴板权限")),xe($.seq),clearTimeout(Pe.current),Pe.current=setTimeout(()=>xe(null),1400)}async function re($){const Z=($==null?void 0:$.mid)||"";if(!Z||X)return;const _e=p.filter($e=>$e.kind==="user"&&$e.seq>=$.seq).length,me=($.text||"").trim().replace(/\s+/g," ").slice(0,60);if(window.confirm(`回退到该提问之前?
|
|
445
|
-
|
|
446
|
-
将撤销该提问及其后共 ${_e} 轮对话:
|
|
447
|
-
${me}${me.length>=60?"…":""}
|
|
448
|
-
|
|
449
|
-
只回退对话上下文,不回退文件改动;此操作不可撤销。`)){Te(Z);try{const $e=t?await Ce.rewindSession(c,i,Z):await Be.sessionRewind(a,Z);$e!=null&&$e.new_session_id&&!$e.rebound?(M(`已回退 ${_e} 轮对话:历史已复制为新会话,正在切换`),onSwitchSession==null||onSwitchSession($e.new_session_id)):M(`已回退 ${_e} 轮对话,原提问已回填输入框`),S($.text||""),h(De=>De.filter(xt=>xt.seq<$.seq)),Tt.current=$.seq-1,ge()}catch($e){M(`回退失败:${($e==null?void 0:$e.message)||"未知原因"}`)}finally{Te("")}}}function ke($){S(Z=>Z.replace($,""))}u.useEffect(()=>{const $=fe.current;if(!$)return;const Z=()=>ft($.selectionStart??0),_e=()=>{ft($.selectionStart??0),on(!1)};return $.addEventListener("keyup",Z),$.addEventListener("click",_e),()=>{$.removeEventListener("keyup",Z),$.removeEventListener("click",_e)}},[wt.chat]);function Me($){var Z;S($),ft(((Z=fe.current)==null?void 0:Z.selectionStart)??$.length),on(!1),ge()}function ze($){if(!Hn)return;const Z=$.type==="skill"?`使用 skill「${$.label}」`:$.key;on(!0),S(me=>me.slice(0,Hn.start)+Z+me.slice(Hn.start+Hn.text.length));const _e=Hn.start+Z.length;ft(_e),requestAnimationFrame(()=>{const me=fe.current;me&&(me.selectionStart=me.selectionEnd=_e)}),ge()}function Fe($){M(`当前环境不支持 ${$.key}`)}const Zt=(f==null?void 0:f.agents)||[],rt=f==null?void 0:f.totals,_r=rt&&(f!=null&&f.found)?[`共 ${f.total} 条`,rt.input?`↑${kl(rt.input)}`:"",rt.output?`↓${kl(rt.output)}`:"",rt.cache_read?`缓存 ${kl(rt.cache_read)}`:"",Lf(rt.duration_ms)].filter(Boolean).join(" · "):"";return r.jsxs("div",{className:"sess-view",children:[r.jsxs("div",{className:"sess-wrap",children:[r.jsx(OP,{withQBar:n,qbarOpen:Q,questions:T,flashSeq:Xt,onJump:U}),r.jsxs("div",{className:"sess-main",children:[r.jsxs("div",{className:"sess-sub",children:[n&&r.jsx("button",{type:"button",className:"sess-qbar-toggle",title:Q?"收起提问索引":"展开提问索引",onClick:()=>Ve($=>!$),children:r.jsx(_N,{className:"h-3.5 w-3.5"})}),r.jsx("span",{className:"sess-conn"+(x?" on":""),title:x?"SSE 已连接(实时更新)":"连接中断,自动重连中…"}),(f==null?void 0:f.session_id)&&r.jsx("span",{className:"sess-chip mono",title:f.session_id,children:f.session_id.replace(/^session_/,"").slice(0,8)}),(f==null?void 0:f.model)&&r.jsx("span",{className:"sess-chip",children:f.model}),Zt.length>1&&r.jsx("span",{className:"sess-agents",children:Zt.map($=>r.jsxs("button",{type:"button",className:"sess-agent"+(((f==null?void 0:f.agent)||j)===$.id?" on":""),onClick:()=>v($.id),children:[$.id,$.type==="sub"?" (子)":""]},$.id))}),r.jsx("span",{style:{flex:1}}),!!(jn!=null&&jn.openSession)&&r.jsx(D,{size:"sm",variant:"ghost",className:"sess-open-dsh",title:Jt?"在 dsh 界面打开当前会话":"尚无会话",disabled:!Jt,onClick:()=>Xw(Jt),children:r.jsx(qp,{className:"h-3.5 w-3.5"})}),t&&["doing","review"].includes(t.column)&&r.jsxs(D,{size:"sm",variant:"outline",className:"sess-pass",disabled:V,title:"通过:卡片移入「已完成」",onClick:ys,children:[r.jsx(Al,{className:"h-3.5 w-3.5"})," 通过"]}),_r&&r.jsx("span",{className:"sess-totals",title:"输入 / 输出 / 缓存读取 / 总耗时",children:_r})]}),r.jsx(AP,{entries:p,metaNull:!f,found:!!(f!=null&&f.found),reason:f==null?void 0:f.reason,taskId:a,agent:(f==null?void 0:f.agent)||j,pid:t?c:fn,boardPid:t?c:"",boardSid:t?i:"",flashSeq:Xt,chatRunning:Xe,exitCode:g==null?void 0:g.exit_code,boxRef:Ms,atBottomRef:hs,onScroll:ho,jumpSeq:Wt,onJumpHandled:be,rwEnabled:gs,rwBusy:Ts,rewindingMid:X,copiedSeq:F,onCopy:_,onRewind:re,onOpenPath:ts}),((Zs=f==null?void 0:f.interaction)==null?void 0:Zs.pending)&&r.jsx(LP,{data:f.interaction,answer:Mn}),wt.chat&&r.jsx(XR,{value:b,onChange:Me,atts:ve,onRemoveAtt:ke,uploading:Re,inputLocked:tt,caps:wt,meta:f,onSend:pt,onStop:mt,chatRunning:Xe,taskRunning:Qe,queuedN:$t,board:t,sending:N,permMode:pe,modelSel:Y,modelOpts:oe,onSetModel:lt,onSetPermission:W,effortSel:Ne,effortOpts:mo,onSetEffort:bn,queueRows:Js,injecting:R,onInject:vs,answerPending:jr,deliveringAnswer:L,onDeliverAnswer:Qo,slashOpen:es,slashQuery:xs,slashItems:[...Yo,...wn],onSlashSelect:ze,onSlashClose:()=>on(!0),onSlashDisabled:Fe,onPasteFiles:Se,onDropFiles:Nt,onUploadFiles:Le,taRef:fe})]})]}),C&&(t?c:fn)&&r.jsx(jP,{pid:t?c:fn,path:C,onClose:()=>O("")}),r.jsx(Kw,{open:!!I,info:I,busy:te,disabledReason:f!=null&&f.running||g!=null&&g.running?"会话运行中:等这一轮跑完,或先点「停止」再交接":"",onHandoff:go,onPass:_n,onClose:()=>!te&&G(null)})]})}const zP={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function DP({column:e}){const t=zP[e];return t?r.jsx("span",{className:"sess-colstate",title:"卡片当前所在列(看板队列)",children:t}):null}const FP={running:"该会话所属任务/卡片正在运行",starting:"卡片已交平台启动,等待会话证实运行(启动中)",answer_pending:"答案已被平台收下,等项目空闲送达",interaction_pending:"agent 向用户提问挂起,等待作答",server_queued:"消息已在 agent 服务端队列排队",foreign_busy:"项目被外部同步会话占用,等其结束后按队列补位"};function BP({state:e}){if(!e||!e.kind)return null;const t=e.kind,n=e.pos||0,s=e.total||0;if(t==="idle")return r.jsxs("span",{className:"sess-qstate",title:"不在统一队列中(既未排队也无运行中的单元)",children:[r.jsx("span",{className:"dot"}),"空闲"]});const o=(t==="queued_serial"||t==="answer_pending")&&n>0,l=yf[t]||t,a=o?`统一队列排队中:本项目前面还有 ${Math.max(0,n-1)} 个单元(本项目排队 ${s} 个)`:FP[t]||"";return r.jsxs("span",{className:E0(t,"sess"),title:a,children:[r.jsx("span",{className:"dot"}),l,o?` · 第 ${n} 位`:""]})}function Oc({task:e,board:t,onClose:n,onSwitchSession:s}){const o=!!e||!!t,{rzOn:l,rzStyle:a,rzStart:i,rzDragStart:c,rzReset:d}=lr("ts.sessW"),[f,m]=u.useState(null),[p,h]=u.useState("");return u.useEffect(()=>{o||(m(null),h(""))},[o]),r.jsx(Qt,{open:o,onOpenChange:g=>{g||n()},children:r.jsxs(Bt,{className:"modal modal-rz sess-modal w-[75vw] h-[90vh] sm:max-w-[94vw] grid-rows-[auto_minmax(0,1fr)]"+(l?" rz-drag":""),style:{...a,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:i,reset:d}),r.jsx(Ut,{className:"text-left",children:r.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[r.jsxs(Ht,{className:"cursor-move select-none text-sm",onMouseDown:c,children:["会话 · ",(e==null?void 0:e.name)||(t==null?void 0:t.title)||(t==null?void 0:t.sid)]}),r.jsx(DP,{column:p}),r.jsx(BP,{state:f})]})}),e&&r.jsx(zf,{task:e,onUnitState:m}),t&&r.jsx(zf,{board:t,onUnitState:m,onCardColumn:h,onPassed:n,onSwitchSession:s})]})})}const cs=u.forwardRef(({className:e,...t},n)=>r.jsx("textarea",{ref:n,"data-slot":"textarea",className:He("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t}));cs.displayName="Textarea";function xm({className:e,...t}){return r.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:r.jsx("table",{"data-slot":"table",className:He("w-full caption-bottom text-sm",e),...t})})}function vm({className:e,...t}){return r.jsx("thead",{"data-slot":"table-header",className:He("[&_tr]:border-b",e),...t})}function ym({className:e,...t}){return r.jsx("tbody",{"data-slot":"table-body",className:He("[&_tr:last-child]:border-0",e),...t})}function Ro({className:e,...t}){return r.jsx("tr",{"data-slot":"table-row",className:He("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function kn({className:e,...t}){return r.jsx("th",{"data-slot":"table-head",className:He("text-muted-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function gn({className:e,...t}){return r.jsx("td",{"data-slot":"table-cell",className:He("p-2 align-middle whitespace-nowrap",e),...t})}const UP={rounds:"达到轮数后自动停止(每轮由 agent 执行一次内置测试流程)",bugs:"案例库新增 bug_report 数达到后自动停止",deadline:"到达截止时间后结束本轮并停止(日历点选日期与时间)",duration:"运行达到设定时长后停止(每轮结束后检查;一轮进行中不打断)"},Xg=["stopped","failed","interrupted"],Jg={name:"",task_type:"normal",brief:"",end_stage:"report",auto_fix:!1,retest:"不复测",stop_type:"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min",extra:"",date_from:"",date_to:""};function HP(e){return e.stop_type==="deadline"?e.deadline_date?{value:e.deadline_date+"T"+(e.deadline_time||"23:59")}:{err:"请选择截止日期"}:e.stop_type==="duration"?!e.dur_value||e.dur_value<=0?{err:"请填写时长"}:{value:String(Math.round(e.dur_value*{min:60,hour:3600,day:86400}[e.dur_unit]))}:e.stop_value?{value:String(e.stop_value)}:{err:"请填写停止条件"}}function VP(e){const t={stop_type:e.stop_type||"rounds",stop_value:1,deadline_date:"",deadline_time:"23:59",dur_value:30,dur_unit:"min"};if(t.stop_type==="deadline"){const[n,s]=String(e.stop_value||"").split("T");t.deadline_date=n||"",t.deadline_time=s||"23:59"}else if(t.stop_type==="duration"){const n=+e.stop_value||0;n%86400===0&&n?(t.dur_value=n/86400,t.dur_unit="day"):n%3600===0&&n?(t.dur_value=n/3600,t.dur_unit="hour"):(t.dur_value=Math.max(1,Math.round(n/60)),t.dur_unit="min")}return t}const Zg={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},Df=[{v:"gen_case",label:"测试用例生成"},{v:"execute",label:"测试"},{v:"report",label:"生成报告"},{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],Ti={normal:Df,regression:Df.filter(e=>e.v!=="gen_case")},ud=e=>(Df.find(t=>t.v===e)||{}).label||"",WP={rounds:"执行轮数",bugs:"累计新 bug",deadline:"截止时间",duration:"持续时长"},qP={queued:0,running:1,done:2,stopped:3,failed:4,interrupted:5},GP=[{k:"name",label:"任务"},{k:"status",label:"状态"},{k:"round",label:"轮次",cls:"num"},{k:"bugs",label:"新bug",cls:"num"},{k:"created",label:"创建"},{k:"ended",label:"结束"}];function KP(e){const t=e.stop_value||"";return e.stop_type==="rounds"?`执行 ${t} 轮`:e.stop_type==="bugs"?`累计新 bug ≥ ${t}`:e.stop_type==="deadline"?`截止 ${String(t).replace("T"," ")}`:e.stop_type==="duration"?`持续 ${YP(t)}`:e.stop_type}function YP(e){const t=+e;return!t||t<=0?String(e||""):t%86400===0?t/86400+" 天":t%3600===0?t/3600+" 小时":t%60===0?t/60+" 分钟":t+" 秒"}function QP({onCreated:e}={}){const t=$n(),n=t.currentProject,[s,o]=u.useState(Jg),[l,a]=u.useState(!1),[i,c]=u.useState(null),[d,f]=u.useState(!1),[m,p]=u.useState(""),[h,g]=u.useState(null),[w,j]=u.useState(1),[v,x]=u.useState(null),[y,b]=u.useState(null),[S,N]=u.useState([]),[k,C]=u.useState(null),O=t.tasks.find(E=>E.id===k)||null,{rzOn:R,rzStyle:z,rzStart:V,rzDragStart:q,rzReset:I}=lr(),[G,te]=u.useState(""),H=t.tasks.filter(E=>E.project_id===(n==null?void 0:n.id)),L=u.useMemo(()=>{const E=G.trim().toLowerCase();return E?H.filter(Y=>(Y.name||"").toLowerCase().includes(E)||(Y.session_title||"").toLowerCase().includes(E)||(Y.session_id||"").toLowerCase().includes(E)):H},[H,G]),K=u.useMemo(()=>{if(!h)return L;const E=Y=>{switch(h){case"status":return qP[Y.status]??99;case"round":return Y.current_round??0;case"bugs":return Y.new_bugs??0;case"created":return Y.created_at||"";case"ended":return Y.ended_at||"";default:return Y.name||""}};return[...H].sort((Y,A)=>{const oe=E(Y),le=E(A);return oe===le?0:oe===""||oe==null?1:le===""||le==null?-1:oe<le?-w:w})},[L,h,w]);function F(E){h!==E?(g(E),j(1)):w===1?j(-1):(g(null),j(1))}async function xe(){try{await t.updateProject(n.id,{guide_text:m}),f(!1),M("项目提示词已保存")}catch(E){M(E.message)}}async function X(){if(!i&&s.task_type==="regression"&&!s.extra.trim()){M("请填写重跑指令");return}if(!i&&s.task_type==="retest_bug"&&!s.date_from&&!s.date_to){M("复测任务需填写提交日期范围");return}if(s.date_from&&s.date_to&&s.date_from>s.date_to){M("日期范围不正确:起始晚于结束");return}const E=!i&&s.task_type==="stress"?{value:"1"}:HP(s);if(E.err){M(E.err);return}const Y={name:s.name,task_type:s.task_type,brief:s.brief.trim(),end_stage:s.end_stage||void 0,auto_fix:s.auto_fix,retest:s.retest,stop_type:s.stop_type,stop_value:E.value,extra:s.extra.trim(),date_from:s.date_from||void 0,date_to:s.date_to||void 0};try{i?(await Be.continue(i.id,Y),M("已入队,接着原会话续跑")):(await Be.create(n.id,Y),M("任务已入队"),s.task_type==="stress"&&(e==null||e("stress"))),o({...s,name:"",brief:"",extra:""}),a(!1),c(null),await t.loadTasks()}catch(A){M(A.message)}}async function Te(E){if(window.confirm(`确认删除任务「${E.name}」?
|
|
450
|
-
轮次记录一并删除(日志文件保留在磁盘),该操作不可恢复。`))try{await Be.remove(E.id),M("任务已删除"),v===E.id&&pe(),k===E.id&&C(null),await t.loadTasks()}catch(Y){M(Y.message)}}async function Pe(E,Y){try{await Be[Y](E),M(Y==="stop"?"已请求停止":"已清空轮次重启入队(从第一轮重跑)"),await t.loadTasks(),v===E&&await se(E)}catch(A){M(A.message)}}async function Re(E){if(v===E){pe();return}try{const Y=await Be.get(E);b(Y),x(E),await ve(E)}catch(Y){M(Y.message)}}async function se(E){try{b(await Be.get(E)),await ve(E)}catch(Y){M(Y.message)}}async function ve(E){N(await Be.rounds(E))}function ie(E,Y){window.open(`/log?task=${E}&round=${Y}`,"_blank")}function ue(){o({...Jg}),c(null),a(!0)}function he(E){const Y=VP(E);o({name:E.name,task_type:E.task_type||"normal",brief:"",end_stage:E.end_stage||"",auto_fix:!!E.auto_fix,retest:E.retest||"不复测",stop_type:Y.stop_type,stop_value:Y.stop_value,deadline_date:Y.deadline_date,deadline_time:Y.deadline_time,dur_value:Y.dur_value,dur_unit:Y.dur_unit,extra:E.extra||""}),c(E),a(!0)}function pe(){x(null),b(null),N([])}return r.jsxs("div",{className:"tasks-tab scroll",children:[n&&r.jsxs("div",{className:"card",children:[r.jsx("h3",{children:"项目信息"}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"项目目录"}),r.jsx("span",{className:"v",children:n.project_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"智能体"}),r.jsx("span",{className:"v",children:(n.agent_path||"").startsWith("dsh-plugin:")?`dsh(插件·进程内) ${n.agent_path.slice(11)}`:n.agent_path||"(未设置)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:n.model||"(智能体默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"工作目录"}),r.jsx("span",{className:"v",children:n.work_dir})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"环境标签"}),r.jsx("span",{className:"v",children:n.env_label||"(未设置)"})]}),r.jsxs("div",{className:"guide-block",children:[r.jsxs("div",{className:"guide-head",children:[r.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"项目附加提示词"}),r.jsx("span",{className:"hint",children:"编辑后保存;内容会加入每个任务的提示词"}),r.jsx("span",{className:"spacer"}),d?r.jsxs(r.Fragment,{children:[r.jsxs(D,{size:"sm",onClick:xe,children:[r.jsx(HN,{})," 保存"]}),r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>f(!1),children:[r.jsx(Ao,{})," 取消"]})]}):r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>{p(n.guide_text||""),f(!0)},children:[r.jsx(Yp,{})," 编辑"]})]}),d?r.jsx(cs,{value:m,onChange:E=>p(E.target.value),rows:4,placeholder:"填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息…"}):r.jsx("div",{className:"guide-read"+(n.guide_text?"":" empty"),children:n.guide_text||"未填写项目附加提示词。点击「编辑」填写如何理解项目、如何写 git commit message、如何部署项目的 skill 或相关信息;内容会加入每个任务的提示词。"})]})]}),n&&r.jsxs("div",{className:"card",children:[r.jsxs("h3",{className:"card-title-row",children:["任务列表",r.jsx("span",{className:"spacer"}),r.jsx(Ie,{className:"h-8 w-[240px]",placeholder:"搜索任务名称 / session id",value:G,onChange:E=>te(E.target.value)}),r.jsxs(D,{size:"sm",className:"ml-2",onClick:ue,children:[r.jsx(Ja,{})," 新建任务"]})]}),H.length?L.length?r.jsxs("div",{className:"tl",children:[r.jsxs("div",{className:"tl-head tl-grid",children:[GP.map(E=>r.jsxs("span",{className:"th-sort"+(E.cls?" "+E.cls:"")+(h===E.k?" on":""),onClick:()=>F(E.k),title:"点击排序:升序 → 降序 → 还原",children:[E.label,h===E.k&&(w===1?r.jsx(Rc,{className:"inline h-3 w-3"}):r.jsx(Ol,{className:"inline h-3 w-3"}))]},E.k)),r.jsx("span",{className:"tl-ops",children:"操作"})]}),K.map(E=>r.jsxs("div",{children:[r.jsxs("div",{className:"tl-row tl-grid"+(v===E.id?" open":""),onClick:()=>Re(E.id),title:v===E.id?"收起详情":"点击查看详情",children:[r.jsxs("div",{className:"tl-name",children:[E.name,E.task_type!=="normal"&&r.jsx("span",{className:"badge st-running",style:{verticalAlign:-2},children:Zg[E.task_type]||E.task_type}),E.task_type==="fix"&&(E.auto_commit||E.auto_deploy||E.auto_retest)&&r.jsxs("span",{className:"badge st-stopped",style:{verticalAlign:-2},children:[E.auto_commit?"自动提交":"",E.auto_commit&&E.auto_deploy?"/":"",E.auto_deploy?"自动部署":"",E.auto_deploy&&E.auto_retest?"/":"",E.auto_retest?"自动复测":""]}),E.error&&r.jsx("div",{className:"tl-err",children:E.error})]}),r.jsx("div",{children:r.jsxs("span",{className:"badge st-"+E.status,children:[r.jsx("span",{className:"dot"}),cr[E.status]||E.status]})}),r.jsx("div",{className:"mono num",children:E.current_round}),r.jsx("div",{className:"mono num",children:E.new_bugs}),r.jsx("div",{className:"mono",children:ns(E.created_at)}),r.jsx("div",{className:"mono",children:ns(E.ended_at)}),r.jsxs("div",{className:"tl-ops",children:[r.jsx(D,{variant:"outline",size:"sm",className:"px-2",title:"会话(查看原始对话内容,可直接在会话中继续对话)",onClick:Y=>{Y.stopPropagation(),C(E.id)},children:r.jsx($N,{})}),(E.status==="running"||E.status==="queued")&&r.jsxs(D,{variant:"outline",size:"sm",onClick:Y=>{Y.stopPropagation(),Pe(E.id,"stop")},children:[r.jsx(Qp,{})," 停止"]}),E.task_type!=="stress"&&["stopped","failed","interrupted","done"].includes(E.status)&&r.jsxs(D,{variant:"outline",size:"sm",title:"继续:修改参数后接着当前会话续跑(不新建会话、不清空轮次)",onClick:Y=>{Y.stopPropagation(),he(E)},children:[r.jsx(JN,{})," 继续"]}),(Xg.includes(E.status)||E.task_type==="stress"&&E.status==="done")&&r.jsxs(D,{variant:"outline",size:"sm",onClick:Y=>{Y.stopPropagation(),Pe(E.id,"restart")},children:[r.jsx(xf,{})," 重启"]}),E.status!=="running"&&r.jsx(D,{variant:"outline",size:"sm",className:"px-2",title:"删除任务(轮次记录一并删除,不可恢复)",onClick:Y=>{Y.stopPropagation(),Te(E)},children:r.jsx(Ks,{})})]})]}),v===E.id&&y&&r.jsxs("div",{className:"tl-detail",children:[r.jsxs("div",{className:"tl-detail-head",children:[r.jsx("b",{children:"任务详情"}),r.jsxs("span",{className:"dim",children:["「",y.name,"」"]}),r.jsx("span",{className:"spacer"}),r.jsxs(D,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:()=>se(E.id),children:[r.jsx(Da,{})," 刷新"]}),r.jsxs(D,{variant:"outline",size:"sm",className:"h-6 px-2 text-[calc(11px*var(--fs))]",onClick:pe,children:[r.jsx(Ao,{})," 收起"]})]}),r.jsxs("div",{className:"detail-grid",children:[r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"状态"}),r.jsx("span",{className:"v",children:r.jsxs("span",{className:"badge st-"+y.status,children:[r.jsx("span",{className:"dot"}),cr[y.status]||y.status]})})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"任务类型"}),r.jsx("span",{className:"v",children:Zg[y.task_type]||y.task_type})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"阶段范围"}),r.jsx("span",{className:"v",children:y.start_stage?`${ud(y.start_stage)} → ${ud(y.end_stage)||y.end_stage}`:"(按类型默认)"})]}),y.task_type==="pipeline"&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"前段任务"}),r.jsxs("span",{className:"v",children:["#",(()=>{try{return JSON.parse(y.payload||"{}").parent_task_id||"?"}catch{return"?"}})()]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"停止条件"}),r.jsxs("span",{className:"v",children:[WP[y.stop_type]||y.stop_type," · ",KP(y)]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动修复"}),r.jsx("span",{className:"v",children:y.auto_fix?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"复测"}),r.jsx("span",{className:"v",children:y.retest||"不复测"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"模型"}),r.jsx("span",{className:"v",children:y.model||"(默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"权限"}),r.jsx("span",{className:"v",children:y.permission||"(CLI 默认)"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动提交"}),r.jsx("span",{className:"v",children:y.auto_commit?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动部署"}),r.jsx("span",{className:"v",children:y.auto_deploy?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"自动复测"}),r.jsx("span",{className:"v",children:y.auto_retest?"开":"关"})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话 ID"}),r.jsx("span",{className:"v",children:y.session_id||"(首轮后生成)"})]}),y.session_title&&r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"会话标题"}),r.jsx("span",{className:"v",children:y.session_title})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"创建时间"}),r.jsx("span",{className:"v",children:ns(y.created_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"开始时间"}),r.jsx("span",{className:"v",children:ns(y.started_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"结束时间"}),r.jsx("span",{className:"v",children:ns(y.ended_at)})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"当前轮次"}),r.jsx("span",{className:"v",children:y.current_round})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增案例"}),r.jsxs("span",{className:"v",style:{color:"var(--pass)"},children:["+",y.new_cases??0]})]}),r.jsxs("div",{className:"kv",children:[r.jsx("span",{className:"k",children:"新增 bug"}),r.jsx("span",{className:"v",children:y.new_bugs})]})]}),y.error&&r.jsxs("div",{className:"detail-err",children:["错误:",y.error]}),y.extra&&r.jsxs("div",{className:"kv",style:{marginTop:8},children:[r.jsx("span",{className:"k",children:"其他要求"}),r.jsx("span",{className:"v",style:{fontFamily:"inherit",color:"var(--muted)",whiteSpace:"pre-wrap"},children:y.extra})]}),(Xg.includes(y.status)||y.task_type==="stress"&&y.status==="done")&&r.jsx("div",{className:"form-row",style:{marginTop:8},children:r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>Pe(y.id,"restart"),children:[r.jsx(xf,{})," 重启任务(清空轮次,从第一轮重跑)"]})}),r.jsxs(xm,{className:"mt-2.5 text-xs",children:[r.jsx(vm,{children:r.jsxs(Ro,{className:"hover:bg-transparent",children:[r.jsx(kn,{className:"px-2",children:"轮次"}),r.jsx(kn,{className:"px-2",children:"状态"}),r.jsx(kn,{className:"px-2",children:"退出码"}),r.jsx(kn,{className:"px-2",children:"开始"}),r.jsx(kn,{className:"px-2",children:"结束"}),r.jsx(kn,{className:"px-2",children:"日志"})]})}),r.jsxs(ym,{children:[S.map(Y=>r.jsxs(Ro,{className:"cursor-pointer",title:"新标签页查看日志",onClick:()=>ie(y.id,Y.round_no),children:[r.jsx(gn,{className:"px-2",children:Y.round_no}),r.jsx(gn,{className:"px-2",children:Y.status}),r.jsx(gn,{className:"px-2 font-mono",children:Y.exit_code==null?"—":Y.exit_code}),r.jsx(gn,{className:"px-2 font-mono text-xs",children:ns(Y.started_at)}),r.jsx(gn,{className:"px-2 font-mono text-xs",children:ns(Y.ended_at)}),r.jsx(gn,{className:"px-2 text-primary",children:"查看日志"})]},Y.round_no)),!S.length&&r.jsx(Ro,{children:r.jsx(gn,{colSpan:6,className:"px-2 text-muted-foreground",children:"尚未执行轮次"})})]})]})]})]},E.id))]}):r.jsxs("div",{className:"hint",children:["没有匹配「",G.trim(),"」的任务"]}):r.jsx("div",{className:"hint",children:"暂无任务,点击右上角「新建任务」创建"})]}),n&&r.jsx(Qt,{open:l,onOpenChange:E=>{a(E),E||c(null)},children:r.jsxs(Bt,{className:"modal modal-rz"+(R?" rz-drag":""),style:{...z,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:V,reset:I}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:q,children:i?`继续任务「${i.name}」`:"新建任务"})}),i&&r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"接着当前会话继续执行(不新建会话、历史轮次保留);停止条件中的轮数/bug 数指「再跑/再增」的数量"}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务名称"}),r.jsx(Ie,{value:s.name,onChange:E=>o({...s,name:E.target.value.trim()}),placeholder:"留空自动命名"})]}),!i&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务类型"}),r.jsxs(At,{value:s.task_type,onValueChange:E=>o(Y=>{const A={...Y,task_type:E},oe=Ti[E];return oe&&!oe.some(le=>le.v===A.end_stage)&&(A.end_stage="report"),A}),children:[r.jsx(Rt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"normal",children:"探索"}),r.jsx(Ae,{value:"regression",children:"回归"}),r.jsx(Ae,{value:"retest_bug",children:"复测(按提交范围)"}),r.jsx(Ae,{value:"stress",children:"压力测试"})]})]})]}),!i&&(s.task_type==="retest_bug"||s.task_type==="normal")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"提交日期范围"}),r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.date_from,onChange:E=>o({...s,date_from:E.target.value})}),r.jsx("span",{className:"hint",children:"至"}),r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.date_to,onChange:E=>o({...s,date_to:E.target.value})}),r.jsx("span",{className:"hint",children:s.task_type==="retest_bug"?"LLM 分析范围内提交影响的用例并执行复测(必填)":"本轮优先设计/执行与该范围提交相关的用例(选填)"})]}),!i&&Ti[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(At,{value:s.end_stage,onValueChange:E=>o({...s,end_stage:E}),children:[r.jsx(Rt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Et,{})}),r.jsx(Pt,{children:Ti[s.task_type].map(E=>r.jsx(Ae,{value:E.v,children:E.label},E.v))})]}),r.jsx("span",{className:"hint",children:"任务执行到该阶段为止;终点在「生成报告」之后会自动追加一个后段任务"})]}),i&&Ti[s.task_type]&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"任务终点"}),r.jsx("span",{className:"hint",children:ud(s.end_stage)||"(按类型默认)"})]}),s.task_type==="stress"&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0 0 8px"},children:"压测任务固定两步:第 1 轮 agent 生成压测场景 → 平台自动发压并出报告;生命周期:测试 → 生成报告。不支持「继续」,重启=重跑。"}),r.jsxs("div",{className:"form-col",children:[r.jsx(et,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:"压测说明(目标服务地址、关注接口、并发/时长期望)"}),r.jsx(cs,{value:s.brief,onChange:E=>o({...s,brief:E.target.value}),rows:4,placeholder:"例如:目标 http://127.0.0.1:8080,压 /api/order 下单与 /api/order/123 查询,按 10→50→100 并发各 1 分钟"})]})]}),!i&&(s.task_type==="normal"||s.task_type==="regression")&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试任务行为:测试中发现的 bug 由 agent 自动修复代码",children:"自动修复 bug"}),r.jsx("input",{type:"checkbox",checked:s.auto_fix,onChange:E=>o({...s,auto_fix:E.target.checked})}),r.jsx("label",{style:{marginLeft:14},children:"复测"}),r.jsxs(At,{value:s.retest,onValueChange:E=>o({...s,retest:E}),children:[r.jsx(Rt,{size:"sm",className:"min-w-[130px]",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"不复测",children:"不复测"}),r.jsx(Ae,{value:"全部失败用例",children:"全部失败用例"}),r.jsx(Ae,{value:"指定范围复测",children:"指定范围复测"})]})]})]}),s.task_type!=="stress"&&r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"停止条件"}),r.jsxs(At,{value:s.stop_type,onValueChange:E=>o({...s,stop_type:E}),children:[r.jsx(Rt,{size:"sm",className:"min-w-[120px]",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"rounds",children:"执行轮数"}),r.jsx(Ae,{value:"bugs",children:"累计新 bug 数"}),r.jsx(Ae,{value:"deadline",children:"截止时间"}),r.jsx(Ae,{value:"duration",children:"持续时长"})]})]}),(s.stop_type==="rounds"||s.stop_type==="bugs")&&r.jsx(Ie,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.stop_value,onChange:E=>o({...s,stop_value:E.target.value===""?"":+E.target.value})}),s.stop_type==="deadline"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{type:"date",className:"h-8 w-auto",value:s.deadline_date,onChange:E=>o({...s,deadline_date:E.target.value})}),r.jsx(Ie,{type:"time",className:"h-8 w-[110px]",value:s.deadline_time,onChange:E=>o({...s,deadline_time:E.target.value})})]}),s.stop_type==="duration"&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{type:"number",min:"1",className:"h-8 w-[90px]",value:s.dur_value,onChange:E=>o({...s,dur_value:E.target.value===""?"":+E.target.value})}),r.jsxs(At,{value:s.dur_unit,onValueChange:E=>o({...s,dur_unit:E}),children:[r.jsx(Rt,{size:"sm",className:"min-w-[70px]",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"min",children:"分钟"}),r.jsx(Ae,{value:"hour",children:"小时"}),r.jsx(Ae,{value:"day",children:"天"})]})]})]}),r.jsx("span",{className:"hint",children:UP[s.stop_type]||""})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(et,{className:"text-xs text-muted-foreground",style:{marginBottom:2},children:!i&&s.task_type==="regression"?"重跑指令(必填:描述要重跑的范围,如模块 / 用例 ID / 变更说明)":"其他要求(选填,原样传给 agent)"}),r.jsx(cs,{value:s.extra,onChange:E=>o({...s,extra:E.target.value}),rows:3,placeholder:!i&&s.task_type==="regression"?"例如:重跑登录模块全部用例;或:本次变更涉及订单接口,重跑 ORD-003、ORD-004":"自由填写,例如:本轮优先测试订单模块;只读代码,不要提出修复方案;执行前先阅读 src/X 目录……"})]})]}),r.jsxs(vn,{className:"flex-none",children:[r.jsx(D,{variant:"outline",onClick:()=>{a(!1),c(null)},children:"取消"}),r.jsx(D,{onClick:X,children:i?"继续执行":"开始任务"})]})]})}),O&&r.jsx(Oc,{task:O,onClose:()=>C(null)})]})}let Mr=null,$i=null,Ii=null;function Ai(e,t){if(e==null||t==null||e===t)return t;try{return JSON.stringify(t)===JSON.stringify(e)?e:t}catch{return t}}function ex(e,t){const n=Fs.getState();t({project:e.project||n.project,live:Ai(n.live,e.live),library:Ai(n.library,e.library),bugs:Ai(n.bugs,e.bugs||[]),rounds:Ai(n.rounds,e.rounds||[]),updatedAt:e.generated_at||""})}const Fs=Fp((e,t)=>({connected:!1,project:null,live:null,library:null,bugs:[],rounds:[],updatedAt:"",connect:async n=>{Mr&&Ii===n||(t().disconnect(),Ii=n,Mr=ng.stream(n),Mr.onopen=()=>e({connected:!0}),Mr.onerror=()=>e({connected:!1}),Mr.onmessage=s=>{try{const o=JSON.parse(s.data);if(o.error)return;ex(o,e)}catch{}},$i=setInterval(()=>t().fetchSnapshot(),3e4),await t().fetchSnapshot())},fetchSnapshot:async()=>{try{const n=await ng.state(Ii);n&&!n.error&&ex(n,e)}catch{}},disconnect:()=>{Mr&&(Mr.close(),Mr=null),$i&&(clearInterval($i),$i=null),Ii=null,e({connected:!1})}}));function Ff(e){return/已拒绝/.test(e)?"reject":/复测通过/.test(e)?"pass":/已修复/.test(e)?"fix":/已分析/.test(e)||/修复方案/.test(e)?"run":/待分析/.test(e)||/复测未通过/.test(e)?"retest":"pending"}const tx=[["retest","R","复测"],["angle","1","角度"],["scan","2","盘点"],["generate","3","生成"],["review","4","判重"],["execute","5","执行"],["cluster","6","聚类"],["analyze","7","分析"],["fix","7b","修复"],["wrapup","8","收尾"]],XP={通过:"pass",失败:"fail",需要复测:"retest",跳过:"skip",未执行:"pending"},JP={round_start:["轮次","ev-round"],phase:["阶段","ev-phase"],proposal:["提案",""],reject:["拒绝","ev-reject"],case_start:["开始",""],case_pass:["通过","ev-pass"],case_fail:["失败","ev-fail"],case_skip:["跳过",""],bug_new:["新Bug","ev-bug"],bug_append:["补证据","ev-bug"],analyze_done:["分析","ev-fix"],fix_done:["修复","ev-fix"],note:["备注",""]},ZP={all:null,fail:e=>e.type==="case_fail"||e.type==="bug_new",case:e=>e.type.startsWith("case_"),phase:e=>e.type==="phase"||e.type==="round_start",bug:e=>e.type==="bug_new"||e.type==="bug_append"||e.type==="analyze_done"||e.type==="fix_done"},eM={all:"全部",fail:"失败",case:"用例",phase:"阶段",bug:"Bug"},tM=["all","fail","case","phase","bug"],ua=["status","module","trend","bug","funnel"],nM={status:{title:"案例库状态"},module:{title:"模块通过率"},trend:{title:"轮次趋势"},bug:{title:"Bug 统计"},funnel:{title:"产出漏斗"}},nx=[["pending","待处理","var(--dim)"],["run","已出方案","var(--run)"],["retest","待分析/复测未过","var(--retest)"],["fix","已修复","var(--fix)"],["pass","复测通过","var(--pass)"],["reject","已拒绝","var(--dim)"]],Zw="ts.chartSlots";function sM(){try{const e=JSON.parse(localStorage.getItem(Zw)||"null");if(Array.isArray(e)&&e.length===3&&e.every(t=>ua.includes(t))&&new Set(e).size===3)return e}catch{}return["status","module","trend"]}const wo={tree:"ts.treeW",side:"ts.sideW",chartsH:"ts.chartsH",c1:"ts.c1w",c2:"ts.c2w"},zs={tree:"tree",side:"side",chartsH:"chartsH",c1:"c1",c2:"c2"},ct=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),dd=e=>XP[e]||"pending",rM=e=>{const t=new Date(String(e).replace(" ","T"));return isNaN(t)?null:t},oM=e=>{const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60);return(n?n+"h":"")+(s?s+"m":"")+t%60+"s"},Oi=(e,t,n)=>Math.max(t,Math.min(n,e));function lM({project:e}){var Tt;const t=e==null?void 0:e.id,n=Fs(P=>P.connected),s=Fs(P=>P.live),o=Fs(P=>P.library),l=Fs(P=>P.bugs),a=Fs(P=>P.rounds),i=Fs(P=>P.updatedAt),c=u.useRef(null),d=u.useRef(null),f=u.useRef(null),m=u.useRef(null),p=u.useRef(null),[h,g]=u.useState(null),[w,j]=u.useState("all"),[v,x]=u.useState(!0),[y,b]=u.useState(sM);function S(P,B){b(J=>{const ae=new Set(J.filter((Oe,qe)=>qe!==P));let ce=J[P];do ce=ua[(ua.indexOf(ce)+B+ua.length)%ua.length];while(ae.has(ce));const fe=[...J];return fe[P]=ce,localStorage.setItem(Zw,JSON.stringify(fe)),fe})}const[N,k]=u.useState(()=>new Set),[C,O]=u.useState(""),R=u.useRef({}),z=u.useRef(null),V=u.useRef(null),q=u.useRef(0),I=u.useRef(""),G=u.useRef("all"),te=u.useRef(!1),H=!!(s&&s.phase&&s.phase!=="done"&&s.phase!=="idle"),L=tx.findIndex(P=>P[0]===(s==null?void 0:s.phase)),K=(s==null?void 0:s.phase)==="done",F=s?s.phase==="done"?{cls:"done",text:"本轮运行已结束"}:{cls:"running",text:s.phase_label||s.phase||"运行中"}:{cls:"idle",text:"空闲(未在运行)"},xe=(()=>{const P=s==null?void 0:s.stop_condition;return P!=null&&P.label?"停止条件: "+P.label+(P.new_bugs!=null?" · 新Bug "+P.new_bugs:"")+(P.target_bugs!=null?"/"+P.target_bugs:""):""})(),X=n?"":"down";function Te(P){let B=P.cases.length;for(const J of P.children)B+=Te(J);return B}const Pe=(Tt=s==null?void 0:s.current_case)==null?void 0:Tt.id,Re=u.useMemo(()=>{const P=o;if(!P)return{__html:""};function B(ae){let ce="";for(const fe of ae.cases){R.current[fe.id]=fe;const Oe=Pe===fe.id,qe=dd(fe.status);ce+=`<div class="case${h===fe.id?" selected":""}${Oe?" running":""}" data-id="${fe.id}" title="${ct(fe.point||fe.name)}"><span class="dot ${Oe?"":qe}"></span><span class="cid">${fe.id}</span><span class="cname">${ct(fe.name)}</span></div>`}for(const fe of ae.children){const Oe=N.has(fe.path)?"":" open";ce+=`<details data-path="${ct(fe.path)}"${Oe}><summary><span class="arrow">▶</span><span>${ct(fe.name)}</span><span class="fcount">${Te(fe)}</span>${fe.desc?`<span class="fdesc">${ct(fe.desc)}</span>`:""}</summary><div class="folder-body">${B(fe)}</div></details>`}return ce}return{__html:P.tree.children.length||P.tree.cases.length?B(P.tree):'<div class="empty">案例库为空——运行测试任务生成用例后在此展示。</div>'}},[o,N,h,Pe]);function se(P){const B=[];for(const J of P.children)B.push(J.path),B.push(...se(J));return B}function ve(){k(new Set)}function ie(){const P=o;P&&k(new Set(se(P.tree)))}function ue(P){const B=P.target.closest(".case");if(!B)return;const J=B.dataset.id;g(ae=>{const ce=ae===J?null:J;return ce?localStorage.setItem("ts_monitor_pick",JSON.stringify({proj:t,id:ce})):localStorage.removeItem("ts_monitor_pick"),ce})}u.useEffect(()=>{const P=d.current;if(!P)return;const B=J=>{const ae=J.target;ae.tagName==="DETAILS"&&ae.dataset.path&&k(ce=>{const fe=new Set(ce);return ae.open?fe.delete(ae.dataset.path):fe.add(ae.dataset.path),fe})};return P.addEventListener("toggle",B),()=>P.removeEventListener("toggle",B)},[]);function he(P){return!P.request&&!P.response?"":'<details class="payload"><summary>请求 / 返回</summary>'+(P.request?`<div class="plabel">请求</div><pre>${ct(P.request)}</pre>`:"")+(P.response?`<div class="plabel">返回</div><pre>${ct(P.response)}</pre>`:"")+"</details>"}function pe(P){const B=JP[P.type]||["事件",""];return`<div class="ev ${B[1]}"><span class="ts">${ct(P.ts||"")}</span><span class="badge">${B[0]}</span>`+(P.case_id?`<span class="cid">${P.case_id}</span>`:"")+`<span class="msg">${ct(P.message||"")}</span>${he(P)}</div>`}function E(){return'<div id="feed-empty">'+(s?"(当前筛选下暂无事件)":"当前没有运行中的测试。<br>在会话中开启实时监控后,运行期间的事件会实时出现在这里。")+"</div>"}function Y(){const P=(s==null?void 0:s.events)||[],B=ZP[w],J=B?P.filter(B):P,ae=J.length?JSON.stringify(J[0]):"",ce=f.current;ce&&(w!==G.current||ae!==I.current||J.length<q.current?(G.current=w,I.current=ae,ce.innerHTML=J.length?J.map(pe).join(""):E(),q.current=J.length):J.length>q.current&&(q.current===0&&(ce.innerHTML=""),ce.insertAdjacentHTML("beforeend",J.slice(q.current).map(pe).join("")),q.current=J.length),v&&(ce.scrollTop=ce.scrollHeight))}u.useEffect(()=>{Y(),Ms()},[w,o,s,a]);function A(P){const B={pass:0,fail:0,retest:0,pending:0,total:0};return function J(ae){for(const ce of ae.cases){let fe=dd(ce.status);fe==="skip"&&(fe="pending"),B[fe]=(B[fe]||0)+1,B.total++}for(const ce of ae.children)J(ce)}(P),B}const oe=u.useMemo(()=>{const P=o==null?void 0:o.stats;if(!P)return{sub:"",body:""};const B=P.total,J=B?Math.round(P.passed/B*100):0,ae=[["通过",P.passed,"var(--pass)"],["失败",P.failed,"var(--fail)"],["需复测",P.retest,"var(--retest)"],["未执行",P.pending+P.skipped,"var(--dim)"]];let ce=0;const fe=ae.filter(Oe=>Oe[1]>0).map(Oe=>{const qe=B?Oe[1]/B*100:0,Qe=Math.max(0,qe-1.5),Xe=`<circle cx="21" cy="21" r="15.915" fill="none" stroke="${Oe[2]}" stroke-width="6" pathLength="100" stroke-linecap="round" stroke-dasharray="${Qe} ${100-Qe}" stroke-dashoffset="${25-ce}"/>`;return ce+=qe,Xe}).join("");return{sub:`通过率 <b class="hl-pass">${J}%</b>`,body:'<div class="cbody">'+(B?`<svg viewBox="0 0 42 42" class="donut">${fe}<text x="21" y="19.5" class="dnum" text-anchor="middle">${B}</text><text x="21" y="26" class="dsub" text-anchor="middle">用例</text></svg><div class="dlegend">${ae.map(Oe=>`<div class="li"><span class="sw" style="background:${Oe[2]}"></span>${Oe[0]}<span class="lm">${Oe[1]}</span><span class="pct">${B?Math.round(Oe[1]/B*100):0}%</span></div>`).join("")}</div>`:'<div class="empty">案例库为空</div>')+"</div>"}},[o]),le=u.useMemo(()=>{const P=o;if(!P)return{sub:"",body:""};let B=P.tree;for(;B.children.length===1&&!B.cases.length&&B.children[0].children.length;)B=B.children[0];const J=B.children.map(ae=>({name:ae.name,a:A(ae)})).filter(ae=>ae.a.total>0);return B.cases.length&&J.push({name:"(根目录)",a:A({cases:B.cases,children:[]})}),J.sort((ae,ce)=>ce.a.total-ae.a.total),{sub:`${J.length} 个分类`,body:'<div class="cbody">'+(J.length?`<div class="mbars">${J.map(ae=>{const ce=ae.a.total,fe=ce?Math.round(ae.a.pass/ce*100):0,Oe=(qe,Qe)=>ae.a[qe]?`<div class="seg ${Qe}" style="width:${ae.a[qe]/ce*100}%"></div>`:"";return`<div class="mbar-row"><span class="mbar-label" title="${ct(ae.name)}">${ct(ae.name)}</span><div class="mbar-track"><div class="mbar-inner">${Oe("pass","pass")}${Oe("fail","fail")}${Oe("retest","retest")}${Oe("pending","pending")}</div></div><span class="mbar-num" title="通过/总数"><b class="hl-pass">${ae.a.pass}</b><em>/${ce}</em><i class="pctn">${fe}%</i></span></div>`}).join("")}</div>`:'<div class="empty">案例库为空</div>')+'</div><div class="mlegend"><span><span class="sw" style="background:var(--pass)"></span>通过</span><span><span class="sw" style="background:var(--fail)"></span>失败</span><span><span class="sw" style="background:var(--retest)"></span>需复测</span><span><span class="sw" style="background:var(--dim)"></span>未执行</span></div>'}},[o]),Ne=u.useMemo(()=>{const P=a||[];if(!P.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无轮次记录</div></div>'};const B=340,J=126,ae=30,ce=20,fe=22,Oe=Math.max(1,...P.map(tt=>tt.passed+tt.failed)),qe=(B-fe)/P.length,Qe=Math.min(34,qe*.52),Xe=J-ce,wt=J-ae-ce;let jn="";for(let tt=0;tt<=2;tt++){const $t=Xe-wt*(tt/2);jn+=`<line x1="${fe}" y1="${$t}" x2="${B-2}" y2="${$t}" class="t-grid"/>`,jn+=`<text x="${fe-5}" y="${$t+2.5}" class="t-ytick" text-anchor="end">${Math.round(Oe*tt/2)}</text>`}let Jt="";return P.forEach((tt,$t)=>{const dn=Math.round(fe+$t*qe+(qe-Qe)/2),qt=Math.round(fe+$t*qe+qe/2),nt=Math.round(tt.passed/Oe*wt),It=Math.round(tt.failed/Oe*wt);nt&&(Jt+=`<rect x="${dn}" y="${Xe-nt}" width="${Qe}" height="${nt}" fill="url(#grad-pass)" rx="2"><title>第 ${tt.round} 轮 通过 ${tt.passed}</title></rect>`),It&&(Jt+=`<rect x="${dn}" y="${Xe-nt-It}" width="${Qe}" height="${It}" fill="url(#grad-fail)" rx="2"><title>第 ${tt.round} 轮 失败 ${tt.failed}</title></rect>`);const Pn=tt.passed+tt.failed,Zn=Xe-nt-It;tt.new_bugs>0&&(Jt+=`<text x="${qt}" y="${Zn-16}" class="t-bug" text-anchor="middle">+${tt.new_bugs}bug</text>`),Pn>0&&(Jt+=`<text x="${qt}" y="${Zn-6}" class="t-val" text-anchor="middle">${Pn}</text>`),Jt+=`<text x="${qt}" y="${J-5}" class="t-lab" text-anchor="middle">R${tt.round}</text>`}),{sub:"绿通过 / 红失败 · 黄字=新建Bug",body:`<div class="cbody"><svg viewBox="0 0 ${B} ${J}" class="trend" preserveAspectRatio="xMidYMid meet"><defs><linearGradient id="grad-pass" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-pass-1)"/><stop offset="1" stop-color="var(--grad-pass-2)"/></linearGradient><linearGradient id="grad-fail" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="var(--grad-fail-1)"/><stop offset="1" stop-color="var(--grad-fail-2)"/></linearGradient></defs><line x1="${fe}" y1="${Xe}" x2="${B-2}" y2="${Xe}" class="t-axis"/>${jn}${Jt}</svg></div>`}},[a]),Ge=u.useMemo(()=>{const P=l||[];if(!P.length)return{sub:"",body:'<div class="cbody"><div class="empty">暂无 bug 报告</div></div>'};const B={};for(const ce of P){const fe=Ff(ce.status);B[fe]=(B[fe]||0)+1}const J=Math.max(1,...nx.map(ce=>B[ce[0]]||0)),ae=nx.filter(ce=>B[ce[0]]>0).map(([ce,fe,Oe])=>`<div class="mbar-row"><span class="mbar-label" title="${fe}">${fe}</span><div class="mbar-track"><div class="bbar" style="width:${B[ce]/J*100}%;background:${Oe}"></div></div><span class="mbar-num"><b>${B[ce]}</b><i class="pctn">${Math.round(B[ce]/P.length*100)}%</i></span></div>`).join("");return{sub:`共 <b>${P.length}</b> 个`,body:`<div class="cbody"><div class="mbars">${ae}</div></div>`}},[l]),dt=u.useMemo(()=>{var Oe;const P=s==null?void 0:s.stats;if(!P||P.proposed==null&&P.accepted==null&&P.executed==null)return{sub:"",body:'<div class="cbody"><div class="empty">暂无运行统计</div></div>'};const B=[["提案",P.proposed],["入库",P.accepted],["执行",P.executed],["通过",P.passed]],J=Math.max(1,...B.map(qe=>qe[1]||0));let ae=null;const ce=B.map(([qe,Qe])=>{const Xe=ae!=null&&ae>0&&Qe!=null?Math.round(Qe/ae*100)+"%":"—";return ae=Qe,`<div class="frow"><span class="fl">${qe}</span><div class="ftrack"><div class="fbar" style="width:${Qe?Math.round(Qe/J*100):0}%"></div></div><span class="fr">${Qe??"—"} · ${Xe}</span></div>`}).join("");let fe="";if((Oe=s==null?void 0:s.options)!=null&&Oe.auto_fix&&P.fixed!=null){const qe=Math.max(1,P.failed||0);fe=`<div class="frow fixbar"><span class="fl">已修复</span><div class="ftrack"><div class="fbar" style="width:${Math.round((P.fixed||0)/qe*100)}%"></div></div><span class="fr">${P.fixed} / ${P.failed??0}</span></div>`}return{sub:P.rejected>0?`拒绝 <b>${P.rejected}</b>`:"",body:`<div class="cbody"><div class="funnel">${ce}${fe}</div></div>`}},[s]),Ze={status:oe,module:le,trend:Ne,bug:Ge,funnel:dt},ft=u.useMemo(()=>{const P=o==null?void 0:o.stats;return P?{__html:`<span class="chip"><span class="dot pass"></span><b>${P.passed}</b></span><span class="chip"><span class="dot fail"></span><b>${P.failed}</b></span><span class="chip"><span class="dot retest"></span><b>${P.retest}</b></span><span class="chip"><span class="dot pending"></span><b>${P.pending+P.skipped}</b></span><span class="chip">共 <b>${P.total}</b></span>`}:null},[o]);function kt(P){const B=(s==null?void 0:s.events)||[];for(let J=B.length-1;J>=0;J--){const ae=B[J];if(ae.case_id===P&&(ae.request||ae.response))return ae}return null}const on=u.useMemo(()=>{var Xe,wt;const P=s,B=h||((Xe=P==null?void 0:P.current_case)==null?void 0:Xe.id),J=B?R.current[B]:null,ae=!!(P&&((wt=P.current_case)==null?void 0:wt.id)===B&&P.phase!=="done"),ce=B?kt(B):null;if(!B)return{__html:'<h3>用例详情</h3><div class="empty">点击左侧用例查看详情;运行中默认显示当前用例。</div>'};const fe=J||P&&P.current_case,Oe=ae?"执行中":J?J.status:"",qe=J&&J.bug_report&&J.bug_report!=="无"?J.bug_report:"";let Qe="<h3>用例详情"+(h?"":"(当前执行)")+`</h3><div class="kv"><span class="k">ID</span><span class="v mono">${ct(B)}</span></div><div class="kv"><span class="k">名称</span><span class="v">${ct(J?J.name:fe&&fe.name||"")}</span></div>`+(J&&J.point?`<div class="kv"><span class="k">测试点</span><span class="v">${ct(J.point)}</span></div>`:"")+`<div class="kv"><span class="k">状态</span><span class="v"><span class="badge-st ${ae?"run":dd(Oe)}">${ct(Oe||"—")}</span></span></div>`+(J&&J.fail_reason?`<div class="kv"><span class="k">失败原因</span><span class="v">${ct(J.fail_reason)}</span></div>`:"")+(J&&J.summary?`<div class="kv"><span class="k">结果摘要</span><span class="v">${ct(J.summary)}</span></div>`:"")+(J&&J.last_run?`<div class="kv"><span class="k">最近执行</span><span class="v mono">${ct(J.last_run)}</span></div>`:"")+(qe?`<div class="kv"><span class="k">bug_report</span><span class="v mono">${ct(qe)}</span></div>`:"");return ce&&(Qe+=`<div class="plabel">请求</div><pre>${ct(ce.request||"(无记录)")}</pre><div class="plabel">返回</div><pre>${ct(ce.response||"(无记录)")}</pre>`),{__html:Qe}},[h,s]),wn=u.useMemo(()=>{var B;const P=s==null?void 0:s.stats;return{__html:P?`本轮: 提案 <b>${P.proposed??"—"}</b> · 入库 <b>${P.accepted??"—"}</b> · 拒绝 <b>${P.rejected??"—"}</b> · 已执行 <b>${P.executed??"—"}</b> · 通过 <b style="color:var(--pass)">${P.passed??0}</b> · 失败 <b style="color:var(--fail)">${P.failed??0}</b> · 跳过 <b>${P.skipped??0}</b> · 新建Bug <b style="color:var(--fail)">${P.new_bug_reports??0}</b>`+(P.fixed!=null&&((B=s==null?void 0:s.options)!=null&&B.auto_fix)?` · 已修复 <b style="color:var(--fix)">${P.fixed}</b>`:""):"案例库统计见左侧。"}},[s]),de=u.useMemo(()=>{var J;const P=(J=s==null?void 0:s.priorities)==null?void 0:J.levels;return!Array.isArray(P)||!P.length?null:{__html:'<div class="prio-title">测试进度(按功能分级)</div>'+P.map(ae=>{const ce=Array.isArray(ae.domains)?ae.domains:[],fe=ce.length,Oe=ce.filter(Xe=>Xe.status==="已覆盖").length,qe=fe?Math.round(Oe/fe*100):0,Qe=ce.map(Xe=>`<span class="pchip${Xe.status==="已覆盖"?" ok":""}" title="${ct(Xe.name)}:${ct(Xe.status||"未覆盖")}">${ct(Xe.name)}</span>`).join("");return`<div class="prio-row"><span class="prio-level">${ct(ae.level||"")}</span><span class="prio-label">${ct(ae.label||"")}</span><span class="prio-track"><span class="prio-in" style="width:${qe}%"></span></span><span class="prio-num">${Oe}<em>/${fe}</em></span><span class="prio-chips">${Qe}</span></div>`}).join("")}},[s]),Q={tree:300,side:370,chartsH:176,chartRatio:[1,1.15,1.35]},Ve=.22;function Xt(){const P=getComputedStyle(m.current),B=parseFloat(P.getPropertyValue("--c1-fr"))||Q.chartRatio[0],J=parseFloat(P.getPropertyValue("--c2-fr"))||Q.chartRatio[1],ae=parseFloat(P.getPropertyValue("--c3-fr"))||Q.chartRatio[2],ce=B+J+ae;return[B/ce,J/ce,ae/ce]}function Un(P){const B=m.current;B.style.setProperty("--c1-fr",P[0]+"fr"),B.style.setProperty("--c2-fr",P[1]+"fr"),B.style.setProperty("--c3-fr",P[2]+"fr")}function Wt(P,B){if(P.button!==0||P.detail>1)return;const J=c.current.querySelector(".m-main"),ae=m.current;if(!J||!ae)return;const ce=()=>B==="tree"?parseInt(getComputedStyle(J).getPropertyValue("--tree-w"),10)||Q.tree:B==="side"?parseInt(getComputedStyle(J).getPropertyValue("--side-w"),10)||Q.side:B==="chartsH"?ae.getBoundingClientRect().height||Q.chartsH:0,fe=dn=>{B==="tree"?J.style.setProperty("--tree-w",Oi(dn,180,600)+"px"):B==="side"?J.style.setProperty("--side-w",Oi(dn,260,720)+"px"):B==="chartsH"&&(ae.style.height=Oi(dn,150,520)+"px")},Oe=ce(),qe=B==="chartsH"?P.clientY:P.clientX,Qe=B==="side",Xe=B==="chartsH",wt=B==="c1"||B==="c2",jn=wt?Xt():null,Jt=P.currentTarget;Jt.classList.add("drag"),document.body.classList.add(Xe?"resizing-y":"resizing-x");const tt=dn=>{let qt=(Xe?dn.clientY:dn.clientX)-qe;if(Qe&&(qt=-qt),wt){const nt=[...jn],It=B==="c1"?0:1,Pn=[0,1,2].filter(it=>it!==It),Zn=ae.getBoundingClientRect().width,jr=qt/Math.max(1,Zn);let gs=nt[It]+jr;gs=Oi(gs,Ve,1-2*Ve);const Ts=1-gs,fn=1-nt[It];fn>1e-4&&(nt[It]=gs,nt[Pn[0]]=nt[Pn[0]]/fn*Ts,nt[Pn[1]]=nt[Pn[1]]/fn*Ts),Un(nt)}else fe(Oe+qt)},$t=()=>{Jt.classList.remove("drag"),document.body.classList.remove("resizing-x","resizing-y"),document.removeEventListener("mousemove",tt),document.removeEventListener("mouseup",$t),wt?localStorage.setItem(wo.c1,JSON.stringify(Xt())):localStorage.setItem(wo[B],String(Math.round(ce())))};document.addEventListener("mousemove",tt),document.addEventListener("mouseup",$t)}function ln(P){const B=c.current.querySelector(".m-main"),J=m.current;P==="tree"?B.style.removeProperty("--tree-w"):P==="side"?B.style.removeProperty("--side-w"):P==="chartsH"?J.style.height="":(J.style.removeProperty("--c1-fr"),J.style.removeProperty("--c2-fr"),J.style.removeProperty("--c3-fr")),localStorage.removeItem(wo[P])}function at(){const P=c.current.querySelector(".m-main"),B=m.current;if(!(!P||!B))try{const J=+localStorage.getItem(wo.tree);J>0&&P.style.setProperty("--tree-w",J+"px");const ae=+localStorage.getItem(wo.side);ae>0&&P.style.setProperty("--side-w",ae+"px");const ce=+localStorage.getItem(wo.chartsH);ce>0&&(B.style.height=ce+"px");const fe=JSON.parse(localStorage.getItem(wo.c1)||"null");Array.isArray(fe)&&fe.length===3&&Un(fe)}catch{}}function Ms(){if(!te.current)try{const P=JSON.parse(localStorage.getItem("ts_monitor_pick")||"null");P&&P.proj===t&&R.current[P.id]&&(g(P.id),te.current=!0)}catch{}}function hs(){const P=Fs.getState().live;V.current=(P==null?void 0:P.live_mtime)!=null?Date.now()/1e3-P.live_mtime:null,z.current&&p.current&&(p.current.textContent="已运行 "+oM(Date.now()-z.current.getTime()));const B=P&&P.phase&&P.phase!=="done"&&P.phase!=="idle";V.current!=null&&B&&V.current>30?O("状态文件 "+Math.round(V.current)+"s 未更新"):O("")}return u.useEffect(()=>{at();const P=setInterval(hs,1e3);return()=>clearInterval(P)},[]),u.useEffect(()=>{t&&Fs.getState().connect(t)},[t]),u.useEffect(()=>()=>{Fs.getState().disconnect()},[]),u.useEffect(()=>{z.current==null&&(s!=null&&s.run_started_at)&&(z.current=rM(s.run_started_at))},[s]),r.jsxs("div",{className:"monitor-tab",ref:c,children:[r.jsxs("header",{className:"m-head",children:[r.jsxs("div",{className:"logo",children:[r.jsx("span",{className:"pulse"+(H?" on":"")}),"Free-Style 测试监控",r.jsxs("span",{style:{color:"var(--dim)"},children:[" · ",e==null?void 0:e.name]})]}),r.jsx("span",{className:"pill "+F.cls,children:F.text}),(s==null?void 0:s.round)!=null&&r.jsx("span",{className:"pill mono",children:"第 "+s.round+" 轮"}),z.current&&r.jsx("span",{className:"pill mono",ref:p}),xe&&r.jsx("span",{className:"pill",children:xe}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"自动修复: "+(s.options.auto_fix?"开":"关")}),(s==null?void 0:s.options)&&r.jsx("span",{className:"pill",children:"复测: "+(s.options.retest||"不复测")}),r.jsx("div",{className:"spacer"}),C&&r.jsx("span",{className:"pill warn",children:C}),r.jsx("span",{className:X,title:"与监控服务器的连接状态"})]}),r.jsx("nav",{className:"phases",children:tx.map((P,B)=>r.jsxs("span",{className:"step"+(K||B<L?" done":"")+(!K&&B===L?" active":""),children:[r.jsx("span",{className:"no",children:P[1]}),P[2]]},P[0]))}),r.jsxs("div",{className:"m-main",children:[r.jsxs("aside",{className:"tree-panel",children:[r.jsxs("div",{className:"panel-head",children:["案例库 ",r.jsx("span",{className:"lib-stats",dangerouslySetInnerHTML:ft||void 0}),r.jsx("div",{className:"spacer"}),r.jsxs("div",{className:"tree-tools",children:[r.jsx("span",{className:"tbtn",onClick:ve,children:"全部展开"}),r.jsx("span",{className:"tbtn",onClick:ie,children:"全部折叠"})]})]}),r.jsx("div",{className:"panel-body",ref:d,onClick:ue,dangerouslySetInnerHTML:Re})]}),r.jsx("div",{className:"vsplit",onMouseDown:P=>Wt(P,zs.tree),onDoubleClick:()=>ln(zs.tree)}),r.jsxs("section",{className:"feed-panel",children:[r.jsx("div",{className:"charts",ref:m,children:y.map((P,B)=>{const J=Ze[P];return r.jsxs(u.Fragment,{children:[B>0&&r.jsx("div",{className:"vsplit",onMouseDown:ae=>Wt(ae,B===1?zs.c1:zs.c2),onDoubleClick:()=>ln(B===1?zs.c1:zs.c2)}),r.jsxs("div",{className:"chart",children:[r.jsxs("h4",{children:[r.jsx("span",{className:"t",children:nM[P].title}),r.jsx("span",{className:"sub",dangerouslySetInnerHTML:{__html:J.sub||""}}),r.jsxs("span",{className:"bswitch",children:[r.jsx("span",{className:"swbtn",title:"上一张图",onClick:()=>S(B,-1),children:"‹"}),r.jsx("span",{className:"swbtn",title:"下一张图",onClick:()=>S(B,1),children:"›"})]})]}),r.jsx("div",{className:"cwrap",dangerouslySetInnerHTML:{__html:J.body}})]})]},P)})}),r.jsx("div",{className:"hsplit",onMouseDown:P=>Wt(P,zs.chartsH),onDoubleClick:()=>ln(zs.chartsH)}),r.jsxs("div",{className:"panel-head",children:["实时事件流",r.jsx("div",{className:"feed-tools",children:tM.map(P=>r.jsx("span",{className:"chip fchip"+(w===P?" on":""),"data-f":P,onClick:()=>j(P),children:eM[P]},P))}),r.jsx("div",{className:"spacer"}),r.jsxs("label",{className:"chip fchip on",style:{cursor:"pointer"},children:[r.jsx("input",{type:"checkbox",checked:v,onChange:P=>x(P.target.checked),style:{verticalAlign:-1}})," 自动滚动"]})]}),r.jsx("div",{className:"feed",ref:f})]}),r.jsx("div",{className:"vsplit",onMouseDown:P=>Wt(P,zs.side),onDoubleClick:()=>ln(zs.side)}),r.jsx("aside",{className:"side-panel",dangerouslySetInnerHTML:on})]}),de&&r.jsx("section",{className:"prio-bar",dangerouslySetInnerHTML:de}),r.jsxs("footer",{className:"statusbar",children:[r.jsx("span",{dangerouslySetInnerHTML:wn}),r.jsx("div",{className:"spacer"}),r.jsx("span",{children:"数据更新于 "+(i||"—")})]})]})}const aM=e=>/复测通过|已拒绝/.test(e||"");function iM(e){return e==="running"?"run":e==="done"?"pass":e==="failed"?"retest":"pending"}function cM(e){return e==="通过"?"pass":e==="失败"?"retest":e==="需要复测"?"run":"pending"}const uM=(e,t,n)=>Math.max(t,Math.min(n,e));function dM({project:e}){const t=e==null?void 0:e.id,n=$n(),s=n.bugs,o=u.useRef(null),[l,a]=u.useState(null),i=u.useRef(null),[c,d]=u.useState(null),[f,m]=u.useState("report"),p=u.useRef("report"),[h,g]=u.useState(null),[w,j]=u.useState(null),[v,x]=u.useState(null),[y,b]=u.useState({auto_commit:!1}),[S,N]=u.useState(!1),[k,C]=u.useState(""),[O,R]=u.useState("fix"),[z,V]=u.useState(!1),[q,I]=u.useState(""),[G,te]=u.useState(!1),[H,L]=u.useState("retest_only"),K=[{v:"analyze",label:"报告分析"},{v:"fix",label:"问题修复"},{v:"deploy",label:"重新部署"},{v:"retest",label:"复测"}],F=[{v:"retest_only",label:"仅复测(现状行为,不部署)"},{v:"deploy_retest",label:"重新部署 → 复测"},{v:"deploy_only",label:"仅重新部署(不复测)"}],xe=u.useRef({auto_commit:!1}),X=u.useRef(null),Te=u.useRef(!1),Pe=u.useMemo(()=>c?{__html:Oo(c.content)}:null,[c]),Re=(w==null?void 0:w.status)==="running",se=(w==null?void 0:w.status)==="queued",ve=(v==null?void 0:v.status)==="running",ie=(v==null?void 0:v.status)==="queued",ue=v?`任务「${v==null?void 0:v.name}」 ${cr[v==null?void 0:v.status]||(v==null?void 0:v.status)} · 轮次 ${v==null?void 0:v.current_round} · 会话 ${(v==null?void 0:v.session_id)||"(首轮后生成)"}`+((v==null?void 0:v.task_type)==="fix"?` · ${v!=null&&v.auto_commit?"自动提交":"不提交"}/${v!=null&&v.auto_deploy?"自动部署":"不部署"}/${v!=null&&v.auto_retest?"自动复测":"不复测"}`:""):"尚无修复/修例任务";function he(){!l||!t||localStorage.setItem("ts_cur_bug",JSON.stringify({proj:t,dir:l,stab:p.current}))}async function pe(Q){a(Q),i.current=Q,m("report"),p.current="report",g(null),X.current=null,j(null),x(null),b({auto_commit:!1}),xe.current={auto_commit:!1},await E(Q)}async function E(Q=l){if(!(!Q||!t))try{const Ve=await ff.get(t,Q);d(Ve),await A(),he()}catch(Ve){M(Ve.message)}}function Y(Q){m(Q),p.current=Q,he()}async function A(){const Q=i.current;if(!(!Q||!t))try{const Xt=(await Be.list(t)).filter(at=>(at.task_type==="fix"||at.task_type==="reject")&&(()=>{try{return JSON.parse(at.payload||"{}").bug_dir===Q}catch{return!1}})()),Un=Xt[0]||null,Wt=Xt.find(at=>at.task_type==="fix")||null;x(Un);const ln=Wt?Wt.id:null;j(Wt),g(ln),X.current=ln,Wt&&b(at=>({auto_commit:xe.current.auto_commit?at.auto_commit:!!Wt.auto_commit}))}catch{}}u.useEffect(()=>{if(f!=="fix")return;const Q=setInterval(()=>{A().catch(()=>{})},2e3);return()=>clearInterval(Q)},[f,l,t]),u.useEffect(()=>{const Q=setInterval(()=>{l&&E().catch(()=>{})},5e3);return()=>clearInterval(Q)},[l,t]);function oe(){if(!l){M("请先选择 bug 报告");return}L("retest_only"),te(!0)}async function le(){try{await Be.create(t,{task_type:"retest_bug",bug_dir:l,retest_scope:H}),M("复测任务已入队,可在「任务」标签页查看"),te(!1),await n.loadTasks(),await A()}catch(Q){M(Q.message)}}function Ne(){if(!l){M("请先选择 bug 报告");return}C((w==null?void 0:w.extra)||""),R((w==null?void 0:w.end_stage)||"fix"),N(!0)}async function Ge(){const Q=k.trim();try{if(!h)await Be.create(t,{task_type:"fix",bug_dir:l,end_stage:O,auto_commit:y.auto_commit,extra:Q}),M("修复任务已入队");else{if(Re||se){M("任务运行中,请先停止再修复");return}await Be.update(h,{extra:Q,auto_commit:y.auto_commit,start_stage:"analyze",end_stage:O}),await Be.restart(h),M("修复任务已重启入队")}N(!1),C(""),await n.loadTasks(),await A(),Y("fix")}catch(Ve){M(Ve.message)}}async function dt(){const Q=q.trim();if(!Q){M("请填写拒绝理由");return}try{await ff.reject(t,l,Q),M("已标记拒绝,修例任务已入队"),V(!1),I(""),await n.loadTasks(),await E(),Y("fix")}catch(Ve){M(Ve.message)}}async function Ze(Q,Ve){if(b(Xt=>({...Xt,[Q]:Ve})),xe.current={...xe.current,[Q]:!0},!!X.current)try{await Be.update(X.current,{[Q]:Ve}),xe.current={...xe.current,[Q]:!1},M("已保存,下次向 agent 发送指令时生效"),await A()}catch(Xt){M(Xt.message)}}async function ft(){if(v)try{await Be.stop(v.id),M("已请求停止"),setTimeout(()=>A().catch(()=>{}),800)}catch(Q){M(Q.message)}}async function kt(){if(!v){M("尚无修复/修例任务");return}if(ve||ie){M("任务运行中,请先停止再重启");return}try{await Be.restart(v.id),M("任务已重启入队"),await A()}catch(Q){M(Q.message)}}function on(Q){if(Q.button!==0||Q.detail>1)return;const Ve=o.current,Xt=parseInt(getComputedStyle(Ve).getPropertyValue("--bugw"),10)||400,Un=Q.clientX;Q.currentTarget.classList.add("drag"),document.body.classList.add("resizing-x");const Wt=at=>Ve.style.setProperty("--bugw",uM(Xt+(at.clientX-Un),260,760)+"px"),ln=()=>{Q.currentTarget.classList.remove("drag"),document.body.classList.remove("resizing-x"),document.removeEventListener("mousemove",Wt),document.removeEventListener("mouseup",ln),localStorage.setItem("ts.bugw",getComputedStyle(Ve).getPropertyValue("--bugw"))};document.addEventListener("mousemove",Wt),document.addEventListener("mouseup",ln)}function wn(){o.current.style.removeProperty("--bugw"),localStorage.removeItem("ts.bugw")}u.useEffect(()=>{try{const Q=+localStorage.getItem("ts.bugw");Q>0&&o.current.style.setProperty("--bugw",Q+"px")}catch{}},[]),u.useEffect(()=>{if(Te.current||!t||!s.length)return;if(i.current){Te.current=!0;return}let Q=null;try{Q=JSON.parse(localStorage.getItem("ts_cur_bug")||"null")}catch{}Q&&Q.proj===t&&s.some(Ve=>Ve.dir===Q.dir)&&(Te.current=!0,pe(Q.dir).then(()=>{const Ve=Q.stab==="fix"?"fix":"report";m(Ve),p.current=Ve}))},[t,s]);const de=r.jsxs("div",{className:"fix-opts",children:[r.jsxs("label",{style:{display:"flex",gap:5,alignItems:"center",cursor:"pointer",color:"var(--text)"},children:[r.jsx("input",{type:"checkbox",checked:y.auto_commit,onChange:Q=>Ze("auto_commit",Q.target.checked)}),"自动提交(修复完成后 git commit,不 push)"]}),r.jsx("span",{className:"hint",children:"部署/复测是否执行由「修复」弹窗中的任务终点决定(终点≥重新部署即部署、终点=复测即任务内复测)"})]});return r.jsxs("div",{className:"bugs-tab",children:[e&&r.jsxs("div",{className:"bugwrap",ref:o,children:[r.jsxs("div",{className:"bug-left",children:[r.jsxs("div",{className:"bug-head",children:["Bug 报告 ",r.jsx("span",{className:"dim",children:s.length?"共 "+s.length:""})]}),r.jsxs("div",{className:"bug-list scroll",children:[!s.length&&r.jsx("div",{className:"hint",style:{padding:12},children:"暂无 bug 报告"}),s.map(Q=>r.jsxs("div",{className:"bugitem"+(l===Q.dir?" sel":"")+(aM(Q.status)?" history":""),title:/已拒绝/.test(Q.status||"")?"已被拒绝的报告":/复测通过/.test(Q.status||"")?"复测通过的历史报告":void 0,onClick:()=>pe(Q.dir),children:[r.jsx("div",{className:"bt",children:Q.title}),r.jsxs("div",{className:"bmeta",children:[r.jsx("span",{className:"bug-status "+Ff(Q.status),children:Q.status||"—"}),Q.last_task&&r.jsxs("span",{className:"bug-status "+iM(Q.last_task.status),children:[Q.last_task.name," · ",cr[Q.last_task.status]||Q.last_task.status]}),r.jsxs("span",{children:[Q.cases.length," 用例"]})]})]},Q.dir))]})]}),r.jsx("div",{className:"vsplit bug-split",onMouseDown:on,onDoubleClick:wn}),r.jsx("div",{className:"bug-right",children:c?r.jsxs("div",{className:"bug-content scroll"+(f==="fix"?" fix-mode":""),children:[r.jsxs("div",{className:"head",children:[r.jsx("h3",{children:c.title}),r.jsx("span",{className:"bug-status "+Ff(c.status),children:c.status||"—"})]}),r.jsxs("div",{className:"mut",children:["bug_report/",c.dir,c.last_task&&r.jsxs(r.Fragment,{children:[" · 最近任务「",c.last_task.name,"」:",cr[c.last_task.status]||c.last_task.status]}),"· ",r.jsxs(D,{variant:"ghost",size:"sm",className:"inline-flex h-5 px-1.5 text-[calc(11px*var(--fs))]",onClick:()=>E(),children:[r.jsx(Da,{})," 刷新"]})]}),r.jsxs("div",{className:"sub-tabs",children:[r.jsx("span",{className:"sub-tab"+(f==="report"?" on":""),onClick:()=>Y("report"),children:"报告"}),r.jsx("span",{className:"sub-tab"+(f==="fix"?" on":""),onClick:()=>Y("fix"),children:"对话"})]}),f==="report"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"ops",children:[!/已拒绝/.test(c.status||"")&&r.jsxs(D,{variant:"outline",size:"sm",onClick:oe,children:[r.jsx(gf,{})," 复测"]}),!["复测通过","已修复"].some(Q=>(c.status||"").includes(Q))&&r.jsxs(D,{size:"sm",onClick:Ne,children:[r.jsx(N0,{})," 修复"]}),!/已拒绝/.test(c.status||"")&&r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>{I(""),V(!0)},children:[r.jsx(Gk,{})," 拒绝"]}),r.jsx("span",{className:"hint",children:"复测/修复/拒绝都会创建任务(固定一轮)执行; 复测后若关联用例全部通过,bug 状态自动改为「已修复」; 拒绝会标记「已拒绝」并按理由修正关联用例; 修复/修例过程在「对话」标签页实时查看"})]}),de,r.jsxs("div",{className:"sec-title",children:["关联用例(",c.cases.length,")"]}),c.cases.length?r.jsxs(xm,{className:"text-xs",children:[r.jsx(vm,{children:r.jsxs(Ro,{className:"hover:bg-transparent",children:[r.jsx(kn,{className:"px-2",children:"ID"}),r.jsx(kn,{className:"px-2",children:"名称"}),r.jsx(kn,{className:"px-2",children:"状态"}),r.jsx(kn,{className:"px-2",children:"最近执行"})]})}),r.jsx(ym,{children:c.cases.map(Q=>r.jsxs(Ro,{children:[r.jsx(gn,{className:"px-2 font-mono text-xs",children:Q.id}),r.jsx(gn,{className:"px-2",children:Q.name}),r.jsx(gn,{className:"px-2",children:r.jsx("span",{className:"bug-status "+cM(Q.status),children:Q.status||"—"})}),r.jsx(gn,{className:"px-2 font-mono text-xs",children:ns(Q.last_run)})]},Q.id))})]}):r.jsx("div",{className:"hint",children:"未解析到关联用例"}),r.jsx("div",{className:"sec-title",children:"完整内容(bug_report.md)"}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:Pe})]}):r.jsxs("div",{className:"fix-panel",children:[r.jsxs("div",{className:"fix-controls",children:[v&&(ve||ie)&&r.jsxs(D,{size:"sm",variant:"outline",onClick:ft,children:[r.jsx(Qp,{})," 停止"]}),v&&["stopped","failed","done","interrupted"].includes(v==null?void 0:v.status)&&r.jsxs(D,{size:"sm",variant:"outline",onClick:kt,children:[r.jsx(xf,{})," 重启任务"]}),r.jsx("span",{className:"hint fix-status",children:ue})]}),v?r.jsx(zf,{task:v,withQBar:!1}):r.jsx("div",{className:"sess-empty",style:{flex:1},children:"尚无修复/修例会话。在「报告」标签页点击「修复」或「拒绝」创建任务后,对话会在这里实时展示。"})]})]}):r.jsx("div",{className:"bug-empty",children:"← 选择左侧 bug 报告查看详情;修复 / 复测会创建任务并放入「任务」标签页执行"})})]}),r.jsx(Qt,{open:S,onOpenChange:N,children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{className:"text-left",children:r.jsxs(Ht,{className:"text-sm",children:["修复「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"修改意见(可选)"}),r.jsx(cs,{rows:4,value:k,onChange:Q=>C(Q.target.value),placeholder:"例如:只修第 3 节指出的空指针判断,不要动缓存层;留空则按报告推荐方案修复"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务终点"}),r.jsxs(At,{value:O,onValueChange:R,children:[r.jsx(Rt,{size:"sm",className:"min-w-[160px]",children:r.jsx(Et,{})}),r.jsx(Pt,{children:K.map(Q=>r.jsx(Ae,{value:Q.v,children:Q.label},Q.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"起点=报告分析;终点≥重新部署时自动部署、终点=复测时任务内复测(复测通过自动标记已修复)"})]}),r.jsx(vn,{className:"flex-none",children:r.jsx(D,{onClick:Ge,children:h?"重启修复":"开始修复"})})]})}),r.jsx(Qt,{open:z,onOpenChange:V,children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{className:"text-left",children:r.jsxs(Ht,{className:"text-sm",children:["拒绝「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"拒绝理由(必填)"}),r.jsx(cs,{rows:4,value:q,onChange:Q=>I(Q.target.value),placeholder:"例如:误报——MCP 超时是环境抖动,不是协议实现问题"}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"确认后报告标记为「已拒绝」并调暗沉底;平台将创建修例任务:按理由修正关联用例, 并把教训记入案例库 PITFALLS.md,后续生成用例时避开同类误报"})]}),r.jsx(vn,{className:"flex-none",children:r.jsx(D,{variant:"destructive",onClick:dt,children:"确认拒绝"})})]})}),r.jsx(Qt,{open:G,onOpenChange:te,children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{className:"text-left",children:r.jsxs(Ht,{className:"text-sm",children:["复测「",c==null?void 0:c.title,"」"]})}),r.jsxs("div",{className:"form-col",children:[r.jsx("label",{children:"任务范围"}),r.jsxs(At,{value:H,onValueChange:L,children:[r.jsx(Rt,{size:"sm",className:"min-w-[220px]",children:r.jsx(Et,{})}),r.jsx(Pt,{children:F.map(Q=>r.jsx(Ae,{value:Q.v,children:Q.label},Q.v))})]}),r.jsx("span",{className:"hint",style:{textAlign:"left"},children:"仅复测且关联用例全部已固化 verify.py 时走平台脚本复测;范围含重新部署时由 agent 先按项目部署说明部署再复测"})]}),r.jsx(vn,{className:"flex-none",children:r.jsx(D,{onClick:le,children:"开始复测"})})]})})]})}const fM=new Set(["done"]);function pM(e){return!!(e!=null&&e.unread)&&!fM.has(e.column)}function Lc({options:e=[],value:t,onChange:n,placeholder:s="搜索…",emptyHint:o="无匹配项",className:l,inputClassName:a}){const[i,c]=u.useState(!1),[d,f]=u.useState(""),[m,p]=u.useState(0),h=u.useRef(null),g=u.useRef(null),w=e.find(S=>S.value===t)||null,j=d.trim().toLowerCase(),v=j?e.filter(S=>((S.search||"")+" "+S.label).toLowerCase().includes(j)):e;u.useEffect(()=>{if(!i)return;const S=N=>{var k;(k=h.current)!=null&&k.contains(N.target)||c(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[i]),u.useEffect(()=>{p(0)},[d,i]);function x(){var S;if(i){c(!1);return}f(""),c(!0),(S=g.current)==null||S.focus()}function y(S){n(S.value),c(!1),f("")}function b(S){if(!i&&(S.key==="ArrowDown"||S.key==="Enter")&&S.preventDefault(),!i){S.key==="ArrowDown"&&x();return}if(S.key==="Escape"){c(!1),f("");return}if(S.key==="ArrowDown"){S.preventDefault(),p(N=>Math.min(N+1,v.length-1));return}if(S.key==="ArrowUp"){S.preventDefault(),p(N=>Math.max(N-1,0));return}if(S.key==="Enter"){S.preventDefault(),v[m]&&y(v[m]);return}}return r.jsxs("div",{ref:h,className:He("relative",l),children:[r.jsx(Ie,{ref:g,className:He("pr-8",a),value:i?d:w?w.label:"",placeholder:s,onChange:S=>{c(!0),f(S.target.value)},onFocus:()=>{i||c(!0)},onKeyDown:b,title:w?w.label:void 0}),r.jsx("button",{type:"button",tabIndex:-1,className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded hover:bg-accent",onClick:()=>x(),children:r.jsx(Ol,{className:He("size-4 opacity-50 transition-transform",i&&"rotate-180")})}),i&&r.jsxs("div",{className:`absolute left-0 right-0 top-full z-50 mt-1 max-h-56 overflow-y-auto
|
|
451
|
-
rounded-md border bg-popover text-popover-foreground p-1 shadow-md`,children:[v.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:o}),v.map((S,N)=>r.jsx("div",{className:He("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm select-none",S.value===t&&"bg-accent text-accent-foreground",S.value!==t&&(N===m?"bg-accent/60 text-accent-foreground":"hover:bg-accent")),onMouseEnter:()=>p(N),onClick:()=>y(S),children:r.jsx("span",{className:"flex-1 truncate",children:S.label})},S.value))]})]})}const mM=10*1024*1024;function hM({project:e,card:t,comments:n,onClose:s,reload:o}){const l=e.id,[a,i]=u.useState(!1),[c,d]=u.useState(t.title+`
|
|
452
|
-
`+(t.description||"")),[f,m]=u.useState(""),[p,h]=u.useState(""),[g,w]=u.useState(""),[j,v]=u.useState(!1),[x,y]=u.useState(!1),[b,S]=u.useState(null),[N,k]=u.useState(!1),[C,O]=u.useState(!1),R=u.useRef(null),{rzOn:z,rzStyle:V,rzStart:q,rzDragStart:I,rzReset:G}=lr("ts.boardW",!1);u.useEffect(()=>{a||d(t.title+`
|
|
453
|
-
`+(t.description||""))},[t.title,t.description,a]),u.useEffect(()=>{i(!1),m(""),h(""),w(""),S(null)},[t.id]);const te=u.useMemo(()=>({__html:Oo(wf(t.description||"*(无描述)*",l))}),[t.description,l]),[H,L]=u.useState([]),[K,F]=u.useState(null),[xe,X]=u.useState({}),[Te,Pe]=u.useState([]);u.useEffect(()=>{Ce.get(l).then(A=>{L(A.cards||[]),F(A.capabilities||null),X(A.session_titles||{})}).catch(()=>{}),Ce.listSessions(l).then(A=>Pe(A.sessions||[])).catch(()=>{})},[l,t.id,t.updated_at]);async function Re(A){try{await Ce.updateCard(l,t.id,A),await o()}catch(oe){M(oe.message)}}async function se(){const A=c.indexOf(`
|
|
454
|
-
`),oe=(A<0?c:c.slice(0,A)).trim()||"未命名",le=A<0?"":c.slice(A+1);await Re({title:oe.slice(0,200),description:le}),i(!1)}async function ve(A){m(A),await Re({scheduled_at:A?new Date(A).getTime():0})}async function ie(A){const oe=g.trim();if(oe)try{const le=await Ce.addComment(l,t.id,oe);w(""),A&&await Ce.sendComment(l,t.id,le.id),await o()}catch(le){M(le.message),await o()}}async function ue(A){const oe=Array.from(A||[]);if(!(!oe.length||N))for(const le of oe){if(le.size>mM){M(`附件过大(>10MB):${le.name}`);continue}if(await Jp(le)){M(`已跳过占位图(极小尺寸):${le.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}k(!0);try{const Ne=await new Promise((de,Q)=>{const Ve=new FileReader;Ve.onload=()=>de(String(Ve.result||"").split(",")[1]||""),Ve.onerror=()=>Q(new Error("文件读取失败")),Ve.readAsDataURL(le)}),Ge=await Ce.uploadMedia(l,{name:le.name,mime:le.type||"application/octet-stream",data:Ne}),dt=(le.type||"").startsWith("image/")?``:`[${le.name}](${Ge.url})`,Ze=R.current,ft=!!Ze&&document.activeElement===Ze,kt=ft?Ze.selectionStart??Ze.value.length:-1,on=ft?(Ze.value||"").indexOf(`
|
|
455
|
-
`):-1,wn=ft&&on>=0&&kt>on;d(de=>wn?de.slice(0,kt)+dt+de.slice(Ze.selectionEnd??kt):(de?de+`
|
|
456
|
-
`:"")+dt+`
|
|
457
|
-
`),M(wn||!ft?`已粘贴附件:${le.name}`:`标题不支持图片,已附加到描述区:${le.name}`)}catch(Ne){M(Ne.message||"附件上传失败")}finally{k(!1)}}}function he(A){var Ne;const le=Array.from(((Ne=A.clipboardData)==null?void 0:Ne.items)||[]).filter(Ge=>Ge.kind==="file").map(Ge=>Ge.getAsFile()).filter(Boolean);le.length&&(A.preventDefault(),ue(le))}function pe(A){var le;const oe=Array.from(((le=A.dataTransfer)==null?void 0:le.files)||[]);oe.length&&(A.preventDefault(),ue(oe))}async function E(){if(!(C||!window.confirm(`确认清理该独立 worktree?
|
|
458
|
-
|
|
459
|
-
${t.worktree}
|
|
460
|
-
|
|
461
|
-
仅在工作树无未提交改动且会话未运行时才能清理(分支保留,不自动删除)。`))){O(!0);try{await Ce.removeWorktree(l,t.id),M("已清理 worktree"),await o()}catch(oe){M(oe.message)}finally{O(!1)}}}const Y=K?!K.chat:!0;return r.jsx(Qt,{open:!0,onOpenChange:A=>{A||s()},children:r.jsxs(Bt,{className:"modal modal-rz board-detail-modal w-[52vw] h-auto max-h-[90vh] sm:max-w-[94vw] overflow-y-auto"+(z?" rz-drag":""),style:{...V,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:q,reset:G}),r.jsx(Ut,{className:"text-left",children:r.jsxs(Ht,{className:"cursor-move select-none text-sm break-words",onMouseDown:I,children:["#",t.id," ",t.title||"未命名"]})}),r.jsxs("div",{className:"board-detail",children:[r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["📝 标题 / 描述",!a&&r.jsx(D,{size:"sm",variant:"ghost",onClick:()=>i(!0),children:"✏ 编辑"})]}),a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"hint",children:"第一行为标题,其余为描述;支持粘贴/拖入图片与文件(存为附件,10MB 内);Ctrl+Enter 保存"}),r.jsx(cs,{ref:R,rows:10,value:c,onChange:A=>d(A.target.value),onPaste:he,onDrop:pe,onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&(A.preventDefault(),N||se())},placeholder:"第一行为标题(空则显示「未命名」),其余为描述…"}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(D,{size:"sm",onClick:se,disabled:N,children:N?"附件上传中…":"保存"}),r.jsx(D,{size:"sm",variant:"outline",onClick:()=>{i(!1),d(t.title+`
|
|
462
|
-
`+(t.description||""))},children:"取消"})]})]}):r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:te})]}),t.column==="todo"&&r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"⏰ 定时开工"}),r.jsx(Ie,{type:"datetime-local",value:f||(t.scheduled_at?gM(t.scheduled_at):""),onChange:A=>ve(A.target.value)}),r.jsx("div",{className:"hint",children:"到点自动进入「正在开发」(受串行门禁约束)"})]}),t.worktree&&r.jsxs("div",{className:"board-sec",children:[r.jsxs("div",{className:"board-sec-t",children:["🌿 独立 worktree",r.jsx(D,{size:"sm",variant:"ghost",disabled:C,title:"删除该独立工作树目录(会话运行中或工作树有未提交改动时会被后端拒绝)",onClick:E,children:C?"清理中…":"清理 worktree"})]}),r.jsxs("div",{className:"hint break-all",title:t.worktree,children:[r.jsx("span",{className:"font-mono",children:t.worktree}),"(分支 ts/card-",t.id,")"]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💬 相关会话"}),(t.sessions||[]).map(A=>r.jsxs("div",{className:"flex items-center gap-1 py-0.5 text-xs cursor-pointer hover:bg-accent/40 rounded px-1 -mx-1",title:`点击查看会话 ${A}`,onClick:()=>S(A),children:[r.jsx("span",{className:"flex-1 min-w-0 truncate",children:xe[A]||r.jsx("span",{className:"font-mono",children:A})}),xe[A]&&r.jsx("span",{className:"font-mono text-muted-foreground",children:A.slice(0,8)}),A===t.session_id&&r.jsx("span",{className:"bug-status pass",children:"主"}),r.jsx(D,{size:"sm",variant:"ghost",title:"复制 id",onClick:oe=>{var le;oe.stopPropagation(),(le=navigator.clipboard)==null||le.writeText(A),M("已复制")},children:r.jsx(Wp,{})}),A!==t.session_id&&r.jsx(D,{size:"sm",variant:"ghost",title:"设为主会话",onClick:oe=>{oe.stopPropagation(),Re({session_id:A})},children:"设主"}),r.jsx(D,{size:"sm",variant:"ghost",title:"解绑",onClick:oe=>{oe.stopPropagation(),Re({unbind_session:A})},children:"✂"}),(K==null?void 0:K.compact)&&r.jsx(D,{size:"sm",variant:"ghost",title:"compact 压缩会话上下文",onClick:async oe=>{oe.stopPropagation();try{await Ce.compact(l,t.id,A),M("compact 已触发")}catch(le){M(le.message)}},children:r.jsx(YN,{})}),(K==null?void 0:K.fork)&&r.jsx(D,{size:"sm",variant:"ghost",disabled:j,title:"压缩并新建:压缩会话内容并新建会话(新会话只含压缩摘要、无历史轮次,原会话保留)",onClick:async oe=>{if(oe.stopPropagation(),!j){v(!0);try{const le=await Ce.forkCompact(l,t.id,A);M("已新建会话并注入压缩内容"),await Re({bind_session:le.new_sid})}catch(le){M(le.message)}finally{v(!1)}}},children:j?"压缩中…":r.jsx(lN,{})}),(K==null?void 0:K.fork)&&r.jsx(D,{size:"sm",variant:"ghost",disabled:x,title:"fork 会话:完整复制为新会话(历史/上下文全量保留)并加入卡片会话列表(不改变主会话,需要时点「设主」)",onClick:async oe=>{if(oe.stopPropagation(),!x){y(!0);try{const le=await Ce.forkSession(l,t.id,A);M("已 fork 新会话并加入卡片会话列表"),await Re({bind_session:le.new_sid})}catch(le){M(le.message)}finally{y(!1)}}},children:x?"fork 中…":r.jsx(yN,{})}),r.jsx(D,{size:"sm",variant:"ghost",title:"查看会话",onClick:oe=>{oe.stopPropagation(),S(A)},children:"🔍"})]},A)),r.jsxs("div",{className:"mt-1 flex gap-1",children:[r.jsx(Lc,{className:"flex-1",placeholder:"搜索或选择已有会话…",emptyHint:"工作区暂无会话",options:Te.map(A=>({value:A.sid,label:`${A.title||A.sid.slice(0,12)}(${new Date(A.mtime*1e3).toLocaleString()})`+(A.bound?" [已绑定]":"")+(A.archived?" [已归档]":""),search:A.sid})),value:p,onChange:h}),r.jsx(D,{size:"sm",variant:"outline",disabled:!p.trim(),onClick:async()=>{await Re({bind_session:p.trim()}),h("")},children:"绑定"})]})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🔗 父任务依赖"}),r.jsx(Lc,{placeholder:"选择父任务卡片…",emptyHint:"没有匹配的卡片",options:[{value:"",label:"(无依赖)"}].concat(H.filter(A=>A.id!==t.id).map(A=>({value:String(A.id),label:`#${A.id} ${A.title||"未命名"}(${A.column})`,search:A.title||""}))),value:t.parent_card_id?String(t.parent_card_id):"",onChange:A=>Re({parent_card_id:A?+A:null})}),H.filter(A=>A.id!==t.id).length===0&&r.jsx("div",{className:"hint",children:"暂无其他卡片可作为父任务"})]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"💭 评论"}),(n||[]).map(A=>r.jsxs("div",{className:"py-1 text-xs",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-muted-foreground",children:A.created_at}),A.sent&&r.jsx("span",{className:"bug-status pass",children:"✓ 已投递"}),r.jsx("span",{className:"flex-1"}),!A.sent&&!Y&&r.jsx(D,{size:"sm",variant:"ghost",title:"投递到主会话",onClick:async()=>{try{await Ce.sendComment(l,t.id,A.id),await o()}catch(oe){M(oe.message)}},children:r.jsx(vf,{})}),r.jsx(D,{size:"sm",variant:"ghost",title:"删除",onClick:async()=>{try{await Ce.removeComment(l,t.id,A.id),await o()}catch(oe){M(oe.message)}},children:r.jsx(Ks,{})})]}),r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:Oo(wf(A.text,l))}})]},A.id)),r.jsx(cs,{rows:3,placeholder:Y?"评论(dsh 不支持投递,仅保存)":"评论(Ctrl+Enter 保存)",value:g,onChange:A=>w(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.ctrlKey&&ie(!1)}}),r.jsxs("div",{className:"mt-1 flex gap-2",children:[r.jsx(D,{size:"sm",variant:"outline",onClick:()=>ie(!1),children:"保存"}),!Y&&r.jsxs(D,{size:"sm",onClick:()=>ie(!0),disabled:!t.session_id,title:t.session_id?"":"尚无会话,请先开始开发",children:[r.jsx(vf,{})," 保存并投递"]})]})]})]}),r.jsx(Oc,{board:b?{projectId:l,sid:b,cid:t.id,column:t.column,title:t.title}:null,onSwitchSession:S,onClose:()=>S(null)})]})})}function gM(e){const t=new Date(e),n=s=>String(s).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}const xM={todo:"待开发",doing:"正在开发",blocked:"阻塞",review:"待审核",done:"已完成"};function vM({project:e,onClose:t,onChanged:n}){const s=e==null?void 0:e.id,[o,l]=u.useState([]),[a,i]=u.useState(!1);async function c(){try{const p=await Ce.trashList(s);l(p.cards||[])}catch(p){M(p.message)}}u.useEffect(()=>{c()},[s]);async function d(p){try{await Ce.restoreCard(s,p.id),M(`已还原「${p.title||"未命名"}」`),await c(),n==null||n()}catch(h){M(h.message)}}async function f(p){if(window.confirm(`彻底删除「${p.title||"未命名"}」?评论一并删除,不可恢复。`))try{await Ce.purgeCard(s,p.id),await c(),n==null||n()}catch(h){M(h.message)}}async function m(){if(!a&&window.confirm(`清空回收站共 ${o.length} 张卡片?全部彻底删除,不可恢复。`)){i(!0);try{await Ce.emptyTrash(s),l([]),M("回收站已清空"),n==null||n()}catch(p){M(p.message)}finally{i(!1)}}}return r.jsx(Qt,{open:!0,onOpenChange:p=>!p&&t(),children:r.jsxs(Bt,{className:"modal board-trash-modal w-[52vw] max-h-[85vh] overflow-y-auto sm:max-w-[94vw]",children:[r.jsx(Ut,{className:"text-left",children:r.jsxs(Ht,{className:"text-sm",children:["回收站(",o.length,")"]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:"删除的卡片仅移入回收站,可还原;这里的彻底删除不可恢复"}),r.jsxs(D,{size:"sm",variant:"outline",disabled:!o.length||a,onClick:m,children:[r.jsx(Ks,{})," 清空回收站"]})]}),o.length===0?r.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:"回收站是空的"}):r.jsx("div",{className:"flex flex-col gap-2",children:o.map(p=>{var h;return r.jsxs("div",{className:"flex items-start gap-2 rounded border border-border px-3 py-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm break-words",children:p.title||"未命名"}),r.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 text-xs text-muted-foreground",children:[r.jsx("span",{className:"bug-status pending",children:xM[p.column]||p.column}),p.jira_key&&r.jsx("span",{className:"bug-status pending",children:p.jira_key}),r.jsxs("span",{children:["删除于 ",((h=p.trashed_at)==null?void 0:h.replace("T"," "))||""]})]})]}),r.jsxs(D,{size:"sm",variant:"outline",title:"还原(回原列原位置)",onClick:()=>d(p),children:[r.jsx(Pc,{})," 还原"]}),r.jsx(D,{size:"sm",variant:"ghost",title:"彻底删除(不可恢复)",onClick:()=>f(p),children:r.jsx(Ks,{})})]},p.id)})}),r.jsx(vn,{children:r.jsx(D,{variant:"outline",onClick:t,children:"关闭"})})]})})}const fd=4,Li=8;function yM({trigger:e,items:t=[],align:n="end"}){const[s,o]=u.useState(!1),[l,a]=u.useState(null),i=u.useRef(null),c=u.useRef(null);function d(f=!1){var m,p;o(!1),a(null),f&&((p=(m=i.current)==null?void 0:m.querySelector("button"))==null||p.focus())}return u.useEffect(()=>{if(!s)return;const f=h=>{var g,w;(g=c.current)!=null&&g.contains(h.target)||(w=i.current)!=null&&w.contains(h.target)||d()},m=h=>{h.key==="Escape"&&d(!0)},p=()=>d();return document.addEventListener("mousedown",f),document.addEventListener("keydown",m),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",m),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]),u.useLayoutEffect(()=>{var w,j,v,x;if(!s)return;const f=(w=i.current)==null?void 0:w.getBoundingClientRect();if(!f)return;const m=((j=c.current)==null?void 0:j.offsetWidth)||0,p=((v=c.current)==null?void 0:v.offsetHeight)||0;let h=n==="start"?f.left:f.right-m;h=Math.max(Li,Math.min(h,window.innerWidth-m-Li));let g=f.bottom+fd;p&&g+p>window.innerHeight-Li&&f.top-fd-p>=Li&&(g=f.top-fd-p),a({left:h,top:g}),(x=c.current)==null||x.focus()},[s,n]),r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:i,className:"inline-flex",onClick:()=>s?d():o(!0),children:e}),s&&Vo.createPortal(r.jsxs("div",{ref:c,role:"menu",tabIndex:-1,style:{position:"fixed",left:l?l.left:-9999,top:l?l.top:-9999,visibility:l?"visible":"hidden"},className:"z-50 min-w-[176px] rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none",children:[t.length===0&&r.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"无可选项"}),t.map(f=>r.jsx("div",{title:f.disabled?f.title:void 0,children:r.jsxs("button",{type:"button",role:"menuitem",disabled:!!f.disabled,"aria-disabled":f.disabled||void 0,title:f.disabled?void 0:f.title,className:He("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm select-none",f.disabled?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent hover:text-accent-foreground"),onClick:()=>{var m;f.disabled||(d(),(m=f.onSelect)==null||m.call(f))},children:[f.icon&&r.jsx("span",{className:"shrink-0",children:f.icon}),r.jsx("span",{className:"flex-1 truncate",children:f.label})]})},f.key))]}),document.body)]})}const wM=6,jM=10*1024*1024,bM={normal:"探索",fix:"修复",retest_bug:"复测",script_retest:"脚本复测",stress:"压测",regression:"回归",pipeline:"后段",reject:"修例"},_M=new Set(["doing","review","done"]),SM={running:"run",queued:"pending",done:"pass"},kM=[["all","全部"],["dev","仅开发"],["test","仅测试"]],NM=[{key:"todo",label:"待开发"},{key:"doing",label:"正在开发"},{key:"blocked",label:"阻塞"},{key:"review",label:"待审核"},{key:"done",label:"已完成"}],sx=[["manual","手动"],["created_desc","创建新→旧"],["updated_desc","更新新→旧"],["title","标题"]],CM=e=>e==="done"?[["entered_desc","进入新→旧"],...sx]:sx,EM={serial:"串行",parallel:"并行"},rx=e=>e.queue_state==="running"||e.queue_state==="starting",ox=e=>!e.answer_pending&&(!!e.running||e.queue_state==="starting"),zi=e=>e.block_kind==="queue"&&!e.answer_pending;function RM({project:e}){var br,mo,ho,Js;const t=e==null?void 0:e.id,n=Jw(),[s,o]=u.useState(null),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),[m,p]=u.useState({}),[h,g]=u.useState(null),[w,j]=u.useState(null),[v,x]=u.useState(""),[y,b]=u.useState(null),[S,N]=u.useState({}),[k,C]=u.useState(null),O=u.useRef({}),[R,z]=u.useState(null),[V,q]=u.useState(!1),[I,G]=u.useState(!1),[te,H]=u.useState(!1),[L,K]=u.useState(null),[F,xe]=u.useState(null),[X,Te]=u.useState(""),Pe=u.useRef(null),[Re,se]=u.useState(null),ve=u.useRef(null),ie=u.useRef(!1),ue=u.useRef([]),he=u.useRef(null),pe=u.useRef(null),E=u.useRef(null),Y=u.useRef(null),A=u.useRef(null),oe=u.useRef(null),le=u.useRef(null);async function Ne(){var T;if(t&&!((T=ve.current)!=null&&T.on))try{pe.current=Ze(),o(await Ce.get(t))}catch(U){M(U.message)}}u.useEffect(()=>{o(null),a(null),K(null),f(""),g(null),C(null),N({}),O.current={},Ne(),hl.get(t).then(ge=>{var Le;return p(((Le=ge.prefs)==null?void 0:Le.board_filters)||{})}).catch(()=>{});let T=null;const U=()=>{E.current||(E.current=setTimeout(()=>{E.current=null,Ne()},300))};try{T=Ce.stream(t),T.addEventListener("hello",U),T.addEventListener("refresh",U)}catch{}const be=setInterval(Ne,6e4);return()=>{clearInterval(be),E.current&&(clearTimeout(E.current),E.current=null);try{T==null||T.close()}catch{}}},[t]);function Ge(T,U){p(be=>{const ge={...be,[T]:U};return hl.set(t,"board_filters",ge).catch(()=>{}),ge})}const dt=u.useMemo(()=>(s==null?void 0:s.cards)||[],[s]);ue.current=dt,he.current=s;function Ze(){const T=new Map;return document.querySelectorAll(".board-card[data-card-id]").forEach(U=>{T.set(U.dataset.cardId,U.getBoundingClientRect())}),T}u.useLayoutEffect(()=>{const T=pe.current;if(pe.current=null,!!T)for(const[U,be]of T){const ge=document.querySelector(`[data-card-id="${U}"]`);if(!ge)continue;const Le=ge.getBoundingClientRect(),Se=be.left-Le.left,Nt=be.top-Le.top;!Se&&!Nt||(ge.style.transition="none",ge.style.transform=`translate(${Se}px, ${Nt}px)`,ge.getBoundingClientRect(),ge.style.transition="transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",ge.style.transform="")}});const ft=dt.find(T=>T.id===l)||null,kt=T=>((s==null?void 0:s.comments)||[]).filter(U=>U.card_id===T);function on(T,U,be,ge){const Le=T.find(lt=>lt.id===U);if(!Le)return T;const Se=T.filter(lt=>lt.id!==U),Nt=Se.filter(lt=>lt.column===be),pt=Nt[Math.min(Math.max(ge,0),Nt.length)],mt={...Le,column:be};if(!pt)return[...Se,mt];const W=Se.findIndex(lt=>lt.id===pt.id);return[...Se.slice(0,W),mt,...Se.slice(W)]}function wn(T,U,be=1/0){o(ge=>ge&&{...ge,cards:on(ge.cards,T.id,U,be)})}async function de(T,U,be,ge=null,Le=!1){try{const Se=await Ce.moveCard(t,T.id,U,be,ge,Le);if(Se.blocked==="parent-not-done"){await Ne(),b({cardId:T.id,action:"move",column:U});return}if(Se.merge_pending){await Ne(),z({card:T,info:Se.merge_pending});return}await Ne()}catch(Se){M(Se.message),await Ne()}}async function Q(T,U){try{await Ce.reorderCard(t,T,U),await Ne()}catch(be){M(be.message),await Ne()}}async function Ve(T,U,be,ge=!1){pe.current=Ze(),wn(T,U),await de(T,U,be,null,ge)}async function Xt(T){if(T.worktree){let U=null;try{U=await Ce.worktreePreview(t,T.id)}catch{U=null}if(U&&U.merge&&U.merge.ahead>0){z({card:T,info:U.merge});return}}await Ve(T,"done")}async function Un(){const T=R;if(T){q(!0);try{await Ce.mergeWorktree(t,T.card.id),z(null),M("已交给 agent 合并:卡片回到开发队列排队,完成后自动回「待审核」"),await Ne()}catch(U){M(U.message)}finally{q(!1)}}}async function Wt(){const T=R;T&&(z(null),await Ve(T.card,"done",void 0,!0))}async function ln(T,U){try{await Ce.updateSettings(t,{sort:{[T]:U}}),await Ne()}catch(be){M(be.message)}}async function at(T,U,be,ge){var Le;try{const Se=await Ce.startCard(t,T.id,U,be,ge);if(Se.blocked==="parent-not-done"){b({cardId:T.id,action:"start",worktree:!!ge});return}ge?M("已在独立 worktree 中开始"):((Le=Se.card)==null?void 0:Le.column)==="blocked"&&M("已加入统一队列排队"),await Ne()}catch(Se){M(Se.message)}}async function Ms(T){let U;try{U=await Ce.worktreePreview(t,T)}catch{U={supported:!1,reason:"无法获取 worktree 预览(后端未重启或接口不可用)"}}return O.current={...O.current,[T]:U},N(O.current),U}function hs(T){if(T.session_id)return"该卡片已有主会话,不能切换到独立 worktree";const U=S[T.id];return U&&U.supported===!1?U.reason||"当前项目不支持独立 worktree":""}async function Tt(T){C({card:T,preview:O.current[T.id]||null});const U=await Ms(T.id);U&&C(be=>be&&be.card.id===T.id?{...be,preview:U}:be)}async function P(T){try{await Ce.deliverAnswer(t,T.id),M("已送达答案"),await Ne()}catch(U){M(U.message)}}async function B(T){try{await Ce.stopCard(t,T.id),await Ne()}catch(U){M(U.message)}}async function J(T){try{await Ce.removeCard(t,T.id),a(null),M("已移入回收站(可从回收站还原)"),await Ne()}catch(U){M(U.message)}}const ae=u.useRef(at);ae.current=at;function ce(T){Pe.current=T.id,xe(T.id),Te(T.title)}function fe(){Pe.current=null,xe(null)}async function Oe(T){if(Pe.current!==T.id)return;const U=X.trim();if(Pe.current=null,xe(null),!(!U||U===T.title))try{await Ce.updateCard(t,T.id,{title:U}),await Ne()}catch(be){M(be.message)}}const qe=u.useRef(Zn);qe.current=Zn;const Qe=u.useRef(jr);Qe.current=jr;const Xe=u.useRef(gs);Xe.current=gs;const wt=u.useRef(fn);wt.current=fn;const jn=u.useRef(de);jn.current=de;const Jt=u.useRef(Q);Jt.current=Q;const tt=u.useRef(nt);tt.current=nt;const $t=u.useRef(null),dn=u.useCallback((T,U)=>{T.button===0&&(T.target.closest("button, a, input, textarea, select")||(ve.current={id:U.id,sx:T.clientX,sy:T.clientY,on:!1},ie.current=!1,window.addEventListener("pointermove",Ts),window.addEventListener("pointerup",it)))},[]);function qt(T,U,be){var pt,mt;const ge=(mt=(pt=document.elementFromPoint(T,U))==null?void 0:pt.closest)==null?void 0:mt.call(pt,".board-col");if(!ge)return null;const Le=ge.dataset.col,Se=[...ge.querySelectorAll(".board-card")].filter(W=>W.dataset.cardId!==String(be));let Nt=Se.length;for(let W=0;W<Se.length;W++){const lt=Se[W].getBoundingClientRect();if(U<lt.top+lt.height/2){Nt=W;break}}return{col:Le,index:Nt,domIds:Se.map(W=>W.dataset.cardId)}}function nt(T){var U,be,ge;return((ge=(be=(U=he.current)==null?void 0:U.settings)==null?void 0:be.sort)==null?void 0:ge[T])||(T==="done"?"entered_desc":"manual")}function It(T,U){const be=nt(U);if(be==="manual")return T;const ge=[...T];return be==="created_desc"?ge.sort((Le,Se)=>(Se.created_at||"").localeCompare(Le.created_at||"")):be==="updated_desc"?ge.sort((Le,Se)=>(Se.updated_at||"").localeCompare(Le.updated_at||"")):be==="title"?ge.sort((Le,Se)=>(Le.title||"").localeCompare(Se.title||"","zh")):be==="entered_desc"&&ge.sort((Le,Se)=>(Se.done_at||"").localeCompare(Le.done_at||"")),ge}function Pn(T){const U=d.trim().toLowerCase();return U?(T.title||"").toLowerCase().includes(U)||(T.description||"").toLowerCase().includes(U)||(T.jira_key||"").toLowerCase().includes(U):!0}function Zn(T,U){var Nt;const be=ue.current.find(pt=>pt.id===T);le.current=(be==null?void 0:be.column)||null,Y.current=((Nt=he.current)==null?void 0:Nt.cards)||null,A.current=null;const ge=document.querySelector(`[data-card-id="${T}"]`);if(!ge)return;const Le=ge.getBoundingClientRect(),Se=ge.cloneNode(!0);Se.className=Se.className.replace(" drag-gap","")+" board-ghost",Object.assign(Se.style,{position:"fixed",left:Le.left+"px",top:Le.top+"px",width:Le.width+"px",margin:"0",zIndex:999,pointerEvents:"none",opacity:"0.95",transform:"scale(1.04) rotate(1.5deg)",boxShadow:"0 16px 32px rgba(0,0,0,.28)",transition:"none"}),document.body.appendChild(Se),oe.current={el:Se,dx:U.clientX-Le.left,dy:U.clientY-Le.top},$t.current=pt=>{pt.key==="Escape"&&(ie.current=!0,ve.current=null,wt.current(T,-1,-1))},window.addEventListener("keydown",$t.current)}function jr(T){const U=oe.current;U&&(U.el.style.left=T.clientX-U.dx+"px",U.el.style.top=T.clientY-U.dy+"px")}function gs(T,U){const be=A.current;if(be&&be.col===U.col&&be.index===U.index)return;const ge=U.col===T.column;ge&&U.col!=="doing"&&nt(U.col)!=="manual"||(A.current=U,c(U.col),pe.current=Ze(),wn(T,U.col,!ge&&nt(U.col)!=="manual"?1/0:U.index))}const Ts=u.useRef(T=>{const U=ve.current;if(!U)return;if(!U.on){if(Math.hypot(T.clientX-U.sx,T.clientY-U.sy)<wM)return;U.on=!0,qe.current(U.id,T),se(U.id)}Qe.current(T);const be=ue.current.find(Le=>Le.id===U.id);if(!be)return;const ge=qt(T.clientX,T.clientY,U.id);ge&&Xe.current(be,ge)}).current;function fn(T,U,be){var bn,Mn,vs,Qo,ys,go;const ge=oe.current;oe.current=null;const Le=ge?ge.el.getBoundingClientRect():null;ge==null||ge.el.remove();const Se=qt(U,be,T),Nt=Ze();Le&&Nt.set(String(T),Le),pe.current=Nt;const pt=Y.current;Y.current=null,A.current=null,se(null),c(null);const mt=(((bn=he.current)==null?void 0:bn.cards)||[]).find(_n=>_n.id===T);if(!mt){Ne();return}const W=le.current;if(le.current=null,!Se){pt&&o(_n=>_n&&{..._n,cards:pt});return}if(Se.col==="doing"&&W!=="doing"){pt&&o(_n=>_n&&{..._n,cards:pt}),ae.current(mt);return}if(Se.col===W){if(Se.col==="doing"){const ts=new Map((((Mn=he.current)==null?void 0:Mn.cards)||[]).map(ze=>[String(ze.id),ze])),_=(Se.domIds||[]).map(ze=>ts.get(ze)).filter(Boolean),re=_[Se.index]??null,ke=re?ox(re)?"prefix":zi(re)?"waiting":"none":"waiting";let Me=null;if(zi(mt)&&ke==="prefix"?Me="force":ox(mt)&&ke==="waiting"&&_.slice(0,Se.index).filter(zi).length>0?Me="stop":zi(mt)&&ke==="waiting"&&(Me="reorder"),Me==="force"&&!window.confirm("强制运行:立即启动该卡片(落哪算哪)?")&&(Me=null),Me==="stop"&&!window.confirm("停止当前任务?停止后卡片进入待审核。")&&(Me=null),!Me){pt&&o(ze=>ze&&{...ze,cards:pt});return}jn.current(mt,"doing",void 0,(re==null?void 0:re.id)??null);return}if(tt.current(Se.col)!=="manual")return;const _n=(((vs=he.current)==null?void 0:vs.cards)||[]).filter(ts=>ts.column===Se.col&&ts.id!==T);Jt.current(T,((Qo=_n[Se.index])==null?void 0:Qo.id)??null);return}let lt=null;tt.current(Se.col)==="manual"&&(lt=((go=(((ys=he.current)==null?void 0:ys.cards)||[]).filter(ts=>ts.column===Se.col&&ts.id!==T)[Se.index])==null?void 0:go.id)??null),jn.current(mt,Se.col,void 0,lt)}const it=u.useRef(T=>{const U=ve.current;ve.current=null,window.removeEventListener("pointermove",Ts),window.removeEventListener("pointerup",it),$t.current&&(window.removeEventListener("keydown",$t.current),$t.current=null),!(!U||!U.on)&&(ie.current=!0,wt.current(U.id,T.clientX,T.clientY))}).current;function po(T){if(ie.current){ie.current=!1;return}Hn(T)}function Yo(T){T.unread&&(o(U=>U&&{...U,cards:U.cards.map(be=>be.id===T.id?{...be,unread:!1}:be)}),Ce.markViewed(t,T.id).catch(()=>{}))}function Hn(T){a(T.id),Yo(T)}if(!t)return null;const es=!!(e!=null&&e.archived),xs=!(e!=null&&e.agent_path);return r.jsxs("div",{className:"board-tab",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-1.5",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"开发看板"}),r.jsx("span",{className:"bug-status pending",children:EM[(br=s==null?void 0:s.settings)==null?void 0:br.mode]||"串行"}),r.jsx("span",{className:"flex-1"}),r.jsx(Ie,{className:"board-search",placeholder:"搜索卡片(标题/描述/Jira)",value:d,onChange:T=>f(T.target.value)}),r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>G(!0),children:[r.jsx(S0,{})," 设置"]}),r.jsxs(D,{size:"sm",variant:"outline",title:"回收站(删除的卡片可还原)",onClick:()=>H(!0),children:[r.jsx(Ks,{})," 回收站"]})]}),r.jsx("div",{className:"board-cols",children:NM.map(T=>{const U=m[T.key]||"all",be=_M.has(T.key)&&U!=="dev"?((s==null?void 0:s.active_tasks)||[]).filter(W=>(W.column||"doing")===T.key):[],ge=U!=="test"?dt.filter(W=>W.column===T.key&&Pn(W)):[],Le=T.key==="doing"?ge:It(ge,T.key),Se=T.key==="doing"?Le.filter(rx):[],Nt=T.key==="doing"?Le.filter(W=>!rx(W)):[],pt=T.key==="doing"?[...Se,...Nt]:Le,mt=Se.length>0&&Nt.length>0?Se.length:-1;return r.jsxs("div",{"data-col":T.key,className:"board-col"+(i===T.key?" dragover":""),children:[r.jsxs("div",{className:"board-col-head",children:[T.label,r.jsx("span",{className:"board-col-count",children:Le.length}),r.jsx("select",{className:"board-col-sort",title:"列表过滤:开发任务=卡片,测试任务=平台测试任务",value:U,onChange:W=>Ge(T.key,W.target.value),children:kM.map(([W,lt])=>r.jsx("option",{value:W,children:lt},W))}),T.key!=="doing"&&r.jsx("select",{className:"board-col-sort",title:"列内排序方案",value:nt(T.key),onChange:W=>ln(T.key,W.target.value),children:CM(T.key).map(([W,lt])=>r.jsx("option",{value:W,children:lt},W))})]}),r.jsxs("div",{className:"board-col-body",children:[be.map(W=>r.jsxs("div",{className:"board-task"+(W.session_id?" has-session":""),title:W.session_id?"测试任务 · 点击查看会话":"测试任务(尚无会话)",onClick:()=>{W.session_id&&g(W)},children:[r.jsx("div",{className:"board-card-title",style:{cursor:"default"},onClick:lt=>lt.stopPropagation(),children:W.name}),r.jsxs("div",{className:"board-card-badges",children:[r.jsxs("span",{className:"board-card-id",title:"测试任务 id",children:["任务 #",W.id]}),r.jsxs("span",{className:"bug-status "+(SM[W.status]||"retest"),children:["测试·",cr[W.status]||W.status]}),r.jsx("span",{className:"bug-status pending",children:bM[W.task_type]||W.task_type}),W.current_round>0&&r.jsxs("span",{className:"bug-status pending",children:["轮 ",W.current_round]})]}),W.error&&r.jsx("div",{className:"board-card-err",children:W.error})]},"task-"+W.id)),pt.map((W,lt)=>r.jsxs(u.Fragment,{children:[lt===mt&&r.jsx("div",{className:"board-runzone",children:r.jsx("span",{children:"等待区 · 按队列顺序"})}),r.jsxs("div",{"data-card-id":W.id,className:`board-card col-${W.column}`+(Re===W.id?" drag-gap":""),onPointerDown:bn=>dn(bn,W),onClick:()=>po(W),children:[r.jsx(MM,{card:W,editing:F===W.id,editTitle:X,onStartEdit:ce,onSaveTitle:Oe,onEditChange:Te,onCancelEdit:fe}),r.jsxs("div",{className:"board-card-badges",children:[pM(W)&&r.jsx("span",{className:"board-card-new",title:"状态有更新,打开卡片或点卡片上的按钮后标记消失",children:"有更新"}),r.jsxs("span",{className:"board-card-id",title:"卡片 id",children:["#",W.id]}),!!yf[W.queue_state]&&r.jsx("span",{className:E0(W.queue_state),children:yf[W.queue_state]}),W.worktree?r.jsx("span",{className:"bug-status pending",title:W.worktree,children:"🌿 worktree"}):null,W.scheduled_at?r.jsxs("span",{className:"bug-status pending",children:["⏰ ",new Date(W.scheduled_at).toLocaleString()]}):null,W.parent_card_id?r.jsxs("span",{className:"bug-status pending",children:["🔗 依赖 #",W.parent_card_id]}):null,W.block_kind==="interaction"&&r.jsxs("span",{className:"bug-status interaction",title:"agent 等待用户回答,回复后自动恢复",children:["🤔 ",W.block_text||"等待回答"]}),W.block_kind==="manual"&&r.jsx("span",{className:"bug-status retest",children:W.block_text||"手动阻塞"}),W.origin==="sync"&&r.jsx("span",{className:"bug-status pending",children:"同步"}),W.jira_key&&r.jsx("span",{className:"bug-status pending",children:W.jira_key})]}),W.last_error&&r.jsx("div",{className:"board-card-err",children:W.last_error}),r.jsxs("div",{className:"board-card-ops",onClick:bn=>{bn.target.closest("button")&&(bn.stopPropagation(),Yo(W))},children:[W.column==="todo"&&r.jsxs("div",{className:"board-split",children:[r.jsxs(D,{size:"sm",variant:"outline",disabled:es||xs,title:es?"项目已归档":xs?"未配置智能体":"",onClick:()=>at(W),children:[r.jsx(gf,{})," 开始"]}),r.jsx(yM,{align:"end",trigger:r.jsx(D,{size:"sm",variant:"outline",disabled:es||xs,title:es?"项目已归档":xs?"未配置智能体":"更多开始方式",onClick:()=>Ms(W.id),children:"▾"}),items:[{key:"queue",label:"开始(入队排队)",onSelect:()=>at(W)},{key:"worktree",label:"🌿 在新 worktree 中开始",disabled:!!hs(W),title:hs(W)||void 0,onSelect:()=>Tt(W)}]})]}),W.column==="doing"&&!W.running&&W.block_kind!=="queue"&&r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>Ve(W,"review"),children:[r.jsx(Hk,{})," 待审核"]}),W.column==="blocked"&&r.jsxs(D,{size:"sm",variant:"outline",disabled:es||xs,onClick:()=>at(W),children:[r.jsx(gf,{})," 重试"]}),W.answer_pending&&r.jsx(D,{size:"sm",variant:"ghost",title:"不等项目空闲,立即把答案送达等待中的会话",onClick:()=>P(W),children:"⚡ 送达"}),W.block_kind==="queue"&&!W.answer_pending&&r.jsx(D,{size:"sm",variant:"ghost",title:"跳过队列立即开始(用户自担风险)",disabled:es||xs,onClick:async()=>{window.confirm("强制开始将跳过队列立即执行,可能与在跑任务冲突,继续?")&&await at(W,void 0,!0)},children:"⚡ 强制"}),W.block_kind==="queue"&&r.jsx(D,{size:"sm",variant:"ghost",title:"取消排队并移入待审核",onClick:()=>B(W),children:"停止"}),W.column==="review"&&r.jsxs(r.Fragment,{children:[r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>Xt(W),children:[r.jsx(Al,{})," 通过"]}),r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>{j(W),x("")},children:[r.jsx(Pc,{})," 打回"]})]}),W.column==="done"&&r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>Ve(W,"todo"),children:[r.jsx(Pc,{})," 重开"]}),r.jsx(D,{size:"sm",variant:"ghost",title:"打开卡片详情",onClick:()=>Hn(W),children:r.jsx(CN,{})}),r.jsx(D,{size:"sm",variant:"ghost",title:"删除卡片",onClick:()=>J(W),children:r.jsx(Ks,{})}),r.jsx(D,{size:"sm",variant:"ghost",title:W.session_id?"进入主会话":"尚无会话",disabled:!W.session_id,onClick:()=>K({sid:W.session_id,cid:W.id,column:W.column,title:W.title||"未命名"}),children:r.jsx(MN,{})}),!!(n!=null&&n.openSession)&&r.jsx(D,{size:"sm",variant:"ghost",title:W.session_id?"在 dsh 界面打开该卡片主会话":"尚无会话",disabled:!W.session_id,onClick:()=>Xw(W.session_id),children:r.jsx(qp,{})})]})]})]},W.id))]}),T.key==="todo"&&r.jsx(TM,{disabled:es,project:e,onAdd:async(W,lt,bn)=>{let Mn=null;try{Mn=await Ce.createCard(t,{title:W,description:lt})}catch(vs){M(vs.message);return}if(bn&&(Mn!=null&&Mn.id))try{await Ce.startCard(t,Mn.id),M("已进入开发队列排队")}catch(vs){M(vs.message)}await Ne()}})]},T.key)})}),ft&&r.jsx(hM,{project:e,card:ft,comments:kt(ft.id),onClose:()=>a(null),reload:Ne}),L&&r.jsx(Oc,{board:{projectId:t,...L},onClose:()=>K(null),onSwitchSession:T=>K(U=>U&&{...U,sid:T})}),h&&r.jsx(Oc,{task:h,onClose:()=>g(null)}),r.jsx(Qt,{open:!!w,onOpenChange:T=>!T&&j(null),children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{children:r.jsxs(Ht,{children:["打回「",w==null?void 0:w.title,"」"]})}),r.jsx(cs,{rows:4,placeholder:"修改意见(将随会话续发改进)",value:v,onChange:T=>x(T.target.value)}),r.jsx(vn,{children:r.jsx(D,{onClick:async()=>{const T=w;j(null),await at(T,v)},children:"确认打回"})})]})}),r.jsx(Qt,{open:!!y,onOpenChange:T=>!T&&b(null),children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{children:r.jsx(Ht,{children:"父任务尚未完成"})}),r.jsx("p",{className:"hint",children:"该卡片有未完成的父任务依赖。建议先完成父任务,或在详情面板解除依赖后再开始。"}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>b(null),children:"取消"}),(y==null?void 0:y.action)==="start"&&r.jsx(D,{onClick:async()=>{const T=y;b(null),await at(dt.find(U=>U.id===T.cardId),void 0,!0,T.worktree)},children:"强制开始(自担风险)"})]})]})}),r.jsx(Qt,{open:!!k,onOpenChange:T=>!T&&C(null),children:r.jsxs(Bt,{className:"modal",children:[r.jsx(Ut,{children:r.jsx(Ht,{children:"在新 worktree 中开始"})}),r.jsx("p",{className:"hint",children:"将为该卡片新建独立 git worktree,会话在独立工作树中执行,主仓库不受影响。"}),((mo=k==null?void 0:k.preview)==null?void 0:mo.path)&&r.jsxs("p",{className:"hint break-all",children:["路径:",r.jsx("span",{className:"font-mono",children:k.preview.path})]}),((ho=k==null?void 0:k.preview)==null?void 0:ho.branch)&&r.jsxs("p",{className:"hint",children:["分支:",r.jsx("span",{className:"font-mono",children:k.preview.branch})]}),r.jsx("p",{className:"hint font-semibold",children:"该卡将立即执行,不与项目队列互斥,可能与项目内其他任务并发。"}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>C(null),children:"取消"}),r.jsx(D,{onClick:async()=>{const T=k;C(null),await at(T.card,void 0,!1,!0)},children:"开始"})]})]})}),r.jsx(Kw,{open:!!R,info:R==null?void 0:R.info,busy:V,disabledReason:(Js=R==null?void 0:R.card)!=null&&Js.running?"会话运行中:等这一轮跑完,或先点「停止」再交接":"",onHandoff:Un,onPass:Wt,onClose:()=>!V&&z(null)}),r.jsx($M,{open:I,onClose:()=>G(!1),projectId:t,settings:s==null?void 0:s.settings,reload:Ne}),te&&r.jsx(vM,{project:e,onClose:()=>H(!1),onChanged:()=>Ne()})]})}const PM=240;function MM({card:e,editing:t,editTitle:n,onStartEdit:s,onSaveTitle:o,onEditChange:l,onCancelEdit:a}){const i=u.useRef(null),c=u.useRef(null),[d,f]=u.useState(5);u.useLayoutEffect(()=>{const p=i.current;if(!p)return;const h=()=>{const g=parseFloat(getComputedStyle(p).lineHeight)||19.5;f(Math.max(0,6-Math.round(p.getBoundingClientRect().height/g)))};if(h(),typeof ResizeObserver<"u"){const g=new ResizeObserver(h);return g.observe(p),()=>g.disconnect()}},[e.title,t]);const m=u.useCallback(()=>{const p=c.current;if(!p)return;p.style.height="auto";const h=p.scrollHeight+(p.offsetHeight-p.clientHeight);p.style.height=Math.min(h,PM)+"px"},[]);return u.useLayoutEffect(()=>{t&&m()},[t,m]),t?r.jsxs(r.Fragment,{children:[r.jsx(cs,{ref:c,rows:1,value:n,autoFocus:!0,className:"board-card-title-input min-h-0 resize-none px-1 py-0 text-[calc(13px*var(--fs))] font-semibold leading-[1.5] break-all",onClick:p=>p.stopPropagation(),onChange:p=>{l(p.target.value),m()},onKeyDown:p=>{p.key==="Enter"&&!p.nativeEvent.isComposing?(p.preventDefault(),o(e)):p.key==="Escape"&&a()},onBlur:()=>o(e)}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:i,className:"board-card-title",title:"单击编辑标题",onClick:p=>{p.stopPropagation(),s(e)},children:e.title||r.jsx("span",{className:"board-card-title-empty",children:"未命名"})}),e.description&&d>0&&r.jsx("div",{className:"board-card-desc",style:{WebkitLineClamp:d},children:e.description})]})}function TM({disabled:e,onAdd:t,project:n}){const[s,o]=u.useState(""),[l,a]=u.useState([]),[i,c]=u.useState(!1),d=u.useRef(null),[f,m]=u.useState(-1),[p,h]=u.useState(!1),[g,w]=u.useState([]);u.useEffect(()=>{if(!(n!=null&&n.agent_path)){w([]);return}let R=!1;return Mt.agentSkills(n.agent_path,n.project_dir||n.work_dir||"").then(z=>{if(R)return;const V=Array.isArray(z)?z:(z==null?void 0:z.skills)||[];w(V.map(q=>({key:q.name||q.id,label:q.name||q.id,desc:(q.description||q.summary||"").slice(0,40),type:"skill"})))}).catch(()=>{}),()=>{R=!0}},[n==null?void 0:n.id,n==null?void 0:n.agent_path,n==null?void 0:n.project_dir,n==null?void 0:n.work_dir]);function j(){const R=d.current;R&&(R.style.height="auto",R.style.height=Math.min(R.scrollHeight,120)+"px")}async function v(R){const z=Array.from(R||[]);if(!z.length||i)return;const V=n==null?void 0:n.id;if(V)for(const q of z){if(q.size>jM){M(`附件过大(>10MB):${q.name}`);continue}if(await Jp(q)){M(`已跳过占位图(极小尺寸):${q.name}(剪贴板里不是有效截图,请重新截图或改用「+」选文件)`);continue}c(!0);try{const I=await new Promise((H,L)=>{const K=new FileReader;K.onload=()=>H(String(K.result||"").split(",")[1]||""),K.onerror=()=>L(new Error("文件读取失败")),K.readAsDataURL(q)}),G=await Ce.uploadMedia(V,{name:q.name,mime:q.type||"application/octet-stream",data:I}),te=(q.type||"").startsWith("image/")?``:`[${q.name}](${G.abs||G.url})`;a(H=>[...H,{md:te,url:Xp(G.url),name:q.name,mime:q.type}]),M(`已添加附件:${q.name}`)}catch(I){M(I.message||"附件上传失败")}finally{c(!1)}}}function x(R){var V;const z=Array.from(((V=R.clipboardData)==null?void 0:V.items)||[]).filter(q=>q.kind==="file").map(q=>q.getAsFile()).filter(Boolean);z.length&&(R.preventDefault(),v(z))}function y(R){var V;const z=Array.from(((V=R.dataTransfer)==null?void 0:V.files)||[]);z.length&&(R.preventDefault(),v(z))}function b(R){a(z=>z.filter(V=>V.md!==R))}u.useEffect(()=>{const R=d.current;if(!R)return;const z=()=>m(R.selectionStart??0),V=()=>{m(R.selectionStart??0),h(!1)};return R.addEventListener("keyup",z),R.addEventListener("click",V),()=>{R.removeEventListener("keyup",z),R.removeEventListener("click",V)}},[]);const S=u.useMemo(()=>Yw(s,f>=0?f:s.length),[s,f]),N=S!=null&&!p,k=S?S.text.slice(1):"";function C(R){if(!S)return;const z=`使用 skill「${R.label}」`;h(!0),o(q=>q.slice(0,S.start)+z+q.slice(S.start+S.text.length));const V=S.start+z.length;m(V),requestAnimationFrame(()=>{const q=d.current;q&&(q.selectionStart=q.selectionEnd=V),j()})}async function O(R=!1){if(i)return;const z=s.indexOf(`
|
|
463
|
-
`),V=(z<0?s:s.slice(0,z)).trim(),q=(z<0?"":s.slice(z+1)).trim(),I=l.map(te=>te.md).join(`
|
|
464
|
-
|
|
465
|
-
`),G=[q,I].filter(Boolean).join(`
|
|
466
|
-
|
|
467
|
-
`);o(""),a([]),requestAnimationFrame(j),await t(V,G,R)}return r.jsxs("div",{className:"board-add",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[(l.length>0||i)&&r.jsxs("div",{className:"sess-attachrow",children:[i&&r.jsx("span",{className:"sess-chip",children:"附件上传中…"}),l.map((R,z)=>r.jsxs("span",{className:"sess-chip",title:R.name,children:[(R.mime||"").startsWith("image/")&&R.url?r.jsx("img",{src:R.url,alt:R.name}):r.jsx(w0,{className:"h-3.5 w-3.5"}),r.jsx("span",{className:"sess-chip-name",children:R.name}),r.jsx("button",{type:"button",className:"sess-chip-x",title:"移除附件",onClick:()=>b(R.md),children:r.jsx(Ao,{className:"h-3 w-3"})})]},R.md+z))]}),r.jsxs("div",{className:"sess-slashwrap",children:[r.jsx(Bw,{open:N,query:k,items:g,onSelect:C,onClose:()=>h(!0)}),r.jsx(cs,{ref:d,rows:1,style:{minHeight:36},className:"resize-none",placeholder:"添加任务…(Enter 落待开发 / Ctrl+Enter 直接排队;可粘贴图片,可留空)",value:s,disabled:e,onChange:R=>{o(R.target.value),m(R.target.selectionStart??R.target.value.length),h(!1),j()},onPaste:x,onDrop:y,onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&!R.nativeEvent.isComposing&&(R.preventDefault(),O(R.ctrlKey))}})]})]}),r.jsx(D,{size:"sm",variant:"outline",disabled:e||i,onClick:()=>O(),children:r.jsx(Ja,{})})]})}function $M({open:e,onClose:t,projectId:n,settings:s,reload:o}){const[l,a]=u.useState("serial"),[i,c]=u.useState({url:"",user:"",token:""}),[d,f]=u.useState(!1),[m,p]=u.useState(!1),h=u.useRef(!1);u.useEffect(()=>{e&&!h.current&&s&&(h.current=!0,a(s.mode||"serial"),c(s.jira||{url:"",user:"",token:""})),e||(h.current=!1)},[e]);async function g(x){a(x);try{await Ce.updateSettings(n,{mode:x}),await o()}catch(y){M(y.message)}}async function w(){try{await Ce.updateSettings(n,{jira:i}),M("Jira 配置已保存"),await o()}catch(x){M(x.message)}}async function j(){f(!0);try{const x=await Ce.jiraTest(n,i);M(x.ok?`连接成功:${x.name}`:`连接失败:${x.error}`)}catch(x){M(x.message)}finally{f(!1)}}async function v(){p(!0);try{const x=await Ce.jiraImport(n);M(`导入完成:新增 ${x.added},跳过 ${x.skipped}`),await o()}catch(x){M(x.message)}finally{p(!1)}}return r.jsx(Qt,{open:e,onOpenChange:x=>!x&&t(),children:r.jsxs(Bt,{className:"modal w-[560px] sm:max-w-[92vw]",children:[r.jsx(Ut,{children:r.jsx(Ht,{children:"看板设置"})}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"ℹ 并行模式"}),[["serial","串行:同时只跑一个任务"],["parallel","并行:最多 5 个并行(队列窗口)"]].map(([x,y])=>r.jsxs("label",{className:"flex items-center gap-2 py-1 text-sm",children:[r.jsx("input",{type:"radio",name:"board-mode",checked:l===x,onChange:()=>g(x)}),y]},x))]}),r.jsxs("div",{className:"board-sec",children:[r.jsx("div",{className:"board-sec-t",children:"🐛 Jira"}),r.jsxs("div",{className:"form-col gap-2",children:[r.jsx(Ie,{placeholder:"Jira 地址(如 https://xx.atlassian.net)",value:i.url,onChange:x=>c({...i,url:x.target.value})}),r.jsx(Ie,{placeholder:"用户名(邮箱)",value:i.user,onChange:x=>c({...i,user:x.target.value})}),r.jsx(Ie,{placeholder:"API token",type:"password",value:i.token,onChange:x=>c({...i,token:x.target.value})})]}),r.jsxs("div",{className:"mt-2 flex gap-2",children:[r.jsx(D,{size:"sm",variant:"outline",onClick:w,children:"保存配置"}),r.jsx(D,{size:"sm",variant:"outline",disabled:d,onClick:j,children:"测试连接"}),r.jsx(D,{size:"sm",disabled:m,onClick:v,children:"导入我的待办"})]}),r.jsx("div",{className:"hint mt-1",children:"导入 = 拉取「指派给我且未解决」的前 50 条建卡(按 key 去重);凭据存服务端"})]})]})})}const IM=/^(\d{1,2}(?:\.\d{1,2})*)[.)、]?\s+/,AM=/^([^::]{1,24})[::]\s*(.*)$/;function ej(e){return e.ownerDocument.createTreeWalker(e,4).nextNode()}function OM(e){const t=e.querySelector("h1");if(!t)return{title:"",meta:[]};const n=t.textContent.trim();t.remove();const s=e.firstElementChild;if(!s||s.tagName!=="UL")return{title:n,meta:[]};const o=[];for(const a of[...s.children]){const i=ej(a);if(!i)return{title:n,meta:[]};const c=i.data.match(AM);if(!c)return{title:n,meta:[]};o.push([i,c])}if(o.length<2)return{title:n,meta:[]};const l=o.map(([a,i])=>(a.data=i[2],{k:i[1].trim(),v:a.parentElement.innerHTML}));return s.remove(),{title:n,meta:l}}function tj(e,t){const n=t||{},s=String(e||""),o=Oo(s);if(typeof DOMParser>"u")return{html:o,title:"",meta:[],outline:[]};const l=new DOMParser().parseFromString("<body>"+o+"</body>","text/html"),a=l.body;for(const f of[...a.querySelectorAll("table")]){const m=l.createElement("div");m.className="md-table-wrap",f.replaceWith(m),m.appendChild(f)}let i="",c=[];if(n.extractHeader){const f=OM(a);i=f.title,c=f.meta}const d=[];return a.querySelectorAll("h1, h2, h3, h4").forEach((f,m)=>{const p="md-h-"+m;f.id=p;let h="";const g=ej(f);if(g){const j=g.data.match(IM);j&&(h=j[1],g.data=g.data.slice(j[0].length))}const w=f.textContent.trim();if(h){const j=l.createElement("span");j.className="md-sec-no",j.textContent=h,f.insertBefore(j,f.firstChild)}d.push({id:p,level:Number(f.tagName.slice(1)),no:h,text:w})}),{html:a.innerHTML,title:i,meta:c,outline:d}}const LM={script:"自定义脚本(run.py)",scenario:"声明式场景(scenario.json)",legacy_scenario:"存量场景(旧布局 load/scenario_<id>.json)"};function pd({title:e,note:t,children:n}){return r.jsxs("details",{className:"lp-fold",children:[r.jsxs("summary",{children:[r.jsx("span",{className:"lp-fold-t",children:e}),t&&r.jsx("span",{className:"lp-fold-n",children:t})]}),r.jsx("div",{className:"lp-fold-body",children:n})]})}function zM({task:e}){var g,w;const[t,n]=u.useState(null),[s,o]=u.useState(""),[l,a]=u.useState(""),i=u.useRef(null);u.useEffect(()=>{if(!(e!=null&&e.id))return;let j=!1;return o(""),Be.loadCase(e.id).then(v=>{j||n(v)}).catch(v=>{j||o(v.message)}),()=>{j=!0}},[e==null?void 0:e.id,e==null?void 0:e.status]);const c=u.useMemo(()=>tj((t==null?void 0:t.plan_md)||"",{extractHeader:!0}),[t==null?void 0:t.plan_md]);u.useEffect(()=>{const j=i.current,v=c.outline;if(!j||!v.length){a("");return}const x=v.map(C=>j.querySelector("#"+C.id)).filter(Boolean);if(!x.length){a("");return}let y=j.parentElement;for(;y&&y!==document.body&&!(/(auto|scroll)/.test(getComputedStyle(y).overflowY)&&y.scrollHeight>y.clientHeight+20);)y=y.parentElement;let b=0;const S=()=>{b=0;const C=(y?y.getBoundingClientRect().top:0)+120;let O=x[0];for(const R of x)if(R.getBoundingClientRect().top<=C)O=R;else break;a(O.id)},N=()=>{b||(b=requestAnimationFrame(S))};S();const k=y||window;return k.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N),()=>{b&&cancelAnimationFrame(b),k.removeEventListener("scroll",N),window.removeEventListener("resize",N)}},[c]);function d(j){var y,b,S;const v=(y=i.current)==null?void 0:y.querySelector("#"+j);if(!v)return;const x=(S=(b=window.matchMedia)==null?void 0:b.call(window,"(prefers-reduced-motion: reduce)"))==null?void 0:S.matches;v.scrollIntoView({block:"start",behavior:x?"auto":"smooth"}),a(j)}if(s)return r.jsxs("div",{className:"hint",children:["方案读取失败:",s]});if(!t)return r.jsx("div",{className:"hint",children:"正在读取方案包…"});const f=t.charts?JSON.stringify(t.charts,null,2):"",m=(c.outline||[]).filter(j=>j.level>=2&&j.level<=3),p=c.title||(e==null?void 0:e.name)||`任务 #${e==null?void 0:e.id}`,h=t.plan_found&&(t.plan_md||"").length>400&&!c.outline.length&&!/<(ul|ol|table)[ >]/.test(c.html);return r.jsxs("div",{className:"lp-plan",children:[h&&r.jsx("div",{className:"hint lp-warn",children:"这份方案正文没有 markdown 结构(无标题 / 列表 / 表格)——页面只渲染 Markdown, 纯文本方案会挤成一整段;建议让 agent 按《方案文档模板》重写 plan.md。"}),r.jsxs("div",{className:"lp-doc"+(m.length>=3?" has-rail":""),children:[m.length>=3&&r.jsxs("nav",{className:"lp-doc-rail","aria-label":"方案目录",children:[r.jsx("div",{className:"lp-doc-rail-t",children:"目录"}),r.jsx("ol",{children:m.map(j=>r.jsx("li",{className:j.level>2?"sub":"",children:r.jsxs("a",{href:"#"+j.id,className:l===j.id?"on":"",onClick:v=>{v.preventDefault(),d(j.id)},children:[r.jsx("span",{className:"no",children:j.no||"·"}),r.jsx("span",{className:"t",children:j.text})]})},j.id))})]}),r.jsxs("article",{className:"lp-doc-main",children:[r.jsxs("header",{className:"lp-doc-head",children:[r.jsxs("div",{className:"lp-doc-eyebrow",children:[r.jsxs("span",{className:"lp-doc-kind",children:["压测方案 · #",e==null?void 0:e.id]}),r.jsxs("span",{className:"lp-doc-chips",children:[r.jsx("span",{className:"lp-chip"+(t.found?" on":" off"),children:t.found?LM[t.driver]||t.driver:"未找到执行载体"}),r.jsx("span",{className:"lp-chip",children:(w=(g=t.charts)==null?void 0:g.panels)!=null&&w.length?`面板 ${t.charts.panels.length} 个`:"默认面板"}),t.has_html&&r.jsx("span",{className:"lp-chip",children:"自定义视图 ✓"})]})]}),r.jsx("h1",{className:"lp-doc-title",children:p}),c.meta.length>0&&r.jsx("dl",{className:"lp-doc-meta",children:c.meta.map((j,v)=>r.jsxs("div",{className:"lp-doc-meta-row",children:[r.jsx("dt",{children:j.k}),r.jsx("dd",{dangerouslySetInnerHTML:{__html:j.v}})]},v))})]}),t.plan_found?r.jsx("div",{className:"lp-doc-body md-body",ref:i,dangerouslySetInnerHTML:{__html:c.html}}):r.jsx("div",{className:"lp-doc-body",ref:i,children:r.jsxs("div",{className:"lp-empty-state",children:[r.jsx("div",{className:"lp-empty-t",children:"本任务未生成方案文档"}),r.jsxs("p",{children:[r.jsx("code",{children:"plan.md"})," 由压测第 1 轮的 agent 产出,用来回答「压谁、压多狠、 看什么、怎么算通过」。它缺失不影响发压执行,但发压前就没有可复核的书面方案—— 可在方案包目录 ",r.jsxs("code",{children:["load/task_",e==null?void 0:e.id,"/"]})," 下补一份 Markdown 方案。"]})]})})]})]}),!t.found&&r.jsxs("div",{className:"hint lp-warn",children:["本任务的方案包缺失(需在 <案例库根>/load/task_",e==null?void 0:e.id,"/ 下生成 run.py 或 scenario.json);发压轮会因此失败。"]}),t.charts_error&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,面板已回退默认:",t.charts_error]}),r.jsxs("div",{className:"lp-doc-appendix",children:[t.script_text&&r.jsx(pd,{title:"执行载体源码",note:t.script_name,children:r.jsx("pre",{className:"lp-code",children:t.script_text})}),f&&r.jsx(pd,{title:"图表声明",note:"charts.json",children:r.jsx("pre",{className:"lp-code",children:f})}),r.jsx(pd,{title:"指标口径速查",note:"写脚本 / 声明图表时对照",children:r.jsxs("ul",{className:"lp-tips",children:[r.jsxs("li",{children:[r.jsx("code",{children:"gauge"}),":瞬时值(rps / lat.p50·p90·p95·p99 / err.rate / conc)"]}),r.jsxs("li",{children:[r.jsx("code",{children:"counter"}),":单调递增累计值(req.total / 业务计数),面板按窗口增量或速率画"]}),r.jsxs("li",{children:[r.jsx("code",{children:"labels"}),":维度字典(如 ",r.jsx("code",{children:'{"status":"已成交"}'}),"), 同一 metric 靠它区分序列;",r.jsx("code",{children:"groupBy"})," 指定的就是这里的键"]}),r.jsxs("li",{children:[r.jsx("code",{children:"summary"}),":收尾 KPI 行,供单值卡与报告使用"]})]})})]})]})}const DM={running:"进行中",done:"成功",failed:"失败",stopped:"已停止",interrupted:"被中断",unknown:"历史(未登记)"};function FM(e,t){const n=((e==null?void 0:e.started_at)||"").slice(5,16)||((e==null?void 0:e.run_key)||"").replace("_"," ");return`${e!=null&&e.registered?`运行 #${t+1}`:"历史报告"} · ${n} · ${DM[e==null?void 0:e.status]||(e==null?void 0:e.status)||"未知"}`}const BM=1200;function UM(e,t){const n=Object.keys(t||{}).sort();return e+"|"+n.map(s=>`${s}=${t[s]}`).join(",")}function lx(e=BM){const t=new Map;return{add(n){if(!n||typeof n.metric!="string")return!1;const s=Number(n.value);if(!Number.isFinite(s))return!1;const o=Number(n.ts),l=UM(n.metric,n.labels);let a=t.get(l);return a||(a={key:l,metric:n.metric,labels:n.labels||{},type:n.type==="counter"?"counter":"gauge",points:[]},t.set(l,a)),a.points.push([Number.isFinite(o)?o:Date.now()/1e3,s]),a.points.length>e&&a.points.shift(),!0},list(){return[...t.values()]},size(){return t.size},clear(){t.clear()}}}function HM(e,t){if(!t)return!0;const n=e||{};return Object.entries(t).every(([s,o])=>String(n[s])===String(o))}function wm(e,t,n){const s=e.list().filter(l=>l.metric===t);if(!s.length)return null;if(n)return s.find(l=>HM(l.labels,n))||null;const o=s.find(l=>!Object.keys(l.labels).length);return o||s.sort((l,a)=>l.key.localeCompare(a.key))[0]}function VM(e,t){return e.list().filter(n=>n.metric===t&&Object.keys(n.labels).length)}function hu(e,t={}){const n=Number(t.scale)||1,s=e.points;if(e.type!=="counter")return s.map(([l,a])=>[l,a*n]);const o=[];for(let l=1;l<s.length;l+=1){const a=s[l][0]-s[l-1][0];if(a<=0)continue;const i=s[l][1]-s[l-1][1];o.push([s[l][0],(t.rate?i/a:i)*n])}return o}function jm(e,t,n="last"){if(!e.length||t<=0)return e.slice();const s=new Map;return e.forEach(([o,l])=>{const a=Math.floor(o/t)*t,i=s.get(a);i?(i.sum+=l,i.n+=1,i.last=l):s.set(a,{t:a,sum:l,n:1,last:l})}),[...s.entries()].sort((o,l)=>o[0]-l[0]).map(([o,l])=>n==="avg"?[o,l.sum/l.n]:n==="sum"?[o,l.sum]:[o,l.last])}function WM(e,t=600){if(e.length<=t)return e;const n=e.length/t,s=[];for(let l=0;l<t;l+=1)s.push(e[Math.floor(l*n)]);const o=e[e.length-1];return s[s.length-1]!==o&&s.push(o),s}function nj(e,t,n){const s=[];return e.list().filter(o=>o.metric===t).forEach(o=>{var a;if(!o.points.length)return;const l=n?(a=o.labels)==null?void 0:a[n]:Object.values(o.labels||{})[0]??"全部";s.push({label:String(l??"全部"),value:o.points[o.points.length-1][1],labels:o.labels||{}})}),s.sort((o,l)=>l.value-o.value)}function qM(e,t="last",n=1){if(!e||!e.points.length)return null;const s=e.points.map(([,l])=>l);let o;return t==="avg"?o=s.reduce((l,a)=>l+a,0)/s.length:t==="max"?o=Math.max(...s):t==="min"?o=Math.min(...s):t==="sum"?o=s.reduce((l,a)=>l+a,0):o=s[s.length-1],o*(Number(n)||1)}function Fo(e,t){if(e==null||!Number.isFinite(e))return"—";if(t!=null&&t!=="")return Number(e).toFixed(Number(t));const n=Math.abs(e);return n>=1e3?Math.round(e).toLocaleString("en-US"):n>=10?e.toFixed(1):n>=1?e.toFixed(2):n===0?"0":e.toFixed(3)}function bm(e){let t=1/0,n=-1/0;return e.forEach(s=>s.forEach(([o])=>{o<t&&(t=o),o>n&&(n=o)})),n>t?n-t:0}function _m(e,t=600){return!e||e<=0?1:Math.max(1,Math.ceil(e/t))}const Gn=["var(--run)","var(--retest)","var(--fail)","var(--pass)","var(--fix)","#8ab4f8","#c58af9","#f6bf72"],Xr=640,Jr=150,Dt={l:48,r:10,t:10,b:18},Bf=600,GM=40;function Zr({text:e="暂无数据(本轮尚未产生该指标)"}){return r.jsx("div",{className:"lp-empty hint",children:e})}function sj(e,t,n,s){const o=t-e,l=s-n;return{x:a=>Dt.l+(o>0?(a-e)/o:.5)*(Xr-Dt.l-Dt.r),y:a=>Jr-Dt.b-(l>0?(a-n)/l:.5)*(Jr-Dt.t-Dt.b)}}function Sm({scale:e,vmin:t,vmax:n}){const s=[t,(t+n)/2,n];return r.jsx("g",{children:s.map((o,l)=>r.jsxs("g",{children:[r.jsx("line",{x1:Dt.l,x2:Xr-Dt.r,y1:e.y(o),y2:e.y(o),stroke:"var(--border)",strokeWidth:"0.5",strokeDasharray:"3 3"}),r.jsx("text",{x:Dt.l-4,y:e.y(o)+3,textAnchor:"end",style:{fontSize:9,fill:"var(--dim)"},children:Fo(o)})]},l))})}function KM({panel:e,store:t}){const n=(e.series||[]).map((m,p)=>{const h=wm(t,m.metric,m.match),g=h?hu(h,{scale:m.scale,rate:h.type==="counter"}):[],w=_m(bm([g]),Bf);return{label:m.label||m.metric,color:Gn[p%Gn.length],points:WM(jm(g,w,h&&h.type==="gauge"?"last":"sum"),Bf),suffix:h&&h.type==="counter"?"/s":""}}),s=n.flatMap(m=>m.points);if(!s.length)return r.jsx(Zr,{});const o=s.map(m=>m[0]),l=s.map(m=>m[1]),[a,i]=[Math.min(...o),Math.max(...o)],c=Math.max(...l,0),d=Math.min(...l,0),f=sj(a,i,d,c);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Xr} ${Jr}`,className:"lp-svg",children:[r.jsx(Sm,{scale:f,vmin:d,vmax:c}),n.map(m=>r.jsx("polyline",{fill:"none",strokeWidth:"1.6",stroke:m.color,points:m.points.map(([p,h])=>`${f.x(p)},${f.y(h)}`).join(" ")},m.label))]}),r.jsx("div",{className:"lp-legend",children:n.map(m=>r.jsxs("span",{children:[r.jsx("i",{style:{background:m.color}}),m.label,m.suffix]},m.label))})]})}function YM({panel:e,store:t}){if(e.by==="label"||!e.by&&e.groupBy){const m=nj(t,e.metric,e.groupBy);if(!m.length)return r.jsx(Zr,{});const p=Math.max(...m.map(h=>h.value),1);return r.jsx("div",{className:"lp-bars",children:m.map((h,g)=>r.jsxs("div",{className:"lp-bar-row",children:[r.jsx("span",{className:"lb",title:h.label,children:h.label}),r.jsx("span",{className:"lt",children:r.jsx("i",{style:{width:`${h.value/p*100}%`,background:Gn[g%Gn.length]}})}),r.jsx("span",{className:"lv",children:Fo(h.value,e.precision)})]},h.label))})}const n=wm(t,e.metric);if(!n)return r.jsx(Zr,{});const s=n.type==="counter",o=hu(n,{scale:e.scale,rate:s}),l=_m(bm([o]),Bf/4),a=jm(o,l,s?"sum":"avg");if(!a.length)return r.jsx(Zr,{});const i=a.map(m=>m[0]),c=a.map(m=>m[1]),d=sj(Math.min(...i),Math.max(...i),0,Math.max(...c,1)),f=Math.max(1,(Xr-Dt.l-Dt.r)/a.length*.7);return r.jsxs("svg",{viewBox:`0 0 ${Xr} ${Jr}`,className:"lp-svg",children:[r.jsx(Sm,{scale:d,vmin:0,vmax:Math.max(...c,1)}),a.map(([m,p])=>r.jsx("rect",{x:d.x(m)-f/2,y:d.y(p),width:f,height:Jr-Dt.b-d.y(p),fill:Gn[0],opacity:"0.85"},m))]})}function QM({panel:e,store:t}){const s=VM(t,e.metric).map(g=>{var w;return{label:String(((w=g.labels)==null?void 0:w[e.groupBy])??Object.values(g.labels)[0]??"?"),type:g.type,points:hu(g,{rate:!1})}}).filter(g=>g.points.length);if(!s.length)return r.jsx(Zr,{});const o=bm(s.map(g=>g.points)),l=Math.max(_m(o,GM),1),a=new Map;s.forEach(g=>{jm(g.points,l,g.type==="counter"?"sum":"avg").forEach(([w,j])=>{a.has(w)||a.set(w,{}),a.get(w)[g.label]=j})});const i=[...a.keys()].sort((g,w)=>g-w),c=i.map(g=>Object.values(a.get(g)).reduce((w,j)=>w+j,0)),d=Math.max(...c,1),f=s.map(g=>g.label),m=Math.max(1,(Xr-Dt.l-Dt.r)/i.length*.7),p=g=>Dt.l+(g-i[0])/Math.max(i[i.length-1]-i[0],1)*(Xr-Dt.l-Dt.r),h=g=>Jr-Dt.b-g/d*(Jr-Dt.t-Dt.b);return r.jsxs("div",{children:[r.jsxs("svg",{viewBox:`0 0 ${Xr} ${Jr}`,className:"lp-svg",children:[r.jsx(Sm,{scale:{x:p,y:h},vmin:0,vmax:d}),i.map(g=>{let w=0;return r.jsx("g",{children:f.map((j,v)=>{const x=a.get(g)[j]||0,y=h(w);w+=x;const b=h(w);return x>0?r.jsx("rect",{x:p(g)-m/2,y:b,width:m,height:y-b,fill:Gn[v%Gn.length],opacity:"0.9"},j):null})},g)})]}),r.jsx("div",{className:"lp-legend",children:f.map((g,w)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Gn[w%Gn.length]}}),g]},g))})]})}function XM({panel:e,store:t}){const n=nj(t,e.metric,e.groupBy),s=n.reduce((i,c)=>i+Math.max(c.value,0),0);if(!n.length||s<=0)return r.jsx(Zr,{});const o=52,l=2*Math.PI*o;let a=0;return r.jsxs("div",{className:"lp-donut",children:[r.jsxs("svg",{viewBox:"0 0 140 140",className:"lp-donut-svg",children:[r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:"var(--border)",strokeWidth:"18"}),n.map((i,c)=>{const d=Math.max(i.value,0)/s,f=`${d*l} ${l}`,m=-a*l;return a+=d,r.jsx("circle",{cx:"70",cy:"70",r:o,fill:"none",stroke:Gn[c%Gn.length],strokeWidth:"18",strokeDasharray:f,strokeDashoffset:m,transform:"rotate(-90 70 70)"},i.label)}),r.jsx("text",{x:"70",y:"74",textAnchor:"middle",style:{fontSize:15,fill:"var(--foreground)"},children:Fo(s)})]}),r.jsx("div",{className:"lp-legend col",children:n.map((i,c)=>r.jsxs("span",{children:[r.jsx("i",{style:{background:Gn[c%Gn.length]}}),i.label," ",r.jsx("b",{children:Fo(i.value)}),r.jsxs("em",{children:[(i.value/s*100).toFixed(1),"%"]})]},i.label))})]})}function JM({panel:e,store:t}){const n=(e.stats||[]).map(s=>{const o=wm(t,s.metric,s.match);return{...s,value:qM(o,s.agg,s.scale)}});return r.jsx("div",{className:"lp-stats",children:n.map(s=>r.jsxs("div",{className:"lp-stat",children:[r.jsx("div",{className:"k",children:s.label||s.metric}),r.jsxs("div",{className:"v",children:[Fo(s.value,s.precision),s.unit?r.jsx("span",{className:"u",children:s.unit}):null]})]},s.metric+(s.label||"")))})}function ZM({panel:e,store:t}){const n=t.list().filter(a=>a.metric===e.metric);if(!n.length)return r.jsx(Zr,{});const s=e.groupBy||null,o=n.map(a=>{var m;const i=a.points.length?a.points[a.points.length-1][1]:null,c=hu(a,{rate:a.type==="counter"}),d=c.length?c[c.length-1][1]:null,f=s?(m=a.labels)==null?void 0:m[s]:Object.values(a.labels||{}).join(" / ")||"全部";return{dim:String(f??"全部"),labels:a.labels||{},last:i,rate:d,type:a.type}}),l=o.some(a=>a.type==="counter");return r.jsx("div",{className:"lp-table-wrap",children:r.jsxs("table",{className:"lp-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:s||"维度"}),r.jsx("th",{style:{textAlign:"right"},children:"最新值"}),l&&r.jsx("th",{style:{textAlign:"right"},children:"速率 /s"})]})}),r.jsx("tbody",{children:o.map(a=>r.jsxs("tr",{children:[r.jsx("td",{title:JSON.stringify(a.labels),children:a.dim}),r.jsx("td",{style:{textAlign:"right"},children:Fo(a.last)}),l&&r.jsx("td",{style:{textAlign:"right"},children:Fo(a.rate)})]},a.dim+JSON.stringify(a.labels)))})]})})}function eT({panel:e,store:t}){const n={panel:e,store:t};return e.type==="line"?r.jsx(KM,{...n}):e.type==="bar"?r.jsx(YM,{...n}):e.type==="stacked_bar"?r.jsx(QM,{...n}):e.type==="donut"?r.jsx(XM,{...n}):e.type==="stat"?r.jsx(JM,{...n}):e.type==="table"?r.jsx(ZM,{...n}):r.jsx(Zr,{text:`未支持的面板类型:${e.type}`})}const tT=2e3,nT=40;function sT({task:e,store:t}){const n=u.useRef(null),s=e==null?void 0:e.id;function o(){const l=n.current&&n.current.contentWindow;if(!l)return;const a=t.list().slice(0,nT).map(i=>({metric:i.metric,labels:i.labels,type:i.type,points:i.points.slice(-300)}));l.postMessage({type:"ts.metrics",task:s,series:a},"*")}return u.useEffect(()=>{if(!s)return;const l=setInterval(o,tT);return()=>clearInterval(l)},[s,t]),s?r.jsxs("section",{className:"lp-panel full lp-hatch",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"自定义视图(panel.html)"}),r.jsx("span",{className:"hint",children:"沙箱 iframe:读不到站点数据,只能消费 postMessage 推入的指标"})]}),r.jsx("iframe",{ref:n,sandbox:"allow-scripts",title:"自定义压测视图",className:"lp-hatch-frame",src:Be.loadCustomHtmlUrl(s),onLoad:o})]}):null}const rT=1e3,oT=2e4,lT=20;function rj({task:e,run:t="",live:n}){const[s,o]=u.useState(null),[l,a]=u.useState(""),[i,c]=u.useState(!1),[d,f]=u.useState(!0),[m,p]=u.useState(""),[,h]=u.useState(0),g=u.useRef(lx()),w=e==null?void 0:e.id,j=n===void 0?(e==null?void 0:e.status)==="running"&&!t:!!n;u.useEffect(()=>{if(!w)return;let x=!1;return f(!0),p(""),Be.loadCase(w).then(y=>{x||(o(y.charts||null),a(y.charts_error||""),c(!!y.has_html),f(!1))}).catch(y=>{x||(p(y.message),f(!1))}),()=>{x=!0}},[w,j]),u.useEffect(()=>{if(!w||!s)return;g.current=lx(),h(b=>b+1);let x=!1;const y=()=>{x||h(b=>b+1)};if(j){const b=Be.loadStream(w,t),S=setInterval(y,rT);return b.onmessage=N=>{try{const k=JSON.parse(N.data);if(k.done){b.close(),clearInterval(S),y();return}g.current.add(k)}catch{}},()=>{x=!0,b.close(),clearInterval(S)}}return(async()=>{let b=0;for(let S=0;S<lT;S+=1){const N=await Be.loadMetrics(w,b,oT,t);if(x)return;const k=N.samples||[];if(k.forEach(C=>g.current.add(C)),!k.length||N.next<=b)break;b=N.next}y()})().catch(b=>{x||p(b.message)}),()=>{x=!0}},[w,j,s,t]);const v=(s==null?void 0:s.panels)||[];return r.jsxs("div",{className:"lp-dash",children:[l&&r.jsxs("div",{className:"hint lp-warn",children:["图表声明不合法,已回退默认面板:",l]}),m&&r.jsxs("div",{className:"hint lp-warn",children:["指标加载失败:",m]}),d&&!v.length?r.jsx("div",{className:"hint",children:"正在读取方案包…"}):r.jsx("div",{className:"lp-grid",children:v.map(x=>r.jsxs("section",{className:"lp-panel "+(x.width==="full"?"full":"half"),children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:x.title}),x.hint&&r.jsx("span",{className:"hint",children:x.hint})]}),r.jsx(eT,{panel:x,store:g.current})]},x.id))}),i&&r.jsx(sT,{task:e,store:g.current})]})}const aT=5e3,iT=2e3;function cT(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/STRESS_DONE|ROUND_DONE|LOAD 总请求/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}function uT({task:e}){const[t,n]=u.useState([]),[s,o]=u.useState(""),[l,a]=u.useState(0),[i,c]=u.useState(""),[d,f]=u.useState(null),m=u.useRef(null),p=u.useRef(!0),h=e==null?void 0:e.id,g=(e==null?void 0:e.status)==="running",w=e==null?void 0:e.ended_at;u.useEffect(()=>{if(!h)return;let k=!1;return Be.loadRuns(h).then(C=>{if(k)return;const O=C.runs||[];n(O),o(R=>O.some(z=>z.run_key===R)?R:O.length?O[0].run_key:"")}).catch(()=>{k||n([])}),()=>{k=!0}},[h,g,w,l]);const j=t.findIndex(k=>k.run_key===s),v=j>=0?t[j]:t[0]||null,x=(v==null?void 0:v.run_key)||"",y=(v==null?void 0:v.status)==="running",b=(v==null?void 0:v.round_no)||0;u.useEffect(()=>{if(!h||!b){c("");return}let k=!1;const C=async()=>{const R=m.current;p.current=R?R.scrollHeight-R.scrollTop-R.clientHeight<60:!0;try{const z=await Be.log(h,b,aT);k||c(V=>V===z.log?V:z.log)}catch{k||c("")}};C();const O=setInterval(C,iT);return()=>{k=!0,clearInterval(O)}},[h,b,l]),u.useEffect(()=>{const k=m.current;k&&p.current&&(k.scrollTop=k.scrollHeight)},[i]),u.useEffect(()=>{if(!h||y){f(null);return}let k=!1;return Be.loadReport(h,x).then(C=>{k||f(C)}).catch(()=>{k||f(null)}),()=>{k=!0}},[h,x,y,w,l]);const S=u.useMemo(()=>i?i.split(`
|
|
468
|
-
`):[],[i]),N=u.useMemo(()=>d!=null&&d.found?tj(d.md).html:"",[d]);return r.jsxs("div",{className:"lp-log",children:[r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行"}),r.jsx("span",{className:"hint",children:"每次发压是一次运行(报告 / 曲线 / 日志都按运行切分)"}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx("button",{type:"button",className:"lp-chip",title:"刷新运行列表",onClick:()=>a(k=>k+1),children:"↻ 刷新"}),t.length>0&&r.jsxs(At,{value:x,onValueChange:o,children:[r.jsx(Rt,{size:"sm",className:"h-7 min-w-[220px] text-xs",children:r.jsx(Et,{})}),r.jsx(Pt,{children:t.map((k,C)=>r.jsx(Ae,{value:k.run_key,children:FM(k,C)},k.run_key))})]})]})]}),!t.length&&r.jsx("div",{className:"hint",children:g?"发压中…(运行列表稍后自动刷新)":"暂无运行记录(发压结束后生成报告与曲线)"}),v&&!v.has_metrics&&r.jsx("div",{className:"hint lp-warn",children:"该运行为存量报告(无曲线数据);可查看下方报告。"})]}),(!v||v.has_metrics)&&r.jsx(rj,{task:e,run:x,live:y}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"运行日志"}),v&&r.jsx("span",{className:"hint",children:v.registered?`第 ${v.round_no} 轮(发压)`:"存量运行无独立日志"})]}),r.jsx("div",{className:"log lp-logbox",ref:m,children:S.length?S.map((k,C)=>r.jsx("div",{className:"log-line "+cT(k),children:k||" "},C)):r.jsx("div",{className:"hint",children:b?"该运行暂无日志":"该运行没有独立日志文件"})})]}),r.jsxs("section",{className:"lp-panel full",children:[r.jsxs("div",{className:"lp-panel-head",children:[r.jsx("h4",{children:"压测报告"}),(d==null?void 0:d.found)&&r.jsxs("span",{className:"hint",children:[d.file,d.run_key?`(运行键 ${d.run_key})`:""]}),(d==null?void 0:d.found)&&r.jsx("button",{type:"button",className:"lp-chip ml-auto",title:"复制报告文件名",onClick:()=>{var k;(k=navigator.clipboard)==null||k.writeText(d.file||""),M("已复制报告文件名")},children:"复制文件名"})]}),d!=null&&d.found?r.jsx("div",{className:"lp-report",children:r.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:N}})}):r.jsx("div",{className:"hint",children:y?"发压中,结束后生成报告":v?"该运行暂无报告":"暂无压测报告(发压结束或被停止后生成)"})]})]})}var dT=Object.defineProperty,km=(e,t)=>dT(e,"name",{value:t,configurable:!0}),md=!1;function oj(){const[e,t]=u.useState(md);return u.useEffect(()=>{md||(md=!0,t(!0))},[]),e}km(oj,"useIsHydrated");var lj=Bo[" useSyncExternalStore ".trim().toString()];function aj(){return()=>{}}km(aj,"subscribe");function ij(){return lj(aj,()=>!0,()=>!1)}km(ij,"useIsHydratedModern");var fT=typeof lj=="function"?ij:oj,pT=Object.defineProperty,Ko=(e,t)=>pT(e,"name",{value:t,configurable:!0}),hd="rovingFocusGroup.onEntryFocus",mT={bubbles:!1,cancelable:!0},gu="RovingFocusGroup",[Uf,cj,hT]=Zp(gu),[gT,uj]=co(gu,[hT]),[xT,vT]=gT(gu),yT=u.forwardRef(Ko(function(t,n){return r.jsx(Uf.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(Uf.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(wT,{...t,ref:n})})})},"RovingFocusGroup")),wT=u.forwardRef(Ko(function(t,n){const{__scopeRovingFocusGroup:s,orientation:o,loop:l=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...p}=t,h=u.useRef(null),g=yt(n,h),w=ru(a),[j,v]=Ll({prop:i,defaultProp:c??null,onChange:d,caller:gu}),[x,y]=u.useState(!1),b=Rs(f),S=cj(s),N=u.useRef(!1),[k,C]=u.useState(0);return u.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(hd,b),()=>O.removeEventListener(hd,b)},[b]),r.jsx(xT,{scope:s,orientation:o,dir:w,loop:l,currentTabStopId:j,onItemFocus:u.useCallback(O=>v(O),[v]),onItemShiftTab:u.useCallback(()=>y(!0),[]),onFocusableItemAdd:u.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:u.useCallback(()=>C(O=>O-1),[]),children:r.jsx(ot.div,{tabIndex:x||k===0?-1:0,"data-orientation":o,...p,ref:g,style:{outline:"none",...t.style},onMouseDown:Ye(t.onMouseDown,()=>{N.current=!0}),onFocus:Ye(t.onFocus,O=>{const R=!N.current;if(O.target===O.currentTarget&&R&&!x){const z=new CustomEvent(hd,mT);if(O.currentTarget.dispatchEvent(z),!z.defaultPrevented){const V=S().filter(H=>H.focusable),q=V.find(H=>H.active),I=V.find(H=>H.id===j),te=[q,I,...V].filter(Boolean).map(H=>H.ref.current);Nm(te,m)}}N.current=!1}),onBlur:Ye(t.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),jT="RovingFocusGroupItem",bT=u.forwardRef(Ko(function(t,n){const{__scopeRovingFocusGroup:s,focusable:o=!0,active:l=!1,tabStopId:a,children:i,...c}=t,d=Yr(),f=a||d,m=vT(jT,s),p=m.currentTabStopId===f,h=cj(s),{onFocusableItemAdd:g,onFocusableItemRemove:w,currentTabStopId:j}=m,v=fT();return Lt(()=>{if(!(!v||!o))return g(),()=>w()},[v,o,g,w]),u.useEffect(()=>{if(!(v||!o))return g(),()=>w()},[v,o,g,w]),r.jsx(Uf.ItemSlot,{scope:s,id:f,focusable:o,active:l,children:r.jsx(ot.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...c,ref:n,onMouseDown:Ye(t.onMouseDown,x=>{o?m.onItemFocus(f):x.preventDefault()}),onFocus:Ye(t.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ye(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){m.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=fj(x,m.orientation,m.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=h().filter(N=>N.focusable).map(N=>N.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const N=S.indexOf(x.currentTarget);S=m.loop?pj(S,N+1):S.slice(N+1)}setTimeout(()=>Nm(S))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:j!=null}):i})})},"RovingFocusGroupItem")),_T={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Ko(dj,"getDirectionAwareKey");function fj(e,t,n){const s=dj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return _T[s]}Ko(fj,"getFocusIntent");function Nm(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}Ko(Nm,"focusFirst");function pj(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Ko(pj,"wrapArray");var ST=yT,kT=bT,NT=Object.defineProperty,Kl=(e,t)=>NT(e,"name",{value:t,configurable:!0}),Cm="Tabs",[CT,j$]=co(Cm,[uj]),mj=uj(),[ET,Em]=CT(Cm),RT=u.forwardRef(Kl(function(t,n){const{__scopeTabs:s,value:o,onValueChange:l,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=t,m=ru(c),[p,h]=Ll({prop:o,onChange:l,defaultProp:a??"",caller:Cm});return r.jsx(ET,{scope:s,baseId:Yr(),value:p,onValueChange:h,orientation:i,dir:m,activationMode:d,children:r.jsx(ot.div,{dir:m,"data-orientation":i,...f,ref:n})})},"Tabs")),PT="TabsList",MT=u.forwardRef(Kl(function(t,n){const{__scopeTabs:s,loop:o=!0,...l}=t,a=Em(PT,s),i=mj(s);return r.jsx(ST,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:r.jsx(ot.div,{role:"tablist","aria-orientation":a.orientation,...l,ref:n})})},"TabsList")),TT="TabsTrigger",$T=u.forwardRef(Kl(function(t,n){const{__scopeTabs:s,value:o,disabled:l=!1,...a}=t,i=Em(TT,s),c=mj(s),d=Rm(i.baseId,o),f=Pm(i.baseId,o),m=o===i.value;return r.jsx(kT,{asChild:!0,...c,focusable:!l,active:m,children:r.jsx(ot.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:d,...a,ref:n,onMouseDown:Ye(t.onMouseDown,p=>{!l&&p.button===0&&p.ctrlKey===!1?i.onValueChange(o):p.preventDefault()}),onKeyDown:Ye(t.onKeyDown,p=>{l||p.target!==p.currentTarget||[" ","Enter"].includes(p.key)&&i.onValueChange(o)}),onFocus:Ye(t.onFocus,()=>{const p=i.activationMode!=="manual";!m&&!l&&p&&i.onValueChange(o)})})})},"TabsTrigger")),IT="TabsContent",AT=u.forwardRef(Kl(function(t,n){const{__scopeTabs:s,value:o,forceMount:l,children:a,...i}=t,c=Em(IT,s),d=Rm(c.baseId,o),f=Pm(c.baseId,o),m=o===c.value,p=u.useRef(m);return u.useEffect(()=>{const h=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(h)},[]),r.jsx(Za,{present:l||m,children:({present:h})=>r.jsx(ot.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!h,id:f,tabIndex:0,...i,ref:n,style:{...t.style,animationDuration:p.current?"0s":void 0},children:h&&a})})},"TabsContent"));function Rm(e,t){return`${e}-trigger-${t}`}Kl(Rm,"makeTriggerId");function Pm(e,t){return`${e}-content-${t}`}Kl(Pm,"makeContentId");var OT=RT,LT=MT,zT=$T,DT=AT;const hj=OT,Mm=u.forwardRef(({className:e,...t},n)=>r.jsx(LT,{ref:n,"data-slot":"tabs-list",className:He("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t}));Mm.displayName="TabsList";const zc=u.forwardRef(({className:e,...t},n)=>r.jsx(zT,{ref:n,"data-slot":"tabs-trigger",className:He("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t}));zc.displayName="TabsTrigger";const Or=u.forwardRef(({className:e,...t},n)=>r.jsx(DT,{ref:n,"data-slot":"tabs-content",className:He("flex-1 outline-none",e),...t}));Or.displayName="TabsContent";const FT=["done","failed","stopped","interrupted"];function BT(){const e=$n(),t=e.currentProject,n=u.useMemo(()=>e.tasks.filter(N=>N.project_id===(t==null?void 0:t.id)&&N.task_type==="stress").sort((N,k)=>(k.created_at||"").localeCompare(N.created_at||"")),[e.tasks,t==null?void 0:t.id]),[s,o]=u.useState(null),[l,a]=u.useState("plan"),[i,c]=u.useState({}),d=u.useRef({}),[f,m]=u.useState([]),[p,h]=u.useState(""),g=n.find(N=>N.id===s)||null,w=g==null?void 0:g.status,j=FT.includes(w),v=w==="running"||w==="queued",x=f.filter(N=>N.registered).length;u.useEffect(()=>{if(!s){m([]);return}let N=!1;return Be.loadRuns(s).then(k=>{N||m(k.runs||[])}).catch(()=>{N||m([])}),()=>{N=!0}},[s,w,p]);async function y(N){if(g){h(N);try{N==="rerun"?await Be.loadRerun(g.id):N==="stop"?await Be.stop(g.id):N==="diagnose"?await Be.loadDiagnose(g.id):N==="restart"&&await Be.restart(g.id),M({rerun:"已入队复压(同一方案再压一次),等待执行",stop:"已请求停止",diagnose:"已把运行现场发给 agent(项目忙时排队)",restart:"已清空运行记录并重启(从第 1 轮重跑)"}[N])}catch(k){M(k.message)}finally{h("")}}}function b(){window.confirm(`用现有方案包再压一次「${g.name}」?
|
|
469
|
-
(跳过 agent 出方案,直接发压并生成新一份报告/曲线)`)&&y("rerun")}function S(){window.confirm(`重启「${g.name}」将清空全部运行记录,从第 1 轮重跑(agent 重新出方案)。
|
|
470
|
-
历史报告文件仍留在 load/report/ 目录。继续?`)&&y("restart")}return u.useEffect(()=>{if(!n.length){o(null);return}n.some(N=>N.id===s)||o(n[0].id)},[n,s]),u.useEffect(()=>{const N=n.filter(k=>{const C=`${k.id}:${k.status}`;return!d.current[C]});N.length&&(N.forEach(k=>{d.current[`${k.id}:${k.status}`]=!0}),Promise.all(N.map(k=>Be.loadCaseMeta(k.id).then(C=>[k.id,C]).catch(()=>[k.id,null]))).then(k=>{c(C=>{const O={...C};return k.forEach(([R,z])=>{z&&(O[R]=z)}),O})}))},[n]),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("aside",{className:"flex w-[300px] flex-none flex-col border-r border-border",children:[r.jsxs("div",{className:"flex-none px-3 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:["压测任务(",n.length,")"]}),r.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2",children:[n.map(N=>{const k=i[N.id];return r.jsxs("button",{type:"button",className:"load-item"+(s===N.id?" on":""),onClick:()=>o(N.id),children:[r.jsx("div",{className:"truncate text-[calc(13px*var(--fs))] font-semibold",title:N.name,children:N.name}),r.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5 text-[calc(11px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{className:"badge st-"+N.status,children:[r.jsx("span",{className:"dot"}),cr[N.status]||N.status]}),r.jsxs("span",{children:["轮 ",N.current_round]}),r.jsx("span",{className:"ml-auto",children:ns(N.created_at)})]}),k&&r.jsxs("div",{className:"lp-marks",children:[k.plan_found&&r.jsx("span",{className:"lp-chip sm",children:"方案 ✓"}),k.driver==="script"&&r.jsx("span",{className:"lp-chip sm",children:"脚本"}),k.driver==="scenario"&&r.jsx("span",{className:"lp-chip sm",children:"场景"}),k.driver==="legacy_scenario"&&r.jsx("span",{className:"lp-chip sm",children:"存量场景"}),!k.found&&r.jsx("span",{className:"lp-chip sm off",children:"无方案"}),k.has_html&&r.jsx("span",{className:"lp-chip sm",children:"自定义视图"})]}),N.error&&r.jsx("div",{className:"mt-1 truncate text-[calc(11px*var(--fs))]",style:{color:"var(--fail)"},title:N.error,children:N.error})]},N.id)}),!n.length&&r.jsx("div",{className:"p-2 text-xs leading-relaxed text-muted-foreground",children:"暂无压测任务。在「测试任务」页新建类型为「压力测试」的任务(填写压测说明)后,会自动显示在这里。"})]})]}),r.jsx("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:g?r.jsxs(hj,{value:l,onValueChange:a,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-3",children:[r.jsx("h3",{className:"m-0 font-serif text-[calc(15px*var(--fs))] font-semibold",children:g.name}),r.jsxs("span",{className:"badge st-"+g.status,children:[r.jsx("span",{className:"dot"}),cr[g.status]||g.status]}),r.jsxs("span",{className:"lp-chip sm",children:["已跑 ",x," 次"]}),r.jsxs(Mm,{className:"ml-2 h-8",children:[r.jsx(zc,{value:"plan",className:"px-3",children:"压测方案"}),r.jsx(zc,{value:"log",className:"px-3",children:"压测日志"})]}),r.jsxs("span",{className:"ml-auto font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:["创建 ",ns(g.created_at),g.started_at?` · 开始 ${ns(g.started_at)}`:"",g.ended_at?` · 结束 ${ns(g.ended_at)}`:""]})]}),r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2 px-4 pt-2",children:[r.jsx(D,{size:"sm",variant:"outline",disabled:!j||!!p,title:"跳过 agent,用现有方案包再压一次(生成新一份报告与曲线)",onClick:b,children:"复压"}),v&&r.jsx(D,{size:"sm",variant:"outline",disabled:!!p,title:"停止当前运行(先落 stop 文件,宽限 10s 后杀进程树)",onClick:()=>y("stop"),children:"停止"}),r.jsx(D,{size:"sm",variant:"outline",disabled:!g.session_id||v||!!p,title:g.session_id?"把最近一次运行的现场(退出码/指标摘要/日志尾)发给该任务的 agent 会话":"会话尚未生成(首轮执行后才有)",onClick:()=>y("diagnose"),children:"诊断"}),r.jsx(D,{size:"sm",variant:"outline",disabled:!j||!!p,title:"清空运行记录,从第 1 轮重跑(agent 重新出方案)——与「复压」不同",onClick:S,children:"重启(换方案)"}),p&&r.jsx("span",{className:"hint",children:"处理中…"}),!j&&v&&r.jsx("span",{className:"hint",children:"运行中:结束后可复压 / 诊断 / 重启"})]}),g.error&&r.jsxs("div",{className:"px-4 pt-1 text-xs",style:{color:"var(--fail)"},children:["错误:",g.error]}),r.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[r.jsx(Or,{value:"plan",children:r.jsx(zM,{task:g})}),r.jsx(Or,{value:"log",children:r.jsx(uT,{task:g})})]})]}):r.jsx("div",{className:"mt-16 text-center text-sm text-muted-foreground",children:"← 从左侧选择一个压测任务查看方案与指标"})})]})}const UT={project_dir:"项目目录",work_dir:"工作目录"},gj=[{key:"board",label:"开发看板"},{key:"tasks",label:"测试任务"},{key:"stress",label:"压测面板"},{key:"monitor",label:"监控面板"},{key:"bugs",label:"Bug 报告"}],sc=gj.map(e=>e.key),ax=Object.fromEntries(gj.map(e=>[e.key,e.label]));function tl(e){const t=(Array.isArray(e==null?void 0:e.order)?e.order:[]).filter(s=>sc.includes(s));for(const s of sc)t.includes(s)||t.push(s);const n=(Array.isArray(e==null?void 0:e.hidden)?e.hidden:[]).filter(s=>sc.includes(s));return{order:t,hidden:n}}function ix(e){const t=(e||"").split(/[\\/]+/).filter(Boolean);for(let n=t.length-1;n>=0;n--)if(!/^[A-Za-z]:$/.test(t[n]))return t[n];return""}const Hf="ts.sidebarW",xj=180,vj=480,yj=230;function HT(){const e=parseInt(localStorage.getItem(Hf),10);return Number.isFinite(e)?Math.min(vj,Math.max(xj,e)):yj}function cx(){var go,_n,ts;const e=Vl(),t=Yn(),n=$n(),[s,o]=u.useState(localStorage.getItem("ts_cur_tab")||"board"),[l,a]=u.useState(null),[i,c]=u.useState(!1),[d,f]=u.useState(null),m=u.useRef(null);m.current=l;const p=u.useRef(!1),h=u.useRef(null),[g,w]=u.useState(!1),[j,v]=u.useState(null),[x,y]=u.useState([]),[b,S]=u.useState(!1),[N,k]=u.useState([]),[C,O]=u.useState(null),[R,z]=u.useState(!1),[V,q]=u.useState(!1),[I,G]=u.useState({name:"",project_dir:"",agent_path:"",work_dir:"",env_label:"",guide_text:"",model:"",reasoning_effort:"",permission_mode:"",skill_understand:"",skill_deploy:"",skill_commit:"",skill_test:"",skill_cases:""}),[te,H]=u.useState({models:[],default:""}),[L,K]=u.useState([]),[F,xe]=u.useState(!1),[X,Te]=u.useState(null),[Pe,Re]=u.useState(!1),[se,ve]=u.useState("project_dir"),[ie,ue]=u.useState(!1),[he,pe]=u.useState(""),[E,Y]=u.useState(!1),[A,oe]=u.useState(null),[le,Ne]=u.useState(""),{rzOn:Ge,rzStyle:dt,rzStart:Ze,rzDragStart:ft,rzReset:kt}=lr(),{rzOn:on,rzStyle:wn,rzDragStart:de}=lr(),{rzOn:Q,rzStyle:Ve,rzDragStart:Xt,rzReset:Un}=lr(),{rzOn:Wt,rzStyle:ln,rzDragStart:at,rzReset:Ms}=lr(),hs=u.useRef(null),[Tt,P]=u.useState([]),B=u.useRef([]);B.current=Tt;const[J,ae]=u.useState(null),ce=u.useRef(!1),fe=u.useRef(null),[Oe,qe]=u.useState(HT),Qe=u.useRef(Oe);Qe.current=Oe;function Xe(_){const re=B.current;if(!re.length)return _;const ke=new Map(re.map((Me,ze)=>[Me,ze]));return[..._].sort((Me,ze)=>(ke.has(Me.id)?ke.get(Me.id):1/0)-(ke.has(ze.id)?ke.get(ze.id):1/0))}function wt(_){const re=$n.getState().projects.map(rt=>rt.id),ke=B.current.filter(rt=>re.includes(rt)),Me=[...ke,...re.filter(rt=>!ke.includes(rt))],ze=new Set(_),Fe=[];let Zt=0;for(const rt of Me)Fe.push(ze.has(rt)?_[Zt++]:rt);return B.current=Fe,P(Fe),Fe}function jn(_,re){if(_.button!==0||_.target.closest("button"))return;const ke={id:re,sx:_.clientX,sy:_.clientY,on:!1};fe.current=ke;const Me=Fe=>{var $s,kr,Nr,ws;if(!fe.current)return;if(!ke.on){if(Math.hypot(Fe.clientX-ke.sx,Fe.clientY-ke.sy)<6)return;ke.on=!0,ce.current=!0,ae(ke.id),document.body.classList.add("projlist-dragging")}const Zt=+((ws=(Nr=(kr=($s=document.elementFromPoint(Fe.clientX,Fe.clientY))==null?void 0:$s.closest)==null?void 0:kr.call($s,"[data-proj-id]"))==null?void 0:Nr.dataset)==null?void 0:ws.projId);if(!Zt||Zt===ke.id)return;const rt=Xe($n.getState().projects).filter(Zs=>!!Zs.archived===R).map(Zs=>Zs.id),_r=rt.indexOf(ke.id),Sr=rt.indexOf(Zt);_r<0||Sr<0||(rt.splice(Sr,0,...rt.splice(_r,1)),wt(rt))},ze=()=>{window.removeEventListener("pointermove",Me),window.removeEventListener("pointerup",ze),document.body.classList.remove("projlist-dragging"),fe.current=null,ae(null),ke.on&&hl.set(0,"proj_order",{order:B.current}).catch(()=>{})};window.addEventListener("pointermove",Me),window.addEventListener("pointerup",ze)}u.useEffect(()=>{let _=!1;return hl.get(0).then(re=>{var Me,ze;if(_)return;const ke=(Array.isArray((ze=(Me=re.prefs)==null?void 0:Me.proj_order)==null?void 0:ze.order)?re.prefs.proj_order.order:[]).map(Number).filter(Number.isFinite);ke.length&&P(ke)}).catch(()=>{}),()=>{_=!0}},[]);function Jt(_){if(_.button!==0)return;_.preventDefault();const re=_.clientX,ke=Qe.current;document.body.classList.add("resizing-x");const Me=Fe=>qe(Math.min(vj,Math.max(xj,ke+Fe.clientX-re))),ze=()=>{window.removeEventListener("mousemove",Me),window.removeEventListener("mouseup",ze),document.body.classList.remove("resizing-x");try{localStorage.setItem(Hf,String(Qe.current))}catch{}};window.addEventListener("mousemove",Me),window.addEventListener("mouseup",ze)}function tt(){qe(yj);try{localStorage.removeItem(Hf)}catch{}}function $t(_){if(p.current){p.current=!1;return}o(_),localStorage.setItem("ts_cur_tab",_)}function dn(_){return _.order.filter(re=>!_.hidden.includes(re))}function qt(_){var ke;a(_);const re=(ke=n.currentProject)==null?void 0:ke.id;re&&hl.set(re,"tabs",_).catch(()=>{})}u.useEffect(()=>{var ke;const _=(ke=n.currentProject)==null?void 0:ke.id;if(!_)return;let re=!1;return hl.get(_).then(Me=>{var ze;re||a(tl((ze=Me.prefs)==null?void 0:ze.tabs))}).catch(()=>{}),c(!1),()=>{re=!0}},[(go=n.currentProject)==null?void 0:go.id]);const nt=l||tl(null),It=dn(nt);u.useEffect(()=>{It.length&&!It.includes(s)&&(o(It[0]),localStorage.setItem("ts_cur_tab",It[0]))},[l]);function Pn(_,re){if(_.button!==0)return;const ke={key:re,sx:_.clientX,on:!1};h.current=ke;const Me=Fe=>{var rt,_r,Sr,$s;if(!h.current)return;if(!ke.on){if(Math.hypot(Fe.clientX-ke.sx,Fe.clientY)<6)return;ke.on=!0,p.current=!0,f(ke.key),document.body.classList.add("tabbar-dragging")}const Zt=($s=(Sr=(_r=(rt=document.elementFromPoint(Fe.clientX,Fe.clientY))==null?void 0:rt.closest)==null?void 0:_r.call(rt,"[data-tab-key]"))==null?void 0:Sr.dataset)==null?void 0:$s.tabKey;!Zt||Zt===ke.key||a(kr=>{const Nr=tl(kr),ws=[...Nr.order],Zs=ws.indexOf(ke.key),$=ws.indexOf(Zt);return Zs<0||$<0?kr:(ws.splice($,0,...ws.splice(Zs,1)),{...Nr,order:ws})})},ze=()=>{if(window.removeEventListener("pointermove",Me),window.removeEventListener("pointerup",ze),document.body.classList.remove("tabbar-dragging"),h.current=null,f(null),ke.on){const Fe=tl(m.current);qt(Fe)}};window.addEventListener("pointermove",Me),window.addEventListener("pointerup",ze)}function Zn(_){const re=tl(l),ke={...re,hidden:[...re.hidden,_]};qt(ke);const Me=dn(ke);(s===_||!Me.includes(s))&&Me.length&&(o(Me[0]),localStorage.setItem("ts_cur_tab",Me[0]))}function jr(_){const re=tl(l);qt({...re,hidden:re.hidden.filter(ke=>ke!==_)}),o(_),localStorage.setItem("ts_cur_tab",_)}function gs(_){n.selectProject(_),localStorage.setItem("ts_cur_project",_)}async function Ts(){try{y(await Mt.agents())}catch{y([])}}async function fn(_){try{const re=await Mt.agentModels(_);H(re);const ke=new Set((re.models||[]).map(Me=>Me.name));ke.size&&G(Me=>Me.model&&!ke.has(Me.model)?{...Me,model:""}:Me)}catch{H({models:[],default:""})}}async function it(_,re){try{const Me=(await Mt.agentSkills(_,re)).skills||[];if(K(Me),Me.length){const ze=new Set(Me.map(Fe=>Fe.name));G(Fe=>({...Fe,skill_understand:ze.has(Fe.skill_understand)?Fe.skill_understand:"",skill_deploy:ze.has(Fe.skill_deploy)?Fe.skill_deploy:"",skill_commit:ze.has(Fe.skill_commit)?Fe.skill_commit:"",skill_test:ze.has(Fe.skill_test)?Fe.skill_test:"",skill_cases:ze.has(Fe.skill_cases)?Fe.skill_cases:""}))}}catch{K([])}}function po(_){v(_?_.id:null),G({name:(_==null?void 0:_.name)||"",project_dir:(_==null?void 0:_.project_dir)||"",agent_path:(_==null?void 0:_.agent_path)||"",work_dir:(_==null?void 0:_.work_dir)||"",env_label:(_==null?void 0:_.env_label)||"",guide_text:(_==null?void 0:_.guide_text)||"",model:(_==null?void 0:_.model)||"",reasoning_effort:(_==null?void 0:_.reasoning_effort)||"",permission_mode:(_==null?void 0:_.permission_mode)||"",skill_understand:(_==null?void 0:_.skill_understand)||"",skill_deploy:(_==null?void 0:_.skill_deploy)||"",skill_commit:(_==null?void 0:_.skill_commit)||"",skill_test:(_==null?void 0:_.skill_test)||"",skill_cases:(_==null?void 0:_.skill_cases)||""}),kt(),w(!0),Ts(),fn((_==null?void 0:_.agent_path)||""),it((_==null?void 0:_.agent_path)||"",(_==null?void 0:_.project_dir)||"")}async function Yo(){const _={...I};if(_.name||(_.name=ix(_.project_dir)),!_.name){M("请填写项目名称");return}try{const re=await Mt.dupCheck({project_dir:_.project_dir||"",work_dir:_.work_dir||"",exclude:j});if(re.length){k(re),O(_),S(!0);return}await es(_)}catch(re){M(re.message)}}async function Hn(){if(S(!1),C){const _=C;O(null),await es(_)}}async function es(_){try{const re=$n.getState();if(j)await re.updateProject(j,_);else{const ke=await re.createProject(_);await $n.getState().selectProject(ke.id)}w(!1),M(j?"已保存":"项目已创建")}catch(re){M(re.message)}}async function xs(_,re){try{await $n.getState().archiveProject(_.id,re),M(re?"项目已归档":"项目已恢复")}catch(ke){M(ke.message)}}function br(_){const re={...I,project_dir:_};I.name.trim()||(re.name=ix(_)),G(re)}function mo(_){ve(_),xe(!0),ue(!1),pe(""),ho(I[_])}async function ho(_){Re(!0);try{Te(await Mt.fsBrowse(_))}catch(re){M(re.message)}finally{Re(!1)}}function Js(_){ue(!1),pe(""),ho(_)}async function T(){const _=he.trim();if(_){Y(!0);try{const re=await Mt.fsMkdir((X==null?void 0:X.path)||"",_);M(`已新建文件夹:${(re==null?void 0:re.name)||_}`),Js((re==null?void 0:re.path)||(X==null?void 0:X.path)||"")}catch(re){M(re.message)}finally{Y(!1)}}}function U(){X!=null&&X.path&&(se==="project_dir"&&br(X.path),se==="project_dir"?it(I.agent_path,X.path):G({...I,[se]:X.path}),xe(!1))}function be(_){oe(_),Ne(""),Ms()}async function ge(){if(A)try{await $n.getState().deleteProject(A.id,{confirm_name:le}),M("项目已删除;案例文件与 bug 报告文件已保留,请自行手动清理"),oe(null)}catch(_){M(_.message)}}async function Le(){await t.logout(),e("/login")}u.useEffect(()=>(n.loadProjects(),hs.current=setInterval(()=>{const _=$n.getState();_.loadProjects().catch(()=>{}),_.currentProject&&(_.loadTasks().catch(()=>{}),_.loadBugs().catch(()=>{}))},5e3),()=>clearInterval(hs.current)),[]);const Se=$n(_=>_.projects),Nt=u.useRef(!1);u.useEffect(()=>{if(Nt.current||!Se.length)return;Nt.current=!0;const _=$n.getState(),re=+localStorage.getItem("ts_cur_project")||0,ke=_.projects.find(Fe=>!Fe.archived)||_.projects[0],Me=_.projects.find(Fe=>Fe.id===re)?re:ke.id;_.selectProject(Me);const ze=localStorage.getItem("ts_cur_tab");sc.includes(ze)&&o(ze)},[Se]);const pt=Xe(n.projects).filter(_=>!!_.archived===R),mt=te.models||[],W=!!I.model&&mt.some(_=>_.name===I.model),lt=mt.length?te.default?"__default__":mt[0].name:"__default__",bn=W?I.model:lt,Mn=mt.find(_=>_.name===te.default),vs=Mn?Mn.display_name||Mn.name:te.default||"智能体默认",Qo=W?I.model:bn==="__default__"?te.default:bn,ys=Uw(te,Qo);return r.jsxs("div",{className:"flex h-svh",children:[r.jsxs("aside",{style:{width:Oe+"px"},className:"flex flex-none flex-col border-r border-border bg-card",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-3 font-serif font-semibold",children:[r.jsx(su,{size:22}),r.jsx("span",{children:"Touchstone"})]}),r.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-1 font-mono text-[calc(10px*var(--fs))] uppercase tracking-[0.14em] text-muted-foreground",children:[r.jsx("span",{children:R?"已归档项目":"项目列表"}),r.jsx("button",{type:"button",title:R?"返回项目列表":"查看已归档项目",className:"rounded p-0.5 hover:text-foreground",onClick:()=>z(_=>!_),children:R?r.jsx(Qu,{size:13}):r.jsx(Xu,{size:13})})]}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto p-2",children:[pt.map(_=>{var re,ke,Me,ze,Fe;return r.jsxs("div",{"data-proj-id":_.id,className:"proj-item cursor-pointer select-none rounded-lg border px-2.5 py-2 transition-colors "+(((re=n.currentProject)==null?void 0:re.id)===_.id?"border-primary/60 bg-accent":"border-transparent hover:bg-accent/60")+(_.archived?" opacity-60":"")+(J===_.id?" proj-dragging":""),onPointerDown:Zt=>jn(Zt,_.id),onClick:()=>{if(ce.current){ce.current=!1;return}gs(_.id)},children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("div",{className:"flex-1 truncate text-sm font-semibold "+(((ke=n.currentProject)==null?void 0:ke.id)===_.id?"text-[var(--tab-active)]":""),children:_.name}),r.jsx("button",{type:"button",title:_.archived?"恢复项目":"归档项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-foreground",onClick:Zt=>{Zt.stopPropagation(),xs(_,!_.archived)},children:_.archived?r.jsx(Qu,{size:13}):r.jsx(Xu,{size:13})}),_.archived&&r.jsx("button",{type:"button",title:"删除项目",className:"flex-none rounded p-1 text-muted-foreground hover:text-[var(--fail, #dc2626)]",onClick:Zt=>{Zt.stopPropagation(),be(_)},children:r.jsx(Ks,{size:13})})]}),r.jsx("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",children:_.project_dir}),r.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 font-mono text-[calc(10px*var(--fs))] text-muted-foreground",children:[r.jsxs("span",{children:["正在开发 ",r.jsx("b",{className:"font-semibold text-[var(--run)]",children:((Me=_.board_counts)==null?void 0:Me.doing)??0})]}),r.jsxs("span",{children:["阻塞 ",r.jsx("b",{className:"font-semibold text-[var(--fail)]",children:((ze=_.board_counts)==null?void 0:ze.blocked)??0})]}),r.jsxs("span",{children:["待审核 ",r.jsx("b",{className:"font-semibold text-[var(--retest)]",children:((Fe=_.board_counts)==null?void 0:Fe.review)??0})]})]})]},_.id)}),!pt.length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:R?"暂无已归档项目":"暂无项目"})]}),r.jsxs("div",{className:"flex items-center gap-1 border-t border-border px-2.5 py-2",children:[r.jsx("span",{className:"mr-auto truncate text-xs text-muted-foreground",children:t.username}),r.jsxs(D,{variant:"ghost",size:"sm",title:"站点设置",onClick:()=>e("/settings"),children:[r.jsx(S0,{})," 设置"]}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(D,{variant:"ghost",size:"sm",onClick:()=>q(_=>!_),children:[r.jsx(RN,{})," 菜单"]}),V&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>q(!1)}),r.jsxs("div",{className:"sets-menu",children:[t.isAdmin&&r.jsxs("button",{type:"button",onClick:()=>{q(!1),e("/admin")},children:[r.jsx(GN,{})," 管理"]}),r.jsxs("button",{type:"button",className:"danger",onClick:Le,children:[r.jsx(Kp,{})," 登出"]})]})]})]})]})]}),r.jsx("div",{className:"vsplit side-split",title:"拖动调整侧栏宽度,双击复位",onMouseDown:Jt,onDoubleClick:tt}),r.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-4 py-2",children:[r.jsx("h2",{className:"m-0 truncate font-serif text-[calc(15px*var(--fs))] font-semibold",children:((_n=n.currentProject)==null?void 0:_n.name)||"— 未选择项目"}),((ts=n.currentProject)==null?void 0:ts.archived)&&r.jsx("span",{className:"flex-none rounded-full border border-border px-2 py-0.5 text-[calc(10px*var(--fs))] text-muted-foreground",children:"已归档"}),r.jsx("div",{className:"flex-1"}),r.jsxs(D,{size:"sm",onClick:()=>po(),children:[r.jsx(Ja,{})," 添加项目"]}),n.currentProject&&r.jsxs(D,{size:"sm",variant:"outline",onClick:()=>po(n.currentProject),children:[r.jsx(Yp,{})," 编辑项目"]}),n.currentProject&&r.jsxs(D,{size:"sm",variant:"outline",title:"归档后从项目列表默认隐藏,可在侧栏「已归档项目」视图中恢复",onClick:()=>xs(n.currentProject,!n.currentProject.archived),children:[n.currentProject.archived?r.jsx(Qu,{}):r.jsx(Xu,{}),n.currentProject.archived?"恢复项目":"归档项目"]})]}),r.jsx("hr",{className:"aurora-line"}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:n.currentProject?r.jsxs(hj,{value:s,onValueChange:$t,className:"flex min-h-0 flex-1 flex-col",children:[r.jsxs("div",{className:"flex flex-none items-center border-b border-border pr-2",children:[r.jsxs(Mm,{className:"w-fit justify-start rounded-none border-none bg-transparent px-2 py-0",children:[It.map(_=>r.jsxs(zc,{value:_,"data-tab-key":_,className:"tabbar-trigger pr-5 data-[state=active]:text-[var(--tab-active)]"+(d===_?" tabbar-dragging":""),onPointerDown:re=>Pn(re,_),children:[ax[_],r.jsx("span",{className:"tabbar-hide",title:"隐藏此标签页(可点右侧按钮恢复)",onClick:re=>{re.stopPropagation(),Zn(_)},onPointerDown:re=>re.stopPropagation(),children:r.jsx(Ao,{className:"size-2.5"})})]},_)),!It.length&&r.jsx("span",{className:"px-3 py-2 text-xs text-muted-foreground",children:"标签页已全部隐藏"})]}),r.jsx("div",{className:"ml-auto"}),r.jsxs("div",{className:"sets-wrap",children:[r.jsxs(D,{variant:"ghost",size:"sm",title:"显示/恢复隐藏的标签页",onClick:()=>c(_=>!_),children:[r.jsx(fg,{}),nt.hidden.length?`隐藏 ${nt.hidden.length}`:"标签页"]}),i&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sets-mask",onClick:()=>c(!1)}),r.jsxs("div",{className:"sets-menu drop-down",children:[!nt.hidden.length&&r.jsxs("div",{className:"px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:["没有隐藏的标签页。",r.jsx("br",{}),"把鼠标悬停到标签上点 × 即可隐藏。"]}),nt.hidden.map(_=>r.jsxs("button",{type:"button",onClick:()=>jr(_),children:[r.jsx(fg,{})," ",ax[_]]},_))]})]})]})]}),r.jsx(Or,{value:"board",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(RM,{project:n.currentProject})}),r.jsx(Or,{value:"tasks",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(QP,{onCreated:_=>{_==="stress"&&$t("stress")}})}),r.jsx(Or,{value:"stress",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(BT,{})}),r.jsx(Or,{value:"monitor",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(lM,{project:n.currentProject})}),r.jsx(Or,{value:"bugs",className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r.jsx(dM,{project:n.currentProject})})]}):r.jsx("div",{className:"mt-20 text-center text-sm text-muted-foreground",children:'← 选择一个项目,或点击"添加项目"创建'})})]}),r.jsx(Qt,{open:g,onOpenChange:w,children:r.jsxs(Bt,{className:"modal modal-rz"+(Ge?" rz-drag":""),style:{...dt,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:Ze,reset:kt}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:ft,children:j?"编辑项目":"添加项目"})}),r.jsxs("div",{className:"modal-scroll overflow-y-auto",children:[r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目名称"}),r.jsx(Ie,{value:I.name,onChange:_=>G({...I,name:_.target.value.trim()}),placeholder:"如 my-project"})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"项目目录"}),r.jsx(Ie,{value:I.project_dir,onChange:_=>br(_.target.value.trim()),onBlur:()=>it(I.agent_path,I.project_dir),placeholder:"/path/to/your/project"}),r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>mo("project_dir"),title:"浏览服务端目录并选择",children:[r.jsx(pg,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"智能体"}),r.jsxs(At,{value:I.agent_path||"__manual__",onValueChange:_=>{const re=_==="__manual__"||_==="__missing__"?"":_;G({...I,agent_path:re}),fn(re),it(re,I.project_dir)},children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"手动填写路径"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__manual__",children:"手动填写路径"}),x.map(_=>r.jsx(Ae,{value:_.found?_.path:"__missing__",children:_.found?`${_.name} · ${_.version||_.path}`:`${_.name} 未找到`},_.path||_.name)),(()=>{const _=(I.agent_path||"").trim();return!_||x.some(re=>re.found&&re.path===_)?null:r.jsx(Ae,{value:_,children:_.startsWith("dsh-plugin:")?`dsh(插件·进程内) ${_.slice(11)}`:`${_}(当前绑定)`})})()]})]}),r.jsxs(D,{variant:"outline",size:"sm",onClick:Ts,title:"重新扫描本机 CLI",children:[r.jsx(Da,{})," 扫描"]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"智能体只有「dsh(插件·进程内)」一个入口:无需额外参数,模型取自宿主 ~/.dsh/settings.yaml(也可在此显式指定);kimi/opencode/claude/hermes 旧族与 dsh CLI(裸 dsh 可执行)均已退场,存量旧绑定起跑会报「该智能体族已下线」,请改绑本入口"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"当前智能体已配置的模型;保存后新创建的任务(含修复/复测)默认使用该模型,已建任务不受影响",children:"模型"}),mt.length?r.jsxs(At,{value:bn,onValueChange:_=>G({...I,model:_==="__default__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1"+(W?"":" text-muted-foreground"),title:W?"":"尚未显式选择:暗色显示的是当前智能体的默认模型(留空即用默认)",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__default__",children:te.default?`默认(${vs})`:"默认(智能体默认)"}),mt.map(_=>r.jsx(Ae,{value:_.name,children:_.display_name||_.name},_.name))]})]}):r.jsx(Ie,{className:"max-w-[240px]",placeholder:te.default?`默认(${vs})`:"默认(智能体默认)",value:I.model,onChange:_=>G({...I,model:_.target.value.trim()})})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"留空用智能体默认模型;设置后从下一条任务开始生效"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内会话的默认思考等级(dsh reasoningEffort);留空用智能体默认档",children:"思考等级"}),r.jsxs(At,{value:I.reasoning_effort||"__default__",onValueChange:_=>G({...I,reasoning_effort:_==="__default__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1"+(I.reasoning_effort?"":" text-muted-foreground"),title:I.reasoning_effort?"":"尚未显式选择:暗色显示的是智能体默认档(留空即用默认)",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__default__",children:ys.defaultEffort?`默认(${(ys.options.find(_=>_.value===ys.defaultEffort)||{}).label||ys.defaultEffort})`:"默认(智能体默认)"}),I.reasoning_effort&&!ys.options.some(_=>_.value===I.reasoning_effort)&&r.jsx(Ae,{value:I.reasoning_effort,children:I.reasoning_effort}),ys.options.map(_=>r.jsx(Ae,{value:_.value,title:_.title,children:_.label},_.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"思考等级:列表来自当前模型的可用档位;留空用智能体默认;设置后新起的会话(含任务与看板卡)按此档运行"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"项目内看板卡片会话的默认权限档;留空用宿主默认(完全访问)",children:"权限"}),r.jsxs(At,{value:I.permission_mode||"__default__",onValueChange:_=>G({...I,permission_mode:_==="__default__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1"+(I.permission_mode?"":" text-muted-foreground"),title:I.permission_mode?"":"尚未显式选择:暗色显示的是宿主默认档(留空即用默认)",children:r.jsx(Et,{})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__default__",children:"默认(宿主默认)"}),Ac.map(_=>r.jsx(Ae,{value:_.value,title:_.desc,children:r.jsxs("span",{className:"sess-perm-item",children:[r.jsx("span",{className:"sess-perm-label",children:_.label}),r.jsx("span",{className:"sess-perm-desc",children:_.desc})]})},_.value))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"权限:项目内新起的看板卡片会话按此档运行(逐条确认=平台接管审批代答);任务会话暂不支持权限档"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"理解/分析项目时优先使用的 skill,注入每类任务首轮提示词",children:"理解项目"}),r.jsxs(At,{value:I.skill_understand||"__none__",onValueChange:_=>G({...I,skill_understand:_==="__none__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"不指定"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`u-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动部署=开时使用的 skill",children:"部署项目"}),r.jsxs(At,{value:I.skill_deploy||"__none__",onValueChange:_=>G({...I,skill_deploy:_==="__none__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"不指定"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`d-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"修复任务自动提交=开时使用的 skill",children:"提交项目"}),r.jsxs(At,{value:I.skill_commit||"__none__",onValueChange:_=>G({...I,skill_commit:_==="__none__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"不指定"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`c-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"测试本项目时优先使用的 skill,注入每类任务首轮提示词",children:"测试项目"}),r.jsxs(At,{value:I.skill_test||"__none__",onValueChange:_=>G({...I,skill_test:_==="__none__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"不指定"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`t-${_.name}`))]})]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{title:"生成用例时遵循的命名/结构/登记规范 skill,注入每类任务首轮提示词",children:"用例规范"}),r.jsxs(At,{value:I.skill_cases||"__none__",onValueChange:_=>G({...I,skill_cases:_==="__none__"?"":_}),children:[r.jsx(Rt,{className:"min-w-[200px] flex-1",children:r.jsx(Et,{placeholder:"不指定"})}),r.jsxs(Pt,{children:[r.jsx(Ae,{value:"__none__",children:"不指定"}),L.map(_=>r.jsxs(Ae,{value:_.name,title:_.description,children:[_.name,_.description?` — ${_.description.slice(0,60)}`:""]},`cs-${_.name}`))]})]})]}),r.jsx("div",{className:"hint",style:{margin:"-4px 0 8px 110px"},children:"选项来自当前智能体可用的 skill(dsh 无 skill 机制恒为空);理解/测试项目/用例规范项注入每类任务首轮,部署/提交项仅注入修复任务的对应条款(自动提交/部署=开时)"}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"工作目录"}),r.jsx(Ie,{value:I.work_dir,onChange:_=>G({...I,work_dir:_.target.value.trim()}),placeholder:"默认 <项目目录>/.touchstone;其下自动生成案例库 free_style 与 bug 报告 bug_report"}),r.jsxs(D,{variant:"outline",size:"sm",onClick:()=>mo("work_dir"),title:"浏览服务端目录并选择",children:[r.jsx(pg,{})," 浏览"]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"环境标签"}),r.jsx(Ie,{value:I.env_label,onChange:_=>G({...I,env_label:_.target.value.trim()}),placeholder:"如 test4 / sitA1,测试、修复、部署针对的环境"})]}),r.jsxs("div",{className:"form-col",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"项目附加提示词"}),r.jsx(cs,{value:I.guide_text,onChange:_=>G({...I,guide_text:_.target.value}),rows:3,className:"min-h-0",placeholder:"填写如何理解项目 / 如何写 git commit message / 如何部署项目 等信息;内容会加入每个任务的提示词"})]})]}),r.jsxs(vn,{className:"flex-none",children:[r.jsx(D,{variant:"outline",onClick:()=>w(!1),children:"取消"}),r.jsx(D,{onClick:Yo,children:"保存"})]})]})}),r.jsx(Qt,{open:b,onOpenChange:S,children:r.jsxs(Bt,{className:"modal modal-rz"+(on?" rz-drag":""),style:{...wn,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:Ze,reset:kt}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:de,children:"目录重复提醒"})}),N.map((_,re)=>r.jsxs("div",{className:"dup-item",children:[r.jsx("b",{children:UT[_.field]||_.field})," ",_.value,r.jsxs("span",{className:"dup-owner",children:["被「",_.username," / ",_.project_name,"」使用"]})]},re)),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"6px 0 0"},children:"重复的目录可能与其他项目的案例库/报告互相干扰,确认仍要保存?"}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>S(!1),children:"返回修改"}),r.jsx(D,{onClick:Hn,children:"仍然保存"})]})]})}),r.jsx(Qt,{open:F,onOpenChange:xe,children:r.jsxs(Bt,{className:"modal modal-rz modal-dir"+(Q?" rz-drag":""),style:{...Ve,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:Ze,reset:Un}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:Xt,children:"选择目录"})}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:(X==null?void 0:X.path)||"",children:(X==null?void 0:X.path)||"(选择根目录)"}),r.jsxs(D,{variant:"outline",size:"sm",disabled:Pe||!(X!=null&&X.parent),onClick:()=>Js(X.parent),children:[r.jsx(Wk,{})," 上级"]}),r.jsxs(D,{variant:"outline",size:"sm",disabled:Pe,onClick:()=>Js((X==null?void 0:X.path)||""),children:[r.jsx(Da,{})," 刷新"]}),r.jsxs(D,{variant:"outline",size:"sm",disabled:Pe||!(X!=null&&X.path),onClick:()=>{ue(!ie),pe("")},title:X!=null&&X.path?`在 ${X.path} 下新建文件夹`:"请先进入一个目录",children:[r.jsx(xN,{})," 新建文件夹"]})]}),ie&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ie,{autoFocus:!0,value:he,disabled:E,onChange:_=>pe(_.target.value),onKeyDown:_=>{_.key==="Enter"&&T()},placeholder:"新文件夹名称(在当前目录下创建)"}),r.jsx(D,{size:"sm",disabled:E||!he.trim(),onClick:T,children:E?"创建中…":"创建"}),r.jsx(D,{variant:"outline",size:"sm",disabled:E,onClick:()=>{ue(!1),pe("")},children:"取消"})]}),r.jsxs("div",{className:"modal-scroll max-h-[50vh] min-h-[120px] overflow-y-auto rounded-md border border-border p-1",children:[Pe&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"加载中…"}),!Pe&&!((X==null?void 0:X.dirs)||[]).length&&r.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"无子目录"}),!Pe&&((X==null?void 0:X.dirs)||[]).map(_=>r.jsx("button",{type:"button",className:"block w-full truncate rounded px-2 py-1 text-left font-mono text-sm hover:bg-accent",title:_.path,onClick:()=>Js(_.path),children:_.name},_.path))]}),r.jsxs(vn,{className:"flex-none",children:[r.jsx(D,{variant:"outline",onClick:()=>xe(!1),children:"取消"}),r.jsx(D,{disabled:Pe||!(X!=null&&X.path),onClick:U,children:"选择此目录"})]})]})}),r.jsx(Qt,{open:!!A,onOpenChange:_=>{_||oe(null)},children:r.jsxs(Bt,{className:"modal modal-rz"+(Wt?" rz-drag":""),style:{...ln,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:Ze,reset:Ms}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:at,children:"删除项目"})}),A&&r.jsxs("div",{className:"space-y-1 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"项目名称:"}),r.jsx("b",{children:A.name})]}),r.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:A.project_dir}),r.jsxs("div",{className:"truncate font-mono text-xs text-muted-foreground",children:["工作目录:",A.work_dir]})]}),r.jsxs("div",{className:"form-row",children:[r.jsx("label",{children:"输入项目名称确认"}),r.jsx(Ie,{value:le,onChange:_=>Ne(_.target.value),placeholder:(A==null?void 0:A.name)||""})]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"将删除项目及其全部任务与轮次记录,不可恢复。磁盘上的案例文件与 bug 报告文件不会删除,请自行手动清理。"}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>oe(null),children:"取消"}),r.jsx(D,{variant:"destructive",disabled:!A||le!==A.name,onClick:ge,children:"确定删除"})]})]})})]})}const VT=Zy("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Dl({className:e,variant:t,...n}){return r.jsx("span",{"data-slot":"badge",className:He(VT({variant:t}),e),...n})}function WT(){const e=Vl(),t=Yn(),[n,s]=u.useState([]),[o,l]=u.useState(!1),[a,i]=u.useState({username:"",password:"",password2:""}),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState({id:null,username:"",password:""}),[g,w]=u.useState(""),{rzOn:j,rzStyle:v,rzStart:x,rzDragStart:y,rzReset:b}=lr(),{rzOn:S,rzStyle:N,rzStart:k,rzDragStart:C,rzReset:O}=lr();async function R(){try{s(await Fr.users())}catch(H){M(H.message)}}u.useEffect(()=>{if(!t.isAdmin){e("/app");return}R()},[]);function z(){i({username:"",password:"",password2:""}),d(""),O(),l(!0)}async function V(){if(d(""),a.password!==a.password2){d("两次输入的密码不一致");return}try{await Fr.createUser({username:a.username,password:a.password}),l(!1),M("新增成功"),await R()}catch(H){d(H.message)}}function q(H){h({id:H.id,username:H.username,password:""}),w(""),m(!0)}async function I(){w("");try{const H={username:p.username};p.password&&(H.password=p.password),await Fr.updateUser(p.id,H),m(!1),await R()}catch(H){w(H.message)}}async function G(H){if(window.confirm(`确认删除用户「${H.username}」?该操作不可恢复`))try{await Fr.deleteUser(H.id),await R()}catch(L){M(L.message)}}async function te(){await t.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"后台管理 · 用户"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:t.username}),r.jsxs(D,{variant:"ghost",size:"sm",onClick:te,children:[r.jsx(Kp,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("div",{className:"sets-page-nav"}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(D,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(Vp,{})," 返回项目"]})})]}),r.jsx("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:r.jsxs(Dn,{className:"gap-0 py-0",children:[r.jsx(fs,{className:"border-b border-border/60 px-5 py-4",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(sC,{className:"size-4 text-primary"})," 用户列表",r.jsxs("span",{className:"font-normal text-muted-foreground",children:[n.length," 人"]}),r.jsxs(D,{variant:"outline",size:"sm",className:"ml-auto",onClick:z,children:[r.jsx(Ja,{})," 新增用户"]})]})}),r.jsx(Fn,{className:"px-3 pb-3",children:n.length?r.jsxs(xm,{children:[r.jsx(vm,{children:r.jsxs(Ro,{className:"hover:bg-transparent",children:[r.jsx(kn,{className:"px-3",children:"ID"}),r.jsx(kn,{className:"px-3",children:"用户名"}),r.jsx(kn,{className:"px-3",children:"创建时间"}),r.jsx(kn,{className:"px-3",children:"角色"}),r.jsx(kn,{className:"px-3 text-right",children:"操作"})]})}),r.jsx(ym,{children:n.map(H=>r.jsxs(Ro,{children:[r.jsx(gn,{className:"px-3 text-muted-foreground",children:H.id}),r.jsx(gn,{className:"px-3 font-medium",children:H.username}),r.jsx(gn,{className:"px-3 font-mono text-xs text-muted-foreground",children:H.created_at}),r.jsx(gn,{className:"px-3",children:H.is_admin?r.jsx(Dl,{variant:"outline",className:"border-[var(--admin-badge)] text-[var(--admin-badge)]",children:"管理员"}):r.jsx(Dl,{variant:"secondary",children:"普通用户"})}),r.jsx(gn,{className:"px-3",children:r.jsxs("div",{className:"flex justify-end gap-1.5",children:[r.jsxs(D,{variant:"ghost",size:"sm",onClick:()=>q(H),children:[r.jsx(Yp,{})," 编辑"]}),!H.is_admin&&r.jsxs(D,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>G(H),children:[r.jsx(Ks,{})," 删除"]})]})})]},H.id))})]}):r.jsx("div",{className:"px-2 py-6 text-sm text-muted-foreground",children:"暂无用户"})})]})})]}),r.jsx(Qt,{open:o,onOpenChange:l,children:r.jsxs(Bt,{className:"modal modal-rz"+(S?" rz-drag":""),style:{...N,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:k,reset:O}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:C,children:"新增用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{value:a.username,onChange:H=>{i({...a,username:H.target.value.trim()}),d("")},placeholder:"2-32 位字母数字或 _ . -"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"密码"}),r.jsx(Ie,{value:a.password,onChange:H=>i({...a,password:H.target.value}),type:"password",placeholder:"至少 6 位"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"确认"}),r.jsx(Ie,{value:a.password2,onChange:H=>i({...a,password2:H.target.value}),type:"password",placeholder:"至少 6 位"})]})]}),c&&r.jsx("div",{className:"text-sm text-destructive",children:c})]}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>l(!1),children:"取消"}),r.jsx(D,{onClick:V,children:"新增用户"})]})]})}),r.jsx(Qt,{open:f,onOpenChange:m,children:r.jsxs(Bt,{className:"modal modal-rz"+(j?" rz-drag":""),style:{...v,marginTop:0},showCloseButton:!1,children:[r.jsx(ar,{start:x,reset:b}),r.jsx(Ut,{className:"text-left",children:r.jsx(Ht,{className:"cursor-move select-none text-sm",onMouseDown:y,children:"编辑用户"})}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"用户名"}),r.jsx(Ie,{value:p.username,onChange:H=>{h({...p,username:H.target.value.trim()}),w("")}})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"重置密码"}),r.jsx(Ie,{value:p.password,onChange:H=>h({...p,password:H.target.value}),type:"password",placeholder:"留空则不修改"})]}),g&&r.jsx("div",{className:"text-sm text-destructive",children:g})]}),r.jsxs(vn,{children:[r.jsx(D,{variant:"outline",onClick:()=>m(!1),children:"取消"}),r.jsx(D,{onClick:I,children:"保存"})]})]})})]})}const wj="ts_skin",jj=[{id:"starlight",label:"星夜金",preview:["#141E36","#E8B86D"]},{id:"classic",label:"经典蓝",preview:["#151b23","#58a6ff"]}];function bj(){const e=localStorage.getItem(wj);return jj.some(t=>t.id===e)?e:"starlight"}function _j(e){document.documentElement.dataset.skin=e,localStorage.setItem(wj,e)}function qT(){_j(bj())}const Sj="ts_fs",kj=[{value:.9,label:"小"},{value:1,label:"标准"},{value:1.15,label:"大"},{value:1.3,label:"特大"}];function Nj(){const e=parseFloat(localStorage.getItem(Sj));return kj.some(t=>t.value===e)?e:1}function Cj(e){document.documentElement.style.setProperty("--fs",String(e));try{localStorage.setItem(Sj,String(e))}catch{}}function GT(){Cj(Nj())}function KT(){const[e,t]=u.useState(null),[n,s]=u.useState({api_base:"",model:"",api_key:"",timeout_s:"",batch_size:""}),[o,l]=u.useState(null),[a,i]=u.useState(!1);async function c(){try{const h=await Fr.ragGet();t(h),s({api_base:h.api_base||"",model:h.model||"",api_key:"",timeout_s:h.timeout_s!=null?String(h.timeout_s):"",batch_size:h.batch_size!=null?String(h.batch_size):""})}catch(h){M(h.message)}}u.useEffect(()=>{c()},[]);function d(){const h={api_base:n.api_base.trim(),model:n.model.trim()};return n.api_key&&(h.api_key=n.api_key),n.timeout_s.trim()&&(h.timeout_s=n.timeout_s.trim()),n.batch_size.trim()&&(h.batch_size=n.batch_size.trim()),h}async function f(){i(!0);try{await Fr.ragSet(d()),M("RAG 配置已保存,立即生效"),await c()}catch(h){M(h.message)}finally{i(!1)}}async function m(){l(null),i(!0);try{l(await Fr.ragTest(d()))}catch(h){M(h.message)}finally{i(!1)}}async function p(){if(window.confirm("确认停用 RAG 语义检索?将删除配置文件,检索回到纯词面模式"))try{await Fr.ragSet({clear:!0}),M("已停用 RAG"),l(null),await c()}catch(h){M(h.message)}}return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(y0,{className:"size-4 text-primary"})," 案例库语义检索(RAG)",e&&(e.configured?r.jsx(Dl,{children:"已启用"}):r.jsx(Dl,{variant:"secondary",children:"未启用"}))]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"走 OpenAI 兼容 /v1/embeddings 接口做嵌入,与内置 BM25 混合检索案例库; 未配置或调用失败时自动回落纯词面检索,不影响任务运行。保存后立即生效(无需重启); 更换模型后下次索引刷新自动全量重建。"}),r.jsxs("div",{className:"truncate font-mono text-[calc(11px*var(--fs))] text-muted-foreground",title:(e==null?void 0:e.config_path)||"",children:["配置文件:",(e==null?void 0:e.config_path)||"…"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"API 地址(api_base,含 /v1,不含 /embeddings)"}),r.jsx(Ie,{value:n.api_base,onChange:h=>s({...n,api_base:h.target.value.trim()}),placeholder:"https://api.openai.com/v1"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"嵌入模型(model,非对话模型)"}),r.jsx(Ie,{value:n.model,onChange:h=>s({...n,model:h.target.value.trim()}),placeholder:"text-embedding-3-small"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"API Key(仅存服务端配置文件,不回显明文)"}),r.jsx(Ie,{type:"password",value:n.api_key,onChange:h=>s({...n,api_key:h.target.value}),placeholder:e!=null&&e.has_api_key?`已设置(${e.api_key_masked},留空保持不变)`:"sk-…"})]}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"请求超时(秒)"}),r.jsx(Ie,{value:n.timeout_s,onChange:h=>s({...n,timeout_s:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.timeout_s)??30}`})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"嵌入批量大小"}),r.jsx(Ie,{value:n.batch_size,onChange:h=>s({...n,batch_size:h.target.value.trim()}),placeholder:`默认 ${(e==null?void 0:e.batch_size)??16}`})]})]}),o&&(o.ok?r.jsxs("div",{className:"text-sm text-[var(--ok-text)]",children:["连接成功:嵌入向量维度 ",o.dim]}):r.jsxs("div",{className:"text-sm text-destructive",children:["连接失败:",o.error]})),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(D,{variant:"outline",disabled:a,onClick:f,children:"保存配置"}),r.jsxs(D,{variant:"ghost",disabled:a,onClick:m,children:[r.jsx(zN,{})," 测试连接"]}),(e==null?void 0:e.configured)&&r.jsxs(D,{variant:"ghost",className:"text-destructive hover:text-destructive",disabled:a,onClick:p,children:[r.jsx(Ks,{})," 停用"]})]})]})]})}const YT=[["blocked_interaction","交互等待"],["task_failed","任务失败"],["card_review","卡片待审核"]];function QT(){var S,N;const[e,t]=u.useState(null),[n,s]=u.useState({webhook_url:"",secret:"",app_secret:""}),[o,l]=u.useState(!1),[a,i]=u.useState(null),[c,d]=u.useState([]),[f,m]=u.useState(!1);u.useEffect(()=>{p(),j()},[]);async function p(){try{t(await Us.feishuCfgGet())}catch(k){M(k.message)}}async function h(){l(!0);try{const k={enabled:!!(e!=null&&e.enabled),base_url:((e==null?void 0:e.base_url)||"").trim(),app_id:((e==null?void 0:e.app_id)||"").trim()};n.webhook_url.trim()&&(k.default_webhook=n.webhook_url.trim()),n.secret&&(k.default_secret=n.secret),n.app_secret&&(k.app_secret=n.app_secret);const C=await Us.feishuCfgSet(k);s({webhook_url:"",secret:"",app_secret:""}),M(C!=null&&C.inbound_started?"飞书配置已保存,入站消息长连接已启动":"飞书配置已保存(应用凭据变更需重启站点生效)"),await p()}catch(k){M(k.message)}finally{l(!1)}}async function g(){try{await Us.feishuCfgSet({default_webhook:"",default_secret:""}),M("已清除默认 Webhook 与签名密钥"),await p()}catch(k){M(k.message)}}async function w(){const k=!f;if(m(k),k)try{d(await Us.feishuOutbox())}catch(C){M(C.message)}}async function j(){try{i(await Us.feishuGet())}catch(k){M(k.message)}}async function v(){try{const k=await Us.feishuBindcode();i(C=>({...C,code:k.code}))}catch(k){M(k.message)}}async function x(){try{const k=await Us.feishuGet();i(k),M(k.bound?"飞书账号已绑定":"尚未检测到绑定:确认已在飞书私聊机器人发送「绑定 <码>」,且本应用凭据已配置")}catch(k){M(k.message)}}async function y(){try{await Us.feishuUnbind(),M("已解绑飞书账号"),j()}catch(k){M(k.message)}}const b=!(e!=null&&e.app_id&&(e!=null&&e.has_app_secret));return r.jsxs(r.Fragment,{children:[r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(Yk,{className:"size-4 text-primary"})," 飞书机器人配置"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!(e!=null&&e.enabled),onChange:k=>t({...e,enabled:k.target.checked})}),"启用飞书推送(总开关,控制本用户默认 webhook 回落)"]}),r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个用户配置自己的飞书机器人:入站长连接按用户各自拉起,推送未绑定项目时 回落项目所有者的默认 webhook。凭据(App Secret/签名密钥)仅存服务端,不回显。"}),r.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"应用 App ID(入站指令用)"}),r.jsx(Ie,{value:(e==null?void 0:e.app_id)||"",onChange:k=>t({...e,app_id:k.target.value.trim()}),placeholder:"cli_xxxx"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"App Secret"}),r.jsx(Ie,{type:"password",value:n.app_secret,onChange:k=>s({...n,app_secret:k.target.value}),placeholder:e!=null&&e.has_app_secret?"已设置(留空保持不变)":"凭证与基础信息页复制"})]})]}),r.jsxs("div",{className:"text-xs",title:"凭据齐全且连接线程已启动时,机器人才能接收飞书消息;连接失败细节看 server.log",children:["入站长连接:",(S=e==null?void 0:e.inbound)!=null&&S.thread?r.jsx("span",{className:"text-primary",children:"运行中"}):(N=e==null?void 0:e.inbound)!=null&&N.configured?"已配置,待启动(重启站点生效)":"未配置(填写并保存后自动连接)"]}),r.jsx("div",{className:"hint",children:"入站指令需:应用开通「机器人」能力 + 权限 im:message / im:message.p2p_msg:readonly / im:resource + 事件订阅选「长连接」并添加 im.message.receive_v1 + 应用发布生效;Secret 保存后不回显(留空=保持现有值),首次配置保存后自动建立长连接,变更凭据需重启站点。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"默认推送 Webhook(未绑定项目的回落目标)"}),r.jsx(Ie,{value:n.webhook_url,onChange:k=>s({...n,webhook_url:k.target.value}),placeholder:e!=null&&e.default_webhook?`已配置:${e.default_webhook}(留空保持不变)`:"https://open.feishu.cn/open-apis/bot/v2/hook/…"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ie,{type:"password",value:n.secret,onChange:k=>s({...n,secret:k.target.value}),placeholder:e!=null&&e.has_default_secret?"已设置(留空保持不变)":"可空"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"站点访问地址(通知里附「详情」链接,可空)"}),r.jsx(Ie,{value:(e==null?void 0:e.base_url)||"",onChange:k=>t({...e,base_url:k.target.value}),placeholder:"http://192.0.2.10:4601"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(D,{variant:"outline",disabled:o,onClick:h,children:"保存配置"}),r.jsx(D,{variant:"ghost",onClick:g,children:"清除默认 Webhook/密钥"}),r.jsx(D,{variant:"ghost",onClick:w,children:f?"收起投递记录":"投递记录"})]}),f&&r.jsx("div",{className:"max-h-60 overflow-y-auto rounded border border-border/60 text-xs",children:c.length?c.map(k=>r.jsxs("div",{className:"border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Dl,{variant:k.status==="sent"?"secondary":k.status==="pending"?"outline":"destructive",children:k.status}),r.jsxs("span",{className:"text-muted-foreground",children:["重试×",k.retries]}),r.jsx("span",{className:"truncate font-mono",children:k.target}),r.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:k.created_at})]}),k.last_error&&r.jsx("div",{className:"truncate text-destructive",title:k.last_error,children:k.last_error})]},k.id)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无投递记录"})})]})]}),r.jsx(XT,{}),r.jsx(JT,{}),r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(j0,{className:"size-4 text-primary"})," 飞书账号绑定"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[a?a.bound?r.jsxs("div",{className:"space-y-1.5 text-sm",children:[r.jsxs("div",{children:["已绑定飞书账号 ",r.jsx("span",{className:"font-mono text-xs",children:a.open_id})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["默认项目:",a.default_project||"未设置(指令未指名项目时机器人会列出可选项目)"]}),r.jsx("div",{className:"hint",style:{textAlign:"left",margin:"0"},children:"在飞书私聊机器人发「帮助」可查看支持的指令。"})]}):r.jsxs("div",{className:"space-y-2 text-sm",children:[b&&r.jsx("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-xs",children:"注意:上方机器人应用凭据(App ID / App Secret)尚未配置,此刻飞书消息无法送达平台,绑定不会生效。 请先填写并保存,再生成绑定码。"}),r.jsx("div",{className:"text-xs text-muted-foreground",children:"绑定后可在飞书私聊机器人执行看板指令(开始卡片 / 审核通过 / 驳回 / 作答提问等)。"}),a.code?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rounded-md border border-border bg-accent/40 px-3 py-2 text-center",children:[r.jsx("div",{className:"font-mono text-2xl font-bold tracking-[0.3em]",children:a.code}),r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:"10 分钟内有效;重新生成会作废旧码"})]}),r.jsxs("div",{className:"text-xs text-muted-foreground",children:["打开飞书 → 私聊你配置的机器人 → 发送「绑定 ",a.code,"」→ 回来点「刷新状态」确认。"]})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"尚未绑定,点击下方「生成绑定码」开始。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}),r.jsx("div",{className:"flex gap-2",children:a!=null&&a.bound?r.jsx(D,{variant:"destructive",onClick:y,children:"解绑"}):a!=null&&a.code?r.jsxs(r.Fragment,{children:[r.jsx(D,{variant:"outline",onClick:v,children:"重新生成"}),r.jsxs(D,{variant:"outline",onClick:x,children:[r.jsx(Da,{})," 刷新状态"]})]}):a&&r.jsx(D,{onClick:v,disabled:b,title:b?"先配置应用凭据,否则机器人收不到消息":void 0,children:"生成绑定码"})})]})]})]})}function XT(){const[e,t]=u.useState([]),[n,s]=u.useState(null),[o,l]=u.useState(null),[a,i]=u.useState({webhook_url:"",webhook_secret:""}),[c,d]=u.useState(!1);u.useEffect(()=>{let p=!0;return Mt.list().then(h=>{if(!p)return;t(h);const g=h.find(w=>!w.archived)||h[0];g&&s(g.id)}).catch(h=>M(h.message)),()=>{p=!1}},[]),u.useEffect(()=>{if(i({webhook_url:"",webhook_secret:""}),!n){l(null);return}let p=!0;return Mt.feishuHookGet(n).then(h=>{p&&l(h)}).catch(()=>{p&&l(null)}),()=>{p=!1}},[n]);async function f(){if(!(!n||!o)){d(!0);try{const p={enabled:!!o.enabled,events:o.events};a.webhook_url.trim()&&(p.webhook_url=a.webhook_url.trim()),a.webhook_secret&&(p.webhook_secret=a.webhook_secret),await Mt.feishuHookSet(n,p),i({webhook_url:"",webhook_secret:""}),M("项目飞书推送配置已保存"),Mt.feishuHookGet(n).then(l).catch(()=>{})}catch(p){M(p.message)}finally{d(!1)}}}const m=e.map(p=>({value:p.id,label:p.name+(p.archived?"(已归档)":""),search:p.project_dir||""}));return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(oC,{className:"size-4 text-primary"})," 项目推送绑定"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"每个项目可单独绑定推送群(阻塞事件通知到该群);未绑定或未启用时回落上方的默认推送 Webhook。"}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"项目"}),r.jsx(Lc,{options:m,value:n,onChange:s,placeholder:e.length?"选择项目…":"暂无项目",emptyHint:"无匹配项目"})]}),e.length?o?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:!!o.enabled,onChange:p=>l({...o,enabled:p.target.checked})}),"启用推送"]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"群机器人 Webhook"}),r.jsx(Ie,{value:a.webhook_url,onChange:p=>i({...a,webhook_url:p.target.value}),placeholder:o.webhook_url?`已绑定:${o.webhook_url}(留空保持)`:"飞书群自定义机器人 Webhook URL"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"签名密钥(机器人开启签名校验时)"}),r.jsx(Ie,{type:"password",value:a.webhook_secret,onChange:p=>i({...a,webhook_secret:p.target.value}),placeholder:o.has_webhook_secret?"已设置(留空保持不变)":"可空"})]}),r.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm",children:YT.map(([p,h])=>r.jsxs("label",{className:"flex items-center gap-1.5",children:[r.jsx("input",{type:"checkbox",checked:o.events.includes(p),onChange:g=>l({...o,events:g.target.checked?[...o.events,p]:o.events.filter(w=>w!==p)})}),h]},p))}),r.jsx("div",{className:"hint",children:"交互等待 / 任务失败默认推送;卡片待审核默认关。Webhook 与签名密钥留空保存时不下发(保持现有值)。"}),r.jsx("div",{children:r.jsx(D,{variant:"outline",disabled:c,onClick:f,children:"保存项目推送"})})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"}):null]})]})}function JT(){var p,h,g,w,j,v;const[e,t]=u.useState(null),[n,s]=u.useState(!1),[o,l]=u.useState(null);async function a(){try{t(await Us.feishuSlashGet())}catch(x){M(x.message)}}u.useEffect(()=>{a()},[]);async function i(x){s(!0);try{const y=await Us.feishuSlashSet(x);l({action:x,...y}),x==="notify"?y.ok?M("权限引导卡片已发到你的飞书私聊,点卡片上的按钮即可重试注册"):M(y.error||"卡片发送失败"):y.ok?M(x==="sync"?`同步完成:新增 ${y.created.length}、更新 ${y.updated.length}、已最新 ${y.kept.length}`:`已清除 ${y.deleted.length} 条 TS 指令`):M(y.card_sent?"需要先开通权限:已把引导卡片发到你的飞书私聊":y.error||"操作失败,请看卡片上的提示"),await a()}catch(y){M(y.message)}finally{s(!1)}}const c=(e==null?void 0:e.remote)||[],d=(e==null?void 0:e.desired)||[],f=new Set(c.map(x=>x.command)),m=d.filter(x=>{const y=c.find(b=>b.command===x.command);return!y||y.description!==x.description||y.icon!==x.icon});return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(rN,{className:"size-4 text-primary"})," 快捷指令(输入框打「/」)"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"把平台指令注册成飞书斜杠指令:机器人私聊里输入「/」即可从指令面板选 /status、/cards、 /approve 等(选中后以「/名称 [参数]」发给机器人,用法与中文指令一致)。 同步只增改本平台的指令,不影响你应用里的其他指令。"}),e?r.jsxs(r.Fragment,{children:[e.error&&r.jsx("div",{className:"text-xs text-destructive",children:e.error}),e.need_scope&&r.jsx("div",{className:"text-xs text-primary",children:"缺「应用指令」权限:点「发飞书权限卡片」→ 你的飞书私聊会收到一张引导卡片, 在上面点「我已开通,重试注册」即由后端重试(无需回站点手动重试)。"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(D,{variant:"outline",disabled:n,onClick:()=>i("sync"),children:"注册 / 同步到飞书"}),r.jsx(D,{variant:"ghost",disabled:n,onClick:()=>i("notify"),children:"发飞书权限卡片"}),r.jsx(D,{variant:"ghost",disabled:n,onClick:a,children:"刷新状态"}),r.jsx(D,{variant:"ghost",disabled:n||!f.size,onClick:()=>{window.confirm("删除飞书侧本平台的斜杠指令?(你应用里的其他指令不受影响)")&&i("clear")},children:"清除 TS 指令"})]}),r.jsxs("div",{className:"text-xs",children:["已注册 ",f.size," / ",d.length," 条",m.length?`,待同步 ${m.length} 条`:",均已与平台一致",(p=e.extra)!=null&&p.length?`;另有 ${e.extra.length} 条非 TS 指令(不会改动)`:""]}),r.jsx("div",{className:"max-h-52 overflow-y-auto rounded border border-border/60 text-xs",children:d.length?d.map(x=>r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/40 px-2 py-1.5 last:border-0",children:[r.jsx(Dl,{variant:f.has(x.command)?"secondary":"outline",children:f.has(x.command)?"已注册":"未注册"}),r.jsxs("span",{className:"shrink-0 font-mono",children:["/",x.command]}),r.jsx("span",{className:"truncate text-muted-foreground",title:x.description,children:x.description})]},x.command)):r.jsx("div",{className:"px-2 py-3 text-muted-foreground",children:"暂无可注册指令"})}),o&&r.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.action==="sync"?`上次同步:新增 ${((h=o.created)==null?void 0:h.length)||0}、更新 ${((g=o.updated)==null?void 0:g.length)||0}、已最新 ${((w=o.kept)==null?void 0:w.length)||0}`:o.action==="notify"?"权限引导卡片已发送(去飞书私聊查看)":`上次清除:删除 ${((j=o.deleted)==null?void 0:j.length)||0} 条`,o.card_sent?r.jsx("div",{className:"text-primary",children:"已把权限引导卡片发到你的飞书私聊,点卡片上的「我已开通,重试注册」即自动重试"}):null,o.card_error?r.jsx("div",{className:"text-destructive",children:o.card_error}):null,(v=o.failed)!=null&&v.length?r.jsx("div",{className:"text-destructive",title:o.failed.join(`
|
|
471
|
-
`),children:o.failed[0]}):null]}),r.jsx("div",{className:"hint",children:"权限:应用需开通 application:app_slash_command:read / write 并**创建版本发布**才可用; 缺权限时可点「发飞书权限卡片」,在飞书卡片上确认后自动重试。 注册结果约 5 分钟同步到客户端(客户端另有约 3 分钟缓存,重启飞书客户端可加速); PC 飞书需 7.70+、移动端 7.71+。"})]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"加载中…"})]})]})}const Vf={absent:{label:"未安装",cls:"none",action:"安装"},installed:{label:"已安装",cls:"ok",action:"重新安装"},outdated:{label:"可更新",cls:"warn",action:"更新"},partial:{label:"需修复",cls:"bad",action:"修复"}},ZT={marked:"平台注册(可整块卸载)",canonical:"手工注册(文本规范,平台可代管)",foreign:"自定义写法(平台只报告、不改动)","":"未注册"};function e$(){const e=Yn(),[t,n]=u.useState("user"),[s,o]=u.useState([]),[l,a]=u.useState(null),[i,c]=u.useState(null),[d,f]=u.useState(""),m=u.useRef(0);u.useEffect(()=>{let g=!0;return Mt.list().then(w=>{if(!g)return;o(w);const j=w.find(v=>!v.archived)||w[0];j&&a(j.id)}).catch(w=>M(w.message)),()=>{g=!1}},[]);async function p(){const g=++m.current;try{const w=await Gu.list(t,l);g===m.current&&c(w)}catch(w){g===m.current&&M(w.message)}}u.useEffect(()=>{c(null),!(t==="project"&&!l)&&p()},[t,l]);async function h(g,w){f(`${g.id}:${w}`);try{const j=w==="install"?await Gu.install(g.id,t,l):await Gu.uninstall(g.id,t,l);w==="uninstall"?M(`已卸载「${g.name}」`):j.state==="installed"?M(j.restart_required?`已安装「${g.name}」,需重启 dsh 生效`:g.type==="dsh_plugin"?`已安装「${g.name}」,注册行已写入(热生效)`:`已安装「${g.name}」,对之后新起的 agent 会话生效`):M(`「${g.name}」安装后状态:${(Vf[j.state]||{}).label||j.state}`),await p()}catch(j){M(j.message)}finally{f("")}}return r.jsxs(r.Fragment,{children:[r.jsxs(Dn,{className:"max-w-2xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(v0,{className:"size-4 text-primary"})," 内置资产"]})}),r.jsxs(Fn,{className:"space-y-3 px-5",children:[r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:["安装平台内置资产(清单 = 仓库 ",r.jsx("span",{className:"font-mono",children:"extensions/*/asset.json"}),"), 两类:",r.jsx("span",{className:"font-mono",children:"skill"}),"(技能文件)与",r.jsx("span",{className:"font-mono",children:"dsh_plugin"}),"(dsh 原生插件:拷进 dsh profile 的 node_modules 并写入 ",r.jsx("span",{className:"font-mono",children:"cordis.patch.yml"})," 注册行,仅用户级)。 用户级写服务进程 HOME(如 ",r.jsx("span",{className:"font-mono",children:"~/.dsh/skills"}),"、",r.jsx("span",{className:"font-mono",children:"~/.dsh/profiles"}),"),影响本机所有项目、仅管理员可操作; 项目级写所选项目目录(如 ",r.jsx("span",{className:"font-mono",children:"<项目>/.dsh/skills"}),"),仅项目所有者可操作。 安装 = 收敛到清单期望状态(已装的会按内容更新)。"]}),r.jsxs("div",{className:"ext-seg",children:[r.jsx("button",{type:"button",className:t==="user"?"active":"",onClick:()=>n("user"),children:"用户级(本机)"}),r.jsx("button",{type:"button",className:t==="project"?"active":"",onClick:()=>n("project"),children:"项目级(所选项目)"})]}),t==="project"&&(s.length>0?r.jsx("div",{style:{maxWidth:320},children:r.jsx(Lc,{options:s.map(g=>({value:g.id,label:g.name+(g.archived?"(已归档)":""),search:g.project_dir})),value:l,onChange:a,placeholder:"选择项目"})}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"还没有项目:先在项目页创建项目,再回来装项目级资产。"})),t==="user"&&!e.isAdmin&&r.jsx("div",{className:"text-xs text-destructive",children:"用户级安装会写入本机 agent 配置、影响所有项目,仅管理员可操作——此处对你只读。"})]})]}),i&&i.assets.map(g=>r.jsx(t$,{a:g,target:t,canInstall:i.can_install,busy:d,onAct:h},g.id)),i&&i.assets.length===0&&r.jsx(Dn,{className:"max-w-2xl py-4",children:r.jsx(Fn,{className:"px-5 text-xs text-muted-foreground",children:"该目标下暂无可安装的内置资产。"})}),!i&&r.jsx(Dn,{className:"max-w-2xl py-4",children:r.jsx(Fn,{className:"px-5 text-xs text-muted-foreground",children:t==="project"&&!l?"请先选择项目。":"加载中…"})})]})}function t$({a:e,target:t,canInstall:n,busy:s,onAct:o}){const l=Vf[e.state]||Vf.absent,a=!e.supported||!n,i=s===`${e.id}:install`,c=s===`${e.id}:uninstall`;function d(){const f=e.type==="dsh_plugin"?"会删除插件包文件与平台写的注册行(用户自定义写法的注册行一律不动,遇到会拒绝并说明)。":"会删除平台安装进技能目录的文件(用户手工放的同名文件不动)。";window.confirm(`确认卸载「${e.name}」?
|
|
472
|
-
${f}`)&&o(e,"uninstall")}return r.jsxs(Dn,{className:"max-w-2xl gap-3 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.name,r.jsx("span",{className:"ext-kind",children:e.type_label||e.type}),e.family_label&&e.family_label!==(e.type_label||e.type)&&r.jsx("span",{className:"ext-kind",children:e.family_label}),r.jsx("span",{className:"ext-state "+l.cls,children:l.label})]})}),r.jsxs(Fn,{className:"space-y-2 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:e.description}),e.files.map(f=>r.jsxs("div",{className:"ext-path",children:[f.path,f.exists?f.same?"":"(内容与仓库不一致)":"(尚未安装)"]},f.to)),e.plugin&&r.jsxs("div",{className:"text-xs leading-relaxed text-muted-foreground",children:[r.jsxs("div",{className:"ext-path",children:[e.plugin.patch_path," —— 注册行:",ZT[e.plugin.patch_mode]||e.plugin.patch_mode,e.plugin.disabled?"(已被 dsh 面板停用,安装会重新启用)":""]}),r.jsxs("div",{children:["插件包 ",r.jsx("span",{className:"font-mono",children:e.plugin.package})," · profile"," ",r.jsx("span",{className:"font-mono",children:e.plugin.profile}),e.plugin.restart_required?" · 该 profile 未开 patchReload,装完需重启 dsh 生效":" · 改注册行即热生效"]}),!e.plugin.requires_ok&&r.jsxs("div",{className:"text-destructive",children:["依赖解析不到:",(e.plugin.requires||[]).filter(f=>!f.ok).map(f=>f.spec).join("、"),"——dsh 自带包需在 profile 的 node_modules 里有对应链接(同目录软链),否则插件加载即报模块缺失。"]})]}),!e.supported&&r.jsx("div",{className:"text-xs text-destructive",children:e.reason}),e.state==="outdated"&&r.jsx("div",{className:"text-xs text-destructive",children:"已装文件与仓库版本不一致(可能被本地改过):更新会用仓库版本覆盖,需要保留本地改动请先另存。"}),e.supported&&!n&&r.jsx("div",{className:"text-xs text-destructive",children:t==="user"?"用户级安装仅管理员可操作,此处只读。":"你没有该项目的操作权限。"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[r.jsxs(D,{size:"sm",disabled:a||!!s,onClick:()=>o(e,"install"),children:[r.jsx(cN,{})," ",i?"处理中…":l.action]}),r.jsxs(D,{size:"sm",variant:"ghost",disabled:a||!!s||e.state==="absent",onClick:d,title:e.state==="absent"?"尚未安装":void 0,children:[r.jsx(Ks,{})," ",c?"卸载中…":"卸载"]})]})]})]})}const n$=[{key:"appearance",label:"外观主题",icon:_0,admin:!1},{key:"password",label:"修改密码",icon:Gp,admin:!1},{key:"feishu",label:"飞书设置",icon:j0,admin:!1},{key:"assets",label:"内置资产",icon:v0,admin:!1},{key:"rag",label:"RAG 检索配置",icon:y0,admin:!0}];function ux(){const e=Vl(),t=P_(),n=Yn(),s=n$.filter(a=>!a.admin||n.isAdmin),o=s.find(a=>a.key===t.section)||s[0];u.useEffect(()=>{t.section!==o.key&&e(`/settings/${o.key}`,{replace:!0})},[t.section,o.key]);async function l(){await n.logout(),e("/login")}return r.jsxs("div",{className:"flex h-svh flex-col",children:[r.jsxs("header",{className:"flex flex-none items-center gap-3 border-b border-border bg-card px-6 py-3",children:[r.jsxs("div",{className:"flex items-center gap-2.5 font-semibold",children:[r.jsx("div",{className:"ts-logo ts-mark size-6 rounded-md text-[calc(11px*var(--fs))]",children:"TS"}),"设置"]}),r.jsx("span",{className:"ml-auto text-sm text-muted-foreground",children:n.username}),r.jsxs(D,{variant:"ghost",size:"sm",onClick:l,children:[r.jsx(Kp,{})," 登出"]})]}),r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsxs("div",{className:"sets-page-side",children:[r.jsx("nav",{className:"sets-page-nav",children:s.map(a=>r.jsxs("button",{type:"button",className:a.key===o.key?"active":"",onClick:()=>e(`/settings/${a.key}`),children:[r.jsx(a.icon,{})," ",a.label]},a.key))}),r.jsx("div",{className:"sets-page-foot",children:r.jsxs(D,{variant:"ghost",size:"sm",onClick:()=>e("/app"),children:[r.jsx(Vp,{})," 返回项目"]})})]}),r.jsxs("main",{className:"min-w-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[o.key==="appearance"&&r.jsx(s$,{}),o.key==="password"&&r.jsx(r$,{}),o.key==="feishu"&&r.jsx(QT,{}),o.key==="assets"&&r.jsx(e$,{}),o.key==="rag"&&r.jsx(KT,{})]})]})]})}function s$(){const[e,t]=u.useState(bj()),[n,s]=u.useState(Nj());return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(_0,{className:"size-4 text-primary"})," 外观主题"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsx("div",{className:"text-xs leading-relaxed text-muted-foreground",children:"选择界面配色与字体大小,点选即生效,记录在本浏览器(localStorage),不影响其他用户。"}),r.jsx("div",{className:"grid grid-cols-2 gap-3",children:jj.map(o=>r.jsxs("button",{type:"button",className:"skin-pick"+(e===o.id?" active":""),onClick:()=>{_j(o.id),t(o.id)},children:[r.jsx("span",{className:"sw",children:o.preview.map(l=>r.jsx("i",{style:{background:l}},l))}),r.jsx("span",{children:o.label}),e===o.id&&r.jsx(Al,{className:"ml-auto size-3.5 text-[var(--star)]"})]},o.id))}),r.jsx("div",{className:"grid grid-cols-4 gap-3",children:kj.map(o=>r.jsxs("button",{type:"button",className:"fs-pick"+(n===o.value?" active":""),onClick:()=>{Cj(o.value),s(o.value)},children:[r.jsx("span",{className:"sample",style:{fontSize:`calc(13px * ${o.value})`},children:"字A"}),r.jsx("span",{children:o.label}),n===o.value&&r.jsx(Al,{className:"ml-auto size-3.5 text-[var(--star)]"})]},o.value))})]})]})}function r$(){const[e,t]=u.useState({old:"",new:""}),[n,s]=u.useState(!1);async function o(){s(!0);try{await bl.changePassword(e.old,e.new),M("密码已修改"),t({old:"",new:""})}catch(l){M(l.message)}finally{s(!1)}}return r.jsxs(Dn,{className:"max-w-xl gap-4 py-4",children:[r.jsx(fs,{className:"px-5 pb-0",children:r.jsxs(ps,{className:"flex items-center gap-2 text-sm",children:[r.jsx(Gp,{className:"size-4 text-primary"})," 修改密码"]})}),r.jsxs(Fn,{className:"space-y-4 px-5",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"原密码"}),r.jsx(Ie,{type:"password",value:e.old,onChange:l=>t({...e,old:l.target.value})})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ie,{type:"password",value:e.new,onChange:l=>t({...e,new:l.target.value})})]}),r.jsx(D,{variant:"outline",disabled:n,onClick:o,children:"保存"})]})]})}function o$(e){return e.startsWith("### PROMPT")?"lp-prompt":e.startsWith("### CMD")?"lp-cmd":e.startsWith("### PID")?"lp-dim":e.startsWith("### COMPACT")?"lp-compact":/### 轮次\s*\d+\s*(开始|结束)/.test(e)?"lp-round":/ROUND_DONE|FIX_DONE|RETEST_SUMMARY|STRESS_DONE/.test(e)?"lp-done":/Exception|Traceback|error|ERR|失败|超时|exit=-?\d+/.test(e)?"lp-err":e.startsWith("{")?"lp-json":""}const l$=5e3;function a$(){const[e,t]=X_(),n=+(e.get("task")||0),s=+(e.get("round")||0),[o,l]=u.useState(null),[a,i]=u.useState([]),[c,d]=u.useState(""),[f,m]=u.useState(!1),[p,h]=u.useState(""),g=u.useRef(null),w=u.useRef(!0),j=u.useMemo(()=>c?c.split(`
|
|
473
|
-
`):[],[c]);u.useEffect(()=>{if(!n){h("缺少 task 参数");return}let x=!1;return(async()=>{try{const[y,b]=await Promise.all([Be.get(n),Be.rounds(n)]);if(x)return;l(y),i(b),b.length&&!b.some(S=>S.round_no===s)&&t({task:String(n),round:String(b[b.length-1].round_no)},{replace:!0})}catch(y){x||h(y.message)}})(),()=>{x=!0}},[n,s]),u.useEffect(()=>(document.title=o?`日志 · ${o.name}`:"任务日志",()=>{document.title="Touchstone"}),[o]),u.useEffect(()=>{if(!n||!s)return;let x=null,y=!1;const b=async()=>{const S=g.current;w.current=S?S.scrollHeight-S.scrollTop-S.clientHeight<60:!0;try{const N=await Be.log(n,s,l$);if(y)return;m(!1),d(k=>k===N.log?k:N.log)}catch{y||(m(!0),d(""))}};return b(),x=setInterval(b,2e3),()=>{y=!0,clearInterval(x)}},[n,s]),u.useEffect(()=>{const x=g.current;x&&w.current&&(x.scrollTop=x.scrollHeight)},[c]);function v(){w.current=!0;const x=g.current;x&&(x.scrollTop=x.scrollHeight)}return r.jsxs("div",{className:"log-page",children:[r.jsxs("div",{className:"log-page-head",children:[r.jsx(su,{size:20}),r.jsx("span",{className:"t",children:"任务日志"}),o&&r.jsxs("span",{className:"dim",children:["「",o.name,"」"]}),o&&r.jsxs("span",{className:"badge st-"+o.status,children:[r.jsx("span",{className:"dot"}),cr[o.status]||o.status]}),r.jsx("span",{className:"spacer"}),a.length>0&&r.jsxs(At,{value:String(s),onValueChange:x=>t({task:String(n),round:x}),children:[r.jsx(Rt,{size:"sm",className:"h-7 min-w-[90px] text-xs",children:r.jsx(Et,{})}),r.jsx(Pt,{children:a.map(x=>r.jsxs(Ae,{value:String(x.round_no),children:["第 ",x.round_no," 轮"]},x.round_no))})]}),r.jsxs("span",{className:"hint",children:[j.length," 行 · 2s 自动刷新 · 在底部时自动跟随"]}),r.jsxs(D,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs",title:"回到底部并恢复自动跟随",onClick:v,children:[r.jsx(Fk,{})," 底部"]})]}),(o==null?void 0:o.task_type)==="stress"&&r.jsx(rj,{task:o}),r.jsx("div",{className:"log-page-body",children:p?r.jsxs("div",{className:"hint",style:{margin:"auto"},children:["加载失败:",p]}):f?r.jsx("div",{className:"hint",style:{margin:"auto"},children:"该轮暂无日志"}):r.jsx("div",{className:"log",ref:g,children:j.map((x,y)=>r.jsx("div",{className:"log-line "+o$(x),children:x||" "},y))})})]})}function Ej(){const e=Yn(),[t,n]=u.useState(""),[s,o]=u.useState(""),[l,a]=u.useState(""),[i,c]=u.useState(""),[d,f]=u.useState(!1);async function m(){if(!d){if(c(""),s.length<6){c("新密码至少 6 位");return}if(s!==l){c("两次输入的新密码不一致");return}f(!0);try{await bl.changePassword(t,s),await e.load(),M("密码已修改")}catch(p){c(p.message||"修改失败")}finally{f(!1)}}}return r.jsx("div",{className:"flex min-h-svh items-center justify-center bg-[radial-gradient(1200px_600px_at_70%_-10%,var(--login-glow)_0%,var(--bg)_55%)] p-4",children:r.jsxs(Dn,{className:"w-[380px] shadow-xl",children:[r.jsxs(fs,{className:"items-center gap-3 border-b border-border/60 pb-5",children:[r.jsx("div",{className:"justify-self-center",children:r.jsx(su,{size:40})}),r.jsxs("div",{className:"text-center",children:[r.jsxs(ps,{className:"flex items-center justify-center gap-2 font-serif text-lg",children:[r.jsx(Gp,{className:"size-4 text-primary"})," 首次登录须修改密码"]}),r.jsxs(h0,{className:"mt-1",children:["账号 ",e.username," 仍在使用一次性初始口令"]})]})]}),r.jsxs(Fn,{className:"flex flex-col gap-4",children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"force-old-pw",className:"text-xs text-muted-foreground",children:"当前口令(启动横幅里的一次性口令)"}),r.jsx(Ie,{id:"force-old-pw",value:t,type:"password",onChange:p=>n(p.target.value),autoComplete:"current-password",autoFocus:!0})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"force-new-pw",className:"text-xs text-muted-foreground",children:"新密码(至少 6 位)"}),r.jsx(Ie,{id:"force-new-pw",value:s,type:"password",onChange:p=>o(p.target.value),autoComplete:"new-password"})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(et,{htmlFor:"force-new-pw2",className:"text-xs text-muted-foreground",children:"确认新密码"}),r.jsx(Ie,{id:"force-new-pw2",value:l,type:"password",onChange:p=>a(p.target.value),autoComplete:"new-password",onKeyUp:p=>{p.key==="Enter"&&m()}})]}),r.jsx("div",{className:"min-h-5 text-[calc(13px*var(--fs))] leading-5 text-destructive",children:i}),r.jsxs(D,{size:"lg",className:"w-full",disabled:d,onClick:m,children:[d&&r.jsx(b0,{className:"size-4 animate-spin"}),"修改并进入"]})]}),r.jsx(g0,{className:"flex-col items-center pt-0",children:r.jsx("button",{type:"button",className:"text-sm text-primary underline-offset-4 hover:underline",onClick:()=>e.logout(),children:"退出登录"})})]})})}const Rj="ts.last_route",i$=["","app","monitor","admin","settings"];function xu(){return"/touchstone/".replace(/\/+$/,"")}function Pj(e){const t=xu();return t&&e.startsWith(t+"/")?e.slice(t.length):t&&e===t?"/":e}function c$(e,t){const n=xu();return(n?[n+"/",n+"/app"]:["/","/app"]).includes(e)&&!t}function u$(e,t=""){try{if(!e)return;const n=Pj(e);if(n==="/login"||n==="/log")return;localStorage.setItem(Rj,xu()+n+(t||""))}catch{}}function d$(){try{const e=localStorage.getItem(Rj)||"";if(!e.startsWith("/"))return"";const t=xu();if(t&&!(e===t||e.startsWith(t+"/")))return"";const[n,s=""]=e.split("?"),o=Pj(n).split("/")[1]||"";return i$.includes(o)?e:""}catch{return""}}function f$(){const e=d$();if(!e)return"";const{pathname:t,search:n}=window.location;return t+n===e||!c$(t,n)?"":(window.history.replaceState(null,"",e),e)}function oa({children:e}){const t=Yn(s=>s.username),n=Yn(s=>s.mustChangePassword);return t?n?r.jsx(Ej,{}):e:r.jsx($l,{to:"/login",replace:!0})}function p$({children:e}){const t=Yn(o=>o.username),n=Yn(o=>o.isAdmin),s=Yn(o=>o.mustChangePassword);return t?s?r.jsx(Ej,{}):n?e:r.jsx($l,{to:"/app",replace:!0}):r.jsx($l,{to:"/login",replace:!0})}function m$({children:e}){return Yn(n=>n.username)?r.jsx($l,{to:"/app",replace:!0}):e}function h$(){const e=Xa();return u.useEffect(()=>{u$(e.pathname,e.search)},[e.pathname,e.search]),r.jsxs(q_,{children:[r.jsx(Ds,{path:"/login",element:r.jsx(m$,{children:r.jsx(cC,{})})}),r.jsx(Ds,{path:"/",element:r.jsx($l,{to:"/app",replace:!0})}),r.jsx(Ds,{path:"/app",element:r.jsx(oa,{children:r.jsx(cx,{})})}),r.jsx(Ds,{path:"/monitor",element:r.jsx(oa,{children:r.jsx(cx,{})})}),r.jsx(Ds,{path:"/admin",element:r.jsx(p$,{children:r.jsx(WT,{})})}),r.jsx(Ds,{path:"/settings",element:r.jsx(oa,{children:r.jsx(ux,{})})}),r.jsx(Ds,{path:"/settings/:section",element:r.jsx(oa,{children:r.jsx(ux,{})})}),r.jsx(Ds,{path:"/log",element:r.jsx(oa,{children:r.jsx(a$,{})})}),r.jsx(Ds,{path:"*",element:r.jsx($l,{to:"/app",replace:!0})})]})}qT();GT();EP();Yn.getState().load().finally(()=>{f$(),ky(document.getElementById("app")).render(r.jsx(Q_,{basename:"/touchstone/".replace(/\/+$/,"")||"/",children:r.jsx(h$,{})}))});
|